r3879 - trunk/bse



Author: timj
Date: 2006-09-10 16:42:06 -0400 (Sun, 10 Sep 2006)
New Revision: 3879

Modified:
   trunk/bse/gsldatautils.c
   trunk/bse/gsldatautils.h
Log:
revert accidental commit


Modified: trunk/bse/gsldatautils.c
===================================================================
--- trunk/bse/gsldatautils.c	2006-09-10 20:33:32 UTC (rev 3878)
+++ trunk/bse/gsldatautils.c	2006-09-10 20:42:06 UTC (rev 3879)
@@ -21,9 +21,6 @@
 #include <string.h>
 #include <unistd.h>
 #include <errno.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
 
 
 #define	BSIZE		GSL_DATA_HANDLE_PEEK_BUFFER	/* FIXME: global buffer size setting */
@@ -237,69 +234,7 @@
     return 0;
 }
 
-static gint /* errno */
-bse_wave_file_from_bbuffer (const char          *file_name,
-                            guint                n_bits,
-                            guint                n_channels,
-                            guint                sample_freq,
-                            guint                n_values,
-                            guint                n_bytes,
-                            const uint8         *bytes)
-{
-  g_return_val_if_fail (file_name != NULL, EINVAL);
-  g_return_val_if_fail (n_bits == 16 || n_bits == 8, EINVAL);
-  int fd = open (file_name, O_WRONLY | O_CREAT | O_TRUNC, 0666);
-  if (fd < 0)
-    return errno;
-  bse_wave_file_dump_header (fd, n_values * n_bits / 8, n_bits, n_channels, sample_freq);
-  GslLong j;
-  do
-    j = write (fd, bytes, n_bytes);
-  while (j < 0 && errno == EINTR);
-  int err = errno;
-  int cs = close (fd);
-  if (j < 0)
-    return err ? err : EIO;
-  if (cs < 0)
-    return errno ? errno : EIO;
-  return 0;
-}
-
 gint /* errno */
-bse_wave_file_from_fbuffer (const char          *file_name,
-                            guint                n_bits,
-                            guint                n_channels,
-                            guint                sample_freq,
-                            guint                n_values,
-                            const gfloat        *values)
-{
-  g_return_val_if_fail (n_bits == 16 || n_bits == 8, EINVAL);
-  void *buffer = g_new (guint32, n_values);
-  GslLong n = gsl_conv_from_float_clip (n_bits > 8 ? GSL_WAVE_FORMAT_SIGNED_16 : GSL_WAVE_FORMAT_UNSIGNED_8,
-                                        G_LITTLE_ENDIAN, values, buffer, n_values);
-  int retval = bse_wave_file_from_bbuffer (file_name, n_bits, n_channels, sample_freq, n_values, n, buffer);
-  g_free (buffer);
-  return retval;
-}
-
-gint /* errno */
-bse_wave_file_from_dbuffer (const char          *file_name,
-                            guint                n_bits,
-                            guint                n_channels,
-                            guint                sample_freq,
-                            guint                n_values,
-                            const gdouble       *values)
-{
-  g_return_val_if_fail (n_bits == 16 || n_bits == 8, EINVAL);
-  void *buffer = g_new (guint32, n_values);
-  GslLong n = gsl_conv_from_double_clip (n_bits > 8 ? GSL_WAVE_FORMAT_SIGNED_16 : GSL_WAVE_FORMAT_UNSIGNED_8,
-                                         G_LITTLE_ENDIAN, values, buffer, n_values);
-  int retval = bse_wave_file_from_bbuffer (file_name, n_bits, n_channels, sample_freq, n_values, n, buffer);
-  g_free (buffer);
-  return retval;
-}
-
-gint /* errno */
 gsl_data_handle_dump_wav (GslDataHandle *dhandle,
 			  gint           fd,
 			  guint          n_bits,

Modified: trunk/bse/gsldatautils.h
===================================================================
--- trunk/bse/gsldatautils.h	2006-09-10 20:33:32 UTC (rev 3878)
+++ trunk/bse/gsldatautils.h	2006-09-10 20:42:06 UTC (rev 3879)
@@ -73,15 +73,6 @@
 						 gint			 fd,
 						 GslWaveFormatType	 format,
 						 guint			 byte_order);
-gint /* errno */     gsl_data_handle_dump_wav	(GslDataHandle		*dhandle,
-						 gint			 fd,
-						 guint			 n_bits,
-						 guint			 n_channels,
-						 guint			 sample_freq);
-void		     gsl_data_handle_dump_wstore(GslDataHandle		*dhandle,
-						 SfiWStore		*wstore,
-						 GslWaveFormatType	 format,
-						 guint			 byte_order);
 gint /* errno */     bse_wave_file_dump_header	(gint			 fd,
 						 guint			 n_data_bytes,
 						 guint			 n_bits,
@@ -89,23 +80,21 @@
 						 guint		         sample_freq);
 gint /* errno */     bse_wave_file_patch_length (gint			 fd,
 						 guint			 n_data_bytes);
+gint /* errno */     gsl_data_handle_dump_wav	(GslDataHandle		*dhandle,
+						 gint			 fd,
+						 guint			 n_bits,
+						 guint			 n_channels,
+						 guint			 sample_freq);
 gint /* errno */     bse_wave_file_dump_data	(gint			 fd,
 						 guint			 n_bits,
 						 guint			 n_values,
 						 const gfloat		*values);
-gint /* errno */     bse_wave_file_from_fbuffer	(const char		*file_name,
-						 guint                   n_bits,
-						 guint                   n_channels,
-						 guint                   sample_freq,
-						 guint                   n_values,
-						 const gfloat           *values);
-gint /* errno */     bse_wave_file_from_dbuffer	(const char		*file_name,
-						 guint                   n_bits,
-						 guint                   n_channels,
-						 guint                   sample_freq,
-						 guint                   n_values,
-						 const gdouble          *values);
+void		     gsl_data_handle_dump_wstore(GslDataHandle		*dhandle,
+						 SfiWStore		*wstore,
+						 GslWaveFormatType	 format,
+						 guint			 byte_order);
 
+
 /* --- conversion utils --- */
 static inline guint   gsl_conv_from_float	(GslWaveFormatType format,
 						 guint             byte_order,




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]