comparison Gui/mplayer/mw.c @ 22286:a7e5b99ac083

Fix GUI compilation
author uau
date Wed, 21 Feb 2007 19:14:49 +0000
parents ad7747bce52d
children 8c2056711a2a
comparison
equal deleted inserted replaced
22285:5d12a6e96930 22286:a7e5b99ac083
19 19
20 #include "../stream/stream.h" 20 #include "../stream/stream.h"
21 #include "../mixer.h" 21 #include "../mixer.h"
22 #include "../libvo/sub.h" 22 #include "../libvo/sub.h"
23 #include "../mplayer.h" 23 #include "../mplayer.h"
24 #include "../access_mpcontext.h"
24 25
25 #include "../libmpdemux/demuxer.h" 26 #include "../libmpdemux/demuxer.h"
26 #include "../libmpdemux/stheader.h" 27 #include "../libmpdemux/stheader.h"
27 #include "../codec-cfg.h" 28 #include "../codec-cfg.h"
28 #include "../m_option.h" 29 #include "../m_option.h"
30 31
31 #define GUI_REDRAW_WAIT 375 32 #define GUI_REDRAW_WAIT 375
32 33
33 #include "play.h" 34 #include "play.h"
34 #include "widgets.h" 35 #include "widgets.h"
35
36 extern mixer_t mixer; // mixer from mplayer.c
37 36
38 extern unsigned int GetTimerMS( void ); 37 extern unsigned int GetTimerMS( void );
39 38
40 unsigned char * mplDrawBuffer = NULL; 39 unsigned char * mplDrawBuffer = NULL;
41 int mplMainRender = 1; 40 int mplMainRender = 1;
78 static unsigned last_redraw_time = 0; 77 static unsigned last_redraw_time = 0;
79 78
80 void mplEventHandling( int msg,float param ) 79 void mplEventHandling( int msg,float param )
81 { 80 {
82 int iparam = (int)param; 81 int iparam = (int)param;
82 mixer_t *mixer = mpctx_get_mixer(guiIntfStruct.mpcontext);
83 83
84 switch( msg ) 84 switch( msg )
85 { 85 {
86 // --- user events 86 // --- user events
87 case evExit: 87 case evExit:
106 if ( !guiIntfStruct.demuxer || video_id == iparam ) break; 106 if ( !guiIntfStruct.demuxer || video_id == iparam ) break;
107 video_id=iparam; 107 video_id=iparam;
108 goto play; 108 goto play;
109 109
110 case evSetSubtitle: 110 case evSetSubtitle:
111 mp_property_do("sub",M_PROPERTY_SET,&iparam); 111 mp_property_do("sub",M_PROPERTY_SET,&iparam,guiIntfStruct.mpcontext);
112 break; 112 break;
113 113
114 #ifdef HAVE_VCD 114 #ifdef HAVE_VCD
115 case evSetVCDTrack: 115 case evSetVCDTrack:
116 guiIntfStruct.Track=iparam; 116 guiIntfStruct.Track=iparam;
245 case evBackward10sec: mplRelSeek( -10 ); break; 245 case evBackward10sec: mplRelSeek( -10 ); break;
246 case evSetMoviePosition: mplAbsSeek( param ); break; 246 case evSetMoviePosition: mplAbsSeek( param ); break;
247 247
248 case evIncVolume: vo_x11_putkey( wsGrayMul ); break; 248 case evIncVolume: vo_x11_putkey( wsGrayMul ); break;
249 case evDecVolume: vo_x11_putkey( wsGrayDiv ); break; 249 case evDecVolume: vo_x11_putkey( wsGrayDiv ); break;
250 case evMute: mixer_mute( &mixer ); break; 250 case evMute: mixer_mute( mixer ); break;
251 251
252 case evSetVolume: 252 case evSetVolume:
253 guiIntfStruct.Volume=param; 253 guiIntfStruct.Volume=param;
254 goto set_volume; 254 goto set_volume;
255 case evSetBalance: 255 case evSetBalance:
259 float l = guiIntfStruct.Volume * ( ( 100.0 - guiIntfStruct.Balance ) / 50.0 ); 259 float l = guiIntfStruct.Volume * ( ( 100.0 - guiIntfStruct.Balance ) / 50.0 );
260 float r = guiIntfStruct.Volume * ( ( guiIntfStruct.Balance ) / 50.0 ); 260 float r = guiIntfStruct.Volume * ( ( guiIntfStruct.Balance ) / 50.0 );
261 if ( l > guiIntfStruct.Volume ) l=guiIntfStruct.Volume; 261 if ( l > guiIntfStruct.Volume ) l=guiIntfStruct.Volume;
262 if ( r > guiIntfStruct.Volume ) r=guiIntfStruct.Volume; 262 if ( r > guiIntfStruct.Volume ) r=guiIntfStruct.Volume;
263 // printf( "!!! v: %.2f b: %.2f -> %.2f x %.2f\n",guiIntfStruct.Volume,guiIntfStruct.Balance,l,r ); 263 // printf( "!!! v: %.2f b: %.2f -> %.2f x %.2f\n",guiIntfStruct.Volume,guiIntfStruct.Balance,l,r );
264 mixer_setvolume( &mixer,l,r ); 264 mixer_setvolume( mixer,l,r );
265 } 265 }
266 if ( osd_level ) 266 if ( osd_level )
267 { 267 {
268 osd_visible=(GetTimerMS() + 1000) | 1; 268 osd_visible=(GetTimerMS() + 1000) | 1;
269 vo_osd_progbar_type=OSD_VOLUME; 269 vo_osd_progbar_type=OSD_VOLUME;