diff src/sid/xs_fileinfo.c @ 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 e566e18e9e3d
children ff902c317ecf
line wrap: on
line diff
--- 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);