changeset 33614:79743a5cf4f0

Rename the symbolic playback state constants. They should not be confused with the guiGetEvent types. Upper case charcaters shall reflect that they are (integer) constants. Additionally, adjust their casts.
author ib
date Wed, 22 Jun 2011 12:12:50 +0000
parents 5660f163ea79
children 1f9a31d4f114
files gui/interface.c gui/interface.h gui/ui/actions.c gui/ui/gtk/fileselect.c gui/ui/main.c gui/win32/dialogs.c gui/win32/interface.c gui/win32/preferences.c mplayer.c
diffstat 9 files changed, 25 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/gui/interface.c	Wed Jun 22 12:09:01 2011 +0000
+++ b/gui/interface.c	Wed Jun 22 12:12:50 2011 +0000
@@ -575,17 +575,17 @@
     case guiSetState:
 
         switch ((int)arg) {
-        case guiSetPlay:
+        case GUI_PLAY:
             guiInfo.Playing = 1;
 // if ( !gtkShowVideoWindow ) wsVisibleWindow( &guiApp.subWindow,wsHideWindow );
             break;
 
-        case guiSetStop:
+        case GUI_STOP:
             guiInfo.Playing = 0;
 // if ( !gtkShowVideoWindow ) wsVisibleWindow( &guiApp.subWindow,wsHideWindow );
             break;
 
-        case guiSetPause:
+        case GUI_PAUSE:
             guiInfo.Playing = 2;
             break;
         }
--- a/gui/interface.h	Wed Jun 22 12:09:01 2011 +0000
+++ b/gui/interface.h	Wed Jun 22 12:12:50 2011 +0000
@@ -55,9 +55,9 @@
 #define guiSetAfilter      17
 #define guiSetContext      18
 
-#define guiSetStop  0
-#define guiSetPlay  1
-#define guiSetPause 2
+#define GUI_STOP  0
+#define GUI_PLAY  1
+#define GUI_PAUSE 2
 
 #define guiDVD       1
 #define guiVCD       2
--- a/gui/ui/actions.c	Wed Jun 22 12:09:01 2011 +0000
+++ b/gui/ui/actions.c	Wed Jun 22 12:12:50 2011 +0000
@@ -128,7 +128,7 @@
         } else
             wsVisibleWindow(&guiApp.subWindow, wsHideWindow);
 
-        guiGetEvent(guiSetState, (void *)guiSetStop);
+        guiGetEvent(guiSetState, (void *)GUI_STOP);
         uiSubRender = 1;
         wsSetBackgroundRGB(&guiApp.subWindow, guiApp.sub.R, guiApp.sub.G, guiApp.sub.B);
         wsClearWindow(guiApp.subWindow);
@@ -148,7 +148,7 @@
         return;
     }
 
-    guiGetEvent(guiSetState, (void *)guiSetPlay);
+    guiGetEvent(guiSetState, (void *)GUI_PLAY);
     uiSubRender = 0;
     wsSetBackgroundRGB(&guiApp.subWindow, 0, 0, 0);
     wsClearWindow(guiApp.subWindow);
--- a/gui/ui/gtk/fileselect.c	Wed Jun 22 12:09:01 2011 +0000
+++ b/gui/ui/gtk/fileselect.c	Wed Jun 22 12:12:50 2011 +0000
@@ -510,7 +510,7 @@
   }
  if ( i ) fsTopList_items=g_list_prepend( fsTopList_items,(gchar *)get_current_dir_name_utf8() );
  if ( uiMainAutoPlay ) { uiMainAutoPlay=0; uiEventHandling( evPlay,0 ); }
-  else guiGetEvent( guiSetState,(void *) guiSetStop );
+  else guiGetEvent( guiSetState,(void *) GUI_STOP );
 }
 
 static void fs_Cancel_released( GtkButton * button,gpointer user_data )
--- a/gui/ui/main.c	Wed Jun 22 12:09:01 2011 +0000
+++ b/gui/ui/main.c	Wed Jun 22 12:12:50 2011 +0000
@@ -227,7 +227,7 @@
         break;
 
    case evStop:
-	guiInfo.Playing=guiSetStop;
+	guiInfo.Playing=GUI_STOP;
 	uiState();
 	guiInfo.NoWindow=False;
 	break;
--- a/gui/win32/dialogs.c	Wed Jun 22 12:09:01 2011 +0000
+++ b/gui/win32/dialogs.c	Wed Jun 22 12:12:50 2011 +0000
@@ -708,7 +708,7 @@
                     int len = SendMessage(listbox, LB_GETTEXTLEN, index, 0);
                     if (len)
                     {
-                        if (guiInfo.Playing) guiGetEvent(guiSetState, (void *) guiSetStop);
+                        if (guiInfo.Playing) guiGetEvent(guiSetState, (void *) GUI_STOP);
                         free(skinName);
                         skinName = malloc(len + 1);
                         SendMessage(listbox, LB_GETTEXT, (WPARAM) index, (LPARAM) skinName);
--- a/gui/win32/interface.c	Wed Jun 22 12:09:01 2011 +0000
+++ b/gui/win32/interface.c	Wed Jun 22 12:12:50 2011 +0000
@@ -218,7 +218,7 @@
         }
         case evStop:
             if(guiInfo.Playing)
