Mercurial > mplayer.hg
comparison mplayer.c @ 33724:c919fb3d2531
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.
author | ib |
---|---|
date | Tue, 05 Jul 2011 09:33:09 +0000 |
parents | 60093217cb01 |
children | f3361b27a151 |
comparison
equal
deleted
inserted
replaced
33723:6c8743e5fa30 | 33724:c919fb3d2531 |
---|---|
582 current_module = "uninit_acodec"; | 582 current_module = "uninit_acodec"; |
583 if (mpctx->sh_audio) | 583 if (mpctx->sh_audio) |
584 uninit_audio(mpctx->sh_audio); | 584 uninit_audio(mpctx->sh_audio); |
585 #ifdef CONFIG_GUI | 585 #ifdef CONFIG_GUI |
586 if (use_gui) | 586 if (use_gui) |
587 guiGetEvent(guiSetAfilter, NULL); | 587 gui(guiSetAfilter, NULL); |
588 #endif | 588 #endif |
589 mpctx->sh_audio = NULL; | 589 mpctx->sh_audio = NULL; |
590 mpctx->mixer.afilter = NULL; | 590 mpctx->mixer.afilter = NULL; |
591 } | 591 } |
592 | 592 |
1332 int new_srate; | 1332 int new_srate; |
1333 int result; | 1333 int result; |
1334 if (!sh_audio) { | 1334 if (!sh_audio) { |
1335 #ifdef CONFIG_GUI | 1335 #ifdef CONFIG_GUI |
1336 if (use_gui) | 1336 if (use_gui) |
1337 guiGetEvent(guiSetAfilter, NULL); | 1337 gui(guiSetAfilter, NULL); |
1338 #endif | 1338 #endif |
1339 mpctx->mixer.afilter = NULL; | 1339 mpctx->mixer.afilter = NULL; |
1340 return 0; | 1340 return 0; |
1341 } | 1341 } |
1342 if (af_control_any_rev(sh_audio->afilter, | 1342 if (af_control_any_rev(sh_audio->afilter, |
1357 result = init_audio_filters(sh_audio, new_srate, | 1357 result = init_audio_filters(sh_audio, new_srate, |
1358 &ao_data->samplerate, &ao_data->channels, &ao_data->format); | 1358 &ao_data->samplerate, &ao_data->channels, &ao_data->format); |
1359 mpctx->mixer.afilter = sh_audio->afilter; | 1359 mpctx->mixer.afilter = sh_audio->afilter; |
1360 #ifdef CONFIG_GUI | 1360 #ifdef CONFIG_GUI |
1361 if (use_gui) | 1361 if (use_gui) |
1362 guiGetEvent(guiSetAfilter, sh_audio->afilter); | 1362 gui(guiSetAfilter, sh_audio->afilter); |
1363 #endif | 1363 #endif |
1364 return result; | 1364 return result; |
1365 } | 1365 } |
1366 | 1366 |
1367 typedef struct mp_osd_msg mp_osd_msg_t; | 1367 typedef struct mp_osd_msg mp_osd_msg_t; |
2535 mp_msg(MSGT_CPLAYER, MSGL_STATUS, "\n"MSGTR_Paused "\r"); | 2535 mp_msg(MSGT_CPLAYER, MSGL_STATUS, "\n"MSGTR_Paused "\r"); |
2536 mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_PAUSED\n"); | 2536 mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_PAUSED\n"); |
2537 } | 2537 } |
2538 #ifdef CONFIG_GUI | 2538 #ifdef CONFIG_GUI |
2539 if (use_gui) | 2539 if (use_gui) |
2540 guiGetEvent(guiSetState, (void *)GUI_PAUSE); | 2540 gui(guiSetState, (void *)GUI_PAUSE); |
2541 #endif | 2541 #endif |
2542 if (mpctx->video_out && mpctx->sh_video && vo_config_count) | 2542 if (mpctx->video_out && mpctx->sh_video && vo_config_count) |
2543 mpctx->video_out->control(VOCTRL_PAUSE, NULL); | 2543 mpctx->video_out->control(VOCTRL_PAUSE, NULL); |
2544 | 2544 |
2545 if (mpctx->audio_out && mpctx->sh_audio) | 2545 if (mpctx->audio_out && mpctx->sh_audio) |
2555 if (mpctx->sh_video && mpctx->video_out && vo_config_count) | 2555 if (mpctx->sh_video && mpctx->video_out && vo_config_count) |
2556 mpctx->video_out->check_events(); | 2556 mpctx->video_out->check_events(); |
2557 #ifdef CONFIG_GUI | 2557 #ifdef CONFIG_GUI |
2558 if (use_gui) { | 2558 if (use_gui) { |
2559 guiEventHandling(); | 2559 guiEventHandling(); |
2560 guiGetEvent(guiReDraw, NULL); | 2560 gui(guiReDraw, NULL); |
2561 if (guiInfo.Playing != GUI_PAUSE || (rel_seek_secs || abs_seek_pos)) | 2561 if (guiInfo.Playing != GUI_PAUSE || (rel_seek_secs || abs_seek_pos)) |
2562 break; | 2562 break; |
2563 } | 2563 } |
2564 #endif | 2564 #endif |
2565 #ifdef CONFIG_MENU | 2565 #ifdef CONFIG_MENU |
2602 #ifdef CONFIG_GUI | 2602 #ifdef CONFIG_GUI |
2603 if (use_gui) { | 2603 if (use_gui) { |
2604 if (guiInfo.Playing == GUI_STOP) | 2604 if (guiInfo.Playing == GUI_STOP) |
2605 mpctx->eof = 1; | 2605 mpctx->eof = 1; |
2606 else | 2606 else |
2607 guiGetEvent(guiSetState, (void *)GUI_PLAY); | 2607 gui(guiSetState, (void *)GUI_PLAY); |
2608 } | 2608 } |
2609 #endif | 2609 #endif |
2610 } | 2610 } |
2611 | 2611 |
2612 static void edl_loadfile(void) | 2612 static void edl_loadfile(void) |
3049 #endif | 3049 #endif |
3050 | 3050 |
3051 #ifdef CONFIG_GUI | 3051 #ifdef CONFIG_GUI |
3052 if (use_gui) { | 3052 if (use_gui) { |
3053 guiInit(); | 3053 guiInit(); |
3054 guiGetEvent(guiSetContext, mpctx); | 3054 gui(guiSetContext, mpctx); |
3055 guiGetEvent(guiSetState, (void *)(gui_no_filename ? GUI_STOP : GUI_PLAY)); | 3055 gui(guiSetState, (void *)(gui_no_filename ? GUI_STOP : GUI_PLAY)); |
3056 } | 3056 } |
3057 #endif | 3057 #endif |
3058 | 3058 |
3059 // ******************* Now, let's see the per-file stuff ******************** | 3059 // ******************* Now, let's see the per-file stuff ******************** |
3060 | 3060 |
3088 | 3088 |
3089 // =================== GUI idle loop (STOP state) =========================== | 3089 // =================== GUI idle loop (STOP state) =========================== |
3090 #ifdef CONFIG_GUI | 3090 #ifdef CONFIG_GUI |
3091 if (use_gui) { | 3091 if (use_gui) { |
3092 mpctx->file_format = DEMUXER_TYPE_UNKNOWN; | 3092 mpctx->file_format = DEMUXER_TYPE_UNKNOWN; |
3093 guiGetEvent(guiNewFile, 0); | 3093 gui(guiNewFile, 0); |
3094 while (guiInfo.Playing != GUI_PLAY) { | 3094 while (guiInfo.Playing != GUI_PLAY) { |
3095 mp_cmd_t *cmd; | 3095 mp_cmd_t *cmd; |
3096 usec_sleep(20000); | 3096 usec_sleep(20000); |
3097 guiEventHandling(); | 3097 guiEventHandling(); |
3098 guiGetEvent(guiReDraw, NULL); | 3098 gui(guiReDraw, NULL); |
3099 if ((cmd = mp_input_get_cmd(0, 0, 0)) != NULL) { | 3099 if ((cmd = mp_input_get_cmd(0, 0, 0)) != NULL) { |
3100 guiGetEvent(guiRunCommand, (void *)cmd->id); | 3100 gui(guiRunCommand, (void *)cmd->id); |
3101 mp_cmd_free(cmd); | 3101 mp_cmd_free(cmd); |
3102 } | 3102 } |
3103 } | 3103 } |
3104 guiGetEvent(guiPreparation, NULL); | 3104 gui(guiPreparation, NULL); |
3105 if (guiInfo.StreamType == STREAMTYPE_STREAM) { | 3105 if (guiInfo.StreamType == STREAMTYPE_STREAM) { |
3106 play_tree_t *entry = play_tree_new(); | 3106 play_tree_t *entry = play_tree_new(); |
3107 play_tree_add_file(entry, guiInfo.Filename); | 3107 play_tree_add_file(entry, guiInfo.Filename); |
3108 if (mpctx->playtree) | 3108 if (mpctx->playtree) |
3109 play_tree_free_list(mpctx->playtree->child, 1); | 3109 play_tree_free_list(mpctx->playtree->child, 1); |
3242 } | 3242 } |
3243 initialized_flags |= INITIALIZED_STREAM; | 3243 initialized_flags |= INITIALIZED_STREAM; |
3244 | 3244 |
3245 #ifdef CONFIG_GUI | 3245 #ifdef CONFIG_GUI |
3246 if (use_gui) | 3246 if (use_gui) |
3247 guiGetEvent(guiSetStream, mpctx->stream); | 3247 gui(guiSetStream, mpctx->stream); |
3248 #endif | 3248 #endif |
3249 | 3249 |
3250 if (mpctx->file_format == DEMUXER_TYPE_PLAYLIST) { | 3250 if (mpctx->file_format == DEMUXER_TYPE_PLAYLIST) { |
3251 play_tree_t *entry; | 3251 play_tree_t *entry; |
3252 // Handle playlist | 3252 // Handle playlist |
3675 mp_msg(MSGT_CPLAYER, MSGL_INFO, MSGTR_FPSforced, mpctx->sh_video->fps, mpctx->sh_video->frametime); | 3675 mp_msg(MSGT_CPLAYER, MSGL_INFO, MSGTR_FPSforced, mpctx->sh_video->fps, mpctx->sh_video->frametime); |
3676 } | 3676 } |
3677 | 3677 |
3678 #ifdef CONFIG_GUI | 3678 #ifdef CONFIG_GUI |
3679 if (use_gui) { | 3679 if (use_gui) { |
3680 if (!guiGetEvent(guiSetVideo, mpctx->sh_video)) | 3680 if (!gui(guiSetVideo, mpctx->sh_video)) |
3681 goto goto_next_file; | 3681 goto goto_next_file; |
3682 guiGetEvent(guiSetAudio, mpctx->sh_audio); | 3682 gui(guiSetAudio, mpctx->sh_audio); |
3683 } | 3683 } |
3684 #endif | 3684 #endif |
3685 | 3685 |
3686 mp_input_set_section(NULL); | 3686 mp_input_set_section(NULL); |
3687 //TODO: add desired (stream-based) sections here | 3687 //TODO: add desired (stream-based) sections here |
3993 if (mpctx->sh_video) | 3993 if (mpctx->sh_video) |
3994 guiInfo.TimeSec = mpctx->sh_video->pts; | 3994 guiInfo.TimeSec = mpctx->sh_video->pts; |
3995 else if (mpctx->sh_audio) | 3995 else if (mpctx->sh_audio) |
3996 guiInfo.TimeSec = playing_audio_pts(mpctx->sh_audio, mpctx->d_audio, mpctx->audio_out); | 3996 guiInfo.TimeSec = playing_audio_pts(mpctx->sh_audio, mpctx->d_audio, mpctx->audio_out); |
3997 guiInfo.LengthInSec = demuxer_get_time_length(mpctx->demuxer); | 3997 guiInfo.LengthInSec = demuxer_get_time_length(mpctx->demuxer); |
3998 guiGetEvent(guiSetMixer, NULL); | 3998 gui(guiSetMixer, NULL); |
3999 guiGetEvent(guiReDraw, NULL); | 3999 gui(guiReDraw, NULL); |
4000 if (guiInfo.Playing == GUI_STOP) | 4000 if (guiInfo.Playing == GUI_STOP) |
4001 break; // STOP | 4001 break; // STOP |
4002 if (guiInfo.Playing == GUI_PAUSE) | 4002 if (guiInfo.Playing == GUI_PAUSE) |
4003 mpctx->osd_function = OSD_PAUSE; | 4003 mpctx->osd_function = OSD_PAUSE; |
4004 if (guiInfo.DiskChanged || guiInfo.NewPlay) | 4004 if (guiInfo.DiskChanged || guiInfo.NewPlay) |
4101 #ifdef CONFIG_GUI | 4101 #ifdef CONFIG_GUI |
4102 if (use_gui && !mpctx->playtree_iter) { | 4102 if (use_gui && !mpctx->playtree_iter) { |
4103 #ifdef CONFIG_DVDREAD | 4103 #ifdef CONFIG_DVDREAD |
4104 if (!guiInfo.DiskChanged) | 4104 if (!guiInfo.DiskChanged) |
4105 #endif | 4105 #endif |
4106 guiGetEvent(guiEndFile, NULL); | 4106 gui(guiEndFile, NULL); |
4107 } | 4107 } |
4108 #endif | 4108 #endif |
4109 | 4109 |
4110 if ( | 4110 if ( |
4111 #ifdef CONFIG_GUI | 4111 #ifdef CONFIG_GUI |