changeset 3348:2a081105513c trunk

-Set the track "title" in metadata instead of "name" -Emit the TrackChange signal any time playback_initiate() is called
author Ben Tucker <ben.tucker@gmail.com>
date Mon, 13 Aug 2007 00:03:33 -0700
parents d3e667797310
children 01a241d35146
files src/audacious/dbus.c src/audacious/playback.c src/audacious/playlist.c
diffstat 3 files changed, 12 insertions(+), 36 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/dbus.c	Mon Aug 13 01:46:16 2007 +0200
+++ b/src/audacious/dbus.c	Mon Aug 13 00:03:33 2007 -0700
@@ -209,7 +209,7 @@
 
     value = tuple_value_to_gvalue(tuple, "title");
     if (value != NULL) {
-        g_hash_table_insert(md, "name", value);
+        g_hash_table_insert(md, "title", value);
     }
 
     value = tuple_value_to_gvalue(tuple, "artist");
--- a/src/audacious/playback.c	Mon Aug 13 01:46:16 2007 +0200
+++ b/src/audacious/playback.c	Mon Aug 13 00:03:33 2007 -0700
@@ -133,6 +133,9 @@
 
     entry = playlist_get_entry_to_play(playlist);
     g_return_if_fail(entry != NULL);
+#ifdef USE_DBUS
+    mpris_emit_track_change(mpris);
+#endif
     playback_play_file(entry);
 
 //    if (playback_get_time() != -1) {
--- a/src/audacious/playlist.c	Mon Aug 13 01:46:16 2007 +0200
+++ b/src/audacious/playlist.c	Mon Aug 13 00:03:33 2007 -0700
@@ -520,12 +520,8 @@
 
     playlistwin_update_list(playlist);
     if (restart_playing) {
-        if (playlist->position) {
-#ifdef USE_DBUS
-            mpris_emit_track_change(mpris);
-#endif
+        if (playlist->position)
             playback_initiate();
-        }
         else {
             mainwin_clear_song_info();
         }
@@ -562,12 +558,8 @@
     playlistwin_update_list(playlist);
 
     if (restart_playing) {
-        if (playlist->position) {
-#ifdef USE_DBUS
-            mpris_emit_track_change(mpris);
-#endif
+        if (playlist->position)
             playback_initiate();
-        }
         else {
             mainwin_clear_song_info();
         }
@@ -606,12 +598,8 @@
     playlist_recalc_total_time(playlist);
 
     if (restart_playing) {
-        if (playlist->position) {
-#ifdef USE_DBUS
-            mpris_emit_track_change(mpris);
-#endif
+        if (playlist->position)
             playback_initiate();
-        }
         else {
             mainwin_clear_song_info();
         }
@@ -1177,12 +1165,8 @@
     PLAYLIST_UNLOCK(playlist->mutex);
     playlist_check_pos_current(playlist);
 
-    if (restart_playing) {
-#ifdef USE_DBUS
-        mpris_emit_track_change(mpris);
-#endif
+    if (restart_playing)
         playback_initiate();
-    }
 
     playlistwin_update_list(playlist);
 }
@@ -1241,14 +1225,10 @@
 
     playlist_check_pos_current(playlist);
 
-    if (restart_playing) {
-#ifdef USE_DBUS
-        mpris_emit_track_change(mpris);
-#endif
+    if (restart_playing)
         playback_initiate();
-    } else {
+    else
         playlistwin_update_list(playlist);
-    }
 }
 
 void
@@ -1426,14 +1406,10 @@
     PLAYLIST_UNLOCK(playlist->mutex);
     playlist_check_pos_current(playlist);
 
-    if (restart_playing) {
-#ifdef USE_DBUS
-        mpris_emit_track_change(mpris);
-#endif
+    if (restart_playing)
         playback_initiate();
-    } else {
+    else
         playlistwin_update_list(playlist);
-    }
 }
 
 void
@@ -1498,9 +1474,6 @@
     PLAYLIST_UNLOCK(playlist->mutex);
 
     playlist_check_pos_current(playlist);
-#ifdef USE_DBUS
-    mpris_emit_track_change(mpris);
-#endif
     playback_initiate();
     playlistwin_update_list(playlist);
 }