changeset 1581:8581eb9d574a

Fix fileinfo dialog to work with new subtune system.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 03 Sep 2007 09:37:32 +0300
parents b83dfdc605d5
children 89fb1700313a
files src/sid/xmms-sid.c src/sid/xmms-sid.h src/sid/xs_fileinfo.c
diffstat 3 files changed, 20 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/sid/xmms-sid.c	Mon Sep 03 09:06:54 2007 +0300
+++ b/src/sid/xmms-sid.c	Mon Sep 03 09:37:32 2007 +0300
@@ -276,7 +276,8 @@
 	return result;
 }
 
-static gboolean xs_get_trackinfo(const gchar *pcFilename, gchar **pcResult, gint *pTrack)
+
+gboolean xs_get_trackinfo(const gchar *pcFilename, gchar **pcResult, gint *pTrack)
 {
 	gchar *tmpSep;
 
--- a/src/sid/xmms-sid.h	Mon Sep 03 09:06:54 2007 +0300
+++ b/src/sid/xmms-sid.h	Mon Sep 03 09:37:32 2007 +0300
@@ -63,7 +63,7 @@
 
 /* Configuration section identifier
  */
-#define XS_PACKAGE_STRING	"Audacious-SID v0.8.0beta18"
+#define XS_PACKAGE_STRING	"Audacious-SID"
 #define XS_CONFIG_IDENT		"sid"
 
 /* Default audio rendering frequency in Hz
@@ -171,6 +171,7 @@
 void	xs_about(void);
 
 void	xs_error(const char *, ...);
+gboolean xs_get_trackinfo(const gchar *, gchar **, gint *);
 
 
 /* Debugging
--- a/src/sid/xs_fileinfo.c	Mon Sep 03 09:06:54 2007 +0300
+++ b/src/sid/xs_fileinfo.c	Mon Sep 03 09:37:32 2007 +0300
@@ -145,7 +145,10 @@
 		tmpNode = NULL;
 	
 	if (tmpNode) {
-		subName = tmpNode->pName;
+		if (tmpNode->pName)
+			subName = tmpNode->pName;
+		else
+			subName = tmpNode->pTitle;
 		subAuthor = tmpNode->pAuthor;
 		subInfo = tmpNode->pInfo;
 	} else {
@@ -181,18 +184,27 @@
 	/* Current implementation leaves old fileinfo window untouched if
 	 * no information can be found for the new file. Hmm...
 	 */
+#ifdef AUDACIOUS_PLUGIN
+	xs_get_trackinfo(pcFilename, &tmpFilename, &n);
+#else
+	tmpFilename = pcFilename;
+#endif	
 
 	/* Get new tune information */
 	XS_MUTEX_LOCK(xs_fileinfowin);
 	XS_MUTEX_LOCK(xs_status);
-	if ((tmpInfo = xs_status.sidPlayer->plrGetSIDInfo(pcFilename)) == NULL) {
+	if ((tmpInfo = xs_status.sidPlayer->plrGetSIDInfo(tmpFilename)) == NULL) {
 		XS_MUTEX_UNLOCK(xs_fileinfowin);
 		XS_MUTEX_UNLOCK(xs_status);
 		return;
 	}
 	XS_MUTEX_UNLOCK(xs_status);
 
-	xs_fileinfostil = xs_stil_get(pcFilename);
+	xs_fileinfostil = xs_stil_get(tmpFilename);
+
+#ifdef AUDACIOUS_PLUGIN
+	g_free(tmpFilename);
+#endif
 
 	/* Check if there already is an open fileinfo window */
 	if (xs_fileinfowin)
@@ -257,7 +269,7 @@
 	gtk_widget_show(tmpOptionMenu);
 
 	/* Set the subtune information */
-	xs_fileinfo_subtune(NULL, tmpMenu);
+	xs_fileinfo_subtune(tmpOptionMenu, tmpMenu);
 
 	/* Free temporary tuneinfo */
 	xs_tuneinfo_free(tmpInfo);