comparison gui/interface.c @ 33791:8b0c78a85a8c

Cosmetic: Change parameter names of gui() and mplayer().
author ib
date Tue, 12 Jul 2011 08:59:47 +0000
parents ab6d06f5b98b
children e1bec41397bb
comparison
equal deleted inserted replaced
33790:ab6d06f5b98b 33791:8b0c78a85a8c
347 } 347 }
348 348
349 mp_msg(MSGT_GPLAYER, MSGL_INFO, MSGTR_AddingVideoFilter, str); 349 mp_msg(MSGT_GPLAYER, MSGL_INFO, MSGTR_AddingVideoFilter, str);
350 } 350 }
351 351
352 int gui(int what, void *arg) 352 int gui(int what, void *data)
353 { 353 {
354 mixer_t *mixer = NULL; 354 mixer_t *mixer = NULL;
355 stream_t *stream; 355 stream_t *stream;
356 #ifdef CONFIG_DVDREAD 356 #ifdef CONFIG_DVDREAD
357 dvd_priv_t *dvd; 357 dvd_priv_t *dvd;
361 if (guiInfo.mpcontext) 361 if (guiInfo.mpcontext)
362 mixer = mpctx_get_mixer(guiInfo.mpcontext); 362 mixer = mpctx_get_mixer(guiInfo.mpcontext);
363 363
364 switch (what) { 364 switch (what) {
365 case GUI_SET_CONTEXT: 365 case GUI_SET_CONTEXT:
366 guiInfo.mpcontext = arg; 366 guiInfo.mpcontext = data;
367 break; 367 break;
368 368
369 case GUI_SET_STATE: 369 case GUI_SET_STATE:
370 370
371 switch ((int)arg) { 371 switch ((int)data) {
372 case GUI_STOP: 372 case GUI_STOP:
373 case GUI_PLAY: 373 case GUI_PLAY:
374 // if ( !gtkShowVideoWindow ) wsVisibleWindow( &guiApp.subWindow,wsHideWindow ); 374 // if ( !gtkShowVideoWindow ) wsVisibleWindow( &guiApp.subWindow,wsHideWindow );
375 case GUI_PAUSE: 375 case GUI_PAUSE:
376 guiInfo.Playing = (int)arg; 376 guiInfo.Playing = (int)data;
377 break; 377 break;
378 } 378 }
379 379
380 uiState(); 380 uiState();
381 break; 381 break;
405 gtkEventHandling(); 405 gtkEventHandling();
406 break; 406 break;
407 407
408 case GUI_RUN_COMMAND: 408 case GUI_RUN_COMMAND:
409 409
410 mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[interface] GUI_RUN_COMMAND: %d\n", (int)arg); 410 mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[interface] GUI_RUN_COMMAND: %d\n", (int)data);
411 411
412 switch ((int)arg) { 412 switch ((int)data) {
413 case MP_CMD_VO_FULLSCREEN: 413 case MP_CMD_VO_FULLSCREEN:
414 uiEventHandling(evFullScreen, 0); 414 uiEventHandling(evFullScreen, 0);
415 break; 415 break;
416 416
417 case MP_CMD_PLAY_TREE_STEP: 417 case MP_CMD_PLAY_TREE_STEP:
646 646
647 break; 647 break;
648 648
649 case GUI_SET_STREAM: 649 case GUI_SET_STREAM:
650 650
651 stream = arg; 651 stream = data;
652 guiInfo.StreamType = stream->type; 652 guiInfo.StreamType = stream->type;
653 653
654 switch (guiInfo.StreamType) { 654 switch (guiInfo.StreamType) {
655 #ifdef CONFIG_DVDREAD 655 #ifdef CONFIG_DVDREAD
656 case STREAMTYPE_DVD: 656 case STREAMTYPE_DVD:
681 } 681 }
682 682
683 break; 683 break;
684 684
685 case GUI_SET_AFILTER: 685 case GUI_SET_AFILTER:
686 guiInfo.afilter = arg; 686 guiInfo.afilter = data;
687 break; 687 break;
688 688
689 case GUI_SET_VIDEO: 689 case GUI_SET_VIDEO:
690 690
691 // video 691 // video
692 692
693 guiInfo.sh_video = arg; 693 guiInfo.sh_video = data;
694 694
695 if (guiInfo.StreamType == STREAMTYPE_STREAM) 695 if (guiInfo.StreamType == STREAMTYPE_STREAM)
696 btnSet(evSetMoviePosition, btnDisabled); 696 btnSet(evSetMoviePosition, btnDisabled);
697 else 697 else
698 btnSet(evSetMoviePosition, btnReleased); 698 btnSet(evSetMoviePosition, btnReleased);
706 706
707 break; 707 break;
708 708
709 case GUI_SET_AUDIO: 709 case GUI_SET_AUDIO:
710 710
711 guiInfo.AudioChannels = arg ? ((sh_audio_t *)arg)->channels : 0; 711 guiInfo.AudioChannels = data ? ((sh_audio_t *)data)->channels : 0;
712 712
713 if (arg && !guiInfo.sh_video) 713 if (data && !guiInfo.sh_video)
714 guiInfo.MovieWindow = False; 714 guiInfo.MovieWindow = False;
715 715
716 gui(GUI_SET_MIXER, 0); 716 gui(GUI_SET_MIXER, 0);
717 717
718 if (gtkEnableAudioEqualizer) { 718 if (gtkEnableAudioEqualizer) {
773 773
774 WinID = guiApp.subWindow.WindowID; 774 WinID = guiApp.subWindow.WindowID;
775 break; 775 break;
776 776
777 case GUI_HANDLE_X_EVENT: 777 case GUI_HANDLE_X_EVENT:
778 wsEvents(wsDisplay, arg); 778 wsEvents(wsDisplay, data);
779 gtkEventHandling(); 779 gtkEventHandling();
780 break; 780 break;
781 781
782 case GUI_END_FILE: 782 case GUI_END_FILE:
783 783
925 return result; 925 return result;
926 } 926 }
927 927
928 /* GUI -> MPlayer */ 928 /* GUI -> MPlayer */
929 929
930 void mplayer(int what, float fparam, void *vparam) 930 void mplayer(int what, float value, void *data)
931 { 931 {
932 equalizer_t *eq = (equalizer_t *)vparam; 932 equalizer_t *eq = (equalizer_t *)data;
933 933
934 switch (what) { 934 switch (what) {
935 // subtitle 935 // subtitle
936 936
937 #ifndef CONFIG_FREETYPE 937 #ifndef CONFIG_FREETYPE
938 case MPLAYER_SET_FONT_FACTOR: 938 case MPLAYER_SET_FONT_FACTOR:
939 font_factor = fparam; 939 font_factor = value;
940 mplayerLoadFont(); 940 mplayerLoadFont();
941 break; 941 break;
942 #else 942 #else
943 case MPLAYER_SET_FONT_OUTLINE: 943 case MPLAYER_SET_FONT_OUTLINE:
944 subtitle_font_thickness = (8.0f / 100.0f) * fparam; 944 subtitle_font_thickness = (8.0f / 100.0f) * value;
945 mplayerLoadFont(); 945 mplayerLoadFont();
946 break; 946 break;
947 947
948 case MPLAYER_SET_FONT_BLUR: 948 case MPLAYER_SET_FONT_BLUR:
949 subtitle_font_radius = (8.0f / 100.0f) * fparam; 949 subtitle_font_radius = (8.0f / 100.0f) * value;
950 mplayerLoadFont(); 950 mplayerLoadFont();
951 break; 951 break;
952 952
953 case MPLAYER_SET_FONT_TEXTSCALE: 953 case MPLAYER_SET_FONT_TEXTSCALE:
954 text_font_scale_factor = fparam; 954 text_font_scale_factor = value;
955 mplayerLoadFont(); 955 mplayerLoadFont();
956 break; 956 break;
957 957
958 case MPLAYER_SET_FONT_OSDSCALE: 958 case MPLAYER_SET_FONT_OSDSCALE:
959 osd_font_scale_factor = fparam; 959 osd_font_scale_factor = value;
960 mplayerLoadFont(); 960 mplayerLoadFont();
961 break; 961 break;
962 962
963 case MPLAYER_SET_FONT_ENCODING: 963 case MPLAYER_SET_FONT_ENCODING:
964 nfree(subtitle_font_encoding); 964 nfree(subtitle_font_encoding);
965 subtitle_font_encoding = gstrdup((char *)vparam); 965 subtitle_font_encoding = gstrdup((char *)data);
966 mplayerLoadFont(); 966 mplayerLoadFont();
967 break; 967 break;
968 968
969 case MPLAYER_SET_FONT_AUTOSCALE: 969 case MPLAYER_SET_FONT_AUTOSCALE:
970 subtitle_autoscale = (int)fparam; 970 subtitle_autoscale = (int)value;
971 mplayerLoadFont(); 971 mplayerLoadFont();
972 break; 972 break;
973 #endif 973 #endif
974 974
975 #ifdef CONFIG_ICONV 975 #ifdef CONFIG_ICONV
976 case MPLAYER_SET_SUB_ENCODING: 976 case MPLAYER_SET_SUB_ENCODING:
977 nfree(sub_cp); 977 nfree(sub_cp);
978 sub_cp = gstrdup((char *)vparam); 978 sub_cp = gstrdup((char *)data);
979 break; 979 break;
980 #endif 980 #endif
981 981
982 case MPLAYER_SET_EXTRA_STEREO: 982 case MPLAYER_SET_EXTRA_STEREO:
983 gtkAOExtraStereoMul = fparam; 983 gtkAOExtraStereoMul = value;
984 if (guiInfo.afilter) 984 if (guiInfo.afilter)
985 af_control_any_rev(guiInfo.afilter, AF_CONTROL_ES_MUL | AF_CONTROL_SET, &gtkAOExtraStereoMul); 985 af_control_any_rev(guiInfo.afilter, AF_CONTROL_ES_MUL | AF_CONTROL_SET, &gtkAOExtraStereoMul);
986 break; 986 break;
987 987
988 case MPLAYER_SET_PANSCAN: 988 case MPLAYER_SET_PANSCAN:
990 mp_cmd_t *mp_cmd; 990 mp_cmd_t *mp_cmd;
991 991
992 mp_cmd = calloc(1, sizeof(*mp_cmd)); 992 mp_cmd = calloc(1, sizeof(*mp_cmd));
993 mp_cmd->id = MP_CMD_PANSCAN; 993 mp_cmd->id = MP_CMD_PANSCAN;
994 mp_cmd->name = strdup("panscan"); 994 mp_cmd->name = strdup("panscan");
995 mp_cmd->args[0].v.f = fparam; 995 mp_cmd->args[0].v.f = value;
996 mp_cmd->args[1].v.i = 1; 996 mp_cmd->args[1].v.i = 1;
997 mp_input_queue_cmd(mp_cmd); 997 mp_input_queue_cmd(mp_cmd);
998 } 998 }
999 break; 999 break;
1000 1000
1001 case MPLAYER_SET_AUTO_QUALITY: 1001 case MPLAYER_SET_AUTO_QUALITY:
1002 auto_quality = (int)fparam; 1002 auto_quality = (int)value;
1003 break; 1003 break;
1004 1004
1005 // set equalizers 1005 // set equalizers
1006 1006
1007 case MPLAYER_SET_CONTRAST: 1007 case MPLAYER_SET_CONTRAST:
1008 if (guiInfo.sh_video) 1008 if (guiInfo.sh_video)
1009 set_video_colors(guiInfo.sh_video, "contrast", (int)fparam); 1009 set_video_colors(guiInfo.sh_video, "contrast", (int)value);
1010 break; 1010 break;
1011 1011
1012 case MPLAYER_SET_BRIGHTNESS: 1012 case MPLAYER_SET_BRIGHTNESS:
1013 if (guiInfo.sh_video) 1013 if (guiInfo.sh_video)
1014 set_video_colors(guiInfo.sh_video, "brightness", (int)fparam); 1014 set_video_colors(guiInfo.sh_video, "brightness", (int)value);
1015 break; 1015 break;
1016 1016
1017 case MPLAYER_SET_HUE: 1017 case MPLAYER_SET_HUE:
1018 if (guiInfo.sh_video) 1018 if (guiInfo.sh_video)
1019 set_video_colors(guiInfo.sh_video, "hue", (int)fparam); 1019 set_video_colors(guiInfo.sh_video, "hue", (int)value);
1020 break; 1020 break;
1021 1021
1022 case MPLAYER_SET_SATURATION: 1022 case MPLAYER_SET_SATURATION:
1023 if (guiInfo.sh_video) 1023 if (guiInfo.sh_video)
1024 set_video_colors(guiInfo.sh_video, "saturation", (int)fparam); 1024 set_video_colors(guiInfo.sh_video, "saturation", (int)value);
1025 break; 1025 break;
1026 1026
1027 case MPLAYER_SET_EQUALIZER: 1027 case MPLAYER_SET_EQUALIZER:
1028 { 1028 {
1029 af_control_ext_t tmp; 1029 af_control_ext_t tmp;
1051 1051
1052 break; 1052 break;
1053 } 1053 }
1054 1054
1055 case MPLAYER_EXIT_GUI: 1055 case MPLAYER_EXIT_GUI:
1056 exit_player_with_rc((enum exit_reason)fparam, (enum exit_reason)fparam >= EXIT_ERROR); 1056 exit_player_with_rc((enum exit_reason)value, (enum exit_reason)value >= EXIT_ERROR);
1057 break; 1057 break;
1058 } 1058 }
1059 } 1059 }
1060 1060
1061 void mplayerLoadFont(void) 1061 void mplayerLoadFont(void)