changeset 36918:e0a0b0846c4e

Add new dynamic label variable $P. This is more convenient than using $p, $s and $e (which we leave for the sake of compatibility).
author ib
date Thu, 13 Mar 2014 16:49:14 +0000
parents 0dfa0ecb10f4
children 5c297b4d616d
files DOCS/xml/de/skin.xml DOCS/xml/en/skin.xml gui/ui/render.c gui/win32/widgetrender.c
diffstat 4 files changed, 43 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/DOCS/xml/de/skin.xml	Thu Mar 13 16:22:27 2014 +0000
+++ b/DOCS/xml/de/skin.xml	Thu Mar 13 16:49:14 2014 +0000
@@ -709,6 +709,12 @@
                     </entry>
                   </row>
                   <row>
+                    <entry>$P</entry>
+                    <entry>
+                      Buchstabe entsprechend der Wiedergabe (Keine: <keycap>s</keycap>, Wiedergabe: <keycap>p</keycap>, Pause: <keycap>e</keycap>)
+                    </entry>
+                  </row>
+                  <row>
                     <entry>$p</entry>
                     <entry>
                       Buchstabe <keycap>p</keycap> (wenn ein Film abgespielt wird)
@@ -749,7 +755,7 @@
 
       <note>
         <para>
-          Die Variablen <literal>$a, $T, $p, $s</literal> und <literal>$e</literal>
+          Die Variablen <literal>$a, $T, $P, $p, $s</literal> und <literal>$e</literal>
           geben Buchstaben zurück, die als spezielle Symbole angezeigt werden sollen
           (zum Beispiel steht <keycap>e</keycap> für das Pause-Symbol, welches gewöhnlich
           etwa so || aussieht).
--- a/DOCS/xml/en/skin.xml	Thu Mar 13 16:22:27 2014 +0000
+++ b/DOCS/xml/en/skin.xml	Thu Mar 13 16:49:14 2014 +0000
@@ -594,6 +594,10 @@
     </entry>
   </row>
   <row>
+    <entry>$P</entry>
+    <entry>a character according to the playback state (stopped: <keycap>s</keycap>, playing: <keycap>p</keycap>, paused: <keycap>e</keycap>)</entry>
+  </row>
+  <row>
     <entry>$p</entry>
     <entry>the <keycap>p</keycap> character (if a movie is playing)</entry>
   </row>
@@ -622,7 +626,7 @@
   </informaltable>
 
   <note><para>
-  The <literal>$a, $T, $p, $s</literal> and <literal>$e</literal>
+  The <literal>$a, $T, $P, $p, $s</literal> and <literal>$e</literal>
   variables all return characters that should be displayed as special symbols
   (for example, <keycap>e</keycap> is for the pause symbol that usually looks
   something like ||). You should have a font for normal characters and
--- a/gui/ui/render.c	Thu Mar 13 16:22:27 2014 +0000
+++ b/gui/ui/render.c	Thu Mar 13 16:49:14 2014 +0000
@@ -175,6 +175,22 @@
                     av_strlcat(trbuf, "e", sizeof(trbuf));
                 break;
 
+            case 'P':
+                switch (guiInfo.Playing) {
+                case GUI_STOP:
+                    av_strlcat(trbuf, "s", sizeof(trbuf));
+                    break;
+
+                case GUI_PLAY:
+                    av_strlcat(trbuf, "p", sizeof(trbuf));
+                    break;
+
+                case GUI_PAUSE:
+                    av_strlcat(trbuf, "e", sizeof(trbuf));
+                    break;
+                }
+                break;
+
             case 'a':
                 switch (guiInfo.AudioChannels) {
                 case 0:
--- a/gui/win32/widgetrender.c	Thu Mar 13 16:22:27 2014 +0000
+++ b/gui/win32/widgetrender.c	Thu Mar 13 16:49:14 2014 +0000
@@ -151,9 +151,21 @@
     stringreplace(text, "$C", "%s", guiInfo.sh_video ? codecname : "");
     stringreplace(text, "$$", "$");
 
-    if(guiInfo.Playing == GUI_STOP) stringreplace(text, "$s", "s");
-    else if(guiInfo.Playing == GUI_PLAY) stringreplace(text, "$p", "p");
-    else if(guiInfo.Playing == GUI_PAUSE) stringreplace(text, "$e", "e");
+    if(guiInfo.Playing == GUI_STOP)
+    {
+        stringreplace(text, "$P", "s");
+        stringreplace(text, "$s", "s");
+    }
+    else if(guiInfo.Playing == GUI_PLAY)
+    {
+        stringreplace(text, "$P", "p");
+        stringreplace(text, "$p", "p");
+    }
+    else if(guiInfo.Playing == GUI_PAUSE)
+    {
+        stringreplace(text, "$P", "e");
+        stringreplace(text, "$e", "e");
+    }
 
     if(guiInfo.AudioChannels == 0) stringreplace(text, "$a", "n");
     else if(guiInfo.AudioChannels == 1) stringreplace(text, "$a", "m");