changeset 1269:681b629322c4 trunk

[svn] - hook up fileinfo box stuff
author nenolod
date Thu, 15 Jun 2006 22:23:39 -0700
parents 97fd96ee4b84
children feff5a622f06
files ChangeLog audacious/playlist.c audacious/ui_fileinfo.c
diffstat 3 files changed, 48 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Jun 15 22:15:56 2006 -0700
+++ b/ChangeLog	Thu Jun 15 22:23:39 2006 -0700
@@ -1,3 +1,12 @@
+2006-06-16 05:15:56 +0000  William Pitcock <nenolod@nenolod.net>
+  revision [1450]
+  - generic info box support
+  
+
+  Changes:        Modified:
+  +1 -2           trunk/audacious/ui_fileinfo.c  
+
+
 2006-06-16 05:13:55 +0000  William Pitcock <nenolod@nenolod.net>
   revision [1448]
   - more fun
--- a/audacious/playlist.c	Thu Jun 15 22:15:56 2006 -0700
+++ b/audacious/playlist.c	Thu Jun 15 22:23:39 2006 -0700
@@ -54,6 +54,7 @@
 #include "skin.h"
 #include "urldecode.h"
 #include "util.h"
+#include "ui_fileinfo.h"
 
 #include "debug.h"
 
@@ -2116,15 +2117,30 @@
 {
     gchar *path = NULL;
     GList *node;
+    PlaylistEntry *entry = NULL;
+    TitleInput *tuple = NULL;
 
     PLAYLIST_LOCK();
-    if ((node = g_list_nth(playlist_get(), pos))) {
-        PlaylistEntry *entry = node->data;
-        path = g_strdup(entry->filename);
+
+    if ((node = g_list_nth(playlist_get(), pos)))
+    {
+        entry = node->data;
+        tuple = entry->tuple;
+	path = g_strdup(entry->filename);
     }
+
     PLAYLIST_UNLOCK();
-    if (path) {
-        input_file_info_box(path);
+    if (tuple != NULL)
+    {
+        if (entry->decoder != NULL && entry->decoder->file_info_box == NULL)
+            fileinfo_show_for_tuple(tuple);
+        else
+            fileinfo_show_for_path(path);
+        g_free(path);
+    }
+    else if (path != NULL)
+    {
+        fileinfo_show_for_path(path);
         g_free(path);
     }
 }
@@ -2133,14 +2149,29 @@
 playlist_fileinfo_current(void)
 {
     gchar *path = NULL;
+    TitleInput *tuple = NULL;
 
     PLAYLIST_LOCK();
+
     if (playlist_get() && playlist_position)
+    {
         path = g_strdup(playlist_position->filename);
+	tuple = playlist_position->tuple;
+    }
+
     PLAYLIST_UNLOCK();
 
-    if (path) {
-        input_file_info_box(path);
+    if (tuple != NULL)
+    {
+        if (playlist_position->decoder != NULL && playlist_position->decoder->file_info_box == NULL)
+            fileinfo_show_for_tuple(tuple);
+        else
+            fileinfo_show_for_path(path);
+        g_free(path);
+    }
+    else if (path != NULL)
+    {
+        fileinfo_show_for_path(path);
         g_free(path);
     }
 }
--- a/audacious/ui_fileinfo.c	Thu Jun 15 22:15:56 2006 -0700
+++ b/audacious/ui_fileinfo.c	Thu Jun 15 22:23:39 2006 -0700
@@ -151,7 +151,7 @@
 }
 
 void
-fileinfo_show_for_filepath(const gchar *path)
+fileinfo_show_for_path(gchar *path)
 {
 	TitleInput *tuple = input_get_song_tuple(path);