-                guiGetEvent(guiSetState, (void *) guiSetStop);
+                guiGetEvent(guiSetState, (void *) GUI_STOP);
             break;
         case evSetMoviePosition:
         {
@@ -288,7 +288,7 @@
                     guiInfo.Chapter = guiInfo.DVD.current_chapter;
                     guiInfo.Angle = guiInfo.DVD.current_angle;
                     guiInfo.DiskChanged = 1;
-                    guiGetEvent(guiSetState, (void *) guiSetPlay);
+                    guiGetEvent(guiSetState, (void *) GUI_PLAY);
                     break;
                 }
 #endif
@@ -297,8 +297,8 @@
                     guiInfo.FilenameChanged = guiInfo.NewPlay = 1;
                     update_playlistwindow();
                     uiGotoTheNext = guiInfo.Playing? 0 : 1;
-                    guiGetEvent(guiSetState, (void *) guiSetStop);
-                    guiGetEvent(guiSetState, (void *) guiSetPlay);
+                    guiGetEvent(guiSetState, (void *) GUI_STOP);
+                    guiGetEvent(guiSetState, (void *) GUI_PLAY);
                     break;
                }
            }
@@ -324,7 +324,7 @@
        return;
    }
    guiInfo.NewPlay = 1;
-   guiGetEvent(guiSetState, (void *) guiSetPlay);
+   guiGetEvent(guiSetState, (void *) GUI_PLAY);
 }
 
 void uiPause( void )
@@ -428,12 +428,12 @@
         style = WS_OVERLAPPEDWINDOW | WS_SIZEBOX;
         SetWindowLong(mygui->subwindow, GWL_STYLE, style);
     }
-    guiGetEvent(guiSetState, (void *) guiSetStop);
+    guiGetEvent(guiSetState, (void *) GUI_STOP);
 }
 
 void uiStop(void)
 {
-    guiGetEvent(guiSetState, (void *) guiSetStop);
+    guiGetEvent(guiSetState, (void *) GUI_STOP);
 }
 
 void uiSetFileName(char *dir, char *name, int type)
@@ -665,12 +665,12 @@
             guiInfo.Playing = (int) arg;
             switch (guiInfo.Playing)
             {
-                case guiSetPlay:
+                case GUI_PLAY:
                 {
                     guiInfo.Playing = 1;
                     break;
                 }
-                case guiSetStop:
+                case GUI_STOP:
                 {
                     guiInfo.Playing = 0;
                     if(movie_aspect >= 0)
@@ -678,7 +678,7 @@
                     update_subwindow();
                     break;
                 }
-                case guiSetPause:
+                case GUI_PAUSE:
                     guiInfo.Playing = 2;
                     break;
             }
--- a/gui/win32/preferences.c	Wed Jun 22 12:09:01 2011 +0000
+++ b/gui/win32/preferences.c	Wed Jun 22 12:12:50 2011 +0000
@@ -558,7 +558,7 @@
                 case ID_APPLY:
                 {
                     int strl;
-                    if(guiInfo.Playing) guiGetEvent(guiSetState, (void *)guiSetStop);
+                    if(guiInfo.Playing) guiGetEvent(guiSetState, (void *)GUI_STOP);
 
                     /* Set the video driver */
                     free(video_driver_list[0]);
--- a/mplayer.c	Wed Jun 22 12:09:01 2011 +0000
+++ b/mplayer.c	Wed Jun 22 12:12:50 2011 +0000
@@ -2537,7 +2537,7 @@
     }
 #ifdef CONFIG_GUI
     if (use_gui)
-        guiGetEvent(guiSetState, (char *)guiSetPause);
+        guiGetEvent(guiSetState, (void *)GUI_PAUSE);
 #endif
     if (mpctx->video_out && mpctx->sh_video && vo_config_count)
         mpctx->video_out->control(VOCTRL_PAUSE, NULL);
@@ -2601,10 +2601,10 @@
     (void)GetRelativeTime(); // ignore time that passed during pause
 #ifdef CONFIG_GUI
     if (use_gui) {
-        if (guiInfo.Playing == guiSetStop)
+        if (guiInfo.Playing == GUI_STOP)
             mpctx->eof = 1;
         else
-            guiGetEvent(guiSetState, (char *)guiSetPlay);
+            guiGetEvent(guiSetState, (void *)GUI_PLAY);
     }
 #endif
 }