From 5aee29fa0419dc1ab9c270ca7d0572d18979f594 Mon Sep 17 00:00:00 2001 From: Dan Barber Date: Tue, 12 Jan 2010 20:05:33 +0000 Subject: [PATCH] ~ Volume control reads current MPD state now. --- lib/page.php | 3 + .../%%3B^3B9^3B9ACDBF%%styles.css.php | 297 ------------------ .../%%3F^3F8^3F8E1A98%%playlist_item.html.php | 17 - .../%%73^737^7373CB1D%%javascript.js.php | 67 ---- .../%%73^73A^73AF6CEB%%menu.html.php | 12 - ...%81^81D^81D213F2%%browselist_item.html.php | 57 ---- .../%%86^860^86006DCD%%browse.html.php | 35 --- .../%%A0^A09^A09C29AE%%playlist.html.php | 22 -- .../%%B6^B60^B607F601%%control.html.php | 65 ---- .../%%C1^C14^C14AEF59%%index.html.php | 58 ---- templates/default/config.inc.php | 4 + templates/default/control.html | 7 +- templates/default/index.html | 2 - templates/default/styles.css | 23 +- 14 files changed, 31 insertions(+), 638 deletions(-) delete mode 100644 smarty/templates_c/%%3B^3B9^3B9ACDBF%%styles.css.php delete mode 100644 smarty/templates_c/%%3F^3F8^3F8E1A98%%playlist_item.html.php delete mode 100644 smarty/templates_c/%%73^737^7373CB1D%%javascript.js.php delete mode 100644 smarty/templates_c/%%73^73A^73AF6CEB%%menu.html.php delete mode 100644 smarty/templates_c/%%81^81D^81D213F2%%browselist_item.html.php delete mode 100644 smarty/templates_c/%%86^860^86006DCD%%browse.html.php delete mode 100644 smarty/templates_c/%%A0^A09^A09C29AE%%playlist.html.php delete mode 100644 smarty/templates_c/%%B6^B60^B607F601%%control.html.php delete mode 100644 smarty/templates_c/%%C1^C14^C14AEF59%%index.html.php diff --git a/lib/page.php b/lib/page.php index ef7d67d..3c1d338 100644 --- a/lib/page.php +++ b/lib/page.php @@ -2,6 +2,9 @@ $progressbar_width = $_CONFIG['progress_bar_width']; $smarty->assign('progressbar_width', $progressbar_width); + $smarty->assign('volume_orientation', $_CONFIG['volume_orientation']); + $smarty->assign('volume_min', $_CONFIG['volume_min']); + $smarty->assign('volume_max', $_CONFIG['volume_max']); $smarty->assign('page', $page); /* print_r($mympd->playlist); */ diff --git a/smarty/templates_c/%%3B^3B9^3B9ACDBF%%styles.css.php b/smarty/templates_c/%%3B^3B9^3B9ACDBF%%styles.css.php deleted file mode 100644 index 3b5b5d9..0000000 --- a/smarty/templates_c/%%3B^3B9^3B9ACDBF%%styles.css.php +++ /dev/null @@ -1,297 +0,0 @@ - -* { - margin: 0px; - padding: 0px; -} -img { - border: 0; -} -a { - text-decoration: none; - color: #fff; -} -body { - background: #333 url(templates/_tpl_vars['template']; ?> -/images/menu_shadow.png) center 29px repeat-x; - color: #fff; - font: 13px helvetica,verdana,sans-serif; - text-align: center; - margin: 45px 0px 0px 0px; -} -p { - margin-bottom: 5px; -} -#menu { - background: #111; - position: fixed; - width: 100%; - height: 30px; - top: 0px; - padding: 0px 2px 0px 0px; - z-index: 1; - text-align: center; -} -#menu ul { - width: 320px; - margin: 0px auto; -} -#menu li { - display: block; - float: left; -} -#menu a { - background: #000 url(templates/_tpl_vars['template']; ?> -/images/menu_back.png); - font: 14px helvetica,verdana,sans-serif; - color: rgba(0, 0, 0, 1);; - text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.6); - padding: 5px 0px 2px; - float: left; - margin-left: 0px; - display: block; - width: 107px; - height: 23px; - text-align: center; - font-weight: bold; -} -#menu a:hover { - background: #ccc url(templates/_tpl_vars['template']; ?> -/images/menu_back_active.png);; - color: #000; -} -#menu a:active { - background: #ccc url(templates/_tpl_vars['template']; ?> -/images/menu_back_active.png);; - color: #000; -} -#menu a.selected { - background: #333 url(templates/_tpl_vars['template']; ?> -/images/menu_back_selected.png); - color: #fff; - width: 106px; - text-shadow: 0 0 12px rgba(150, 210, 255, 0.9); -} -#page { - padding: 0px; - clear: left; -} -#page ul { - list-style-type: none; - width: 280px; - text-align: left; - margin-left: auto; - margin-right: auto; -} -#page ul.list { - margin-top: 10px; -} -#page ul li { - padding: 0px 1px 1px 0px; - border-top: 1px solid #666; -} -#song_display { - position: relative; - width: 280px; - height: 217px; - margin: 0px auto 5px; - /* height: 55px; */ - text-align: left; - font-size: 14px; -} -#page #pos { - font-weight: bold; -} -#page #title { - font-size: 16px; - color: #ffc; - font-weight: bold; -} -#page #song_info { - text-align: center; - white-space: nowrap; - overflow: hidden; - clear: both; -} -#page #album_info { - position: absolute; - top: 10px; - left: 150px; -} -#page #artist { - font-style: italic; -} -#page #album { - color: #888; -} -#buttons { - width: 280px; - margin: 0px auto; - padding-top: 10px; - text-align: right; -} - -img.icon { - margin: 2px 2px -1px 2px; -} -img.button { - float: right; - margin: 2px 2px -1px 2px; -} -#controls { - background: #666 url(templates/_tpl_vars['template']; ?> -/images/control_back.png) center center repeat-x; - text-align: center; - margin: 8px 0px 0px 0px; - padding: 10px 7px 10px 0px; - height: 50px; -} -#controls .container { - position: relative; - width: 280px; - margin: 0px auto; -} -#controls #main_controls { - width: 280px; -} -#controls #main_controls li { - display: block; - float: left; - border: 0; -} -#controls #main_controls a { - background-image: url(templates/_tpl_vars['template']; ?> -/images/buttons.png); - background-repeat: no-repeat; - display: block; - float: left; - width: 50px; - height: 50px; - margin-left: 7px; -} -#main_controls #prev_button { - background-position: 0px 0px; -} -#main_controls #playpause_button { - background-position: -50px 0px; -} -#main_controls #playpause_button.pause { - background-position: -100px 0px; -} -#main_controls #stop_button { - background-position: -150px 0px; -} -#main_controls #next_button { - background-position: -200px 0px; -} - -#main_controls #prev_button:hover { - background-position: 0px -50px; -} -#main_controls #playpause_button:hover { - background-position: -50px -50px; -} -#main_controls #playpause_button.pause:hover { - background-position: -100px -50px; -} -#main_controls #stop_button:hover { - background-position: -150px -50px; -} -#main_controls #next_button:hover { - background-position: -200px -50px; -} - -#volume_repeat { - position: absolute; - left: 250px; -} -#volume_repeat a { - display: block; - width: 30px; - height: 20px; - margin-bottom: 10px; - background-position: 0px 0px; - background-repeat: no-repeat; -} -#volume_repeat #volume_button { - background-image: url(templates/_tpl_vars['template']; ?> -/images/shuffle.png); -} -#volume_repeat #repeat_button { - background-image: url(templates/_tpl_vars['template']; ?> -/images/repeat.png); -} -#volume_repeat #volume_button:hover { - background-position: 0px -20px; -} -#volume_repeat #repeat_button:hover { - background-position: 0px -20px; -} -#volume_repeat #repeat_button.selected { - background-position: -30px 0px; -} -#volume_repeat #repeat_button.selected:hover { - background-position: -30px -20px; -} - -#volume_container { - position: absolute; - display: none; - top: -120px; - background: rgba(255, 0, 0, 0.5); - height: 140px; - width: 30px; -} - -#crumb_trail ul { - list-style-position: inside; - text-align: left; -} - -#crumb_trail li { - display: inline; - margin-left: 3px; - border: 0px none !important; -} -li.playing { - background: #444; -} -#progress { - background: #222 url(templates/_tpl_vars['template']; ?> -/images/progress_back.png) center center repeat-x; - border: 1px solid #666; - padding: 2px; - width: 276px; - height: 10px; - margin: 5px auto 10px; - text-align: left; - clear: both; -} -#progressbar { - font-size: 1px; - background: #ccc url(templates/_tpl_vars['template']; ?> -/images/progress.png) center center repeat-x;; - height: 10px; - margin: 0px; - padding: 0px; -} -#cover_image { - float: left; - height: 130px; - width: 130px; - margin: 10px 0px 20px; -} -img#cover { - background: #111; - padding: 2px; - border: 1px solid #666; -} -#tracktime { - font-weight: bold; - position: absolute; - top: 130px; - left: 150px; -} -#tracktime #total { - color: #666; -} \ No newline at end of file diff --git a/smarty/templates_c/%%3F^3F8^3F8E1A98%%playlist_item.html.php b/smarty/templates_c/%%3F^3F8^3F8E1A98%%playlist_item.html.php deleted file mode 100644 index b2333ba..0000000 --- a/smarty/templates_c/%%3F^3F8^3F8E1A98%%playlist_item.html.php +++ /dev/null @@ -1,17 +0,0 @@ - - array(array('modifier', 'string_format', 'default/playlist_item.html', 1, false),)), $this); ?> - _tpl_vars['playlist_item']['Pos'] == $this->_tpl_vars['playing']): ?>
  • Remove from PlaylistPlay _tpl_vars['playlist_item']['Pos']+1)) ? $this->_run_mod_handler('string_format', true, $_tmp, "%02d") : smarty_modifier_string_format($_tmp, "%02d")); ?> -. _tpl_vars['playlist_item']['Title']): ?>_tpl_vars['playlist_item']['Title']; ?> -_tpl_vars['playlist_item']['Artist'] && $this->_tpl_vars['show_extra_track_info']): ?>
    _tpl_vars['playlist_item']['Artist']; ?> - _tpl_vars['playlist_item']['Album']): ?>(_tpl_vars['playlist_item']['Album']; ?> -)_tpl_vars['playlist_item']['file_name']; ?> -
  • \ No newline at end of file diff --git a/smarty/templates_c/%%73^737^7373CB1D%%javascript.js.php b/smarty/templates_c/%%73^737^7373CB1D%%javascript.js.php deleted file mode 100644 index 558220c..0000000 --- a/smarty/templates_c/%%73^737^7373CB1D%%javascript.js.php +++ /dev/null @@ -1,67 +0,0 @@ - - song_length = _tpl_vars['song_length']; ?> -; - song_position = _tpl_vars['song_position']; ?> -; - - song_min = _tpl_vars['initialmin']; ?> -; - song_sec = _tpl_vars['initialsec']; ?> -; - - progressbar_width = _tpl_vars['progressbar_width']; ?> -; - - mpd_state = '_tpl_vars['mpd_state']; ?> -'; - - = 60) { - song_sec = 0; - song_min = song_min + 1 - } - } - - progressbar = document.getElementById(\'progressbar\'); - - new_margin = Math.round(progressbar_width - ((song_position / song_length) * progressbar_width)); - - new_margin_string = new_margin + \'px\'; - - progressbar.style.marginRight = new_margin_string; - document.getElementById(\'min\').innerHTML = format_time(song_min); - document.getElementById(\'sec\').innerHTML = format_time(song_sec); - - //alert(progressbar.style.marginRight + \' - \' + new_margin_string); - - } - - if (mpd_state == \'play\') { - //start off with a shorter interval. this should make the whole thing a little more accurate. - setTimeout(\'update_progress()\', 750); - } - -'; ?> diff --git a/smarty/templates_c/%%73^73A^73AF6CEB%%menu.html.php b/smarty/templates_c/%%73^73A^73AF6CEB%%menu.html.php deleted file mode 100644 index c96f781..0000000 --- a/smarty/templates_c/%%73^73A^73AF6CEB%%menu.html.php +++ /dev/null @@ -1,12 +0,0 @@ - - diff --git a/smarty/templates_c/%%81^81D^81D213F2%%browselist_item.html.php b/smarty/templates_c/%%81^81D^81D213F2%%browselist_item.html.php deleted file mode 100644 index 8712cc7..0000000 --- a/smarty/templates_c/%%81^81D^81D213F2%%browselist_item.html.php +++ /dev/null @@ -1,57 +0,0 @@ - - array(array('modifier', 'escape', 'default/browselist_item.html', 4, false),)), $this); ?> - - _tpl_vars['browselist_item']['directory']): ?> - -
  • _tpl_vars['browselist_item']['directory_name'])) ? $this->_run_mod_handler('escape', true, $_tmp, 'html') : smarty_modifier_escape($_tmp, 'html')); ?> -
  • - - _tpl_vars['browselist_item']['metaArtist']): ?> - -
  • _tpl_vars['browselist_item']['metaArtist'])) ? $this->_run_mod_handler('escape', true, $_tmp, 'html') : smarty_modifier_escape($_tmp, 'html')); ?> -
  • - - _tpl_vars['browselist_item']['metaAlbum']): ?> - -
  • _tpl_vars['browselist_item']['metaAlbum'])) ? $this->_run_mod_handler('escape', true, $_tmp, 'html') : smarty_modifier_escape($_tmp, 'html')); ?> -
  • - - _tpl_vars['browselist_item']['Title']): ?> - - _tpl_vars['browselist_item']['in_playlist']): ?>
  • AddPlay _tpl_vars['browselist_item']['Title'])) ? $this->_run_mod_handler('escape', true, $_tmp, 'html') : smarty_modifier_escape($_tmp, 'html'))): ?>_tpl_vars['browselist_item']['Title'])) ? $this->_run_mod_handler('escape', true, $_tmp, 'html') : smarty_modifier_escape($_tmp, 'html')); ?> -_tpl_vars['browselist_item']['Artist'] && $this->_tpl_vars['show_extra_track_info']): ?>
    _tpl_vars['browselist_item']['Artist'])) ? $this->_run_mod_handler('escape', true, $_tmp, 'html') : smarty_modifier_escape($_tmp, 'html')); ?> - _tpl_vars['browselist_item']['Album']): ?>(_tpl_vars['browselist_item']['Album'])) ? $this->_run_mod_handler('escape', true, $_tmp, 'html') : smarty_modifier_escape($_tmp, 'html')); ?> -)_tpl_vars['browselist_item']['file_name'])) ? $this->_run_mod_handler('escape', true, $_tmp, 'html') : smarty_modifier_escape($_tmp, 'html')); ?> -
  • - - _tpl_vars['browselist_item']['file']): ?> - - _tpl_vars['browselist_item']['in_playlist']): ?>
  • AddPlay _tpl_vars['browselist_item']['Title'])) ? $this->_run_mod_handler('escape', true, $_tmp, 'html') : smarty_modifier_escape($_tmp, 'html'))): ?>_tpl_vars['browselist_item']['Title'])) ? $this->_run_mod_handler('escape', true, $_tmp, 'html') : smarty_modifier_escape($_tmp, 'html')); ?> -_tpl_vars['browselist_item']['Artist'] && $this->_tpl_vars['show_extra_track_info']): ?>
    _tpl_vars['browselist_item']['Artist'])) ? $this->_run_mod_handler('escape', true, $_tmp, 'html') : smarty_modifier_escape($_tmp, 'html')); ?> - _tpl_vars['browselist_item']['Album']): ?>(_tpl_vars['browselist_item']['Album'])) ? $this->_run_mod_handler('escape', true, $_tmp, 'html') : smarty_modifier_escape($_tmp, 'html')); ?> -)_tpl_vars['browselist_item']['file_name'])) ? $this->_run_mod_handler('escape', true, $_tmp, 'html') : smarty_modifier_escape($_tmp, 'html')); ?> -
  • - - \ No newline at end of file diff --git a/smarty/templates_c/%%86^860^86006DCD%%browse.html.php b/smarty/templates_c/%%86^860^86006DCD%%browse.html.php deleted file mode 100644 index 473cf43..0000000 --- a/smarty/templates_c/%%86^860^86006DCD%%browse.html.php +++ /dev/null @@ -1,35 +0,0 @@ - - array(array('modifier', 'escape', 'default/browse.html', 6, false),)), $this); ?> - - - -
    - - \ No newline at end of file diff --git a/smarty/templates_c/%%A0^A09^A09C29AE%%playlist.html.php b/smarty/templates_c/%%A0^A09^A09C29AE%%playlist.html.php deleted file mode 100644 index 4a13fe0..0000000 --- a/smarty/templates_c/%%A0^A09^A09C29AE%%playlist.html.php +++ /dev/null @@ -1,22 +0,0 @@ - - _tpl_vars['playlist']): ?> -
    - - - -

    (Empty playlist)

    - - \ No newline at end of file diff --git a/smarty/templates_c/%%B6^B60^B607F601%%control.html.php b/smarty/templates_c/%%B6^B60^B607F601%%control.html.php deleted file mode 100644 index 370d0b0..0000000 --- a/smarty/templates_c/%%B6^B60^B607F601%%control.html.php +++ /dev/null @@ -1,65 +0,0 @@ - - array(array('modifier', 'escape', 'default/control.html', 3, false),array('modifier', 'string_format', 'default/control.html', 12, false),)), $this); ?> -
    - - - -
    - -

    - -
    --:--
    - -
     
    - -
    - -
    - -
    - -
    -
    -
      -
    • -
    • -
    • -
    • -
    -
    -
    - - -
    -
    -
    - diff --git a/smarty/templates_c/%%C1^C14^C14AEF59%%index.html.php b/smarty/templates_c/%%C1^C14^C14AEF59%%index.html.php deleted file mode 100644 index 5d4d339..0000000 --- a/smarty/templates_c/%%C1^C14^C14AEF59%%index.html.php +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - NeoMPC <?php echo $this->_tpl_vars['version']; ?> - - - - - - - - - - - - - - _tpl_vars; -$this->_smarty_include(array('smarty_include_tpl_file' => "default/menu.html", 'smarty_include_vars' => array())); -$this->_tpl_vars = $_smarty_tpl_vars; -unset($_smarty_tpl_vars); - ?> - -
    - - _tpl_vars; -$this->_smarty_include(array('smarty_include_tpl_file' => "default/".($this->_tpl_vars['page']).".html", 'smarty_include_vars' => array())); -$this->_tpl_vars = $_smarty_tpl_vars; -unset($_smarty_tpl_vars); - ?> - -
    - - _tpl_vars['refresh']; ?> - - - - - \ No newline at end of file diff --git a/templates/default/config.inc.php b/templates/default/config.inc.php index 039ac89..4eda4e7 100644 --- a/templates/default/config.inc.php +++ b/templates/default/config.inc.php @@ -5,5 +5,9 @@ $_CONFIG['album_cover_size'] = 130; $_CONFIG['progress_bar_width'] = 276; + + $_CONFIG['volume_orientation'] = 'v'; + $_CONFIG['volume_max'] = 5; + $_CONFIG['volume_min'] = 105; ?> diff --git a/templates/default/control.html b/templates/default/control.html index f3f3742..3e575b6 100644 --- a/templates/default/control.html +++ b/templates/default/control.html @@ -36,8 +36,11 @@
  • -
    - +
    + + +
    +
    diff --git a/templates/default/index.html b/templates/default/index.html index 2065135..84ffa1a 100644 --- a/templates/default/index.html +++ b/templates/default/index.html @@ -12,8 +12,6 @@ diff --git a/templates/default/styles.css b/templates/default/styles.css index a0d26cc..d4544a8 100644 --- a/templates/default/styles.css +++ b/templates/default/styles.css @@ -205,7 +205,7 @@ img.button { background-repeat: no-repeat; } #volume_repeat #volume_button { - background-image: url(templates/{:$template:}/images/shuffle.png); + background-image: url(templates/{:$template:}/images/volume.png); } #volume_repeat #repeat_button { background-image: url(templates/{:$template:}/images/repeat.png); @@ -226,10 +226,25 @@ img.button { #volume_container { position: absolute; display: none; - top: -120px; - background: rgba(255, 0, 0, 0.5); - height: 140px; + top: -140px; + background: url(templates/{:$template:}/images/volume_container.png) center center no-repeat; + height: 160px; width: 30px; +} +#volume_container a#volume_hide { + position: absolute; + top: 140px; + left: 0px; + width: 30px; + height: 20px; +} +#volume_container a#volume_slider { + background: url(templates/{:$template:}/images/volume_slider.png) center center no-repeat; + position: absolute; + top: 5px; + left: 5px; + width: 20px; + height: 30px; } #crumb_trail ul {