[MPlayer-cvslog] r34165 - in trunk/gui: interface.c ui/actions.c ui/gtk/menu.c ui/main.c ui/render.c

ib subversion at mplayerhq.hu
Fri Sep 30 17:28:01 CEST 2011


Author: ib
Date: Fri Sep 30 17:28:01 2011
New Revision: 34165

Log:
Cosmetic: Order STREAMTYPE related code.

Always choose order FILE, STREAM, VCD, DVD for reasons of clarity.

Modified:
   trunk/gui/interface.c
   trunk/gui/ui/actions.c
   trunk/gui/ui/gtk/menu.c
   trunk/gui/ui/main.c
   trunk/gui/ui/render.c

Modified: trunk/gui/interface.c
==============================================================================
--- trunk/gui/interface.c	Fri Sep 30 17:13:01 2011	(r34164)
+++ trunk/gui/interface.c	Fri Sep 30 17:28:01 2011	(r34165)
@@ -603,6 +603,13 @@ int gui(int what, void *data)
         guiInfo.StreamType = stream->type;
 
         switch (guiInfo.StreamType) {
+#ifdef CONFIG_VCD
+        case STREAMTYPE_VCD:
+            guiInfo.Tracks = 0;
+            stream_control(stream, STREAM_CTRL_GET_NUM_CHAPTERS, &guiInfo.Tracks);
+            break;
+#endif
+
 #ifdef CONFIG_DVDREAD
         case STREAMTYPE_DVD:
             dvd = stream->priv;
@@ -619,13 +626,6 @@ int gui(int what, void *data)
             break;
 #endif
 
-#ifdef CONFIG_VCD
-        case STREAMTYPE_VCD:
-            guiInfo.Tracks = 0;
-            stream_control(stream, STREAM_CTRL_GET_NUM_CHAPTERS, &guiInfo.Tracks);
-            break;
-#endif
-
         default:
             break;
         }

