From 04024c2cafab56ea76a9a2b35097584d6db98c06 Mon Sep 17 00:00:00 2001 Message-Id: <04024c2cafab56ea76a9a2b35097584d6db98c06.1714487402.git.mdw@distorted.org.uk> From: Mark Wooding Date: Sat, 10 May 2008 13:22:27 +0100 Subject: [PATCH] Fiddle with playing.tmpl a bit. not fully translated Organization: Straylight/Edgeware From: Richard Kettlewell --- server/actions.c | 4 + server/macros-disorder.c | 2 +- templates/playing.tmpl | 268 +++++++++++++++++++++------------------ 3 files changed, 149 insertions(+), 125 deletions(-) diff --git a/server/actions.c b/server/actions.c index 2bdb8c4..2332754 100644 --- a/server/actions.c +++ b/server/actions.c @@ -135,6 +135,7 @@ static const struct action { /** @brief Action handler */ void (*handler)(void); } actions[] = { +#if 0 { "confirm", act_confirm }, { "disable", act_disable }, { "edituser", act_edituser }, @@ -145,7 +146,9 @@ static const struct action { { "move", act_move }, { "pause", act_pause }, { "play", act_play }, +#endif { "playing", act_playing }, +#if 0 { "prefs", act_prefs }, { "random-disable", act_random_disable }, { "random-enable", act_random_enable }, @@ -155,6 +158,7 @@ static const struct action { { "resume", act_resume }, { "scratch", act_scratch }, { "volume", act_volume }, +#endif }; /** @brief Expand a template diff --git a/server/macros-disorder.c b/server/macros-disorder.c index 7105be1..cc79657 100644 --- a/server/macros-disorder.c +++ b/server/macros-disorder.c @@ -590,7 +590,7 @@ static int exp_enabled(int attribute((unused)) nargs, return mx_bool_result(output, enabled); } -/* @trackstate{TRACK +/* @trackstate{TRACK} * * Expands to "playing" if TRACK is currently playing, or "queue" if it is in * the queue, otherwise to nothing. diff --git a/templates/playing.tmpl b/templates/playing.tmpl index b45d975..c016858 100644 --- a/templates/playing.tmpl +++ b/templates/playing.tmpl @@ -1,3 +1,4 @@ +@include{macros.tmpl}@# -@include:stdhead@ - @if{@isplaying@}{@playing{@part:title@}@}{@label:playing.title@}@ +@include{stdhead.tmpl} + @if{@isplaying} + {@part{@playing}{title}@label{playing.title}} -@include{topbar}@ -

@label:playing.title@

+@include{topbar.tmpl} +

@label{playing.title}

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

- @if{@paused@}{ - - @label:playing.pause@ - - + @if{@paused}{ +@# Paused + @label{playing.pause} + + }{ - - @label:playing.pause@ - - - }@ - @if{@random-enabled@}{ - - @label:playing.random@ - - +@# Not paused + @label{playing.pause} + + + } + @if{@random-enabled}{ +@# Random play enabled + @label{playing.random} + + }{ - - @label:playing.random@ - - - }@ - @if{@enabled@}{ - - @label:playing.playing@ - - +@# Random play disabled + @label{playing.random} + + + } + @if{@enabled}{ +@# Play enabled + @label{playing.playing} + + }{ - - @label:playing.playing@ - - - }@ -

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

- }@ + } -@#{only display the table if there is something to put in it}@ -@if{@or{@isplaying@}{@isqueue@}@}{ +@# Only display the table if there is something to put in it +@if{@or{@isplaying}{@isqueue}}{ - - - - - - + + + + + + - @if{@arg:mgmt@}{ + @if{@arg{mgmt}}{ }@ - @if{@isplaying@}{ + @if{@isplaying}{ - + @playing{ - + @@ -144,14 +164,14 @@ USA title="@part{title}@">@part{short}{title}@ - @if{@arg:mgmt@}{ + href="@url?action=scratch&id=@id@&mgmt=@arg{mgmt}">@label{playing.scratch}}{@label{playing.scratch}}@ + @if{@arg{mgmt}}{ @@ -161,21 +181,21 @@ USA }@}@ @if{@isqueue@}{ - + @queue{ - + @@ -183,39 +203,39 @@ USA title="@part{title}@">@part{short}{title}@ + href="@url?action=remove&id=@id@&mgmt=@arg{mgmt}">@label{playing.remove}}{@label{playing.remove}}@ - @if{@arg:mgmt@}{ + @if{@arg{mgmt}}{ @if{@or{@isfirst@} {@not{@movable@}@}@}{
@label:heading.when@@label:heading.who@@label:heading.artist@@label:heading.album@@label:heading.title@@label:heading.length@@label{heading.when}@label{heading.who}@label{heading.artist}@label{heading.album}@label{heading.title}@label{heading.length}         
@label:playing.now@@label{playing.now}
@when@@if{@eq{@who@}{}@}{@if{@eq{@state@}{random}@}{@label:playing.randomtrack@}{ }@}{@who@}@@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}@}@ @length@ @if{@scratchable@}{@label:playing.scratch@}{@label:playing.scratch@}@     
@label:playing.next@@label{playing.next}
@when@@if{@eq{@who@}{}@}{@if{@eq{@state@}{random}@}{@label:queue.randomtrack@}{ }@}{@who@}@@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}@}@ @length@ @if{@removable@}{@label:playing.remove@}{@label:playing.remove@}@ + class=button src="@image{noupall}" + title="@label{playing.upallverbose}" alt=""> + class=button src="@image{noup}" + title="@label{playing.upverbose}" alt=""> }{ @label:playing.upall@ + href="@url?action=move&id=@id@&delta=2147483647&mgmt=true">@label{playing.upall} @label:playing.up@ + href="@url?action=move&id=@id@&delta=1&mgmt=true">@label{playing.up} }@ @if{@or{@islast@} @@ -223,25 +243,25 @@ USA + class=button src="@image{nodownall}" + title="@label{playing.downallverbose}" alt=""> + class=button src="@image{nodown}" + title="@label{playing.downverbose}" alt=""> }{ @label:playing.downall@ + href="@url?action=move&id=@id@&delta=-2147483647&mgmt=true">@label{playing.downall} @label:playing.down@ + href="@url?action=move&id=@id@&delta=-1&mgmt=true">@label{playing.down} }@ }@ -- [mdw]