<?PHP // current.php

    include("config.php");

    $meta = "<META HTTP-EQUIV=refresh CONTENT=\"20;URL=current.php\">\n";

    print_header($meta);

    if (isset($command)) {
        switch ($command) {
            case "play":
                $result = play();
            break;
            case "stop":
                $result = stop();
            break;
            case "pause":
                $result = pause();
            break;
            case "next":
                $result = next_track();
            break;
            case "repeat":
                $result = queue($album, $track);
            break;
        }
    }

    $status = status();


    print_heading("Currently Playing", "image/refresh.gif", "current.php", "Refresh");

    echo "<P ALIGN=CENTER>";
    if ($status["TITLE"] and $status["ARTIST"]) {
        echo "<FONT SIZE=4><B><A TARGET=\"mp3tracks\" HREF=\"tracks.php?album=".$status["ALBUM_NO"]."&track=".$status["TRACK_NO"]."\">".$status["TITLE"]."</A></B></FONT> ";
        echo "<FONT SIZE=4>by ".$status["ARTIST"]."</FONT>";
    } else {
        echo "<FONT SIZE=4>Nothing playing</FONT>";
    }
    //$info = info();
    //print_rating ($info["RATING"], "track", $album, $track);
    echo "</P>";

    $buttons = "<TABLE CELLPADDING=10 ALIGN=CENTER BORDER=0><TR>";
    $buttons .= "<TD><FONT SIZE=-1><A HREF=\"current.php?command=play\">PLAY</A>";
    $buttons .= "<TD><FONT SIZE=-1><A HREF=\"current.php?command=stop\">STOP</A>";
    $buttons .= "<TD><FONT SIZE=-1><A HREF=\"current.php?command=pause\">PAUSE</A>";
    $buttons .= "<TD><FONT SIZE=-1><A HREF=\"current.php?command=next\">NEXT</A>";
    $buttons .= "<TD><FONT SIZE=-1><A TARGET=\"mp3queue\" HREF=\"queue.php?album=".$status["ALBUM_NO"]."&track=".$status["TRACK_NO"]."\">REPEAT</A>";
    $buttons .= "</TR></TABLE>";

    echo $buttons;


?>