Modified: trunk/gui/ui/actions.c
==============================================================================
--- trunk/gui/ui/actions.c	Fri Sep 30 17:13:01 2011	(r34164)
+++ trunk/gui/ui/actions.c	Fri Sep 30 17:28:01 2011	(r34165)
@@ -242,13 +242,13 @@ void uiCurr(void)
         return;
 
     switch (guiInfo.StreamType) {
-#ifdef CONFIG_DVDREAD
-    case STREAMTYPE_DVD:
+#ifdef CONFIG_VCD
+    case STREAMTYPE_VCD:
         break;
 #endif
 
-#ifdef CONFIG_VCD
-    case STREAMTYPE_VCD:
+#ifdef CONFIG_DVDREAD
+    case STREAMTYPE_DVD:
         break;
 #endif
 
@@ -281,6 +281,15 @@ void uiPrev(void)
         return;
 
     switch (guiInfo.StreamType) {
+#ifdef CONFIG_VCD
+    case STREAMTYPE_VCD:
+        if (--guiInfo.Track == 1) {
+            guiInfo.Track = 2;
+            stop = 1;
+        }
+        break;
+#endif
+
 #ifdef CONFIG_DVDREAD
     case STREAMTYPE_DVD:
 
@@ -296,15 +305,6 @@ void uiPrev(void)
         break;
 #endif
 
-#ifdef CONFIG_VCD
-    case STREAMTYPE_VCD:
-        if (--guiInfo.Track == 1) {
-            guiInfo.Track = 2;
-            stop = 1;
-        }
-        break;
-#endif
-
     default:
 
         prev = listSet(gtkGetPrevPlItem, NULL);
@@ -335,6 +335,17 @@ void uiNext(void)
         return;
 
     switch (guiInfo.StreamType) {
+#ifdef CONFIG_VCD
+    case STREAMTYPE_VCD:
+
+        if (++guiInfo.Track >= guiInfo.Tracks) {
+            stop = (guiInfo.Track > guiInfo.Tracks);
+            guiInfo.Track = FFMAX(2, guiInfo.Tracks);
+        }
+
+        break;
+#endif
+
 #ifdef CONFIG_DVDREAD
     case STREAMTYPE_DVD:
 
@@ -350,17 +361,6 @@ void uiNext(void)
         break;
 #endif
 
-#ifdef CONFIG_VCD
-    case STREAMTYPE_VCD:
-
-        if (++guiInfo.Track >= guiInfo.Tracks) {
-            stop = (guiInfo.Track > guiInfo.Tracks);
-            guiInfo.Track = FFMAX(2, guiInfo.Tracks);
-        }
-
-        break;
-#endif
-
     default:
 
         next = listSet(gtkGetNextPlItem, NULL);

Modified: trunk/gui/ui/gtk/menu.c
==============================================================================
--- trunk/gui/ui/gtk/menu.c	Fri Sep 30 17:13:01 2011	(r34164)
+++ trunk/gui/ui/gtk/menu.c	Fri Sep 30 17:28:01 2011	(r34165)
@@ -66,6 +66,10 @@
 #include "gui/ui/pixmaps/empty.xpm"
 #include "gui/ui/pixmaps/loadeaf.xpm"
 #include "gui/ui/pixmaps/title.xpm"
+#ifdef CONFIG_VCD
+#include "gui/ui/pixmaps/vcd.xpm"
+#include "gui/ui/pixmaps/playvcd.xpm"
+#endif
 #ifdef CONFIG_DVDREAD
 #include "gui/ui/pixmaps/dvd.xpm"
 #include "gui/ui/pixmaps/playdvd.xpm"
@@ -75,10 +79,6 @@
 #include "gui/ui/pixmaps/sublang.xpm"
 #include "gui/ui/pixmaps/empty1px.xpm"
 #endif
-#ifdef CONFIG_VCD
-#include "gui/ui/pixmaps/vcd.xpm"
-#include "gui/ui/pixmaps/playvcd.xpm"
-#endif
 
 static void ActivateMenuItem( int Item )
 {

Modified: trunk/gui/ui/main.c
==============================================================================
--- trunk/gui/ui/main.c	Fri Sep 30 17:13:01 2011	(r34164)
+++ trunk/gui/ui/main.c	Fri Sep 30 17:28:01 2011	(r34165)
@@ -56,9 +56,9 @@
 #include "mpcommon.h"
 
 #define CLEAR_FILE 1
-#define CLEAR_DVD  2
-#define CLEAR_VCD  4
-#define CLEAR_ALL  (CLEAR_FILE + CLEAR_DVD + CLEAR_VCD)
+#define CLEAR_VCD  2
+#define CLEAR_DVD  4
+#define CLEAR_ALL  (CLEAR_FILE + CLEAR_VCD + CLEAR_DVD)
 
 #define GUI_REDRAW_WAIT 375
 
@@ -113,6 +113,10 @@ static void guiInfoMediumClear (int what
     listSet(gtkDelPl, NULL);
   }
 
+#ifdef CONFIG_VCD
+  if (what & CLEAR_VCD) guiInfo.Tracks = 0;
+#endif
+
 #ifdef CONFIG_DVDREAD
   if (what & CLEAR_DVD)
   {
@@ -123,10 +127,6 @@ static void guiInfoMediumClear (int what
     guiInfo.Angles = 0;
   }
 #endif
-
-#ifdef CONFIG_VCD
-  if (what & CLEAR_VCD) guiInfo.Tracks = 0;
-#endif
 }
 
 static unsigned last_redraw_time = 0;
@@ -194,8 +194,8 @@ play:
 
         switch ( guiInfo.StreamType )
          {
-	  case STREAMTYPE_STREAM:
 	  case STREAMTYPE_FILE:
+	  case STREAMTYPE_STREAM:
 	       guiInfoMediumClear( CLEAR_ALL - CLEAR_FILE );
 	       if ( !guiInfo.Track )
 	         guiInfo.Track=1;
@@ -386,7 +386,7 @@ set_volume:
 	 }
 	wsClearWindow( guiApp.subWindow );
 #ifdef CONFIG_DVDREAD
-	if ( guiInfo.StreamType == STREAMTYPE_DVD || guiInfo.StreamType == STREAMTYPE_VCD ) goto play_dvd_2;
+	if ( guiInfo.StreamType == STREAMTYPE_VCD || guiInfo.StreamType == STREAMTYPE_DVD ) goto play_dvd_2;
 	 else
 #endif
 	 guiInfo.NewPlay=GUI_FILE_NEW;

Modified: trunk/gui/ui/render.c
==============================================================================
--- trunk/gui/ui/render.c	Fri Sep 30 17:13:01 2011	(r34164)
+++ trunk/gui/ui/render.c	Fri Sep 30 17:28:01 2011	(r34165)
@@ -47,10 +47,6 @@ static void TranslateFilename(int c, cha
     size_t len;
 
     switch (guiInfo.StreamType) {
-    case STREAMTYPE_STREAM:
-        av_strlcpy(tmp, guiInfo.Filename, tmplen);
-        break;
-
     case STREAMTYPE_FILE:
         if (guiInfo.Filename && guiInfo.Filename[0]) {
             p = strrchr(guiInfo.Filename, '/');
@@ -72,6 +68,16 @@ static void TranslateFilename(int c, cha
             av_strlcpy(tmp, MSGTR_NoFileLoaded, tmplen);
         break;
 
+    case STREAMTYPE_STREAM:
+        av_strlcpy(tmp, guiInfo.Filename, tmplen);
+        break;
+
+#ifdef CONFIG_VCD
+    case STREAMTYPE_VCD:
+        snprintf(tmp, tmplen, MSGTR_Title, guiInfo.Track - 1);
+        break;
+#endif
+
 #ifdef CONFIG_DVDREAD
     case STREAMTYPE_DVD:
         if (guiInfo.Chapter)
@@ -81,12 +87,6 @@ static void TranslateFilename(int c, cha
         break;
 #endif
 
-#ifdef CONFIG_VCD
-    case STREAMTYPE_VCD:
-        snprintf(tmp, tmplen, MSGTR_Title, guiInfo.Track - 1);
-        break;
-#endif
-
     default:
         av_strlcpy(tmp, MSGTR_NoMediaOpened, tmplen);
         break;
@@ -271,16 +271,16 @@ calclengthmmmmss:
                     av_strlcat(trbuf, "f", sizeof(trbuf));
                     break;
 
+                case STREAMTYPE_STREAM:
+                    av_strlcat(trbuf, "u", sizeof(trbuf));
+                    break;
+
 #ifdef CONFIG_VCD
                 case STREAMTYPE_VCD:
                     av_strlcat(trbuf, "v", sizeof(trbuf));
                     break;
 #endif
 
-                case STREAMTYPE_STREAM:
-                    av_strlcat(trbuf, "u", sizeof(trbuf));
-                    break;
-
 #ifdef CONFIG_DVDREAD
                 case STREAMTYPE_DVD:
                     av_strlcat(trbuf, "d", sizeof(trbuf));


More information about the MPlayer-cvslog mailing list