Mercurial > mplayer.hg
changeset 6311:da2dda48b7ec
add mute support ( step 1 ) and fixed panscan bugs (1000l for me)
author | pontscho |
---|---|
date | Thu, 06 Jun 2002 07:13:57 +0000 |
parents | eda1e909a3bf |
children | c5fa750dde23 |
files | Gui/mplayer/gtk/menu.c Gui/mplayer/mw.h input/input.c input/input.h libvo/mga_common.c libvo/vo_xmga.c libvo/vo_xv.c libvo/vo_xvidix.c mixer.c mixer.h mplayer.c |
diffstat | 11 files changed, 38 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/Gui/mplayer/gtk/menu.c Thu Jun 06 01:45:39 2002 +0000 +++ b/Gui/mplayer/gtk/menu.c Thu Jun 06 07:13:57 2002 +0000 @@ -380,6 +380,7 @@ } #endif AddSeparator( Menu ); + AddMenuItem( Menu,"Mute", evMute ); AddMenuItem( Menu,MSGTR_MENU_PlayList, evPlayList ); AddMenuItem( Menu,MSGTR_MENU_SkinBrowser, evSkinBrowser ); AddMenuItem( Menu,MSGTR_MENU_Preferences, evPreferences );
--- a/Gui/mplayer/mw.h Thu Jun 06 01:45:39 2002 +0000 +++ b/Gui/mplayer/mw.h Thu Jun 06 07:13:57 2002 +0000 @@ -2,6 +2,7 @@ // main window #include "../../libmpdemux/stream.h" +#include "../../mixer.h" unsigned char * mplDrawBuffer = NULL; int mplMainRender = 1; @@ -99,6 +100,7 @@ case 'l': if ( guiIntfStruct.Playing == 1 ) strcat( trbuf,"p" ); break; case 'e': if ( guiIntfStruct.Playing == 2 ) strcat( trbuf,"e" ); break; case 'a': +// if ( guiIntfStruct.Mute ) { strcat( trbuf,"n" ); break; } switch ( guiIntfStruct.AudioType ) { case 0: strcat( trbuf,"n" ); break; @@ -373,7 +375,7 @@ case evIncVolume: vo_x11_putkey( wsGrayMul ); break; case evDecVolume: vo_x11_putkey( wsGrayDiv ); break; - case evMute: guiIntfStruct.Mute=1; break; + case evMute: mixer_mute(); guiIntfStruct.Mute=muted; break; case evSetVolume: case evSetBalance: guiIntfStruct.VolumeChanged=1; break;
--- a/input/input.c Thu Jun 06 01:45:39 2002 +0000 +++ b/input/input.c Thu Jun 06 07:13:57 2002 +0000 @@ -52,6 +52,7 @@ { MP_CMD_OSD, "osd",0, { {MP_CMD_ARG_INT,{-1}}, {-1,{0}} } }, { MP_CMD_VOLUME, "volume", 1, { { MP_CMD_ARG_INT,{0} }, {-1,{0}} } }, { MP_CMD_MIXER_USEMASTER, "use_master", 0, { {-1,{0}} } }, + { MP_CMD_MUTE, "mute", 0, { {-1,{0}} } }, { MP_CMD_CONTRAST, "contrast",1, { {MP_CMD_ARG_INT,{0}}, {MP_CMD_ARG_INT,{0}}, {-1,{0}} } }, { MP_CMD_BRIGHTNESS, "brightness",1, { {MP_CMD_ARG_INT,{0}}, {MP_CMD_ARG_INT,{0}}, {-1,{0}} } }, { MP_CMD_HUE, "hue",1, { {MP_CMD_ARG_INT,{0}}, {MP_CMD_ARG_INT,{0}}, {-1,{0}} } }, @@ -205,6 +206,7 @@ { { '/', 0 }, "volume -1" }, { { '0', 0 }, "volume 1" }, { { '*', 0 }, "volume 1" }, + { { 'm', 0 }, "mute" }, { { '1', 0 }, "contrast -1" }, { { '2', 0 }, "contrast 1" }, { { '3', 0 }, "brightness -1" }, @@ -220,7 +222,7 @@ { { 'h', 0 }, "tv_step_channel 1" }, { { 'k', 0 }, "tv_step_channel -1" }, { { 'n', 0 }, "tv_step_norm" }, - { { 'm', 0 }, "tv_step_chanlist" }, + { { 'u', 0 }, "tv_step_chanlist" }, #endif #ifdef HAVE_NEW_GUI { { 'l', 0 }, "gui_loadfile" },
--- a/input/input.h Thu Jun 06 01:45:39 2002 +0000 +++ b/input/input.h Thu Jun 06 07:13:57 2002 +0000 @@ -27,6 +27,7 @@ #define MP_CMD_DVDNAV 22 #define MP_CMD_SCREENSHOT 23 #define MP_CMD_PANSCAN 24 +#define MP_CMD_MUTE 25 #define MP_CMD_GUI_EVENTS 5000 #define MP_CMD_GUI_LOADFILE 5001
--- a/libvo/mga_common.c Thu Jun 06 01:45:39 2002 +0000 +++ b/libvo/mga_common.c Thu Jun 06 07:13:57 2002 +0000 @@ -282,6 +282,7 @@ #endif #ifdef VO_XMGA case VOCTRL_GET_PANSCAN: + if ( !inited || !vo_fs ) return VO_FALSE; return VO_TRUE; case VOCTRL_SET_PANSCAN: if ( vo_fs && ( vo_panscan != vo_panscan_amount ) )
--- a/libvo/vo_xmga.c Thu Jun 06 01:45:39 2002 +0000 +++ b/libvo/vo_xmga.c Thu Jun 06 07:13:57 2002 +0000 @@ -90,6 +90,8 @@ static XSetWindowAttributes xWAttribs; +static int inited=0; + #define VO_XMGA #include "mga_common.c" #undef VO_XMGA @@ -201,8 +203,6 @@ vo_mga_flip_page(); } -static int inited=0; - static uint32_t config( uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t flags, char *title, uint32_t format,const vo_tune_info_t* info) { char * mTitle=(title == NULL) ? "XMGA render" : title; @@ -340,7 +340,7 @@ XSync( mDisplay,False ); saver_off(mDisplay); - + return 0; }
--- a/libvo/vo_xv.c Thu Jun 06 01:45:39 2002 +0000 +++ b/libvo/vo_xv.c Thu Jun 06 07:13:57 2002 +0000 @@ -859,10 +859,9 @@ case VOCTRL_GUISUPPORT: return VO_TRUE; case VOCTRL_GET_PANSCAN: + if ( !vo_config_count || !vo_fs ) return VO_FALSE; return VO_TRUE; case VOCTRL_SET_PANSCAN: - -// if((vo_fs && (vo_panscan != vo_panscan_amount)) || (!vo_fs && vo_panscan_amount)) if ( vo_fs && ( vo_panscan != vo_panscan_amount ) ) { panscan_calc();
--- a/libvo/vo_xvidix.c Thu Jun 06 01:45:39 2002 +0000 +++ b/libvo/vo_xvidix.c Thu Jun 06 07:13:57 2002 +0000 @@ -370,6 +370,8 @@ XSync(mDisplay, False); saver_off(mDisplay); /* turning off screen saver */ + + vo_config_count++; return(0); } @@ -430,6 +432,7 @@ static void uninit(void) { + if ( vo_config_count ) return; vidix_term(); saver_on(mDisplay); /* screen saver back on */ @@ -464,6 +467,7 @@ vo_x11_fullscreen(); return VO_TRUE; case VOCTRL_GET_PANSCAN: + if ( !vo_config_count || !vo_fs ) return VO_FALSE; return VO_TRUE; case VOCTRL_SET_PANSCAN: if ( vo_fs && ( vo_panscan != vo_panscan_amount ) )
--- a/mixer.c Thu Jun 06 01:45:39 2002 +0000 +++ b/mixer.c Thu Jun 06 07:13:57 2002 +0000 @@ -13,6 +13,10 @@ char * mixer_device=NULL; +int muted = 0; +float mute_l = 0.0f; +float mute_r = 0.0f; + void mixer_getvolume( float *l,float *r ) { ao_control_vol_t vol; @@ -33,6 +37,7 @@ if(CONTROL_OK != audio_out->control(AOCONTROL_SET_VOLUME,(int)&vol)) return; } + muted=0; } #define MIXER_CHANGE 3 @@ -66,7 +71,16 @@ return ( mixer_l + mixer_r ) / 2; } +void mixer_mute( void ) +{ + if ( muted ) mixer_setvolume( mute_l,mute_r ); + else + { + mixer_getvolume( &mute_l,&mute_r ); + mixer_setvolume( 0,0 ); + muted=1; + } +} -
--- a/mixer.h Thu Jun 06 01:45:39 2002 +0000 +++ b/mixer.h Thu Jun 06 07:13:57 2002 +0000 @@ -3,12 +3,14 @@ #define __MPLAYER_MIXER extern char * mixer_device; +extern int muted; extern void mixer_getvolume( float *l,float *r ); extern void mixer_setvolume( float l,float r ); extern void mixer_incvolume( void ); extern void mixer_decvolume( void ); extern float mixer_getbothvolume( void ); +void mixer_mute( void ); //extern void mixer_setbothvolume( int v ); #define mixer_setbothvolume( v ) mixer_setvolume( v,v )
--- a/mplayer.c Thu Jun 06 01:45:39 2002 +0000 +++ b/mplayer.c Thu Jun 06 07:13:57 2002 +0000 @@ -2404,6 +2404,9 @@ } #endif } break; + case MP_CMD_MUTE: { + mixer_mute(); + } case MP_CMD_MIXER_USEMASTER : { } break; case MP_CMD_CONTRAST : { @@ -2545,6 +2548,7 @@ if(video_out && vo_config_count) video_out->control(VOCTRL_FULLSCREEN, 0); } break; case MP_CMD_PANSCAN : { + if ( !video_out ) break; if ( video_out->control( VOCTRL_GET_PANSCAN,NULL ) == VO_TRUE ) { int abs= cmd->args[1].v.i;