[MPlayer-cvslog] r33812 - in trunk: command.c gui/interface.c gui/interface.h gui/ui/actions.c gui/ui/gtk/fileselect.c gui/win32/dialogs.c gui/win32/interface.c gui/win32/preferences.c libvo/video_out.c libvo/vo_dx...

ib subversion at mplayerhq.hu
Tue Jul 5 11:33:10 CEST 2011


Author: ib
Date: Tue Jul  5 11:33:09 2011
New Revision: 33812

Log:
Rename guiGetEvent() gui().

This function is the interface between MPlayer and the GUI.
It doesn't have much to do with events and doesn't merely get things.

Modified:
   trunk/command.c
   trunk/gui/interface.c
   trunk/gui/interface.h
   trunk/gui/ui/actions.c
   trunk/gui/ui/gtk/fileselect.c
   trunk/gui/win32/dialogs.c
   trunk/gui/win32/interface.c
   trunk/gui/win32/preferences.c
   trunk/libvo/video_out.c
   trunk/libvo/vo_dxr3.c
   trunk/libvo/vo_xover.c
   trunk/libvo/x11_common.c
   trunk/mplayer.c

Modified: trunk/command.c
==============================================================================
--- trunk/command.c	Tue Jul  5 00:24:52 2011	(r33811)
+++ trunk/command.c	Tue Jul  5 11:33:09 2011	(r33812)
@@ -1075,7 +1075,7 @@ static int mp_property_fullscreen(m_opti
     case M_PROPERTY_STEP_DOWN:
 #ifdef CONFIG_GUI
         if (use_gui)
-            guiGetEvent(guiRunCommand, (void *) MP_CMD_VO_FULLSCREEN);
+            gui(guiRunCommand, (void *) MP_CMD_VO_FULLSCREEN);
         else
 #endif
         if (vo_config_count)
@@ -2801,10 +2801,10 @@ int run_command(MPContext *mpctx, mp_cmd
                     int i = 0;
                     if (n > 0)
                         for (i = 0; i < n; i++)
-                            guiGetEvent(guiRunCommand, (void *)MP_CMD_PLAY_TREE_STEP);
+                            gui(guiRunCommand, (void *)MP_CMD_PLAY_TREE_STEP);
                     else
                         for (i = 0; i < -1 * n; i++)
-                            guiGetEvent(guiRunCommand, (void *)-MP_CMD_PLAY_TREE_STEP);
+                            gui(guiRunCommand, (void *)-MP_CMD_PLAY_TREE_STEP);
                 } else
 #endif
                 {
@@ -2966,7 +2966,7 @@ int run_command(MPContext *mpctx, mp_cmd
 #ifdef CONFIG_GUI
             // playtree_iter isn't used by the GUI
             if (use_gui)
-                guiGetEvent(guiRunCommand, (void *)MP_CMD_STOP);
+                gui(guiRunCommand, (void *)MP_CMD_STOP);
             else
 #endif
             // Go back to the starting point.

Modified: trunk/gui/interface.c
==============================================================================
--- trunk/gui/interface.c	Tue Jul  5 00:24:52 2011	(r33811)
+++ trunk/gui/interface.c	Tue Jul  5 11:33:09 2011	(r33812)
@@ -548,7 +548,7 @@ static void add_vf(char *str)
     mp_msg(MSGT_GPLAYER, MSGL_INFO, MSGTR_AddingVideoFilter, str);
 }
 
-int guiGetEvent(int type, void *arg)
+int gui(int type, void *arg)
 {
     mixer_t *mixer = NULL;
     stream_t *stream;
@@ -628,7 +628,7 @@ int guiGetEvent(int type, void *arg)
 
     case guiPreparation:
 
-        guiGetEvent(guiNewFile, NULL);
+        gui(guiNewFile, NULL);
 
         switch (guiInfo.StreamType) {
         case STREAMTYPE_PLAYLIST:
@@ -847,7 +847,7 @@ int guiGetEvent(int type, void *arg)
         switch (guiInfo.StreamType) {
 #ifdef CONFIG_DVDREAD
         case STREAMTYPE_DVD:
-            guiGetEvent(guiSetDVD, stream->priv);
+            gui(guiSetDVD, stream->priv);
             break;
 #endif
 
@@ -917,7 +917,7 @@ int guiGetEvent(int type, void *arg)
         if (arg && !guiInfo.sh_video)
             guiInfo.MovieWindow = False;
 
-        guiGetEvent(guiSetMixer, NULL);
+        gui(guiSetMixer, NULL);
 
         if (gtkEnableAudioEqualizer) {
             equalizer_t eq;
@@ -1019,7 +1019,7 @@ int guiGetEvent(int type, void *arg)
             } else
                 wsVisibleWindow(&guiApp.subWindow, wsHideWindow);
 
-            guiGetEvent(guiSetState, (void *)GUI_STOP);
+            gui(guiSetState, (void *)GUI_STOP);
             uiSubRender = 1;
             wsSetBackgroundRGB(&guiApp.subWindow, guiApp.sub.R, guiApp.sub.G, guiApp.sub.B);
             wsClearWindow(guiApp.subWindow);

Modified: trunk/gui/interface.h
==============================================================================
--- trunk/gui/interface.h	Tue Jul  5 00:24:52 2011	(r33811)
+++ trunk/gui/interface.h	Tue Jul  5 11:33:09 2011	(r33812)
@@ -235,7 +235,7 @@ void *gtkSet(int cmd, float fparam, void
 void guiDone(void);
 void guiEventHandling(void);
 void guiExit(enum exit_reason how);
-int guiGetEvent(int type, void *arg);
+int gui(int type, void *arg);
 void guiInit(void);
 void guiLoadFont(void);
 void guiLoadSubtitle(char *name);

Modified: trunk/gui/ui/actions.c
==============================================================================
--- trunk/gui/ui/actions.c	Tue Jul  5 00:24:52 2011	(r33811)
+++ trunk/gui/ui/actions.c	Tue Jul  5 11:33:09 2011	(r33812)
@@ -103,7 +103,7 @@ void uiPlay(void)
         return;
     }
 
-    guiGetEvent(guiSetState, (void *)GUI_PLAY);
+    gui(guiSetState, (void *)GUI_PLAY);
     uiSubRender = 0;
     wsSetBackgroundRGB(&guiApp.subWindow, 0, 0, 0);
     wsClearWindow(guiApp.subWindow);

Modified: trunk/gui/ui/gtk/fileselect.c
==============================================================================
--- trunk/gui/ui/gtk/fileselect.c	Tue Jul  5 00:24:52 2011	(r33811)
+++ trunk/gui/ui/gtk/fileselect.c	Tue Jul  5 11:33:09 2011	(r33812)
@@ -510,7 +510,7 @@ static void fs_Ok_released( GtkButton * 
   }
  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 *) GUI_STOP );
+  else gui( guiSetState,(void *) GUI_STOP );
 }
 
 static void fs_Cancel_released( GtkButton * button,gpointer user_data )

Modified: trunk/gui/win32/dialogs.c
==============================================================================
--- trunk/gui/win32/dialogs.c	Tue Jul  5 00:24:52 2011	(r33811)
+++ trunk/gui/win32/dialogs.c	Tue Jul  5 11:33:09 2011	(r33812)
@@ -708,7 +708,7 @@ static LRESULT CALLBACK SkinBrowserWndPr
                     int len = SendMessage(listbox, LB_GETTEXTLEN, index, 0);
                     if (len)
                     {
-                        if (guiInfo.Playing) guiGetEvent(guiSetState, (void *) GUI_STOP);
+                        if (guiInfo.Playing) gui(guiSetState, (void *) GUI_STOP);
                         free(skinName);
                         skinName = malloc(len + 1);
                         SendMessage(listbox, LB_GETTEXT, (WPARAM) index, (LPARAM) skinName);

Modified: trunk/gui/win32/interface.c
==============================================================================
--- trunk/gui/win32/interface.c	Tue Jul  5 00:24:52 2011	(r33811)
+++ trunk/gui/win32/interface.c	Tue Jul  5 11:33:09 2011	(r33812)
@@ -174,7 +174,7 @@ static void guiSetEvent(int event)
             GetVolumeInformation(dvd_device, dvdname, MAX_PATH, NULL, NULL, NULL, NULL, 0);
             capitalize(dvdname);
             mp_msg(MSGT_GPLAYER, MSGL_V, "Opening DVD %s -> %s\n", dvd_device, dvdname);
-            guiGetEvent(guiPreparation, (void *) STREAMTYPE_DVD);
+            gui(guiPreparation, (void *) STREAMTYPE_DVD);
             mygui->playlist->clear_playlist(mygui->playlist);
             mygui->playlist->add_track(mygui->playlist, filename, NULL, dvdname, 0);
             mygui->startplay(mygui);
@@ -218,7 +218,7 @@ static void guiSetEvent(int event)
         }
         case evStop:
             if(guiInfo.Playing)
-                guiGetEvent(guiSetState, (void *) GUI_STOP);
+                gui(guiSetState, (void *) GUI_STOP);
             break;
         case evSetMoviePosition:
         {
@@ -288,7 +288,7 @@ static void guiSetEvent(int event)
                     guiInfo.Chapter = guiInfo.DVD.current_chapter;
                     guiInfo.Angle = guiInfo.DVD.current_angle;
                     guiInfo.DiskChanged = 1;
-                    guiGetEvent(guiSetState, (void *) GUI_PLAY);
+                    gui(guiSetState, (void *) GUI_PLAY);
                     break;
                 }
 #endif
@@ -297,8 +297,8 @@ static void guiSetEvent(int event)
                     guiInfo.FilenameChanged = guiInfo.NewPlay = 1;
                     update_playlistwindow();
                     uiGotoTheNext = guiInfo.Playing? 0 : 1;
-                    guiGetEvent(guiSetState, (void *) GUI_STOP);
-                    guiGetEvent(guiSetState, (void *) GUI_PLAY);
+                    gui(guiSetState, (void *) GUI_STOP);
+                    gui(guiSetState, (void *) GUI_PLAY);
                     break;
                }
            }
