summaryrefslogtreecommitdiffstats
path: root/Gui/interface.c
diff options
context:
space:
mode:
authorpontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-07-02 13:35:04 +0000
committerpontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-07-02 13:35:04 +0000
commit90dabd0261ce580efb8bfe078eb3717673cea8ea (patch)
treebac8807b73f59c8a5ab12c7efffc9d018f58b96b /Gui/interface.c
parent2677cc6ae2f2d5dda311a1ed5afd17f3f195cd4b (diff)
downloadmpv-90dabd0261ce580efb8bfe078eb3717673cea8ea.tar.bz2
mpv-90dabd0261ce580efb8bfe078eb3717673cea8ea.tar.xz
fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@6620 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'Gui/interface.c')
-rw-r--r--Gui/interface.c35
1 files changed, 33 insertions, 2 deletions
diff --git a/Gui/interface.c b/Gui/interface.c
index 84f6967f38..7e473a59c9 100644
--- a/Gui/interface.c
+++ b/Gui/interface.c
@@ -7,6 +7,7 @@
#include "ws.h"
#include "mplayer/play.h"
#include "interface.h"
+#include "skin/skin.h"
#include "../mplayer.h"
#include "mplayer/widgets.h"
@@ -15,6 +16,7 @@
#include "../libvo/x11_common.h"
#include "../libvo/video_out.h"
#include "../input/input.h"
+#include "../libao2/audio_out.h"
#include <inttypes.h>
#include <sys/types.h>
@@ -65,12 +67,15 @@ typedef struct
int disp_w,disp_h;
} tmp_sh_video_t;
+extern ao_functions_t * audio_out;
+
void guiGetEvent( int type,char * arg )
{
stream_t * stream = (stream_t *) arg;
#ifdef USE_DVDREAD
dvd_priv_t * dvdp = (dvd_priv_t *) arg;
#endif
+
switch ( type )
{
case guiXEvent:
@@ -172,12 +177,38 @@ void guiGetEvent( int type,char * arg )
if ( (unsigned int)arg & guiVCD ) guiIntfStruct.VCDTracks=0;
#endif
break;
+ case guiReDraw:
+// if ( audio_out )
+// {
+// float l,r;
+ // mixer_getvolume( &l,&r );
+// guiIntfStruct.Volume=(r>l?r:l);
+// printf( "!!! guiIntfStruct.Volume: %.2f \n",guiIntfStruct.Volume );
+// }
+ mplEventHandling( evRedraw,0 );
+ break;
+ case guiSetVolume:
+ if ( audio_out )
+ {
+ float l,r;
+ mixer_getvolume( &l,&r );
+ guiIntfStruct.Volume=(r>l?r:l);
+ if ( r != l ) guiIntfStruct.Balance=( ( r - l ) + 100 ) * 0.5f;
+ else guiIntfStruct.Balance=0.0f;
+ btnModify( evSetVolume,guiIntfStruct.Volume );
+ btnModify( evSetBalance,guiIntfStruct.Balance );
+ }
+ break;
}
}
+extern unsigned int GetTimerMS( void );
+extern int mplTimer;
+
void guiEventHandling( void )
{
- if ( ( use_gui && !guiIntfStruct.Playing )||( guiIntfStruct.AudioOnly ) ) wsHandleEvents();
+ if ( !guiIntfStruct.Playing || guiIntfStruct.AudioOnly ) wsHandleEvents();
gtkEventHandling();
- mplTimerHandler(); // handle GUI timer events
+ mplTimer=GetTimerMS() / 20;
+// if ( !( GetTimerMS()%2 ) )
}