[MPlayer-cvslog] r37014 - in trunk: DOCS/xml/de/skin.xml DOCS/xml/en/skin.xml gui/ui/render.c gui/win32/widgetrender.c

ib subversion at mplayerhq.hu
Thu Mar 13 17:49:14 CET 2014


Author: ib
Date: Thu Mar 13 17:49:14 2014
New Revision: 37014

Log:
Add new dynamic label variable $P.

This is more convenient than using $p, $s and $e
(which we leave for the sake of compatibility).

Modified:
   trunk/gui/ui/render.c
   trunk/gui/win32/widgetrender.c

Changes in other areas also in this revision:
Modified:
   trunk/DOCS/xml/de/skin.xml
   trunk/DOCS/xml/en/skin.xml

Modified: trunk/gui/ui/render.c
==============================================================================
--- trunk/gui/ui/render.c	Thu Mar 13 17:22:27 2014	(r37013)
+++ trunk/gui/ui/render.c	Thu Mar 13 17:49:14 2014	(r37014)
@@ -175,6 +175,22 @@ calclengthmmmmss:
                     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:

Modified: trunk/gui/win32/widgetrender.c
==============================================================================
--- trunk/gui/win32/widgetrender.c	Thu Mar 13 17:22:27 2014	(r37013)
+++ trunk/gui/win32/widgetrender.c	Thu Mar 13 17:49:14 2014	(r37014)
@@ -151,9 +151,21 @@ static char *generatetextfromlabel(widge
     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");


More information about the MPlayer-cvslog mailing list