include('mpd.php');
-$cur_track= $mpd->current_track_id;
-$playlist= $mpd->playlist;
-if($cur_track !=-1)
+$cur_track = $mpd->current_track_id;
+$playlist = $mpd->playlist;
+$playlist_count = $mpd->playlist_count;
+
+if($cur_track !=-1) {
+
+ $trackno=$cur_track+1;
+
+ echo "<div class=\"trackno\">#$trackno/$playlist_count</div>";
if ($playlist[$cur_track]['name']==$playlist[$cur_track]['title']) {
- echo htmlentities(cut_file($playlist[$cur_track]['name']));
+ echo "<div class=\"trackname\">".htmlentities(cut_file($playlist[$cur_track]['name']))."</div>";
} else {
- echo htmlentities($playlist[$cur_track]['title']);
+ echo "<div class=\"trackname\">".htmlentities($playlist[$cur_track]['title'])."</div>";
}
-else
- echo "No Track selected";
+
+} else {
+ echo "<div class=\"trackno\">#-/$playlist_count</div>";
+ echo "<div class=\"trackname\">No track selected</div>";
+}
?>