X-Git-Url: https://git.distorted.org.uk/~mdw/disorder/blobdiff_plain/af106f2dee658f1605891b4c69ca1036946c5147..d3a3ef14c820bb651c34d70be745ecac159d44f1:/templates/playing.tmpl?ds=inline
diff --git a/templates/playing.tmpl b/templates/playing.tmpl
index c910120..147333c 100644
--- a/templates/playing.tmpl
+++ b/templates/playing.tmpl
@@ -19,113 +19,87 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA
-->
@discard{
- @include{macros.tmpl}
+
+ @# 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}
+ {
+
+ }
+ {
}}
+
+ @# 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} {} {}
+ }{}
}@#
- @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 disabled
- @label{playing.playing}
-
-
- }
-@# Volume form
-
+ @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}} +
+