X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/blobdiff_plain/af106f2dee658f1605891b4c69ca1036946c5147..2b33c4cf27ec6f4bd73c16ed1395eab209dec51f:/templates/playing.tmpl
diff --git a/templates/playing.tmpl b/templates/playing.tmpl
index c910120..bc0200e 100644
--- a/templates/playing.tmpl
+++ b/templates/playing.tmpl
@@ -19,113 +19,90 @@ 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}
+ {
+ @label{playing.@class}
+
+ }
+
+ @# 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}}
+
+ @# Expand to &back=manage or to nothing
+ @define {back} {}
+ {@ifmanage{&back=manage}{}}
}@#
- @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}} +
+