Exemplo n.º 1
0
             case "Time":
                 if (array_key_exists($column, $songinfo) && strlen($songinfo[$column]) > 0) {
                     echo format_time($songinfo[$column]);
                 } else {
                     echo $configuration["unknown_string"];
                 }
                 break;
             case "Track":
                 if (array_key_exists($column, $songinfo) && strlen($songinfo[$column]) > 0) {
                     echo $songinfo[$column];
                 } else {
                     echo $configuration["unknown_string"];
                 }
                 break;
             case "songformat":
                 echo format_song_title($configuration["song_display_format"], $songinfo, strval($counte));
                 break;
             default:
                 if (array_key_exists($column, $songinfo) && strlen($songinfo[$column]) > 0) {
                     echo htmlentities($songinfo[$column]);
                 } else {
                     echo $configuration["unknown_string"];
                 }
                 break;
         }
         echo "</td>";
     }
     echo "</tr>\n";
     $counte++;
 }
 echo "</table>\n";
Exemplo n.º 2
0
//make_link("index.php", "status", "refresh");
//echo "]</small></h2>";
echo "</span><br /><span class=\"playing\">";
if (array_key_exists("command", $_REQUEST) && $_REQUEST["command"]) {
    if ($command_successful !== true && $configuration["error_msg"]) {
        echo "Error on command " . $_REQUEST["command"] . " with arguments: " . $_REQUEST["arg"] . "<br />\n";
    }
}
switch ($mpd_status["state"]) {
    case "play":
    case "pause":
        $songinfo = do_mpd_command($connection, "playlistid " . $mpd_status["songid"], null, true);
        if ($configuration["filenames_only"] == true) {
            echo $songinfo["file"];
        } else {
            echo format_song_title($configuration["song_display_format"], $songinfo, $mpd_status["song"]);
        }
        $elapsed_time = floatval(trim(strtok($mpd_status["time"], ":")));
        $total_time = floatval(trim(strtok("")));
        $remaining_time = $total_time - $elapsed_time;
        echo "<br />\n(";
        if ($configuration["time_elapsed"] == true) {
            make_link("", "status", format_time($elapsed_time), array("time_elapsed" => "false"));
            echo ")/";
        } else {
            echo "-";
            make_link("", "status", format_time($remaining_time), array("time_elapsed" => "true"));
            echo ") ";
        }
        echo "[" . format_time($total_time) . "]";
        //	echo $mpd_status["bitrate"]." kbps";