mirror of
https://github.com/mpv-player/mpv
synced 2025-04-01 23:00:41 +00:00
fix osd volume bar handling in gui
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@1849 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
faa08119a6
commit
9b5e280ea4
@ -435,7 +435,6 @@ void mplMainMouseHandle( int Button,int X,int Y,int RX,int RY )
|
||||
mplMainRender=1;
|
||||
SelectedButton=i;
|
||||
boxMoved=0;
|
||||
if ( ( item->msg == evSetVolume )||( item->msg == evSetBalance ) ) mplShMem->VolumeChanged=1;
|
||||
msButton=itPotmeter;
|
||||
itemtype=itPotmeter;
|
||||
}
|
||||
@ -450,7 +449,6 @@ void mplMainMouseHandle( int Button,int X,int Y,int RX,int RY )
|
||||
mplMainRender=1;
|
||||
SelectedButton=i;
|
||||
boxMoved=0;
|
||||
if ( ( item->msg == evSetVolume )||( item->msg == evSetBalance ) ) mplShMem->VolumeChanged=1;
|
||||
msButton=itHPotmeter;
|
||||
itemtype=itHPotmeter;
|
||||
}
|
||||
@ -478,7 +476,11 @@ void mplMainMouseHandle( int Button,int X,int Y,int RX,int RY )
|
||||
potihandled:
|
||||
if ( item->value > 100.0f ) item->value=100.0f;
|
||||
if ( item->value < 0.0f ) item->value=0.0f;
|
||||
// if ( ( item->msg == evSetVolume )||( item->msg == evSetBalance ) )
|
||||
if ( ( item->msg == evSetVolume )||( item->msg == evSetBalance ) )
|
||||
{
|
||||
mplShMem->VolumeChanged=1;
|
||||
mplShMem->Volume=item->value;
|
||||
}
|
||||
mplMsgHandle( item->msg,item->value );
|
||||
mplMainRender=1; wsPostRedisplay( &appMPlayer.mainWindow );
|
||||
break;
|
||||
@ -500,6 +502,11 @@ potihandled:
|
||||
case itHPotmeter:
|
||||
item->used=0;
|
||||
btnModify( item->msg,(float)( X - item->x ) / item->width * 100.0f );
|
||||
if ( ( item->msg == evSetVolume )||( item->msg == evSetBalance ) )
|
||||
{
|
||||
mplShMem->VolumeChanged=1;
|
||||
mplShMem->Volume=item->value;
|
||||
}
|
||||
value=item->value;
|
||||
break;
|
||||
}
|
||||
|
10
mplayer.c
10
mplayer.c
@ -1792,6 +1792,16 @@ if(rel_seek_secs || abs_seek_pos){
|
||||
// printf("mplShMem->Playing=%d \n",mplShMem->Playing);
|
||||
if(mplShMem->Playing==0) break; // STOP
|
||||
if(mplShMem->Playing==2) osd_function=OSD_PAUSE;
|
||||
#ifdef USE_OSD
|
||||
if ( ( osd_level )&&( mplShMem->VolumeChanged ) )
|
||||
{
|
||||
osd_visible=sh_video->fps; // 1 sec
|
||||
vo_osd_progbar_type=OSD_VOLUME;
|
||||
vo_osd_progbar_value=((mplShMem->Volume )*256.0)/100.0;
|
||||
}
|
||||
#endif
|
||||
mixer_setvolume( mplShMem->Volume,mplShMem->Volume );
|
||||
mplShMem->VolumeChanged=0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user