[beast/devel: 5/35] BSE: adapt to Rapicorn updates, use string_format() in particular



commit e41f32f0bbd15a487846648f3d5e8f13bc5448f7
Author: Tim Janik <timj gnu org>
Date:   Sun May 12 04:33:01 2013 +0200

    BSE: adapt to Rapicorn updates, use string_format() in particular

 bse/bseserver.cc            |    8 ++++----
 bse/gsldatahandle-mad.cc    |    9 +++++----
 bse/gsldatahandle-vorbis.cc |    8 ++++----
 bse/tests/firhandle.cc      |    6 +++---
 bse/tests/loophandle.cc     |    8 ++++----
 bse/tests/resamplehandle.cc |    2 +-
 6 files changed, 21 insertions(+), 20 deletions(-)
---
diff --git a/bse/bseserver.cc b/bse/bseserver.cc
index 3c3d0f4..1a38413 100644
--- a/bse/bseserver.cc
+++ b/bse/bseserver.cc
@@ -453,7 +453,7 @@ bse_server_require_pcm_input (BseServer *server)
                          "An audio signal of silence will be used instead of a recorded signal, "
                          "so playback operation may produce results not actually intended "
                          "(such as a silent output signal).");
-          umsg.text3 = string_printf (_("Audio device \"%s\" is not open for input, audio driver: %s=%s"),
+          umsg.text3 = string_format (_("Audio device \"%s\" is not open for input, audio driver: %s=%s"),
                                       BSE_DEVICE (server->pcm_device)->open_device_name,
                                       BSE_DEVICE_GET_CLASS (server->pcm_device)->driver_name,
                                       BSE_DEVICE (server->pcm_device)->open_device_args);
@@ -504,7 +504,7 @@ server_open_pcm_device (BseServer *server,
       umsg.text1 = _("No available audio device was found.");
       umsg.text2 = _("No available audio device could be found and opened successfully. "
                      "Sorry, no fallback selection can be made for audio devices, giving up.");
-      umsg.text3 = string_printf (_("Failed to open PCM devices: %s"), bse_error_blurb (error));
+      umsg.text3 = string_format (_("Failed to open PCM devices: %s"), bse_error_blurb (error));
       umsg.label = _("PCM device selections problems");
       ServerImpl::instance().send_user_message (umsg);
     }
@@ -531,7 +531,7 @@ server_open_midi_device (BseServer *server)
           umsg.text1 = _("MIDI input or output is not available.");
           umsg.text2 = _("No available MIDI device could be found and opened successfully. "
                          "Reverting to null device, no MIDI events will be received or sent.");
-          umsg.text3 = string_printf (_("Failed to open MIDI devices: %s"), bse_error_blurb (error));
+          umsg.text3 = string_format (_("Failed to open MIDI devices: %s"), bse_error_blurb (error));
           umsg.label = _("MIDI device selections problems");
           ServerImpl::instance().send_user_message (umsg);
         }
@@ -589,7 +589,7 @@ bse_server_open_devices (BseServer *self)
               umsg.text1 = _("Failed to start PCM recording to disk.");
               umsg.text2 = _("An error occoured while opening the recording file, selecting a different "
                              "file might fix this situation.");
-              umsg.text3 = string_printf (_("Failed to open file \"%s\" for recording: %s"), 
self->wave_file, bse_error_blurb (error));
+              umsg.text3 = string_format (_("Failed to open file \"%s\" for recording: %s"), 
self->wave_file, bse_error_blurb (error));
               umsg.label = _("PCM recording errors");
               ServerImpl::instance().send_user_message (umsg);
              g_object_unref (self->pcm_writer);
diff --git a/bse/gsldatahandle-mad.cc b/bse/gsldatahandle-mad.cc
index 9b853ec..f61f297 100644
--- a/bse/gsldatahandle-mad.cc
+++ b/bse/gsldatahandle-mad.cc
@@ -448,11 +448,11 @@ dh_mad_open (GslDataHandle      *dhandle,
   return error;
 }
 
