function getPlayerTable($mpd) { $player = $mpd->getPlayer(); $song = $player->getSong(); $output = ""; if ($player->getState() == "play") { $output .= '<script type="text/javascript">playerTimer()</script>'; } $output .= "\n\n<table>\n"; $output .= "<tr><th colspan=\"4\">"; $output .= $player->getSongnr() . ". " . $song->toString(HTMLESCAPE); $output .= "</th></tr>\n"; $output .= "<tr><td colspan=\"4\">"; $output .= "<table><tr>"; $link = 'class="body-clickable" onclick="player(\'previous\')"'; $output .= "<td {$link}>" . Icons::getplayRewind() . "</td>"; if ($player->getState() == "play") { $link = 'class="body-clickable" onclick="player(\'pause\')"'; $output .= "<td {$link}>" . Icons::getplayPause(); $output .= "</td>"; } else { $link = 'class="body-clickable" onclick="player(\'play\')"'; $output .= "<td {$link}>" . Icons::getplayPlay(); $output .= "</td>"; } $link = 'class="body-clickable" onclick="player(\'next\')"'; $output .= "<td {$link}>" . Icons::getplayForward() . "</td>"; $link = 'class="body-clickable" onclick="player(\'stop\')"'; $output .= "<td {$link}>" . Icons::getplayStop() . "</td>"; $output .= "</tr></table>"; $output .= "</td></tr>\n"; $output .= "<tr>"; $output .= "<td colspan=\"4\">" . $song->getElapsedTime() . " / " . $song->getTotalTime() . "</td>"; $output .= "</tr>\n"; $output .= "<tr><td colspan=\"4\">"; $bars = 20; for ($i = 1; $i <= $bars; $i++) { $output .= '<span onclick="setVolume(' . $i . ' , ' . $bars . ')">'; if ($player->isVolumeOn($i, $bars)) { $output .= Icons::getVolumeOn(); } else { $output .= Icons::getVolumeOff(); } $output .= '</span>'; } $output .= "</td></tr>"; $output .= "</table>\n"; return $output; }