X-Git-Url: https://git.distorted.org.uk/~mdw/disorder/blobdiff_plain/2257512d31e410938ae2f7f7f511830989c58f7f..8b15f02d9c4041d45a310dce13f67b5a8bf11ca8:/templates/playing.tmpl
diff --git a/templates/playing.tmpl b/templates/playing.tmpl
index 084f5c3..07cbd6a 100644
--- a/templates/playing.tmpl
+++ b/templates/playing.tmpl
@@ -19,115 +19,88 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA
-->
@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}
+ {
+ @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}}
+ {@if {@eq {@arg{action}}{manage}}
+ {@yes}
+ {@no}}
+
+ @# Expand to &back=manage or to nothing
@define {back} {}
- {@ifmanage{&back=manage}{}}
- @include{macros.tmpl}
+ {@ifmanage{&back=manage}{}}
}@#
-@include{stdhead.tmpl}@#
+@quiethead
@if{@isplaying}
{@playing{@part{@id}{title}}}
{@label{playing.title}}
-@include{topbar.tmpl}
+@stdmenu{@ifmanage{manage}{playing}}
@label{playing.title}
@# Extra control buttons for the management page
@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 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}}
+
+
}{}
@@ -143,150 +116,60 @@ USA
@label{heading.length} |
|
@ifmanage{
- |
- |
- |
- |
+ |
+ |
+ |
+ |
}{}
+ @if{@isplaying}{
+
+ @label{playing.now} |
+
+ }
@playing{
-
- @label{playing.now} |
-
-
- @when{@id} |
- @if{@eq{@who{@id}}{}}
- {@if{@eq{@state{@id}}{random}}
- {@label{playing.randomtrack}}
- { }}
- {@who{@id}}
- |
- @right{play}
- {@part{@id}{short}{artist}}
- {@part{short}{artist}}
- |
- @right{play}
- {@part{short}{album}}
- {@part{short}{album}}
- |
- @part{@id}{short}{title} |
- @length{@id} |
- @if{@removabl{@id}}
- {
- }
- {}
- |
- @ifmanage{
- |
- |
- |
- |
- }{}
-
+
+ @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} |
-
+ @if{@isqueue}{
+
+ @label{playing.next} |
+
}
@queue{
-
- @when |
- @if{@eq{@who@}{}@}{@if{@eq{@state@}{random}@}{@label{queue.randomtrack}}{ }@}{@who@} |
- @right{play}{@part{@id}{short}{artist}}{@part{@id}{short}{artist}} |
- @right{play}{@part{@id}{short}{album}}{@part{@id}{short}{album}@} |
- @part{@id}{short}{title} |
- @length |
- @if{@removable@}{}{} |
-
- @if{@eq{@arg{action}}{manage}}{
- @if{@or{@isfirst@}
- {@not{@movable@}@}@}{
-
-
-
- |
-
- }{
-
- |
-
- |
-
- }
-
- @if{@or{@islast@}
- {@not{@movable@}@}@}{
-
- |
-
- |
-
- }{
-
- |
-
- |
-
- }
- }
- |
- }
+
+ @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
@discard{
@@ -295,5 +178,6 @@ mode:sgml
sgml-always-quote-attributes:nil
sgml-indent-step:1
sgml-indent-data:t
+indent-tabs-mode:nil
End:
-}@
+}@#