changeset 1496:e7e94da0737b trunk

[svn] - also detect changes based on playlist "displayed title"
author nenolod
date Fri, 04 Aug 2006 01:35:22 -0700
parents a9e00b61a389
children 6fa65c687f80
files ChangeLog Plugins/General/notify/notify.c
diffstat 2 files changed, 28 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Aug 04 01:24:02 2006 -0700
+++ b/ChangeLog	Fri Aug 04 01:35:22 2006 -0700
@@ -1,3 +1,12 @@
+2006-08-04 08:24:02 +0000  William Pitcock <nenolod@nenolod.net>
+  revision [1904]
+  - fix the real_ip<InputPlugin *>.set_info mapping properly when InputPlugin cue_ip::stop() is reached.
+  
+
+  Changes:        Modified:
+  +1 -1           trunk/Plugins/Input/cue/cuesheet.c  
+
+
 2006-08-04 08:21:49 +0000  William Pitcock <nenolod@nenolod.net>
   revision [1902]
   - use $(NOTIFY_LIBS) and $(NOTIFY_CFLAGS)... not really much of difference, but yeah
--- a/Plugins/General/notify/notify.c	Fri Aug 04 01:24:02 2006 -0700
+++ b/Plugins/General/notify/notify.c	Fri Aug 04 01:35:22 2006 -0700
@@ -19,6 +19,7 @@
 static gint timeout_tag = 0;
 
 static gint notify_playlist_pos = -1;
+static gchar *previous_title = NULL;
 
 /* our API. */
 static void do_notification(gchar *summary, gchar *message, gchar *icon_uri);
@@ -49,13 +50,22 @@
 static void cleanup(void)
 {
 	gtk_timeout_remove(timeout_tag);
+
+	if (previous_title != NULL)
+	{
+		g_free(previous_title)
+		previous_title = NULL;
+	}
 }
 
 static gboolean watchdog_func(gpointer unused)
 {
 	gint pos = playlist_get_position();
+	gchar *title = playlist_get_songtitle(pos);
 
-	if (pos != notify_playlist_pos)
+	if (pos != notify_playlist_pos ||
+		(title != NULL && previous_title != NULL &&
+		 g_strcasecmp(title, previous_title)))
 	{
 		gchar *tmpbuf;
 		TitleInput *tuple;
@@ -76,6 +86,14 @@
 
 	notify_playlist_pos = pos;
 
+	if (previous_title != NULL)
+	{
+		g_free(previous_title)
+		previous_title = NULL;
+	}
+
+	previous_title = g_strdup(title);
+
 	return TRUE;
 }