[MPlayer-cvslog] r37073 - trunk/gui/ui/render.c

ib subversion at mplayerhq.hu
Wed Mar 26 17:42:15 CET 2014


Author: ib
Date: Wed Mar 26 17:42:15 2014
New Revision: 37073

Log:
Arrange variables to be translated alphabetically.

Modified:
   trunk/gui/ui/render.c

Modified: trunk/gui/ui/render.c
==============================================================================
--- trunk/gui/ui/render.c	Wed Mar 26 17:21:52 2014	(r37072)
+++ trunk/gui/ui/render.c	Wed Mar 26 17:42:15 2014	(r37073)
@@ -52,30 +52,6 @@ static char *TranslateVariables(const ch
             }
         } else {
             switch (text[++i]) {
-            case 't':
-                snprintf(trans, sizeof(trans), "%02d", guiInfo.Track);
-                av_strlcat(translation, trans, sizeof(translation));
-                break;
-
-            case 'o':
-                TranslateFilename(0, trans, sizeof(trans));
-                av_strlcat(translation, trans, sizeof(translation));
-                break;
-
-            case 'f':
-                TranslateFilename(1, trans, sizeof(trans));
-                av_strlcat(translation, trans, sizeof(translation));
-                break;
-
-            case 'F':
-                TranslateFilename(2, trans, sizeof(trans));
-                av_strlcat(translation, trans, sizeof(translation));
-                break;
-
-            case '6':
-                t = guiInfo.RunningTime;
-                goto calclengthhhmmss;
-
             case '1':
                 t = guiInfo.ElapsedTime;
 calclengthhhmmss:
@@ -83,10 +59,6 @@ calclengthhhmmss:
                 av_strlcat(translation, trans, sizeof(translation));
                 break;
 
-            case '7':
-                t = guiInfo.RunningTime;
-                goto calclengthmmmmss;
-
             case '2':
                 t = guiInfo.ElapsedTime;
 calclengthmmmmss:
@@ -109,24 +81,37 @@ calclengthmmmmss:
                 av_strlcat(translation, trans, sizeof(translation));
                 break;
 
+            case '6':
+                t = guiInfo.RunningTime;
+                goto calclengthhhmmss;
+
+            case '7':
+                t = guiInfo.RunningTime;
+                goto calclengthmmmmss;
+
             case '8':
                 snprintf(trans, sizeof(trans), "%01d:%02d:%02d", guiInfo.ElapsedTime / 3600, (guiInfo.ElapsedTime / 60) % 60, guiInfo.ElapsedTime % 60);
                 av_strlcat(translation, trans, sizeof(translation));
                 break;
 
-            case 'v':
-                snprintf(trans, sizeof(trans), "%3.2f%%", guiInfo.Volume);
-                av_strlcat(translation, trans, sizeof(translation));
-                break;
+            case 'a':
+                switch (guiInfo.AudioChannels) {
+                case 0:
+                    av_strlcat(translation, "n", sizeof(translation));
+                    break;
 
-            case 'V':
-                snprintf(trans, sizeof(trans), "%3.1f", guiInfo.Volume);
-                av_strlcat(translation, trans, sizeof(translation));
-                break;
+                case 1:
+                    av_strlcat(translation, "m", sizeof(translation));
+                    break;
 
-            case 'U':
-                snprintf(trans, sizeof(trans), "%3.0f", guiInfo.Volume);
-                av_strlcat(translation, trans, sizeof(translation));
+                case 2:
+                    av_strlcat(translation, (guiInfo.AudioPassthrough ? "r" : "t"), sizeof(translation));
+                    break;
+
+                default:
+                    av_strlcat(translation, "r", sizeof(translation));
+                    break;
+                }
                 break;
 
             case 'b':
@@ -139,29 +124,34 @@ calclengthmmmmss:
                 av_strlcat(translation, trans, sizeof(translation));
                 break;
 
+            case 'C':
+                snprintf(trans, sizeof(trans), "%s", guiInfo.CodecName ? guiInfo.CodecName : "");
+                av_strlcat(translation, trans, sizeof(translation));
+                break;
+
             case 'D':
                 snprintf(trans, sizeof(trans), "%3.0f", guiInfo.Balance);
                 av_strlcat(translation, trans, sizeof(translation));
                 break;
 
-            case 'x':
-                snprintf(trans, sizeof(trans), "%d", guiInfo.VideoWidth);
-                av_strlcat(translation, trans, sizeof(translation));
+            case 'e':
+                if (guiInfo.Playing == GUI_PAUSE)
+                    av_strlcat(translation, "e", sizeof(translation));
                 break;
 
-            case 'y':
-                snprintf(trans, sizeof(trans), "%d", guiInfo.VideoHeight);
+            case 'f':
+                TranslateFilename(1, trans, sizeof(trans));
                 av_strlcat(translation, trans, sizeof(translation));
                 break;
 
-            case 'C':
-                snprintf(trans, sizeof(trans), "%s", guiInfo.CodecName ? guiInfo.CodecName : "");
+            case 'F':
+                TranslateFilename(2, trans, sizeof(trans));
                 av_strlcat(translation, trans, sizeof(translation));
                 break;
 
-            case 's':
-                if (guiInfo.Playing == GUI_STOP)
-                    av_strlcat(translation, "s", sizeof(translation));
+            case 'o':
+                TranslateFilename(0, trans, sizeof(trans));
+                av_strlcat(translation, trans, sizeof(translation));
                 break;
 
             case 'l': // legacy
@@ -170,11 +160,6 @@ calclengthmmmmss:
                     av_strlcat(translation, "p", sizeof(translation));
                 break;
 
-            case 'e':
-                if (guiInfo.Playing == GUI_PAUSE)
-                    av_strlcat(translation, "e", sizeof(translation));
-                break;
-
             case 'P':
                 switch (guiInfo.Playing) {
                 case GUI_STOP:
@@ -191,24 +176,14 @@ calclengthmmmmss:
                 }
                 break;
 
-            case 'a':
-                switch (guiInfo.AudioChannels) {
-                case 0:
-                    av_strlcat(translation, "n", sizeof(translation));
-                    break;
-
-                case 1:
-                    av_strlcat(translation, "m", sizeof(translation));
-                    break;
-
-                case 2:
-                    av_strlcat(translation, (guiInfo.AudioPassthrough ? "r" : "t"), sizeof(translation));
-                    break;
+            case 's':
+                if (guiInfo.Playing == GUI_STOP)
+                    av_strlcat(translation, "s", sizeof(translation));
+                break;
 
-                default:
-                    av_strlcat(translation, "r", sizeof(translation));
-                    break;
-                }
+            case 't':
+                snprintf(trans, sizeof(trans), "%02d", guiInfo.Track);
+                av_strlcat(translation, trans, sizeof(translation));
                 break;
 
             case 'T':
@@ -244,6 +219,31 @@ calclengthmmmmss:
                 }
                 break;
 
+            case 'U':
+                snprintf(trans, sizeof(trans), "%3.0f", guiInfo.Volume);
+                av_strlcat(translation, trans, sizeof(translation));
+                break;
+
+            case 'v':
+                snprintf(trans, sizeof(trans), "%3.2f%%", guiInfo.Volume);
+                av_strlcat(translation, trans, sizeof(translation));
+                break;
+
+            case 'V':
+                snprintf(trans, sizeof(trans), "%3.1f", guiInfo.Volume);
+                av_strlcat(translation, trans, sizeof(translation));
+                break;
+
+            case 'x':
+                snprintf(trans, sizeof(trans), "%d", guiInfo.VideoWidth);
+                av_strlcat(translation, trans, sizeof(translation));
+                break;
+
+            case 'y':
+                snprintf(trans, sizeof(trans), "%d", guiInfo.VideoHeight);
+                av_strlcat(translation, trans, sizeof(translation));
+                break;
+
             case '$':
                 av_strlcat(translation, "$", sizeof(translation));
                 break;


More information about the MPlayer-cvslog mailing list