r3902 - in trunk: . tools



Author: timj
Date: 2006-09-26 12:57:42 -0400 (Tue, 26 Sep 2006)
New Revision: 3902

Modified:
   trunk/ChangeLog
   trunk/TODO
   trunk/tools/bseloopfuncs.c
   trunk/tools/bsewavetool.cc
Log:
Tue Sep 26 18:47:39 2006  Tim Janik  <timj gtk org>

        * tools/bsewavetool.cc: mention in --help that chunks are exported
        as WAV files.

        * tools/bseloopfuncs.c: minor fixups.
        don't leak data handles in gsl_loop_highpass_handle().




Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2006-09-26 08:40:01 UTC (rev 3901)
+++ trunk/ChangeLog	2006-09-26 16:57:42 UTC (rev 3902)
@@ -1,3 +1,11 @@
+Tue Sep 26 18:47:39 2006  Tim Janik  <timj gtk org>
+
+	* tools/bsewavetool.cc: mention in --help that chunks are exported
+	as WAV files.
+
+	* tools/bseloopfuncs.c: minor fixups.
+	don't leak data handles in gsl_loop_highpass_handle().
+
 Sun Sep 17 13:39:49 2006  Stefan Westerfeld  <stefan space twc de>
 
 	* tools/bsefextract.cc tools/bsefcompare.cc: Replace atof with

Modified: trunk/TODO
===================================================================
--- trunk/TODO	2006-09-26 08:40:01 UTC (rev 3901)
+++ trunk/TODO	2006-09-26 16:57:42 UTC (rev 3902)
@@ -1,4 +1,6 @@
 NEXT-RELEASE:
+- wave-tool:
+  * bit-width conversion float<->16 (optional saturation)
 - undef _DOMAIN
 - rename: bse/Makefile.am: bse_c_sources & bse_cc_sources
 - fix birnet_thread_run uses (unref thread)

Modified: trunk/tools/bseloopfuncs.c
===================================================================
--- trunk/tools/bseloopfuncs.c	2006-09-26 08:40:01 UTC (rev 3901)
+++ trunk/tools/bseloopfuncs.c	2006-09-26 16:57:42 UTC (rev 3902)
@@ -125,46 +125,47 @@
     }
 }
 
-GslDataHandle *gsl_loop_highpass_handle (GslDataHandle *src_handle,
-				         gdouble       freq1,
-				         gdouble       freq1_level_db,
-				         gdouble       freq2)
+GslDataHandle*
+gsl_loop_highpass_handle (GslDataHandle *src_handle,
+			  gdouble        freq1,
+			  gdouble        freq1_level_db,
+			  gdouble        freq2)
 {
   g_return_val_if_fail (src_handle != NULL, NULL);
-
+  
   /* check out data handle */
   if (gsl_data_handle_open (src_handle) != BSE_ERROR_NONE)
     return NULL;
-
+  
   GslLong src_handle_n_values   = gsl_data_handle_n_values (src_handle);
   GslLong src_handle_n_channels = gsl_data_handle_n_channels (src_handle);
   GslLong src_handle_mix_freq   = gsl_data_handle_mix_freq (src_handle);
   GslLong src_handle_osc_freq   = gsl_data_handle_osc_freq (src_handle);
-  gchar **src_handle_xinfos     = src_handle->setup.xinfos;
-
+  
   /* read input */
-  gfloat *src_values  = g_new (gfloat, src_handle_n_values);
+  gfloat *src_values = g_new (gfloat, src_handle_n_values);
   GslLong i;
   GslDataPeekBuffer pbuf = { +1, };
-  for (i = 0; i < src_handle_n_values; i++)
+  for (i = 0; i < src_handle_n_values; i++) /* FIXME: use gsl_data_handle_read() */
     src_values[i] = gsl_data_handle_peek_value (src_handle, i, &pbuf);
-
+  
   /* apply fir filter to new memory buffer */
   gfloat *dest_values = g_new (gfloat, src_handle_n_values);
   fir_hp (src_values, src_handle_n_values, dest_values, freq1, freq1_level_db, freq2);
   g_free (src_values);
-
+  
   /* create a mem handle with filtered data */
-  GslDataHandle *dest_handle = gsl_data_handle_new_mem (src_handle_n_channels,
-							32, // bit_depth: possibly increased by filtering
-						        src_handle_mix_freq,
-							src_handle_osc_freq,
-							src_handle_n_values,
-							dest_values,
-							g_free);
-
+  GslDataHandle *mhandle = gsl_data_handle_new_mem (src_handle_n_channels,
+                                                    32, // bit_depth: possibly increased by filtering
+                                                    src_handle_mix_freq,
+                                                    src_handle_osc_freq,
+                                                    src_handle_n_values,
+                                                    dest_values,
+                                                    g_free);
+  GslDataHandle *dhandle = gsl_data_handle_new_add_xinfos (mhandle, src_handle->setup.xinfos);
   gsl_data_handle_close (src_handle);
-  return gsl_data_handle_new_add_xinfos (dest_handle, src_handle_xinfos);
+  gsl_data_handle_unref (mhandle);
+  return dhandle;
 }
 
 static gdouble

Modified: trunk/tools/bsewavetool.cc
===================================================================
--- trunk/tools/bsewavetool.cc	2006-09-26 08:40:01 UTC (rev 3901)
+++ trunk/tools/bsewavetool.cc	2006-09-26 16:57:42 UTC (rev 3902)
@@ -1797,7 +1797,7 @@
     g_print ("{-m=midi-note|-f=osc-freq|--all-chunks|-x=filename} [options]\n");
     if (bshort)
       return;
-    g_print ("    Export chunks from bsewave file.\n");
+    g_print ("    Export chunks from bsewave as WAV file.\n");
     g_print ("    Options:\n");
     g_print ("    -x <filename>       set export filename (supports %%N %%F and %%C, see below)\n");
     g_print ("    -f <osc-freq>       oscillator frequency to select a wave chunk\n");




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