2 require_once("always.php");
3 require_once("Session.php");
4 require_once("PlayTracks.php");
7 require_once("header.php");
9 function track_link( $trk, $link_title, $row_class = "" ) {
12 $track_link_url = sprintf( "?l=%s&a=%s&t=%s", urlencode($trk->album
), urlencode($trk->artist
)
13 , urlencode($trk->title
) );
14 $safe_title = htmlspecialchars($link_title);
15 $duration = preg_replace( "/^[0:]{1,4}/", "", $trk->duration
);
17 <tr class="track$row_class">
18 <td class="track$row_class">
19 <a class="track$row_class" href="artist.php$track_link_url$letter_get" title="$trk->path_na
22 <td class="track$row_class">$duration</td>
23 <th class="track$row_class">
24 <a class="alphabetica" href="edit_track.php$track_link_url" title="Edit Track Info">E</a>
34 $album_artist_fmt = <<<EOHTML
36 <tr class="q_headline">
37 <td class="q_cell" colspan="3">
43 $artist_link_fmt = '<a href="/artist.php?a=%s"><span class="q_artist">%s</span></a>';
44 $album_link_fmt = '<a href="/album.php?l=%s"><span class="q_album">%s</span></a>';
46 $track_fmt = <<<EOHTML
49 <td class="q_cell" title="Position in queue">%d</td>
50 <td class="q_cell" title="Track number and name">
51 <span class="q_title">%d - %s</span>
53 <td class="q_cell" title="When this track will start playing">%s</td>
57 $current_track = current_track();
58 $tracks = current_queue();
59 echo '<table id="queue">';
62 $when = $current_track->finishing
;
63 for( $k=0; isset($tracks[$k]); $k++
) {
66 $escape_artist = urlencode($v->artist
);
67 $escape_album = urlencode($v->album
);
69 if ( $escape_artist != $last_artist ||
$escape_album != $last_album ) {
70 if ( $escape_artist != $last_artist && $escape_album != $last_album ) {
71 $links = sprintf( $album_link_fmt, $escape_album, $v->album
);
72 $links .= "/" . sprintf( $artist_link_fmt, $escape_artist, $v->artist
);
74 else if ( $escape_artist != $last_artist ) {
75 $links = sprintf( $artist_link_fmt, $escape_artist, $v->artist
);
77 else if ( $escape_album != $last_album ) {
78 $links = sprintf( $album_link_fmt, $escape_album, $v->album
);
80 printf( $album_artist_fmt, $links );
81 $last_artist = $escape_artist;
82 $last_album = $escape_album;
84 printf( $track_fmt, $position, $v->tracknum
, $v->title
, date('H:i:s', $when ) );
85 $when +
= $v->dur_secs
;