ajax.php
changeset 18 69af47034212
parent 10 d3059e20b0fa
child 21 74edc873234f
--- a/ajax.php	Sat Apr 12 09:26:01 2008 -0400
+++ b/ajax.php	Fri Apr 25 12:42:26 2008 -0400
@@ -76,7 +76,10 @@
       dcop_action('playlist', "playByIndex $tid");
       $return = array(
         'current_track_length' => $playlist[$tid]['length_int'],
-        'current_track_pos' => 0
+        'current_track_pos' => 0,
+        'current_track_title' => $playlist[$tid]['title'],
+        'current_track_album' => $playlist[$tid]['album'],
+        'current_track_artist' => $playlist[$tid]['artist']
       );
       echo $json->encode($return);
       break;
@@ -120,12 +123,18 @@
           'volume' => dcop_action('player', 'getVolume'),
           // include the MD5 of the playlist so that if it changes, the
           // client can refresh (otherwise things get madly corrupted)
-          'playlist_hash' => $playlist_last_md5
+          'playlist_hash' => $playlist_last_md5,
+          'current_track_title' => false,
+          'current_track_album' => false,
+          'current_track_artist' => false
         );
       if ( isset($playlist[$current_track]) )
       {
         $return['current_track_length'] = $playlist[$current_track]['length_int'];
         $return['current_track_pos'] = dcop_action('player', 'trackCurrentTime');
+        $return['current_track_title'] = $playlist[$current_track]['title'];
+        $return['current_track_artist'] = $playlist[$current_track]['artist'];
+        $return['current_track_album'] = $playlist[$current_track]['album'];
       }
       echo $json->encode($return);
       break;