@@ -324,7 +324,7 @@ void uiPlay( void )
        return;
    }
    guiInfo.NewPlay = 1;
-   guiGetEvent(guiSetState, (void *) GUI_PLAY);
+   gui(guiSetState, (void *) GUI_PLAY);
 }
 
 void uiPause( void )
@@ -481,7 +481,7 @@ void guiDone(void)
 }
 
 /* this function gets called by mplayer to update the gui */
-int guiGetEvent(int type, void *arg)
+int gui(int type, void *arg)
 {
     stream_t *stream = arg;
 #ifdef CONFIG_DVDREAD
@@ -501,7 +501,7 @@ int guiGetEvent(int type, void *arg)
     {
         case guiPreparation:
         {
-            guiGetEvent(guiNewFile, NULL);
+            gui(guiNewFile, NULL);
             guiInfo.DiskChanged = 0;
             guiInfo.FilenameChanged = 0;
             guiInfo.NewPlay = 0;
@@ -576,7 +576,7 @@ int guiGetEvent(int type, void *arg)
             {
 #ifdef CONFIG_DVDREAD
                 case STREAMTYPE_DVD:
-                    guiGetEvent(guiSetDVD, stream->priv);
+                    gui(guiSetDVD, stream->priv);
                     break;
 #endif
             }
@@ -746,7 +746,7 @@ int guiGetEvent(int type, void *arg)
               style = WS_OVERLAPPEDWINDOW | WS_SIZEBOX;
               SetWindowLong(mygui->subwindow, GWL_STYLE, style);
           }
-          guiGetEvent(guiSetState, (void *) GUI_STOP);
+          gui(guiSetState, (void *) GUI_STOP);
           break;
         }
         default:

Modified: trunk/gui/win32/preferences.c
==============================================================================
--- trunk/gui/win32/preferences.c	Tue Jul  5 00:24:52 2011	(r33811)
+++ trunk/gui/win32/preferences.c	Tue Jul  5 11:33:09 2011	(r33812)
@@ -575,7 +575,7 @@ static LRESULT CALLBACK PrefsWndProc(HWN
                 case ID_APPLY:
                 {
                     int strl;
-                    if(guiInfo.Playing) guiGetEvent(guiSetState, (void *)GUI_STOP);
+                    if(guiInfo.Playing) gui(guiSetState, (void *)GUI_STOP);
 
                     /* Set the video driver */
                     free(video_driver_list[0]);

Modified: trunk/libvo/video_out.c
==============================================================================
--- trunk/libvo/video_out.c	Tue Jul  5 00:24:52 2011	(r33811)
+++ trunk/libvo/video_out.c	Tue Jul  5 11:33:09 2011	(r33812)
@@ -372,7 +372,7 @@ int config_video_out(const vo_functions_
 #ifdef CONFIG_GUI
     if (use_gui) {
       // GUI creates and manages window for us
-      guiGetEvent(guiSetVideoWindow, 0);
+      gui(guiSetVideoWindow, 0);
     }
 #endif
   }

Modified: trunk/libvo/vo_dxr3.c
==============================================================================
--- trunk/libvo/vo_dxr3.c	Tue Jul  5 00:24:52 2011	(r33811)
+++ trunk/libvo/vo_dxr3.c	Tue Jul  5 11:33:09 2011	(r33812)
@@ -491,7 +491,7 @@ static int config(uint32_t width, uint32
 		vo_dheight = d_height;
 #ifdef CONFIG_GUI
 		if (use_gui)
-			guiGetEvent(guiSetVideoWindow, 0);
+			gui(guiSetVideoWindow, 0);
 #endif
 		XGetWindowAttributes(mDisplay, DefaultRootWindow(mDisplay), &xwin_attribs);
 		depth = xwin_attribs.depth;

Modified: trunk/libvo/vo_xover.c
==============================================================================
--- trunk/libvo/vo_xover.c	Tue Jul  5 00:24:52 2011	(r33811)
+++ trunk/libvo/vo_xover.c	Tue Jul  5 11:33:09 2011	(r33812)
@@ -269,7 +269,7 @@ static int config(uint32_t width, uint32
   vo_dwidth=d_width; vo_dheight=d_height;
 
 #ifdef CONFIG_GUI
-  if(use_gui) guiGetEvent( guiSetVideoWindow,0 ); // the GUI will set up / resize the window
+  if(use_gui) gui( guiSetVideoWindow,0 ); // the GUI will set up / resize the window
   else
     {
 #endif

Modified: trunk/libvo/x11_common.c
==============================================================================
--- trunk/libvo/x11_common.c	Tue Jul  5 00:24:52 2011	(r33811)
+++ trunk/libvo/x11_common.c	Tue Jul  5 11:33:09 2011	(r33812)
@@ -821,7 +821,7 @@ int vo_x11_check_events(Display * mydisp
 #ifdef CONFIG_GUI
         if (use_gui)
         {
-            guiGetEvent(guiXEvent, &Event);
+            gui(guiXEvent, &Event);
             if (vo_window != Event.xany.window)
                 continue;
         }

Modified: trunk/mplayer.c
==============================================================================
--- trunk/mplayer.c	Tue Jul  5 00:24:52 2011	(r33811)
+++ trunk/mplayer.c	Tue Jul  5 11:33:09 2011	(r33812)
@@ -584,7 +584,7 @@ void uninit_player(unsigned int mask)
             uninit_audio(mpctx->sh_audio);
 #ifdef CONFIG_GUI
         if (use_gui)
-            guiGetEvent(guiSetAfilter, NULL);
+            gui(guiSetAfilter, NULL);
 #endif
         mpctx->sh_audio      = NULL;
         mpctx->mixer.afilter = NULL;
@@ -1334,7 +1334,7 @@ static int build_afilter_chain(sh_audio_
     if (!sh_audio) {
 #ifdef CONFIG_GUI
         if (use_gui)
-            guiGetEvent(guiSetAfilter, NULL);
+            gui(guiSetAfilter, NULL);
 #endif
         mpctx->mixer.afilter = NULL;
         return 0;
@@ -1359,7 +1359,7 @@ static int build_afilter_chain(sh_audio_
     mpctx->mixer.afilter = sh_audio->afilter;
 #ifdef CONFIG_GUI
     if (use_gui)
-        guiGetEvent(guiSetAfilter, sh_audio->afilter);
+        gui(guiSetAfilter, sh_audio->afilter);
 #endif
     return result;
 }
@@ -2537,7 +2537,7 @@ static void pause_loop(void)
     }
 #ifdef CONFIG_GUI
     if (use_gui)
-        guiGetEvent(guiSetState, (void *)GUI_PAUSE);
+        gui(guiSetState, (void *)GUI_PAUSE);
 #endif
     if (mpctx->video_out && mpctx->sh_video && vo_config_count)
         mpctx->video_out->control(VOCTRL_PAUSE, NULL);
@@ -2557,7 +2557,7 @@ static void pause_loop(void)
 #ifdef CONFIG_GUI
         if (use_gui) {
             guiEventHandling();
-            guiGetEvent(guiReDraw, NULL);
+            gui(guiReDraw, NULL);
             if (guiInfo.Playing != GUI_PAUSE || (rel_seek_secs || abs_seek_pos))
                 break;
         }
@@ -2604,7 +2604,7 @@ static void pause_loop(void)
         if (guiInfo.Playing == GUI_STOP)
             mpctx->eof = 1;
         else
-            guiGetEvent(guiSetState, (void *)GUI_PLAY);
+            gui(guiSetState, (void *)GUI_PLAY);
     }
 #endif
 }
@@ -3051,8 +3051,8 @@ int main(int argc, char *argv[])
 #ifdef CONFIG_GUI
     if (use_gui) {
         guiInit();
-        guiGetEvent(guiSetContext, mpctx);
-        guiGetEvent(guiSetState, (void *)(gui_no_filename ? GUI_STOP : GUI_PLAY));
+        gui(guiSetContext, mpctx);
+        gui(guiSetState, (void *)(gui_no_filename ? GUI_STOP : GUI_PLAY));
     }
 #endif
 
@@ -3090,18 +3090,18 @@ play_next_file:
 #ifdef CONFIG_GUI
     if (use_gui) {
         mpctx->file_format = DEMUXER_TYPE_UNKNOWN;
-        guiGetEvent(guiNewFile, 0);
+        gui(guiNewFile, 0);
         while (guiInfo.Playing != GUI_PLAY) {
             mp_cmd_t *cmd;
             usec_sleep(20000);
             guiEventHandling();
-            guiGetEvent(guiReDraw, NULL);
+            gui(guiReDraw, NULL);
             if ((cmd = mp_input_get_cmd(0, 0, 0)) != NULL) {
-                guiGetEvent(guiRunCommand, (void *)cmd->id);
+                gui(guiRunCommand, (void *)cmd->id);
                 mp_cmd_free(cmd);
             }
         }
-        guiGetEvent(guiPreparation, NULL);
+        gui(guiPreparation, NULL);
         if (guiInfo.StreamType == STREAMTYPE_STREAM) {
             play_tree_t *entry = play_tree_new();
             play_tree_add_file(entry, guiInfo.Filename);
@@ -3244,7 +3244,7 @@ play_next_file:
 
 #ifdef CONFIG_GUI
     if (use_gui)
-        guiGetEvent(guiSetStream, mpctx->stream);
+        gui(guiSetStream, mpctx->stream);
 #endif
 
     if (mpctx->file_format == DEMUXER_TYPE_PLAYLIST) {
@@ -3677,9 +3677,9 @@ goto_enable_cache:
 
 #ifdef CONFIG_GUI
         if (use_gui) {
-            if (!guiGetEvent(guiSetVideo, mpctx->sh_video))
+            if (!gui(guiSetVideo, mpctx->sh_video))
                 goto goto_next_file;
-            guiGetEvent(guiSetAudio, mpctx->sh_audio);
+            gui(guiSetAudio, mpctx->sh_audio);
         }
 #endif
 
@@ -3995,8 +3995,8 @@ goto_enable_cache:
                 else if (mpctx->sh_audio)
                     guiInfo.TimeSec = playing_audio_pts(mpctx->sh_audio, mpctx->d_audio, mpctx->audio_out);
                 guiInfo.LengthInSec = demuxer_get_time_length(mpctx->demuxer);
-                guiGetEvent(guiSetMixer, NULL);
-                guiGetEvent(guiReDraw, NULL);
+                gui(guiSetMixer, NULL);
+                gui(guiReDraw, NULL);
                 if (guiInfo.Playing == GUI_STOP)
                     break;                  // STOP
                 if (guiInfo.Playing == GUI_PAUSE)
@@ -4103,7 +4103,7 @@ goto_next_file:  // don't jump here afte
 #ifdef CONFIG_DVDREAD
         if (!guiInfo.DiskChanged)
 #endif
-        guiGetEvent(guiEndFile, NULL);
+        gui(guiEndFile, NULL);
     }
 #endif
 


More information about the MPlayer-cvslog mailing list