1
0
mirror of https://github.com/danbee/neompc synced 2025-03-04 08:39:10 +00:00

+ Control page now auto refreshes for next track. Still needs full testing.

~ Few changes to the layout.
This commit is contained in:
Dan Barber 2007-05-14 21:34:24 +00:00
parent 57e537d177
commit a672dca6f1
8 changed files with 35 additions and 21 deletions

View File

@ -6,7 +6,7 @@
/* Config relating to the display of CD covers */
/* music_directory must match you MPD music_directory config */
$_CONFIG['music_directory'] = '/home/danbee/Music';
$_CONFIG['music_directory'] = '/home/media/data/audio';
$_CONFIG['album_cover_name'] = 'folder.jpg';
$_CONFIG['album_cover_size'] = 130;

View File

@ -79,6 +79,8 @@
$page = 'playlist';
}
//echo $mympd->current_track_length, ' - ', $mympd->current_track_position;
$smarty->assign('page', $page);
?>

View File

@ -35,6 +35,16 @@
$smarty->assign('coversize', $_CONFIG['album_cover_size']);
}
$time_left = (($mympd->current_track_length - $mympd->current_track_position) + 2) * 1000;
//echo $time_left / 1000;
if ($mympd->state == MPD_STATE_PLAYING) {
$smarty->assign('refresh',
"<script>setTimeout('window.location.replace(unescape(window.location.pathname));', "
. $time_left . ");</script>");
}
break;
case "browse":

View File

@ -1,4 +1,4 @@
<div id="song_display">{if $current_title}<span class="pos">{$current_track_no+1|string_format:"%02d"}.</span> <span class="title">{$current_title}</span><br /><span class="artist">{$current_artist}</span> {if $current_album}<span class="album">({$current_album})</span>{/if}{elseif $current_file}{$current_file}{else}<br />[Nothing playing]{/if}</div>
<div id="song_display">{if $current_title}<span class="pos">{$current_track_no+1|string_format:"%02d"}.</span> <span class="title">{$current_title}</span><br /><span class="artist">{$current_artist}</span> {if $current_album}<!--<span class="album">({$current_album})</span>-->{/if}{elseif $current_file}{$current_file}{else}<br />[Nothing playing]{/if}</div>
{if $coverimage}<div id="cover_image"><img id="cover" src="lib/image.php?file={$coverimage}&size={$coversize}"></div>{/if}

View File

@ -9,9 +9,13 @@
<style>
{include file="default/styles.css"}
</style>
</head>
<body>
{$refresh}
{include file="default/menu.html"}
<div id="page">

View File

@ -1,6 +1,4 @@
<div id="menu">
<a {if $page == 'browse'}class="selected" {/if}href="{$browse_link}">Browse</a>
<a {if $page == 'playlist'}class="selected" {/if}href="{$playlist_link}">Playlist</a>
<a {if $page == 'control'}class="selected" {/if}href="{$control_link}">Control</a>
<a {if $page == 'browse'}class="selected" {/if}href="{$browse_link}">Browse</a><a {if $page == 'playlist'}class="selected" {/if}href="{$playlist_link}">Playlist</a><a {if $page == 'control'}class="selected" {/if}href="{$control_link}">Control</a>
</div>

View File

@ -107,8 +107,8 @@ img.button {
}
#song_display {
width: 215px;
margin: 0px auto;
height: 55px;
margin: 0px auto 5px;
/* height: 55px; */
text-align: center;
font-size: 12px;
}