changeset 3705:38259e9394a2

add InputPlayback::set_params() and InputPlayback::set_title() which will replace InputPlugin::set_info() and InputPlugin::set_info_text() someday.
author William Pitcock <nenolod@atheme.org>
date Sun, 07 Oct 2007 14:05:16 -0500
parents fa3d2a62a066
children fc17623eb561
files src/audacious/playback.c src/audacious/plugin.h
diffstat 2 files changed, 33 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/playback.c	Sun Oct 07 13:40:45 2007 -0500
+++ b/src/audacious/playback.c	Sun Oct 07 14:05:16 2007 -0500
@@ -102,6 +102,28 @@
     g_mutex_unlock(playback->pb_change_mutex);
 }
 
+static void
+playback_set_pb_params(InputPlayback *playback, gchar *title,
+    gint length, gint rate, gint freq, gint nch)
+{
+    playback->title = g_strdup(title);
+    playback->length = length;
+    playback->rate = rate;
+    playback->freq = freq;
+    playback->nch = nch;
+
+    /* XXX: this can be removed/merged here someday */
+    playback->plugin->set_info(title, length, rate, freq, nch);
+}
+
+static void
+playback_set_pb_title(InputPlayback *playback, gchar *title)
+{
+    playback->title = g_strdup(title);
+
+    playback->plugin->set_info_text(title);
+}
+
 void
 playback_eof(void)
 {
@@ -388,6 +410,8 @@
     /* init vtable functors */
     playback->set_pb_ready = playback_set_pb_ready;
     playback->set_pb_change = playback_set_pb_change;
+    playback->set_params = playback_set_pb_params;
+    playback->set_title = playback_set_pb_title;
     
     set_current_input_playback(playback);
 
--- a/src/audacious/plugin.h	Sun Oct 07 13:40:45 2007 -0500
+++ b/src/audacious/plugin.h	Sun Oct 07 14:05:16 2007 -0500
@@ -446,6 +446,15 @@
     GMutex *pb_change_mutex;
     GCond *pb_change_cond;
     void (*set_pb_change)(InputPlayback *self);
+
+    gint nch;
+    gint rate;
+    gint freq;
+    gint length;
+    gchar *title;
+    
+    void (*set_params) (InputPlayback *, gchar * title, gint length, gint rate, gint freq, gint nch);
+    void (*set_title) (InputPlayback *, gchar * text);
 };
 
 struct _InputPlugin {