X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/blobdiff_plain/04024c2cafab56ea76a9a2b35097584d6db98c06..8042af4ab3d704dcc3077815e005f0448755eb3d:/templates/playing.tmpl diff --git a/templates/playing.tmpl b/templates/playing.tmpl index c016858..147333c 100644 --- a/templates/playing.tmpl +++ b/templates/playing.tmpl @@ -1,4 +1,3 @@ -@include{macros.tmpl}@# +@discard{ + + @# On/off button for pause etc + @# @class should be the class: pause, random, playing + @# @action should be the action to switch to the opposite state + @# @state should be the current state + @define {onoff} {class action state} + {@actbutton{@label{playing.@class}} + {@label{playing.@q{@action}verbose}} + {@action} + } + + @# Volume up/down buttons + @# @dir is the direction: up or down + @# @sign is the sign: + or - + @define {vbutton}{dir sign} + {@right{volume} + { + @label{volume.@dir} + } + {}} + + @# Expand to @yes for the Manage page and @no for the playing page + @define {ifmanage} {yes no} + {@if {@eq {@arg{action}}{manage}} + {@yes} + {@no}} + + @ifmanage{ + @define {back} {} {&back=manage} + @define {formback} {} {} + }{} +}@# -@include{stdhead.tmpl} +@quiethead @if{@isplaying} - {@part{@playing}{title}@label{playing.title}} + {@playing{@part{@id}{title}}} + {@label{playing.title}} -@include{topbar.tmpl} +@stdmenu{@ifmanage{manage}{playing}}

@label{playing.title}

@# Extra control buttons for the management page - @if{@arg{mgmt}}{ + @ifmanage{
-

- @if{@paused}{ -@# Paused - @label{playing.pause} - - - }{ -@# Not paused - @label{playing.pause} - - - } - @if{@random-enabled}{ -@# Random play enabled - @label{playing.random} - - - }{ -@# Random play disabled - @label{playing.random} - - - } - @if{@enabled}{ -@# Play enabled - @label{playing.playing} - - - }{ -@# Play disbaled - @label{playing.playing} - - - } -@3 Volume form -

- - @label{playing.volume} -@# Volume up button - @right{volume}{ - - @label{volume.reduce} - - }{ - - } -@# Volume value widgets - @label{volume.left} - @label{volume.right} - -@# Volume set button - @right{volume}{ - - } -@# Volume down button - @right{volume}{ - - @label{volume.increase} - - }{ - - } - -
-

+

+ @if{@paused} + {@onoff{pause}{resume}{enabled}} + {@onoff{pause}{pause}{disabled}} + @if{@random-enabled} + {@onoff{random}{randomdisable}{enabled}} + {@onoff{random}{randomenable}{disabled}} + @if{@enabled} + {@onoff{playing}{disable}{enabled}} + {@onoff{playing}{enable}{disabled}} +

+ + @label{playing.volume} + @vbutton{up}{+} + @label{volume.left} + + @label{volume.right} + + + @right{volume}{ + @submit{@label{volume.set}} + + } + @vbutton{down}{-} + +
+

- } + }{} @# Only display the table if there is something to put in it @if{@or{@isplaying}{@isqueue}}{ @@ -133,152 +114,69 @@ USA @label{heading.title} @label{heading.length}   - @if{@arg{mgmt}}{ -   -   -   -   - }@ + @ifmanage{ +   +   +   +   + }{} @if{@isplaying}{ - - @label{playing.now} - + + @label{playing.now} + + } @playing{ - - @when@ - @if{@eq{@who@}{}@}{@if{@eq{@state@}{random}@}{@label{playing.randomtrack}}{ }@}{@who@}@ - @right{play}{@part{short}{artist}@}{@part{short}{artist}@}@ - @right{play}{@part{short}{album}@}{@part{short}{album}@}@ - @part{short}{title}@ - @length@ - @if{@scratchable@}{@label{playing.scratch}}{@label{playing.scratch}}@ - @if{@arg{mgmt}}{ -   -   -   -   - }@ - - }@}@ - @if{@isqueue@}{ - - @label{playing.next} - + + @mwhen{playing}{@id} + @mwho{playing}{@id} + @martist{playing}{@track} + @malbum{playing}{@track} + @mtitle{playing}{@track} + @length{@id} + @mremove{playing}{@id} + @ifmanage{ +   +   +   +   + }{} + + } + @if{@isqueue}{ + + @label{playing.next} + + } @queue{ - - @when@ - @if{@eq{@who@}{}@}{@if{@eq{@state@}{random}@}{@label{queue.randomtrack}}{ }@}{@who@}@ - @right{play}{@part{short}{artist}@}{@part{short}{artist}@}@ - @right{play}{@part{short}{album}@}{@part{short}{album}@}@ - @part{short}{title}@ - @length@ - @if{@removable@}{@label{playing.remove}}{@label{playing.remove}}@ - - @if{@arg{mgmt}}{ - @if{@or{@isfirst@} - {@not{@movable@}@}@}{ - - - - - - }{ - - - @label{playing.upall} - - @label{playing.up} - }@ - - @if{@or{@islast@} - {@not{@movable@}@}@}{ - - - - - - }{ - - - @label{playing.downall} - - @label{playing.down} - }@ - - }@ - - }@}@ + + @mwhen{queue}{@id} + @mwho{queue}{@id} + @martist{queue}{@track} + @malbum{queue}{@track} + @mtitle{queue}{@track} + @length{@id} + @mremove{queue}{@id} + @ifmanage{ + @mmove{@id}{upall}{2147483647} + @mmove{@id}{up}{1} + @mmove{@id}{down}{-1} + @mmove{@id}{downall}{-2147483647} + }{} + + } -}@ +} -@include{topbarend}@ +@credits -@@ - +}@#