# HG changeset patch # User ib # Date 1309862871 0 # Node ID f3361b27a151c5b389fb9c3b53384b37b54dc1e3 # Parent c919fb3d253144efa4d2125577874693d5ba3a54 Rename the gui() symbolic constants. Use prefix GMP for the constants, rename them and use upper case characters. For optical reasons, change parameter arg from NULL to 0 where it isn't used to pass anything. diff -r c919fb3d2531 -r f3361b27a151 command.c --- a/command.c Tue Jul 05 09:33:09 2011 +0000 +++ b/command.c Tue Jul 05 10:47:51 2011 +0000 @@ -1075,7 +1075,7 @@ case M_PROPERTY_STEP_DOWN: #ifdef CONFIG_GUI if (use_gui) - gui(guiRunCommand, (void *) MP_CMD_VO_FULLSCREEN); + gui(GMP_RUN_COMMAND, (void *) MP_CMD_VO_FULLSCREEN); else #endif if (vo_config_count) @@ -2801,10 +2801,10 @@ int i = 0; if (n > 0) for (i = 0; i < n; i++) - gui(guiRunCommand, (void *)MP_CMD_PLAY_TREE_STEP); + gui(GMP_RUN_COMMAND, (void *)MP_CMD_PLAY_TREE_STEP); else for (i = 0; i < -1 * n; i++) - gui(guiRunCommand, (void *)-MP_CMD_PLAY_TREE_STEP); + gui(GMP_RUN_COMMAND, (void *)-MP_CMD_PLAY_TREE_STEP); } else #endif { @@ -2966,7 +2966,7 @@ #ifdef CONFIG_GUI // playtree_iter isn't used by the GUI if (use_gui) - gui(guiRunCommand, (void *)MP_CMD_STOP); + gui(GMP_RUN_COMMAND, (void *)MP_CMD_STOP); else #endif // Go back to the starting point. diff -r c919fb3d2531 -r f3361b27a151 gui/interface.c --- a/gui/interface.c Tue Jul 05 09:33:09 2011 +0000 +++ b/gui/interface.c Tue Jul 05 10:47:51 2011 +0000 @@ -561,11 +561,11 @@ mixer = mpctx_get_mixer(guiInfo.mpcontext); switch (type) { - case guiSetContext: + case GMP_SET_CONTEXT: guiInfo.mpcontext = arg; break; - case guiSetState: + case GMP_SET_STATE: switch ((int)arg) { case GUI_STOP: @@ -579,7 +579,7 @@ uiState(); break; - case guiNewFile: + case GMP_NEW_FILE: // if ( guiInfo.Playing == 1 && guiInfo.FilenameChanged ) if (guiInfo.FilenameChanged) { @@ -598,9 +598,9 @@ break; - case guiRunCommand: + case GMP_RUN_COMMAND: - mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[interface] guiRunCommand: %d\n", (int)arg); + mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[interface] GMP_RUN_COMMAND: %d\n", (int)arg); switch ((int)arg) { case MP_CMD_VO_FULLSCREEN: @@ -626,9 +626,9 @@ break; - case guiPreparation: + case GMP_PREPARATION: - gui(guiNewFile, NULL); + gui(GMP_NEW_FILE, 0); switch (guiInfo.StreamType) { case STREAMTYPE_PLAYLIST: @@ -839,7 +839,7 @@ break; - case guiSetStream: + case GMP_SET_STREAM: stream = arg; guiInfo.StreamType = stream->type; @@ -847,7 +847,7 @@ switch (guiInfo.StreamType) { #ifdef CONFIG_DVDREAD case STREAMTYPE_DVD: - gui(guiSetDVD, stream->priv); + gui(GMP_SET_DVD, stream->priv); break; #endif @@ -865,7 +865,7 @@ break; #ifdef CONFIG_DVDREAD - case guiSetDVD: + case GMP_SET_DVD: dvd = arg; guiInfo.DVD.titles = dvd->vmg_file->tt_srpt->nr_of_srpts; guiInfo.DVD.chapters = dvd->vmg_file->tt_srpt->title[dvd_title].nr_of_ptts; @@ -881,11 +881,11 @@ break; #endif - case guiSetAfilter: + case GMP_SET_AFILTER: guiInfo.afilter = arg; break; - case guiSetVideo: + case GMP_SET_VIDEO: // video @@ -910,14 +910,14 @@ break; - case guiSetAudio: + case GMP_SET_AUDIO: guiInfo.AudioChannels = arg ? ((sh_audio_t *)arg)->channels : 0; if (arg && !guiInfo.sh_video) guiInfo.MovieWindow = False; - gui(guiSetMixer, NULL); + gui(GMP_SET_MIXER, 0); if (gtkEnableAudioEqualizer) { equalizer_t eq; @@ -936,7 +936,7 @@ wsVisibleWindow(&guiApp.subWindow, (guiInfo.MovieWindow ? wsShowWindow : wsHideWindow)); break; - case guiSetMixer: + case GMP_SET_MIXER: if (mixer) { float l, r; static float last_balance = -1; @@ -958,11 +958,11 @@ } break; - case guiReDraw: + case GMP_REDRAW: uiEventHandling(evRedraw, 0); break; - case guiSetVideoWindow: + case GMP_SETUP_VIDEO_WINDOW: if (!guiApp.subWindow.isFullScreen) { wsResizeWindow(&guiApp.subWindow, vo_dwidth, vo_dheight); @@ -978,13 +978,13 @@ WinID = guiApp.subWindow.WindowID; break; - case guiXEvent: + case GMP_X_EVENT: guiInfo.event_struct = arg; wsEvents(wsDisplay, arg); gtkEventHandling(); break; - case guiEndFile: + case GMP_END_FILE: if (!uiGotoTheNext && guiInfo.Playing) { uiGotoTheNext = 1; @@ -1019,7 +1019,7 @@ } else wsVisibleWindow(&guiApp.subWindow, wsHideWindow); - gui(guiSetState, (void *)GUI_STOP); + gui(GMP_SET_STATE, (void *)GUI_STOP); uiSubRender = 1; wsSetBackgroundRGB(&guiApp.subWindow, guiApp.sub.R, guiApp.sub.G, guiApp.sub.B); wsClearWindow(guiApp.subWindow); diff -r c919fb3d2531 -r f3361b27a151 gui/interface.h --- a/gui/interface.h Tue Jul 05 09:33:09 2011 +0000 +++ b/gui/interface.h Tue Jul 05 10:47:51 2011 +0000 @@ -35,22 +35,22 @@ #define GMPlayer "gmplayer" -#define guiXEvent 0 -#define guiSetState 1 -#define guiRunCommand 2 -#define guiSetDVD 3 -#define guiSetAudio 6 +#define GMP_X_EVENT 0 +#define GMP_SET_STATE 1 +#define GMP_RUN_COMMAND 2 +#define GMP_SET_DVD 3 +#define GMP_SET_AUDIO 6 #define guiReDrawSubWindow 7 -#define guiSetVideoWindow 8 -#define guiSetStream 9 -#define guiReDraw 10 -#define guiSetMixer 11 -#define guiNewFile 12 -#define guiSetVideo 13 -#define guiPreparation 16 -#define guiSetAfilter 17 -#define guiSetContext 18 -#define guiEndFile 19 +#define GMP_SETUP_VIDEO_WINDOW 8 +#define GMP_SET_STREAM 9 +#define GMP_REDRAW 10 +#define GMP_SET_MIXER 11 +#define GMP_NEW_FILE 12 +#define GMP_SET_VIDEO 13 +#define GMP_PREPARATION 16 +#define GMP_SET_AFILTER 17 +#define GMP_SET_CONTEXT 18 +#define GMP_END_FILE 19 #define GUI_STOP 0 #define GUI_PLAY 1 diff -r c919fb3d2531 -r f3361b27a151 gui/ui/actions.c --- a/gui/ui/actions.c Tue Jul 05 09:33:09 2011 +0000 +++ b/gui/ui/actions.c Tue Jul 05 10:47:51 2011 +0000 @@ -103,7 +103,7 @@ return; } - gui(guiSetState, (void *)GUI_PLAY); + gui(GMP_SET_STATE, (void *)GUI_PLAY); uiSubRender = 0; wsSetBackgroundRGB(&guiApp.subWindow, 0, 0, 0); wsClearWindow(guiApp.subWindow); diff -r c919fb3d2531 -r f3361b27a151 gui/ui/gtk/fileselect.c --- a/gui/ui/gtk/fileselect.c Tue Jul 05 09:33:09 2011 +0000 +++ b/gui/ui/gtk/fileselect.c Tue Jul 05 10:47:51 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 gui( guiSetState,(void *) GUI_STOP ); + else gui( GMP_SET_STATE,(void *) GUI_STOP ); } static void fs_Cancel_released( GtkButton * button,gpointer user_data ) diff -r c919fb3d2531 -r f3361b27a151 gui/win32/dialogs.c --- a/gui/win32/dialogs.c Tue Jul 05 09:33:09 2011 +0000 +++ b/gui/win32/dialogs.c Tue Jul 05 10:47:51 2011 +0000 @@ -708,7 +708,7 @@ int len = SendMessage(listbox, LB_GETTEXTLEN, index, 0); if (len) { - if (guiInfo.Playing) gui(guiSetState, (void *) GUI_STOP); + if (guiInfo.Playing) gui(GMP_SET_STATE, (void *) GUI_STOP); free(skinName); skinName = malloc(len + 1); SendMessage(listbox, LB_GETTEXT, (WPARAM) index, (LPARAM) skinName); diff -r c919fb3d2531 -r f3361b27a151 gui/win32/interface.c --- a/gui/win32/interface.c Tue Jul 05 09:33:09 2011 +0000 +++ b/gui/win32/interface.c Tue Jul 05 10:47:51 2011 +0000 @@ -174,7 +174,7 @@ 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); - gui(guiPreparation, (void *) STREAMTYPE_DVD); + gui(GMP_PREPARATION, (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 @@ } case evStop: if(guiInfo.Playing) - gui(guiSetState, (void *) GUI_STOP); + gui(GMP_SET_STATE, (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; - gui(guiSetState, (void *) GUI_PLAY); + gui(GMP_SET_STATE, (void *) GUI_PLAY); break; } #endif @@ -297,8 +297,8 @@ guiInfo.FilenameChanged = guiInfo.NewPlay = 1; update_playlistwindow(); uiGotoTheNext = guiInfo.Playing? 0 : 1; - gui(guiSetState, (void *) GUI_STOP); - gui(guiSetState, (void *) GUI_PLAY); + gui(GMP_SET_STATE, (void *) GUI_STOP); + gui(GMP_SET_STATE, (void *) GUI_PLAY); break; } } @@ -324,7 +324,7 @@ return; } guiInfo.NewPlay = 1; - gui(guiSetState, (void *) GUI_PLAY); + gui(GMP_SET_STATE, (void *) GUI_PLAY); } void uiPause( void ) @@ -499,9 +499,9 @@ switch (type) { - case guiPreparation: + case GMP_PREPARATION: { - gui(guiNewFile, NULL); + gui(GMP_NEW_FILE, 0); guiInfo.DiskChanged = 0; guiInfo.FilenameChanged = 0; guiInfo.NewPlay = 0; @@ -528,7 +528,7 @@ strcpy(guiInfo.Filename, filename); break; } - case guiSetAudio: + case GMP_SET_AUDIO: { guiInfo.MovieWindow = (arg && !guiInfo.sh_video); // NOTE: This type doesn't mean (and never meant) that we have @@ -538,10 +538,10 @@ ShowWindow(mygui->subwindow, SW_HIDE); break; } - case guiSetContext: + case GMP_SET_CONTEXT: guiInfo.mpcontext = arg; break; - case guiSetVideo: + case GMP_SET_VIDEO: { guiInfo.sh_video = arg; if (arg) @@ -559,7 +559,7 @@ } break; } - case guiSetVideoWindow: + case GMP_SETUP_VIDEO_WINDOW: { guiInfo.MovieWidth = vo_dwidth; guiInfo.MovieHeight = vo_dheight; @@ -569,21 +569,21 @@ update_subwindow(); break; } - case guiSetStream: + case GMP_SET_STREAM: { guiInfo.StreamType = stream->type; switch(stream->type) { #ifdef CONFIG_DVDREAD case STREAMTYPE_DVD: - gui(guiSetDVD, stream->priv); + gui(GMP_SET_DVD, stream->priv); break; #endif } break; } #ifdef CONFIG_DVDREAD - case guiSetDVD: + case GMP_SET_DVD: { guiInfo.DVD.titles = dvdp->vmg_file->tt_srpt->nr_of_srpts; guiInfo.DVD.chapters = dvdp->vmg_file->tt_srpt->title[dvd_title].nr_of_ptts; @@ -599,13 +599,13 @@ break; } #endif - case guiReDraw: + case GMP_REDRAW: mygui->updatedisplay(mygui, mygui->mainwindow); break; - case guiSetAfilter: + case GMP_SET_AFILTER: guiInfo.afilter = arg; break; - case guiSetState: + case GMP_SET_STATE: { guiInfo.Playing = (int) arg; switch (guiInfo.Playing) @@ -629,7 +629,7 @@ } break; } - case guiRunCommand: + case GMP_RUN_COMMAND: { mp_msg(MSGT_GPLAYER,MSGL_V, "cmd: %d\n", (int) arg); /* MPlayer asks us to quit */ @@ -660,7 +660,7 @@ } break; } - case guiNewFile: + case GMP_NEW_FILE: { audio_id = -1; video_id = -1; @@ -686,7 +686,7 @@ if(gtkAutoSyncOn) autosync = gtkAutoSync; break; } - case guiSetMixer: + case GMP_SET_MIXER: { if(audio_out) { @@ -702,7 +702,7 @@ } break; } - case guiEndFile: + case GMP_END_FILE: { if(!uiGotoTheNext && guiInfo.Playing) { @@ -746,7 +746,7 @@ style = WS_OVERLAPPEDWINDOW | WS_SIZEBOX; SetWindowLong(mygui->subwindow, GWL_STYLE, style); } - gui(guiSetState, (void *) GUI_STOP); + gui(GMP_SET_STATE, (void *) GUI_STOP); break; } default: diff -r c919fb3d2531 -r f3361b27a151 gui/win32/preferences.c --- a/gui/win32/preferences.c Tue Jul 05 09:33:09 2011 +0000 +++ b/gui/win32/preferences.c Tue Jul 05 10:47:51 2011 +0000 @@ -575,7 +575,7 @@ case ID_APPLY: { int strl; - if(guiInfo.Playing) gui(guiSetState, (void *)GUI_STOP); + if(guiInfo.Playing) gui(GMP_SET_STATE, (void *)GUI_STOP); /* Set the video driver */ free(video_driver_list[0]); diff -r c919fb3d2531 -r f3361b27a151 libvo/video_out.c --- a/libvo/video_out.c Tue Jul 05 09:33:09 2011 +0000 +++ b/libvo/video_out.c Tue Jul 05 10:47:51 2011 +0000 @@ -372,7 +372,7 @@ #ifdef CONFIG_GUI if (use_gui) { // GUI creates and manages window for us - gui(guiSetVideoWindow, 0); + gui(GMP_SETUP_VIDEO_WINDOW, 0); } #endif } diff -r c919fb3d2531 -r f3361b27a151 libvo/vo_dxr3.c --- a/libvo/vo_dxr3.c Tue Jul 05 09:33:09 2011 +0000 +++ b/libvo/vo_dxr3.c Tue Jul 05 10:47:51 2011 +0000 @@ -491,7 +491,7 @@ vo_dheight = d_height; #ifdef CONFIG_GUI if (use_gui) - gui(guiSetVideoWindow, 0); + gui(GMP_SETUP_VIDEO_WINDOW, 0); #endif XGetWindowAttributes(mDisplay, DefaultRootWindow(mDisplay), &xwin_attribs); depth = xwin_attribs.depth; diff -r c919fb3d2531 -r f3361b27a151 libvo/vo_xover.c --- a/libvo/vo_xover.c Tue Jul 05 09:33:09 2011 +0000 +++ b/libvo/vo_xover.c Tue Jul 05 10:47:51 2011 +0000 @@ -269,7 +269,7 @@ vo_dwidth=d_width; vo_dheight=d_height; #ifdef CONFIG_GUI - if(use_gui) gui( guiSetVideoWindow,0 ); // the GUI will set up / resize the window + if(use_gui) gui(GMP_SETUP_VIDEO_WINDOW, 0); // the GUI will set up / resize the window else { #endif diff -r c919fb3d2531 -r f3361b27a151 libvo/x11_common.c --- a/libvo/x11_common.c Tue Jul 05 09:33:09 2011 +0000 +++ b/libvo/x11_common.c Tue Jul 05 10:47:51 2011 +0000 @@ -821,7 +821,7 @@ #ifdef CONFIG_GUI if (use_gui) { - gui(guiXEvent, &Event); + gui(GMP_X_EVENT, &Event); if (vo_window != Event.xany.window) continue; } diff -r c919fb3d2531 -r f3361b27a151 mplayer.c --- a/mplayer.c Tue Jul 05 09:33:09 2011 +0000 +++ b/mplayer.c Tue Jul 05 10:47:51 2011 +0000 @@ -584,7 +584,7 @@ uninit_audio(mpctx->sh_audio); #ifdef CONFIG_GUI if (use_gui) - gui(guiSetAfilter, NULL); + gui(GMP_SET_AFILTER, NULL); #endif mpctx->sh_audio = NULL; mpctx->mixer.afilter = NULL; @@ -1334,7 +1334,7 @@ if (!sh_audio) { #ifdef CONFIG_GUI if (use_gui) - gui(guiSetAfilter, NULL); + gui(GMP_SET_AFILTER, NULL); #endif mpctx->mixer.afilter = NULL; return 0; @@ -1359,7 +1359,7 @@ mpctx->mixer.afilter = sh_audio->afilter; #ifdef CONFIG_GUI if (use_gui) - gui(guiSetAfilter, sh_audio->afilter); + gui(GMP_SET_AFILTER, sh_audio->afilter); #endif return result; } @@ -2537,7 +2537,7 @@ } #ifdef CONFIG_GUI if (use_gui) - gui(guiSetState, (void *)GUI_PAUSE); + gui(GMP_SET_STATE, (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 @@ #ifdef CONFIG_GUI if (use_gui) { guiEventHandling(); - gui(guiReDraw, NULL); + gui(GMP_REDRAW, 0); if (guiInfo.Playing != GUI_PAUSE || (rel_seek_secs || abs_seek_pos)) break; } @@ -2604,7 +2604,7 @@ if (guiInfo.Playing == GUI_STOP) mpctx->eof = 1; else - gui(guiSetState, (void *)GUI_PLAY); + gui(GMP_SET_STATE, (void *)GUI_PLAY); } #endif } @@ -3051,8 +3051,8 @@ #ifdef CONFIG_GUI if (use_gui) { guiInit(); - gui(guiSetContext, mpctx); - gui(guiSetState, (void *)(gui_no_filename ? GUI_STOP : GUI_PLAY)); + gui(GMP_SET_CONTEXT, mpctx); + gui(GMP_SET_STATE, (void *)(gui_no_filename ? GUI_STOP : GUI_PLAY)); } #endif @@ -3090,18 +3090,18 @@ #ifdef CONFIG_GUI if (use_gui) { mpctx->file_format = DEMUXER_TYPE_UNKNOWN; - gui(guiNewFile, 0); + gui(GMP_NEW_FILE, 0); while (guiInfo.Playing != GUI_PLAY) { mp_cmd_t *cmd; usec_sleep(20000); guiEventHandling(); - gui(guiReDraw, NULL); + gui(GMP_REDRAW, 0); if ((cmd = mp_input_get_cmd(0, 0, 0)) != NULL) { - gui(guiRunCommand, (void *)cmd->id); + gui(GMP_RUN_COMMAND, (void *)cmd->id); mp_cmd_free(cmd); } } - gui(guiPreparation, NULL); + gui(GMP_PREPARATION, 0); if (guiInfo.StreamType == STREAMTYPE_STREAM) { play_tree_t *entry = play_tree_new(); play_tree_add_file(entry, guiInfo.Filename); @@ -3244,7 +3244,7 @@ #ifdef CONFIG_GUI if (use_gui) - gui(guiSetStream, mpctx->stream); + gui(GMP_SET_STREAM, mpctx->stream); #endif if (mpctx->file_format == DEMUXER_TYPE_PLAYLIST) { @@ -3677,9 +3677,9 @@ #ifdef CONFIG_GUI if (use_gui) { - if (!gui(guiSetVideo, mpctx->sh_video)) + if (!gui(GMP_SET_VIDEO, mpctx->sh_video)) goto goto_next_file; - gui(guiSetAudio, mpctx->sh_audio); + gui(GMP_SET_AUDIO, mpctx->sh_audio); } #endif @@ -3995,8 +3995,8 @@ 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); - gui(guiSetMixer, NULL); - gui(guiReDraw, NULL); + gui(GMP_SET_MIXER, 0); + gui(GMP_REDRAW, 0); if (guiInfo.Playing == GUI_STOP) break; // STOP if (guiInfo.Playing == GUI_PAUSE) @@ -4103,7 +4103,7 @@ #ifdef CONFIG_DVDREAD if (!guiInfo.DiskChanged) #endif - gui(guiEndFile, NULL); + gui(GMP_END_FILE, 0); } #endif