changeset 1011:4a693f5b7054 trunk

[svn] - replace xmms_remote_*() with playlist functions.
author yaz
date Thu, 10 May 2007 22:27:38 -0700
parents 8bad1b46ef78
children d0d99b22e393
files ChangeLog src/filewriter/filewriter.c src/filewriter/filewriter.h
diffstat 3 files changed, 23 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu May 10 21:43:57 2007 -0700
+++ b/ChangeLog	Thu May 10 22:27:38 2007 -0700
@@ -1,3 +1,12 @@
+2007-05-11 04:43:57 +0000  William Pitcock <nenolod@sacredspiral.co.uk>
+  revision [2184]
+  - make this compile again and indent properly
+  
+  trunk/src/lastfm/lastfm.c |  149 +++++++++++++++++++++++-----------------------
+  trunk/src/lastfm/lastfm.h |    5 -
+  2 files changed, 78 insertions(+), 76 deletions(-)
+
+
 2007-05-11 00:48:34 +0000  Cristi Magherusan <majeru@atheme.org>
   revision [2182]
   added primitive metadata handling (just gets printed in the terminal)
--- a/src/filewriter/filewriter.c	Thu May 10 21:43:57 2007 -0700
+++ b/src/filewriter/filewriter.c	Thu May 10 22:27:38 2007 -0700
@@ -75,10 +75,6 @@
 
 static gchar *file_path = NULL;
 
-gint ctrlsocket_get_session_id(void);   /* FIXME */
-
-extern TitleInput *input_get_song_tuple(const gchar *filename);
-
 static void file_init(void);
 static void file_about(void);
 static gint file_open(AFormat fmt, gint rate, gint nch);
@@ -192,9 +188,10 @@
 
 static gint file_open(AFormat fmt, gint rate, gint nch)
 {
-    gchar *origfilename = NULL, *filename = NULL, *temp = NULL;
+    gchar *filename = NULL, *temp = NULL;
     gint pos;
     gint rv;
+    Playlist *playlist;
 
     if (xmms_check_realtime_priority())
     {
@@ -209,17 +206,19 @@
     input.frequency = rate;
     input.channels = nch;
 
-    pos = xmms_remote_get_playlist_pos(ctrlsocket_get_session_id());
+    playlist = playlist_get_active();
+    if(!playlist)
+        return 0;
 
-    origfilename = xmms_remote_get_playlist_file(ctrlsocket_get_session_id(),
-                                                 pos);
-
-    tuple = input_get_song_tuple(origfilename);
+    pos = playlist_get_position(playlist);
+    tuple = playlist_get_tuple(playlist, pos);
+    if(!tuple)
+        return 0;
 
     if (filenamefromtags)
     {
-        gchar *utf8 =
-            xmms_remote_get_playlist_title(ctrlsocket_get_session_id(), pos);
+        gchar *utf8 = xmms_get_titlestring(xmms_get_gentitle_format(), tuple);
+
         g_strchomp(utf8); //chop trailing ^J --yaz
 
         filename = g_locale_from_utf8(utf8, -1, NULL, NULL, NULL);
@@ -229,7 +228,7 @@
     }
     if (filename == NULL)
     {
-        filename = g_path_get_basename(origfilename);
+        filename = g_strdup(tuple->file_name);
         if (!use_suffix)
             if ((temp = strrchr(filename, '.')) != NULL)
                 *temp = '\0';
@@ -253,12 +252,10 @@
 
     gchar *directory;
     if (save_original)
-        directory = g_path_get_dirname(origfilename);
+        directory = g_strdup(tuple->file_path);
     else
         directory = g_strdup(file_path);
 
-    g_free(origfilename);
-
     temp = g_strdup_printf("%s/%s.%s",
                            directory, filename, fileext_str[fileext]);
     g_free(directory);
@@ -272,7 +269,6 @@
         return 0;
 
     rv = plugin.open();
-    bmp_title_input_free(tuple);
 
     return rv;
 }
--- a/src/filewriter/filewriter.h	Thu May 10 21:43:57 2007 -0700
+++ b/src/filewriter/filewriter.h	Thu May 10 22:27:38 2007 -0700
@@ -30,7 +30,7 @@
 #include <string.h>
 
 #include <audacious/plugin.h>
-#include <audacious/beepctrl.h>
+#include <audacious/playlist.h>
 #include <audacious/configdb.h>
 #include <audacious/i18n.h>
 #include <audacious/util.h>