-static GslLong
+static int64
 dh_mad_read (GslDataHandle *dhandle,
-            GslLong        voffset, /* in values */
-            GslLong        n_values,
-            gfloat        *values)
+            int64          voffset, /* in values */
+            int64          n_values,
+            float         *values)
 {
   MadHandle *handle = (MadHandle*) dhandle;
   GslLong pos = voffset / dhandle->setup.n_channels;
@@ -604,6 +604,7 @@ dh_mad_coarse_seek (GslDataHandle *dhandle,
     }
   return handle->pcm_pos * dhandle->setup.n_channels;
 }
+
 static void
 dh_mad_close (GslDataHandle *dhandle)
 {
diff --git a/bse/gsldatahandle-vorbis.cc b/bse/gsldatahandle-vorbis.cc
index 88c9f55..3df9d95 100644
--- a/bse/gsldatahandle-vorbis.cc
+++ b/bse/gsldatahandle-vorbis.cc
@@ -272,11 +272,11 @@ read_packet (VorbisHandle *vhandle)
       vhandle->pcm[i] = pcm[i];
 }
 
-static GslLong
+static int64
 dh_vorbis_read (GslDataHandle *dhandle,
-               GslLong        voffset, /* in values */
-               GslLong        n_values,
-               gfloat        *values)
+               int64          voffset, /* in values */
+               int64          n_values,
+               float         *values)
 {
   VorbisHandle *vhandle = (VorbisHandle*) dhandle;
   GslLong pos = voffset / dhandle->setup.n_channels;
diff --git a/bse/tests/firhandle.cc b/bse/tests/firhandle.cc
index 6fa2ece..6c470e7 100644
--- a/bse/tests/firhandle.cc
+++ b/bse/tests/firhandle.cc
@@ -10,8 +10,8 @@
 #include <stdlib.h>
 #include <complex>
 #include <vector>
-using Rapicorn::string_printf;
 
+using Rapicorn::string_format;
 using std::vector;
 using std::min;
 using std::max;
@@ -254,10 +254,10 @@ test_with_sine_sweep (FirHandleType type)
         }
       samples_per_second = sweep_sin.size() / (m / dups);
       TMSG ("    %-28s : %+.14f samples/second",
-            string_printf ("%s O64 mono", handle_name (type)).c_str(),
+            string_format ("%s O64 mono", handle_name (type)).c_str(),
             samples_per_second);
       TMSG ("    %-28s : %+.14f streams",
-            string_printf ("CPU %s mono", handle_name (type)).c_str(),
+            string_format ("CPU %s mono", handle_name (type)).c_str(),
             samples_per_second / 44100.0);
     }
 }
diff --git a/bse/tests/loophandle.cc b/bse/tests/loophandle.cc
index 971ebb3..02cea03 100644
--- a/bse/tests/loophandle.cc
+++ b/bse/tests/loophandle.cc
@@ -62,11 +62,11 @@ loop_handle_reference_destroy (GslDataHandle *dhandle)
   sfi_delete_struct (LoopHandleReference, lhandle);
 }
 
-static GslLong
+static int64
 loop_handle_reference_read (GslDataHandle *dhandle,
-                           GslLong        voffset,
-                           GslLong        n_values,
-                           gfloat        *values)
+                           int64          voffset,
+                           int64          n_values,
+                           float         *values)
 {
   LoopHandleReference *lhandle = (LoopHandleReference*) dhandle;
 
diff --git a/bse/tests/resamplehandle.cc b/bse/tests/resamplehandle.cc
index 00ec5ef..e4c26e9 100644
--- a/bse/tests/resamplehandle.cc
+++ b/bse/tests/resamplehandle.cc
@@ -170,7 +170,7 @@ generate_test_signal (vector<Sample> &signal,
           cached_window[i] = bse_window_blackman (wpos);
         }
     }
-  string signal_cache_key = Rapicorn::string_printf ("%zd/%.1f/%.1f/%.1f", signal_length, sample_rate, 
frequency1, frequency2);
+  string signal_cache_key = Rapicorn::string_format ("%d/%.1f/%.1f/%.1f", signal_length, sample_rate, 
frequency1, frequency2);
   static map<string, vector<Sample> > signal_cache;
   vector<Sample>& cached_signal = signal_cache[signal_cache_key];
   if (cached_signal.empty())


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