changeset 567:1e987b380776 trunk

[svn] - update to new plugin API
author nenolod
date Mon, 29 Jan 2007 03:33:15 -0800
parents 98c4735c3c2e
children 8c64b5abdcda
files ChangeLog src/musepack/libmpc.cxx src/musepack/libmpc.h
diffstat 3 files changed, 24 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Jan 29 03:26:26 2007 -0800
+++ b/ChangeLog	Mon Jan 29 03:33:15 2007 -0800
@@ -1,3 +1,11 @@
+2007-01-29 11:26:26 +0000  William Pitcock <nenolod@sacredspiral.co.uk>
+  revision [1218]
+  - update to new input plugin API
+  
+  trunk/src/wavpack/libwavpack.cxx |   33 ++++++++++++++++-----------------
+  1 file changed, 16 insertions(+), 17 deletions(-)
+
+
 2007-01-29 11:14:02 +0000  William Pitcock <nenolod@sacredspiral.co.uk>
   revision [1216]
   - make this compile again
--- a/src/musepack/libmpc.cxx	Mon Jan 29 03:26:26 2007 -0800
+++ b/src/musepack/libmpc.cxx	Mon Jan 29 03:33:15 2007 -0800
@@ -301,16 +301,16 @@
     return 0;
 }
 
-static void mpcPlay(char* p_Filename)
+static void mpcPlay(InputPlayback *data)
 {
     mpcDecoder.offset   = -1;
     mpcDecoder.isAlive  = true;
     mpcDecoder.isOutput = false;
     mpcDecoder.isPause  = false;
-    threadHandle = g_thread_create(GThreadFunc(decodeStream), (void *) g_strdup(p_Filename), TRUE, NULL);
+    threadHandle = g_thread_create(GThreadFunc(decodeStream), (void *) g_strdup(data->filename), TRUE, NULL);
 }
 
-static void mpcStop()
+static void mpcStop(InputPlayback *data)
 {
     setAlive(false);
     if (threadHandle)
@@ -318,34 +318,34 @@
         g_thread_join(threadHandle);
         if (mpcDecoder.isOutput)
         {
-            MpcPlugin.output->buffer_free();
-            MpcPlugin.output->close_audio();
+            data->output->buffer_free();
+            data->output->close_audio();
             mpcDecoder.isOutput = false;
         }
     }
 }
 
-static void mpcPause(short p_Pause)
+static void mpcPause(InputPlayback *data, short p_Pause)
 {
     lockAcquire();
     mpcDecoder.isPause = p_Pause;
-    MpcPlugin.output->pause(p_Pause);
+    data->output->pause(p_Pause);
     lockRelease();
 }
 
-static void mpcSeek(int p_Offset)
+static void mpcSeek(InputPlayback *data, int p_Offset)
 {
     lockAcquire();
     mpcDecoder.offset = static_cast<double> (p_Offset);
-    MpcPlugin.output->flush(1000 * p_Offset);
+    data->output->flush(1000 * p_Offset);
     lockRelease();
 }
 
-static int mpcGetTime()
+static int mpcGetTime(InputPlayback *data)
 {
     if(!isAlive())
         return -1;
-    return MpcPlugin.output->output_time();
+    return data->output->output_time();
 }
 
 static TitleInput *mpcGetSongTuple(char* p_Filename)
--- a/src/musepack/libmpc.h	Mon Jan 29 03:26:26 2007 -0800
+++ b/src/musepack/libmpc.h	Mon Jan 29 03:33:15 2007 -0800
@@ -104,12 +104,12 @@
 static void       saveConfigBox(GtkWidget*, gpointer);
 static int        mpcIsOurFile(char*);
 static int        mpcIsOurFD(char*,VFSFile*);
-static void       mpcPlay(char*);
-static void       mpcStop();
-static void       mpcPause(short);
-static void       mpcSeek(int);
+static void       mpcPlay(InputPlayback *data);
+static void       mpcStop(InputPlayback *data);
+static void       mpcPause(InputPlayback *data, short);
+static void       mpcSeek(InputPlayback *data, int);
 static void       mpcSetEq(int, float, float*);
-static int        mpcGetTime();
+static int        mpcGetTime(InputPlayback *data);
 static void       mpcGetSongInfo(char*, char**, int*);
 static void       freeTags(MpcInfo&);
 static MpcInfo    getTags(const char*);