annotate Gui/mplayer/mw.c @ 22907:8c2056711a2a

Remove useless #includes.
author diego
date Fri, 06 Apr 2007 21:01:08 +0000
parents a7e5b99ac083
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
1
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
2 // main window
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
3
8055
79ddb7291765 not needed
pontscho
parents: 8048
diff changeset
4 #include <stdlib.h>
79ddb7291765 not needed
pontscho
parents: 8048
diff changeset
5 #include <stdio.h>
79ddb7291765 not needed
pontscho
parents: 8048
diff changeset
6 #include <inttypes.h>
79ddb7291765 not needed
pontscho
parents: 8048
diff changeset
7 #include <sys/stat.h>
79ddb7291765 not needed
pontscho
parents: 8048
diff changeset
8 #include <unistd.h>
79ddb7291765 not needed
pontscho
parents: 8048
diff changeset
9
17144
0e1471d9da74 Unify include paths, -I.. is in CFLAGS.
diego
parents: 17087
diff changeset
10 #include "app.h"
0e1471d9da74 Unify include paths, -I.. is in CFLAGS.
diego
parents: 17087
diff changeset
11 #include "skin/font.h"
0e1471d9da74 Unify include paths, -I.. is in CFLAGS.
diego
parents: 17087
diff changeset
12 #include "skin/skin.h"
0e1471d9da74 Unify include paths, -I.. is in CFLAGS.
diego
parents: 17087
diff changeset
13 #include "wm/ws.h"
8055
79ddb7291765 not needed
pontscho
parents: 8048
diff changeset
14
17144
0e1471d9da74 Unify include paths, -I.. is in CFLAGS.
diego
parents: 17087
diff changeset
15 #include "../config.h"
0e1471d9da74 Unify include paths, -I.. is in CFLAGS.
diego
parents: 17087
diff changeset
16 #include "../help_mp.h"
0e1471d9da74 Unify include paths, -I.. is in CFLAGS.
diego
parents: 17087
diff changeset
17 #include "../libvo/x11_common.h"
0e1471d9da74 Unify include paths, -I.. is in CFLAGS.
diego
parents: 17087
diff changeset
18 #include "../libvo/fastmemcpy.h"
8055
79ddb7291765 not needed
pontscho
parents: 8048
diff changeset
19
19271
64d82a45a05d introduce new 'stream' directory for all stream layer related components and split them from libmpdemux
ben
parents: 19104
diff changeset
20 #include "../stream/stream.h"
17144
0e1471d9da74 Unify include paths, -I.. is in CFLAGS.
diego
parents: 17087
diff changeset
21 #include "../mixer.h"
0e1471d9da74 Unify include paths, -I.. is in CFLAGS.
diego
parents: 17087
diff changeset
22 #include "../libvo/sub.h"
22286
a7e5b99ac083 Fix GUI compilation
uau
parents: 21161
diff changeset
23 #include "../access_mpcontext.h"
2447
3248aabc6d1d add vcd,dvd,etcsymbol handling
pontscho
parents: 2045
diff changeset
24
17144
0e1471d9da74 Unify include paths, -I.. is in CFLAGS.
diego
parents: 17087
diff changeset
25 #include "../libmpdemux/demuxer.h"
0e1471d9da74 Unify include paths, -I.. is in CFLAGS.
diego
parents: 17087
diff changeset
26 #include "../libmpdemux/stheader.h"
0e1471d9da74 Unify include paths, -I.. is in CFLAGS.
diego
parents: 17087
diff changeset
27 #include "../codec-cfg.h"
18185
34cc93e9848f simpler and better subtitles switching, patch by Stanislav Maslovski <stanislav P maslovski A gmail P com>
gpoirier
parents: 18118
diff changeset
28 #include "../m_option.h"
34cc93e9848f simpler and better subtitles switching, patch by Stanislav Maslovski <stanislav P maslovski A gmail P com>
gpoirier
parents: 18118
diff changeset
29 #include "../m_property.h"
8305
4c23944315d6 - add R¸«ädiger Kuhlmann's <mplayer-list-UGa6JdjLujS2@ruediger-kuhlmann.de> patch
pontscho
parents: 8302
diff changeset
30
13672
d80a81d6e2d8 Limit Gui redraw rate.
reimar
parents: 12691
diff changeset
31 #define GUI_REDRAW_WAIT 375
8305
4c23944315d6 - add R¸«ädiger Kuhlmann's <mplayer-list-UGa6JdjLujS2@ruediger-kuhlmann.de> patch
pontscho
parents: 8302
diff changeset
32
8055
79ddb7291765 not needed
pontscho
parents: 8048
diff changeset
33 #include "play.h"
79ddb7291765 not needed
pontscho
parents: 8048
diff changeset
34 #include "widgets.h"
79ddb7291765 not needed
pontscho
parents: 8048
diff changeset
35
8043
e5dda05f9aab cleanup
pontscho
parents: 8039
diff changeset
36 extern unsigned int GetTimerMS( void );
e5dda05f9aab cleanup
pontscho
parents: 8039
diff changeset
37
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
38 unsigned char * mplDrawBuffer = NULL;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
39 int mplMainRender = 1;
2940
1902b7ff9cdc middle menu is working
pontscho
parents: 2902
diff changeset
40
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
41 int mplMainAutoPlay = 0;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
42 int mplMiddleMenu = 0;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
43
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
44 int mainVisible = 1;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
45
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
46 int boxMoved = 0;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
47 int sx = 0,sy = 0;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
48 int i,pot = 0;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
49
8973
0a665389cf2b - add playbar
pontscho
parents: 8933
diff changeset
50 #include "common.h"
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
51
8058
9246adcf95f0 cosmetic
pontscho
parents: 8055
diff changeset
52 void mplMainDraw( void )
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
53 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
54
6043
421781c5b128 fix some small bug and -rootwin
pontscho
parents: 5919
diff changeset
55 if ( appMPlayer.mainWindow.State == wsWindowClosed ) exit_player( MSGTR_Exit_quit );
421781c5b128 fix some small bug and -rootwin
pontscho
parents: 5919
diff changeset
56
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
57 if ( appMPlayer.mainWindow.Visible == wsWindowNotVisible ||
1729
d6c99f70449e fix hprogressbar
pontscho
parents: 1723
diff changeset
58 !mainVisible ) return;
d6c99f70449e fix hprogressbar
pontscho
parents: 1723
diff changeset
59 // !appMPlayer.mainWindow.Mapped ) return;
d6c99f70449e fix hprogressbar
pontscho
parents: 1723
diff changeset
60
6794
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6755
diff changeset
61 if ( mplMainRender && appMPlayer.mainWindow.State == wsWindowExpose )
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
62 {
8973
0a665389cf2b - add playbar
pontscho
parents: 8933
diff changeset
63 btnModify( evSetMoviePosition,guiIntfStruct.Position );
0a665389cf2b - add playbar
pontscho
parents: 8933
diff changeset
64 btnModify( evSetVolume,guiIntfStruct.Volume );
0a665389cf2b - add playbar
pontscho
parents: 8933
diff changeset
65
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
66 memcpy( mplDrawBuffer,appMPlayer.main.Bitmap.Image,appMPlayer.main.Bitmap.ImageSize );
8973
0a665389cf2b - add playbar
pontscho
parents: 8933
diff changeset
67 Render( &appMPlayer.mainWindow,appMPlayer.Items,appMPlayer.NumberOfItems,mplDrawBuffer,appMPlayer.main.Bitmap.ImageSize );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
68 mplMainRender=0;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
69 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
70 wsPutImage( &appMPlayer.mainWindow );
2854
fd44ecf77f8d move bug meg fileload bug fixed asszem.
pontscho
parents: 2851
diff changeset
71 // XFlush( wsDisplay );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
72 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
73
19104
2ec2301183cd marks several read-only string parameters which aren't modified inside the called function as const. Patch by Stefan Huehner, stefan AT huehner-org
reynaldo
parents: 18976
diff changeset
74 extern void exit_player(const char* how);
6280
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
75 extern int vcd_track;
13672
d80a81d6e2d8 Limit Gui redraw rate.
reimar
parents: 12691
diff changeset
76 static unsigned last_redraw_time = 0;
1729
d6c99f70449e fix hprogressbar
pontscho
parents: 1723
diff changeset
77
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
78 void mplEventHandling( int msg,float param )
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
79 {
8423
c6a1a5b6ba25 - fix three submenu bug
pontscho
parents: 8380
diff changeset
80 int iparam = (int)param;
22286
a7e5b99ac083 Fix GUI compilation
uau
parents: 21161
diff changeset
81 mixer_t *mixer = mpctx_get_mixer(guiIntfStruct.mpcontext);
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
82
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
83 switch( msg )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
84 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
85 // --- user events
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
86 case evExit:
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
87 exit_player( "Exit" );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
88 break;
2994
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
89
6298
d42cb911d7f7 add network streaming support for gui
pontscho
parents: 6280
diff changeset
90 case evPlayNetwork:
9040
2a0619fd84f0 - add new entry's to hungarian skin howto (please Gabu translate)
pontscho
parents: 8975
diff changeset
91 gfree( (void **)&guiIntfStruct.Subtitlename );
2a0619fd84f0 - add new entry's to hungarian skin howto (please Gabu translate)
pontscho
parents: 8975
diff changeset
92 gfree( (void **)&guiIntfStruct.AudioFile );
6298
d42cb911d7f7 add network streaming support for gui
pontscho
parents: 6280
diff changeset
93 guiIntfStruct.StreamType=STREAMTYPE_STREAM;
d42cb911d7f7 add network streaming support for gui
pontscho
parents: 6280
diff changeset
94 goto play;
d42cb911d7f7 add network streaming support for gui
pontscho
parents: 6280
diff changeset
95 case evSetURL:
d42cb911d7f7 add network streaming support for gui
pontscho
parents: 6280
diff changeset
96 gtkShow( evPlayNetwork,NULL );
d42cb911d7f7 add network streaming support for gui
pontscho
parents: 6280
diff changeset
97 break;
8312
ef8c992672f4 - audio track handling in menu (idea from R¸«ädiger Kuhlmann)
pontscho
parents: 8305
diff changeset
98
ef8c992672f4 - audio track handling in menu (idea from R¸«ädiger Kuhlmann)
pontscho
parents: 8305
diff changeset
99 case evSetAudio:
8423
c6a1a5b6ba25 - fix three submenu bug
pontscho
parents: 8380
diff changeset
100 if ( !guiIntfStruct.demuxer || audio_id == iparam ) break;
c6a1a5b6ba25 - fix three submenu bug
pontscho
parents: 8380
diff changeset
101 audio_id=iparam;
8484
9ea5f18a7957 - fix (?) "mixer bug"
pontscho
parents: 8481
diff changeset
102 goto play;
8380
743fa83d9e2d need this
pontscho
parents: 8312
diff changeset
103
743fa83d9e2d need this
pontscho
parents: 8312
diff changeset
104 case evSetVideo:
8423
c6a1a5b6ba25 - fix three submenu bug
pontscho
parents: 8380
diff changeset
105 if ( !guiIntfStruct.demuxer || video_id == iparam ) break;
c6a1a5b6ba25 - fix three submenu bug
pontscho
parents: 8380
diff changeset
106 video_id=iparam;
8484
9ea5f18a7957 - fix (?) "mixer bug"
pontscho
parents: 8481
diff changeset
107 goto play;
8380
743fa83d9e2d need this
pontscho
parents: 8312
diff changeset
108
18118
f9a939c204ad Adds "cheap" subtitle switching for non-DVD playouts (for ex. OGG or MKV).
gpoirier
parents: 17254
diff changeset
109 case evSetSubtitle:
22286
a7e5b99ac083 Fix GUI compilation
uau
parents: 21161
diff changeset
110 mp_property_do("sub",M_PROPERTY_SET,&iparam,guiIntfStruct.mpcontext);
18185
34cc93e9848f simpler and better subtitles switching, patch by Stanislav Maslovski <stanislav P maslovski A gmail P com>
gpoirier
parents: 18118
diff changeset
111 break;
18118
f9a939c204ad Adds "cheap" subtitle switching for non-DVD playouts (for ex. OGG or MKV).
gpoirier
parents: 17254
diff changeset
112
6280
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
113 #ifdef HAVE_VCD
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
114 case evSetVCDTrack:
8423
c6a1a5b6ba25 - fix three submenu bug
pontscho
parents: 8380
diff changeset
115 guiIntfStruct.Track=iparam;
6280
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
116 case evPlayVCD:
7009
98bed9e12087 - add dxr3 gui support (dialogbox, etc.)
pontscho
parents: 6996
diff changeset
117 gtkSet( gtkClearStruct,0,(void *)guiALL );
6280
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
118 guiIntfStruct.StreamType=STREAMTYPE_VCD;
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
119 goto play;
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
120 #endif
3054
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
121 #ifdef USE_DVDREAD
2994
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
122 case evPlayDVD:
5665
3e7f39c4110c fix dvd playing under gui
pontscho
parents: 5651
diff changeset
123 guiIntfStruct.DVD.current_title=1;
3e7f39c4110c fix dvd playing under gui
pontscho
parents: 5651
diff changeset
124 guiIntfStruct.DVD.current_chapter=1;
3e7f39c4110c fix dvd playing under gui
pontscho
parents: 5651
diff changeset
125 guiIntfStruct.DVD.current_angle=1;
3618
772729dd7b40 better dvd support
pontscho
parents: 3597
diff changeset
126 play_dvd_2:
7009
98bed9e12087 - add dxr3 gui support (dialogbox, etc.)
pontscho
parents: 6996
diff changeset
127 gtkSet( gtkClearStruct,0,(void *)(guiALL - guiDVD) );
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
128 guiIntfStruct.StreamType=STREAMTYPE_DVD;
8423
c6a1a5b6ba25 - fix three submenu bug
pontscho
parents: 8380
diff changeset
129 goto play;
3054
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
130 #endif
2994
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
131 case evPlay:
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
132 case evPlaySwitchToPause:
6280
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
133 play:
6713
cc917a581b6e add simple playlist support
pontscho
parents: 6651
diff changeset
134
6794
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6755
diff changeset
135 if ( ( msg == evPlaySwitchToPause )&&( guiIntfStruct.Playing == 2 ) ) goto NoPause;
3618
772729dd7b40 better dvd support
pontscho
parents: 3597
diff changeset
136
6905
e32d3d0d8998 - fix playlist2dvd bug
pontscho
parents: 6903
diff changeset
137 if ( gtkSet( gtkGetCurrPlItem,0,NULL ) &&( guiIntfStruct.StreamType == STREAMTYPE_FILE ) )
6713
cc917a581b6e add simple playlist support
pontscho
parents: 6651
diff changeset
138 {
cc917a581b6e add simple playlist support
pontscho
parents: 6651
diff changeset
139 plItem * next = gtkSet( gtkGetCurrPlItem,0,NULL );
cc917a581b6e add simple playlist support
pontscho
parents: 6651
diff changeset
140 plLastPlayed=next;
8423
c6a1a5b6ba25 - fix three submenu bug
pontscho
parents: 8380
diff changeset
141 mplSetFileName( next->path,next->name,STREAMTYPE_FILE );
6713
cc917a581b6e add simple playlist support
pontscho
parents: 6651
diff changeset
142 }
cc917a581b6e add simple playlist support
pontscho
parents: 6651
diff changeset
143
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
144 switch ( guiIntfStruct.StreamType )
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
145 {
6298
d42cb911d7f7 add network streaming support for gui
pontscho
parents: 6280
diff changeset
146 case STREAMTYPE_STREAM:
6280
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
147 case STREAMTYPE_FILE:
7009
98bed9e12087 - add dxr3 gui support (dialogbox, etc.)
pontscho
parents: 6996
diff changeset
148 gtkSet( gtkClearStruct,0,(void *)(guiALL - guiFilenames) );
6280
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
149 break;
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
150 #ifdef HAVE_VCD
2995
f294650ae03b mondom fixed
pontscho
parents: 2994
diff changeset
151 case STREAMTYPE_VCD:
7009
98bed9e12087 - add dxr3 gui support (dialogbox, etc.)
pontscho
parents: 6996
diff changeset
152 gtkSet( gtkClearStruct,0,(void *)(guiALL - guiVCD - guiFilenames) );
8933
bfe1b826cff1 add DVD and CDRom device entry's, and fix two 10l bug
pontscho
parents: 8883
diff changeset
153 if ( !cdrom_device ) cdrom_device=gstrdup( DEFAULT_CDROM_DEVICE );
7009
98bed9e12087 - add dxr3 gui support (dialogbox, etc.)
pontscho
parents: 6996
diff changeset
154 mplSetFileName( NULL,cdrom_device,STREAMTYPE_VCD );
6280
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
155 if ( guiIntfStruct.Playing != 2 )
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
156 {
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
157 if ( !guiIntfStruct.Track )
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
158 {
8423
c6a1a5b6ba25 - fix three submenu bug
pontscho
parents: 8380
diff changeset
159 if ( guiIntfStruct.VCDTracks > 1 ) guiIntfStruct.Track=2;
c6a1a5b6ba25 - fix three submenu bug
pontscho
parents: 8380
diff changeset
160 else guiIntfStruct.Track=1;
6280
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
161 }
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
162 guiIntfStruct.DiskChanged=1;
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
163 }
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
164 break;
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
165 #endif
3054
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
166 #ifdef USE_DVDREAD
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
167 case STREAMTYPE_DVD:
7009
98bed9e12087 - add dxr3 gui support (dialogbox, etc.)
pontscho
parents: 6996
diff changeset
168 gtkSet( gtkClearStruct,0,(void *)(guiALL - guiDVD - guiFilenames) );
8933
bfe1b826cff1 add DVD and CDRom device entry's, and fix two 10l bug
pontscho
parents: 8883
diff changeset
169 if ( !dvd_device ) dvd_device=gstrdup( DEFAULT_DVD_DEVICE );
7009
98bed9e12087 - add dxr3 gui support (dialogbox, etc.)
pontscho
parents: 6996
diff changeset
170 mplSetFileName( NULL,dvd_device,STREAMTYPE_DVD );
5667
fd0a2f189e80 fix dvd pause. 10l
pontscho
parents: 5665
diff changeset
171 if ( guiIntfStruct.Playing != 2 )
fd0a2f189e80 fix dvd pause. 10l
pontscho
parents: 5665
diff changeset
172 {
8423
c6a1a5b6ba25 - fix three submenu bug
pontscho
parents: 8380
diff changeset
173 guiIntfStruct.Title=guiIntfStruct.DVD.current_title;
c6a1a5b6ba25 - fix three submenu bug
pontscho
parents: 8380
diff changeset
174 guiIntfStruct.Chapter=guiIntfStruct.DVD.current_chapter;
c6a1a5b6ba25 - fix three submenu bug
pontscho
parents: 8380
diff changeset
175 guiIntfStruct.Angle=guiIntfStruct.DVD.current_angle;
6280
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
176 guiIntfStruct.DiskChanged=1;
5667
fd0a2f189e80 fix dvd pause. 10l
pontscho
parents: 5665
diff changeset
177 }
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
178 break;
3054
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
179 #endif
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
180 }
8423
c6a1a5b6ba25 - fix three submenu bug
pontscho
parents: 8380
diff changeset
181 guiIntfStruct.NewPlay=1;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
182 mplPlay();
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
183 break;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
184 #ifdef USE_DVDREAD
3597
fe1283137353 init title change basz.
pontscho
parents: 3499
diff changeset
185 case evSetDVDSubtitle:
8423
c6a1a5b6ba25 - fix three submenu bug
pontscho
parents: 8380
diff changeset
186 dvdsub_id=iparam;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
187 goto play_dvd_2;
3597
fe1283137353 init title change basz.
pontscho
parents: 3499
diff changeset
188 break;
fe1283137353 init title change basz.
pontscho
parents: 3499
diff changeset
189 case evSetDVDAudio:
8423
c6a1a5b6ba25 - fix three submenu bug
pontscho
parents: 8380
diff changeset
190 audio_id=iparam;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
191 goto play_dvd_2;
3597
fe1283137353 init title change basz.
pontscho
parents: 3499
diff changeset
192 break;
fe1283137353 init title change basz.
pontscho
parents: 3499
diff changeset
193 case evSetDVDChapter:
8423
c6a1a5b6ba25 - fix three submenu bug
pontscho
parents: 8380
diff changeset
194 guiIntfStruct.DVD.current_chapter=iparam;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
195 goto play_dvd_2;
3597
fe1283137353 init title change basz.
pontscho
parents: 3499
diff changeset
196 break;
fe1283137353 init title change basz.
pontscho
parents: 3499
diff changeset
197 case evSetDVDTitle:
8423
c6a1a5b6ba25 - fix three submenu bug
pontscho
parents: 8380
diff changeset
198 guiIntfStruct.DVD.current_title=iparam;
5665
3e7f39c4110c fix dvd playing under gui
pontscho
parents: 5651
diff changeset
199 guiIntfStruct.DVD.current_chapter=1;
3e7f39c4110c fix dvd playing under gui
pontscho
parents: 5651
diff changeset
200 guiIntfStruct.DVD.current_angle=1;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
201 goto play_dvd_2;
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
202 break;
3618
772729dd7b40 better dvd support
pontscho
parents: 3597
diff changeset
203 #endif
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
204
2994
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
205 case evPause:
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
206 case evPauseSwitchToPlay:
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
207 NoPause:
4963
13262bd21965 small changes
pontscho
parents: 4950
diff changeset
208 mplPause();
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
209 break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
210
8423
c6a1a5b6ba25 - fix three submenu bug
pontscho
parents: 8380
diff changeset
211 case evStop:
c6a1a5b6ba25 - fix three submenu bug
pontscho
parents: 8380
diff changeset
212 guiIntfStruct.Playing=guiSetStop;
c6a1a5b6ba25 - fix three submenu bug
pontscho
parents: 8380
diff changeset
213 mplState();
c6a1a5b6ba25 - fix three submenu bug
pontscho
parents: 8380
diff changeset
214 guiIntfStruct.NoWindow=False;
c6a1a5b6ba25 - fix three submenu bug
pontscho
parents: 8380
diff changeset
215 break;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
216
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
217 case evLoadPlay:
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
218 mplMainAutoPlay=1;
6280
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
219 // guiIntfStruct.StreamType=STREAMTYPE_FILE;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
220 case evLoad:
6713
cc917a581b6e add simple playlist support
pontscho
parents: 6651
diff changeset
221 gtkSet( gtkDelPl,0,NULL );
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
222 gtkShow( evLoad,NULL );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
223 break;
6794
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6755
diff changeset
224 case evLoadSubtitle: gtkShow( evLoadSubtitle,NULL ); break;
7169
35bab6be713b add subtitle dropping support
pontscho
parents: 7150
diff changeset
225 case evDropSubtitle:
35bab6be713b add subtitle dropping support
pontscho
parents: 7150
diff changeset
226 gfree( (void **)&guiIntfStruct.Subtitlename );
35bab6be713b add subtitle dropping support
pontscho
parents: 7150
diff changeset
227 guiLoadSubtitle( NULL );
35bab6be713b add subtitle dropping support
pontscho
parents: 7150
diff changeset
228 break;
6794
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6755
diff changeset
229 case evLoadAudioFile: gtkShow( evLoadAudioFile,NULL ); break;
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6755
diff changeset
230 case evPrev: mplPrev(); break;
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6755
diff changeset
231 case evNext: mplNext(); break;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
232
6713
cc917a581b6e add simple playlist support
pontscho
parents: 6651
diff changeset
233 case evPlayList: gtkShow( evPlayList,NULL ); break;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
234 case evSkinBrowser: gtkShow( evSkinBrowser,skinName ); break;
6713
cc917a581b6e add simple playlist support
pontscho
parents: 6651
diff changeset
235 case evAbout: gtkShow( evAbout,NULL ); break;
cc917a581b6e add simple playlist support
pontscho
parents: 6651
diff changeset
236 case evPreferences: gtkShow( evPreferences,NULL ); break;
cc917a581b6e add simple playlist support
pontscho
parents: 6651
diff changeset
237 case evEqualizer: gtkShow( evEqualizer,NULL ); break;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
238
8720
5546fe9dfa06 add fwd/bck 10 min
pontscho
parents: 8484
diff changeset
239 case evForward10min: mplRelSeek( 600 ); break;
5546fe9dfa06 add fwd/bck 10 min
pontscho
parents: 8484
diff changeset
240 case evBackward10min: mplRelSeek( -600 );break;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
241 case evForward1min: mplRelSeek( 60 ); break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
242 case evBackward1min: mplRelSeek( -60 ); break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
243 case evForward10sec: mplRelSeek( 10 ); break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
244 case evBackward10sec: mplRelSeek( -10 ); break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
245 case evSetMoviePosition: mplAbsSeek( param ); break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
246
1860
c65abbc91c5c fix mwm bug's. faszom (C), and remove mixer.*
pontscho
parents: 1848
diff changeset
247 case evIncVolume: vo_x11_putkey( wsGrayMul ); break;
c65abbc91c5c fix mwm bug's. faszom (C), and remove mixer.*
pontscho
parents: 1848
diff changeset
248 case evDecVolume: vo_x11_putkey( wsGrayDiv ); break;
22286
a7e5b99ac083 Fix GUI compilation
uau
parents: 21161
diff changeset
249 case evMute: mixer_mute( mixer ); break;
6619
f554e7271587 fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents: 6546
diff changeset
250
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
251 case evSetVolume:
6619
f554e7271587 fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents: 6546
diff changeset
252 guiIntfStruct.Volume=param;
f554e7271587 fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents: 6546
diff changeset
253 goto set_volume;
f554e7271587 fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents: 6546
diff changeset
254 case evSetBalance:
f554e7271587 fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents: 6546
diff changeset
255 guiIntfStruct.Balance=param;
f554e7271587 fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents: 6546
diff changeset
256 set_volume:
f554e7271587 fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents: 6546
diff changeset
257 {
f554e7271587 fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents: 6546
diff changeset
258 float l = guiIntfStruct.Volume * ( ( 100.0 - guiIntfStruct.Balance ) / 50.0 );
f554e7271587 fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents: 6546
diff changeset
259 float r = guiIntfStruct.Volume * ( ( guiIntfStruct.Balance ) / 50.0 );
f554e7271587 fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents: 6546
diff changeset
260 if ( l > guiIntfStruct.Volume ) l=guiIntfStruct.Volume;
f554e7271587 fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents: 6546
diff changeset
261 if ( r > guiIntfStruct.Volume ) r=guiIntfStruct.Volume;
f554e7271587 fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents: 6546
diff changeset
262 // printf( "!!! v: %.2f b: %.2f -> %.2f x %.2f\n",guiIntfStruct.Volume,guiIntfStruct.Balance,l,r );
22286
a7e5b99ac083 Fix GUI compilation
uau
parents: 21161
diff changeset
263 mixer_setvolume( mixer,l,r );
6619
f554e7271587 fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents: 6546
diff changeset
264 }
f554e7271587 fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents: 6546
diff changeset
265 if ( osd_level )
f554e7271587 fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents: 6546
diff changeset
266 {
18287
292337d09af2 Remove updating of vo_mouse_timer_const from the main loop and also
uau
parents: 18185
diff changeset
267 osd_visible=(GetTimerMS() + 1000) | 1;
6619
f554e7271587 fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents: 6546
diff changeset
268 vo_osd_progbar_type=OSD_VOLUME;
f554e7271587 fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents: 6546
diff changeset
269 vo_osd_progbar_value=( ( guiIntfStruct.Volume ) * 256.0 ) / 100.0;
f554e7271587 fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents: 6546
diff changeset
270 vo_osd_changed( OSDTYPE_PROGBAR );
f554e7271587 fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents: 6546
diff changeset
271 }
f554e7271587 fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents: 6546
diff changeset
272 break;
1847
773ae4ba43f5 add voluechanged
pontscho
parents: 1845
diff changeset
273
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
274
2994
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
275 case evIconify:
8423
c6a1a5b6ba25 - fix three submenu bug
pontscho
parents: 8380
diff changeset
276 switch ( iparam )
2994
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
277 {
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
278 case 0: wsIconify( appMPlayer.mainWindow ); break;
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
279 case 1: wsIconify( appMPlayer.subWindow ); break;
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
280 }
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
281 break;
14589
9635dcba8f29 Add half size entry to the GMPlayer menu.
diego
parents: 14156
diff changeset
282 case evHalfSize:
9635dcba8f29 Add half size entry to the GMPlayer menu.
diego
parents: 14156
diff changeset
283 btnSet( evFullScreen,btnReleased );
9635dcba8f29 Add half size entry to the GMPlayer menu.
diego
parents: 14156
diff changeset
284 if ( guiIntfStruct.Playing )
9635dcba8f29 Add half size entry to the GMPlayer menu.
diego
parents: 14156
diff changeset
285 {
9635dcba8f29 Add half size entry to the GMPlayer menu.
diego
parents: 14156
diff changeset
286 if ( appMPlayer.subWindow.isFullScreen )
9635dcba8f29 Add half size entry to the GMPlayer menu.
diego
parents: 14156
diff changeset
287 {
9635dcba8f29 Add half size entry to the GMPlayer menu.
diego
parents: 14156
diff changeset
288 mplFullScreen();
9635dcba8f29 Add half size entry to the GMPlayer menu.
diego
parents: 14156
diff changeset
289 }
9635dcba8f29 Add half size entry to the GMPlayer menu.
diego
parents: 14156
diff changeset
290 wsResizeWindow( &appMPlayer.subWindow, guiIntfStruct.MovieWidth / 2, guiIntfStruct.MovieHeight / 2 );
9635dcba8f29 Add half size entry to the GMPlayer menu.
diego
parents: 14156
diff changeset
291 wsMoveWindow( &appMPlayer.subWindow, 0,
9635dcba8f29 Add half size entry to the GMPlayer menu.
diego
parents: 14156
diff changeset
292 ( wsMaxX - guiIntfStruct.MovieWidth/2 )/2 + wsOrgX,
9635dcba8f29 Add half size entry to the GMPlayer menu.
diego
parents: 14156
diff changeset
293 ( wsMaxY - guiIntfStruct.MovieHeight/2 )/2 + wsOrgY );
9635dcba8f29 Add half size entry to the GMPlayer menu.
diego
parents: 14156
diff changeset
294 }
9635dcba8f29 Add half size entry to the GMPlayer menu.
diego
parents: 14156
diff changeset
295 break;
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
296 case evDoubleSize:
9202
c2f31ca14a92 - rewrite Jan Spitalnik's patch
pontscho
parents: 9040
diff changeset
297 btnSet( evFullScreen,btnReleased );
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
298 if ( guiIntfStruct.Playing )
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
299 {
14006
62aeba62685c Restore normal/double size GUI functionality ( broken since EWMH fs support ).
al
parents: 13672
diff changeset
300 if ( appMPlayer.subWindow.isFullScreen )
62aeba62685c Restore normal/double size GUI functionality ( broken since EWMH fs support ).
al
parents: 13672
diff changeset
301 {
62aeba62685c Restore normal/double size GUI functionality ( broken since EWMH fs support ).
al
parents: 13672
diff changeset
302 mplFullScreen();
62aeba62685c Restore normal/double size GUI functionality ( broken since EWMH fs support ).
al
parents: 13672
diff changeset
303 }
62aeba62685c Restore normal/double size GUI functionality ( broken since EWMH fs support ).
al
parents: 13672
diff changeset
304 wsResizeWindow( &appMPlayer.subWindow, guiIntfStruct.MovieWidth * 2, guiIntfStruct.MovieHeight * 2 );
62aeba62685c Restore normal/double size GUI functionality ( broken since EWMH fs support ).
al
parents: 13672
diff changeset
305 wsMoveWindow( &appMPlayer.subWindow, 0,
62aeba62685c Restore normal/double size GUI functionality ( broken since EWMH fs support ).
al
parents: 13672
diff changeset
306 ( wsMaxX - guiIntfStruct.MovieWidth*2 )/2 + wsOrgX,
62aeba62685c Restore normal/double size GUI functionality ( broken since EWMH fs support ).
al
parents: 13672
diff changeset
307 ( wsMaxY - guiIntfStruct.MovieHeight*2 )/2 + wsOrgY );
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
308 }
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
309 break;
6623
7bc4c6ba9485 add -audiofile support for gui
pontscho
parents: 6619
diff changeset
310 case evNormalSize:
9202
c2f31ca14a92 - rewrite Jan Spitalnik's patch
pontscho
parents: 9040
diff changeset
311 btnSet( evFullScreen,btnReleased );
6623
7bc4c6ba9485 add -audiofile support for gui
pontscho
parents: 6619
diff changeset
312 if ( guiIntfStruct.Playing )
7bc4c6ba9485 add -audiofile support for gui
pontscho
parents: 6619
diff changeset
313 {
14006
62aeba62685c Restore normal/double size GUI functionality ( broken since EWMH fs support ).
al
parents: 13672
diff changeset
314 if ( appMPlayer.subWindow.isFullScreen )
62aeba62685c Restore normal/double size GUI functionality ( broken since EWMH fs support ).
al
parents: 13672
diff changeset
315 {
62aeba62685c Restore normal/double size GUI functionality ( broken since EWMH fs support ).
al
parents: 13672
diff changeset
316 mplFullScreen();
62aeba62685c Restore normal/double size GUI functionality ( broken since EWMH fs support ).
al
parents: 13672
diff changeset
317 }
62aeba62685c Restore normal/double size GUI functionality ( broken since EWMH fs support ).
al
parents: 13672
diff changeset
318 wsResizeWindow( &appMPlayer.subWindow, guiIntfStruct.MovieWidth, guiIntfStruct.MovieHeight );
62aeba62685c Restore normal/double size GUI functionality ( broken since EWMH fs support ).
al
parents: 13672
diff changeset
319 wsMoveWindow( &appMPlayer.subWindow, 0,
62aeba62685c Restore normal/double size GUI functionality ( broken since EWMH fs support ).
al
parents: 13672
diff changeset
320 ( wsMaxX - guiIntfStruct.MovieWidth )/2 + wsOrgX,
62aeba62685c Restore normal/double size GUI functionality ( broken since EWMH fs support ).
al
parents: 13672
diff changeset
321 ( wsMaxY - guiIntfStruct.MovieHeight )/2 + wsOrgY );
6623
7bc4c6ba9485 add -audiofile support for gui
pontscho
parents: 6619
diff changeset
322 break;
7bc4c6ba9485 add -audiofile support for gui
pontscho
parents: 6619
diff changeset
323 } else if ( !appMPlayer.subWindow.isFullScreen ) break;
2994
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
324 case evFullScreen:
9202
c2f31ca14a92 - rewrite Jan Spitalnik's patch
pontscho
parents: 9040
diff changeset
325 if ( !guiIntfStruct.Playing && !gtkShowVideoWindow ) break;
4981
bfc652fc7f43 rewrite fullscreen support in some libvo driver
pontscho
parents: 4979
diff changeset
326 mplFullScreen();
9202
c2f31ca14a92 - rewrite Jan Spitalnik's patch
pontscho
parents: 9040
diff changeset
327 if ( appMPlayer.subWindow.isFullScreen ) btnSet( evFullScreen,btnPressed );
c2f31ca14a92 - rewrite Jan Spitalnik's patch
pontscho
parents: 9040
diff changeset
328 else btnSet( evFullScreen,btnReleased );
2994
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
329 break;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
330
7541
f51e76c3882e add aspect changing support
pontscho
parents: 7169
diff changeset
331 case evSetAspect:
8423
c6a1a5b6ba25 - fix three submenu bug
pontscho
parents: 8380
diff changeset
332 switch ( iparam )
7541
f51e76c3882e add aspect changing support
pontscho
parents: 7169
diff changeset
333 {
f51e76c3882e add aspect changing support
pontscho
parents: 7169
diff changeset
334 case 2: movie_aspect=16.0f / 9.0f; break;
f51e76c3882e add aspect changing support
pontscho
parents: 7169
diff changeset
335 case 3: movie_aspect=4.0f / 3.0f; break;
f51e76c3882e add aspect changing support
pontscho
parents: 7169
diff changeset
336 case 4: movie_aspect=2.35; break;
f51e76c3882e add aspect changing support
pontscho
parents: 7169
diff changeset
337 case 1:
f51e76c3882e add aspect changing support
pontscho
parents: 7169
diff changeset
338 default: movie_aspect=-1;
f51e76c3882e add aspect changing support
pontscho
parents: 7169
diff changeset
339 }
f51e76c3882e add aspect changing support
pontscho
parents: 7169
diff changeset
340 wsClearWindow( appMPlayer.subWindow );
8039
pontscho
parents: 7751
diff changeset
341 #ifdef USE_DVDREAD
8423
c6a1a5b6ba25 - fix three submenu bug
pontscho
parents: 8380
diff changeset
342 if ( guiIntfStruct.StreamType == STREAMTYPE_DVD || guiIntfStruct.StreamType == STREAMTYPE_VCD ) goto play_dvd_2;
8039
pontscho
parents: 7751
diff changeset
343 else
pontscho
parents: 7751
diff changeset
344 #endif
8423
c6a1a5b6ba25 - fix three submenu bug
pontscho
parents: 8380
diff changeset
345 guiIntfStruct.NewPlay=1;
7541
f51e76c3882e add aspect changing support
pontscho
parents: 7169
diff changeset
346 break;
f51e76c3882e add aspect changing support
pontscho
parents: 7169
diff changeset
347
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
348 // --- timer events
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
349 case evRedraw:
13672
d80a81d6e2d8 Limit Gui redraw rate.
reimar
parents: 12691
diff changeset
350 {
d80a81d6e2d8 Limit Gui redraw rate.
reimar
parents: 12691
diff changeset
351 unsigned now = GetTimerMS();
d80a81d6e2d8 Limit Gui redraw rate.
reimar
parents: 12691
diff changeset
352 extern int mplPBFade;
d80a81d6e2d8 Limit Gui redraw rate.
reimar
parents: 12691
diff changeset
353 if ((now > last_redraw_time) &&
d80a81d6e2d8 Limit Gui redraw rate.
reimar
parents: 12691
diff changeset
354 (now < last_redraw_time + GUI_REDRAW_WAIT) &&
d80a81d6e2d8 Limit Gui redraw rate.
reimar
parents: 12691
diff changeset
355 !mplPBFade)
d80a81d6e2d8 Limit Gui redraw rate.
reimar
parents: 12691
diff changeset
356 break;
d80a81d6e2d8 Limit Gui redraw rate.
reimar
parents: 12691
diff changeset
357 last_redraw_time = now;
d80a81d6e2d8 Limit Gui redraw rate.
reimar
parents: 12691
diff changeset
358 }
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
359 mplMainRender=1;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
360 wsPostRedisplay( &appMPlayer.mainWindow );
8973
0a665389cf2b - add playbar
pontscho
parents: 8933
diff changeset
361 wsPostRedisplay( &appMPlayer.barWindow );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
362 break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
363 // --- system events
6218
8cfddba867b4 fix text render chrash ...
pontscho
parents: 6183
diff changeset
364 #ifdef MP_DEBUG
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
365 case evNone:
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
366 mp_msg( MSGT_GPLAYER,MSGL_STATUS,"[mw] event none received.\n" );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
367 break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
368 default:
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
369 mp_msg( MSGT_GPLAYER,MSGL_STATUS,"[mw] unknown event received ( %d,%.2f ).\n",msg,param );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
370 break;
6218
8cfddba867b4 fix text render chrash ...
pontscho
parents: 6183
diff changeset
371 #endif
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
372 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
373 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
374
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
375 #define itPLMButton (itNULL - 1)
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
376 #define itPRMButton (itNULL - 2)
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
377
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
378 void mplMainMouseHandle( int Button,int X,int Y,int RX,int RY )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
379 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
380 static int itemtype = 0;
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
381 int i;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
382 wItem * item = NULL;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
383 float value = 0.0f;
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
384
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
385 static int SelectedItem = -1;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
386 int currentselected = -1;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
387
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
388 for ( i=0;i < appMPlayer.NumberOfItems + 1;i++ )
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
389 if ( ( appMPlayer.Items[i].pressed != btnDisabled )&&
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
390 ( wgIsRect( X,Y,appMPlayer.Items[i].x,appMPlayer.Items[i].y,appMPlayer.Items[i].x+appMPlayer.Items[i].width,appMPlayer.Items[i].y+appMPlayer.Items[i].height ) ) )
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
391 { currentselected=i; break; }
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
392
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
393 switch ( Button )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
394 {
6651
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6627
diff changeset
395 case wsPMMouseButton:
6755
a31b9f15cbff - fix audio equalizer
pontscho
parents: 6713
diff changeset
396 gtkShow( evHidePopUpMenu,NULL );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
397 mplShowMenu( RX,RY );
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
398 itemtype=itPRMButton;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
399 break;
6651
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6627
diff changeset
400 case wsRMMouseButton:
5919
60cf2bca993f some bug fix
pontscho
parents: 5689
diff changeset
401 mplHideMenu( RX,RY,0 );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
402 break;
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
403
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
404 case wsPLMouseButton:
6755
a31b9f15cbff - fix audio equalizer
pontscho
parents: 6713
diff changeset
405 gtkShow( evHidePopUpMenu,NULL );
8973
0a665389cf2b - add playbar
pontscho
parents: 8933
diff changeset
406 sx=X; sy=Y; boxMoved=1; itemtype=itPLMButton;
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
407 SelectedItem=currentselected;
8973
0a665389cf2b - add playbar
pontscho
parents: 8933
diff changeset
408 if ( SelectedItem == -1 ) break;
0a665389cf2b - add playbar
pontscho
parents: 8933
diff changeset
409 boxMoved=0;
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
410 item=&appMPlayer.Items[SelectedItem];
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
411 itemtype=item->type;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
412 item->pressed=btnPressed;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
413 switch( item->type )
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
414 {
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
415 case itButton:
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
416 if ( ( SelectedItem > -1 ) &&
8973
0a665389cf2b - add playbar
pontscho
parents: 8933
diff changeset
417 ( ( ( item->msg == evPlaySwitchToPause && item->msg == evPauseSwitchToPlay ) ) ||
0a665389cf2b - add playbar
pontscho
parents: 8933
diff changeset
418 ( ( item->msg == evPauseSwitchToPlay && item->msg == evPlaySwitchToPause ) ) ) )
0a665389cf2b - add playbar
pontscho
parents: 8933
diff changeset
419 { item->pressed=btnDisabled; }
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
420 break;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
421 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
422 break;
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
423 case wsRLMouseButton:
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
424 boxMoved=0;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
425 item=&appMPlayer.Items[SelectedItem];
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
426 item->pressed=btnReleased;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
427 SelectedItem=-1;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
428 if ( currentselected == - 1 ) { itemtype=0; break; }
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
429 value=0;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
430 switch( itemtype )
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
431 {
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
432 case itPotmeter:
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
433 case itHPotmeter:
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
434 btnModify( item->msg,(float)( X - item->x ) / item->width * 100.0f );
6619
f554e7271587 fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents: 6546
diff changeset
435 mplEventHandling( item->msg,item->value );
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
436 value=item->value;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
437 break;
17254
0e152834911a vpotmeter fix, scroll in the correct direction
ods15
parents: 17144
diff changeset
438 case itVPotmeter:
0e152834911a vpotmeter fix, scroll in the correct direction
ods15
parents: 17144
diff changeset
439 btnModify( item->msg, ( 1. - (float)( Y - item->y ) / item->height) * 100.0f );
0e152834911a vpotmeter fix, scroll in the correct direction
ods15
parents: 17144
diff changeset
440 mplEventHandling( item->msg,item->value );
0e152834911a vpotmeter fix, scroll in the correct direction
ods15
parents: 17144
diff changeset
441 value=item->value;
0e152834911a vpotmeter fix, scroll in the correct direction
ods15
parents: 17144
diff changeset
442 break;
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
443 }
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
444 mplEventHandling( item->msg,value );
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
445 itemtype=0;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
446 break;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
447
17087
4a56f15dee5f Fix popup menu problems: GTK cannot get a grab while the button is down,
reimar
parents: 14589
diff changeset
448 case wsRRMouseButton:
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
449 gtkShow( evShowPopUpMenu,NULL );
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
450 break;
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
451
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
452 // --- rolled mouse ... de szar :)))
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
453 case wsP5MouseButton: value=-2.5f; goto rollerhandled;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
454 case wsP4MouseButton: value= 2.5f;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
455 rollerhandled:
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
456 item=&appMPlayer.Items[currentselected];
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
457 if ( ( item->type == itHPotmeter )||( item->type == itVPotmeter )||( item->type == itPotmeter ) )
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
458 {
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
459 item->value+=value;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
460 btnModify( item->msg,item->value );
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
461 mplEventHandling( item->msg,item->value );
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
462 }
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
463 break;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
464
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
465 // --- moving
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
466 case wsMoveMouse:
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
467 item=&appMPlayer.Items[SelectedItem];
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
468 switch ( itemtype )
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
469 {
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
470 case itPLMButton:
2854
fd44ecf77f8d move bug meg fileload bug fixed asszem.
pontscho
parents: 2851
diff changeset
471 wsMoveWindow( &appMPlayer.mainWindow,False,RX - abs( sx ),RY - abs( sy ) );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
472 mplMainRender=0;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
473 break;
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
474 case itPRMButton:
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
475 mplMenuMouseHandle( X,Y,RX,RY );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
476 break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
477 case itPotmeter:
1729
d6c99f70449e fix hprogressbar
pontscho
parents: 1723
diff changeset
478 item->value=(float)( X - item->x ) / item->width * 100.0f;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
479 goto potihandled;
8973
0a665389cf2b - add playbar
pontscho
parents: 8933
diff changeset
480 case itVPotmeter:
17254
0e152834911a vpotmeter fix, scroll in the correct direction
ods15
parents: 17144
diff changeset
481 item->value=(1. - (float)( Y - item->y ) / item->height) * 100.0f;
8973
0a665389cf2b - add playbar
pontscho
parents: 8933
diff changeset
482 goto potihandled;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
483 case itHPotmeter:
1729
d6c99f70449e fix hprogressbar
pontscho
parents: 1723
diff changeset
484 item->value=(float)( X - item->x ) / item->width * 100.0f;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
485 potihandled:
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
486 if ( item->value > 100.0f ) item->value=100.0f;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
487 if ( item->value < 0.0f ) item->value=0.0f;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
488 mplEventHandling( item->msg,item->value );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
489 break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
490 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
491 break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
492 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
493 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
494
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
495 int keyPressed = 0;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
496
6183
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
497 void mplMainKeyHandle( int KeyCode,int Type,int Key )
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
498 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
499 int msg = evNone;
4950
307a94037c5c bazmeg a playtree - t
pontscho
parents: 4858
diff changeset
500
4409
61e53100353e add XF86 multimedia key cucc.
pontscho
parents: 4061
diff changeset
501 if ( Type != wsKeyPressed ) return;
6183
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
502
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
503 if ( !Key )
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
504 {
6183
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
505 switch ( KeyCode )
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
506 {
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
507 case wsXFMMPrev: msg=evPrev; break;
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
508 case wsXFMMStop: msg=evStop; break;
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
509 case wsXFMMPlay: msg=evPlaySwitchToPause; break;
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
510 case wsXFMMNext: msg=evNext; break;
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
511 case wsXFMMVolUp: msg=evIncVolume; break;
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
512 case wsXFMMVolDown: msg=evDecVolume; break;
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
513 case wsXFMMMute: msg=evMute; break;
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
514 }
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
515 }
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
516 else
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
517 {
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
518 switch ( Key )
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
519 {
8302
c7fa49f1de0a no exit on fulscreen if you press esc
pontscho
parents: 8300
diff changeset
520 case wsEnter: msg=evPlay; break;
6183
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
521 case wsXF86LowerVolume: msg=evDecVolume; break;
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
522 case wsXF86RaiseVolume: msg=evIncVolume; break;
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
523 case wsXF86Mute: msg=evMute; break;
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
524 case wsXF86Play: msg=evPlaySwitchToPause; break;
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
525 case wsXF86Stop: msg=evStop; break;
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
526 case wsXF86Prev: msg=evPrev; break;
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
527 case wsXF86Next: msg=evNext; break;
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
528 case wsXF86Media: msg=evLoad; break;
8973
0a665389cf2b - add playbar
pontscho
parents: 8933
diff changeset
529 case wsEscape:
8302
c7fa49f1de0a no exit on fulscreen if you press esc
pontscho
parents: 8300
diff changeset
530 if ( appMPlayer.subWindow.isFullScreen )
c7fa49f1de0a no exit on fulscreen if you press esc
pontscho
parents: 8300
diff changeset
531 {
8973
0a665389cf2b - add playbar
pontscho
parents: 8933
diff changeset
532 if ( guiIntfStruct.event_struct ) ((XEvent *)guiIntfStruct.event_struct)->type=None;
8302
c7fa49f1de0a no exit on fulscreen if you press esc
pontscho
parents: 8300
diff changeset
533 mplEventHandling( evNormalSize,0 );
8973
0a665389cf2b - add playbar
pontscho
parents: 8933
diff changeset
534 return;
8302
c7fa49f1de0a no exit on fulscreen if you press esc
pontscho
parents: 8300
diff changeset
535 }
6183
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
536 default: vo_x11_putkey( Key ); return;
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
537 }
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
538 }
4858
65730cea02e7 add half new input support for gui
pontscho
parents: 4818
diff changeset
539 if ( msg != evNone ) mplEventHandling( msg,0 );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
540 }
6967
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
541
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
542 /* this will be used to handle Drag&Drop files */
7092
8e9607c5897e - warning fixes from Dominik Mierzejewski <dominik@rangers.eu.org>
pontscho
parents: 7009
diff changeset
543 void mplDandDHandler(int num,char** files)
6967
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
544 {
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
545 struct stat buf;
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
546 int f = 0;
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
547
8481
e4736a12c898 applied Gregory's patch
pontscho
parents: 8423
diff changeset
548 char* subtitles = NULL;
e4736a12c898 applied Gregory's patch
pontscho
parents: 8423
diff changeset
549 char* filename = NULL;
e4736a12c898 applied Gregory's patch
pontscho
parents: 8423
diff changeset
550
6967
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
551 if (num <= 0)
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
552 return;
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
553
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
554
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
555 /* now fill it with new items */
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
556 for(f=0; f < num; f++){
6977
7242f1840f8d kde3 dnd fix from Gregory Kovriga and file name handling fix in dnd callback
pontscho
parents: 6967
diff changeset
557 char* str = strdup( files[f] );
6967
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
558 plItem* item;
6977
7242f1840f8d kde3 dnd fix from Gregory Kovriga and file name handling fix in dnd callback
pontscho
parents: 6967
diff changeset
559
6996
163f78ece9c2 add uri2filename converter
pontscho
parents: 6977
diff changeset
560 #ifdef USE_ICONV
6977
7242f1840f8d kde3 dnd fix from Gregory Kovriga and file name handling fix in dnd callback
pontscho
parents: 6967
diff changeset
561 if ( strchr( str,'%' ) )
7242f1840f8d kde3 dnd fix from Gregory Kovriga and file name handling fix in dnd callback
pontscho
parents: 6967
diff changeset
562 {
6996
163f78ece9c2 add uri2filename converter
pontscho
parents: 6977
diff changeset
563 char * tmp=gconvert_uri_to_filename( str );
163f78ece9c2 add uri2filename converter
pontscho
parents: 6977
diff changeset
564 free( str ); str=tmp;
6977
7242f1840f8d kde3 dnd fix from Gregory Kovriga and file name handling fix in dnd callback
pontscho
parents: 6967
diff changeset
565 }
6996
163f78ece9c2 add uri2filename converter
pontscho
parents: 6977
diff changeset
566 #endif
6977
7242f1840f8d kde3 dnd fix from Gregory Kovriga and file name handling fix in dnd callback
pontscho
parents: 6967
diff changeset
567
6967
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
568 if(stat(str,&buf) == 0 && S_ISDIR(buf.st_mode) == 0) {
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
569 /* this is not a directory so try to play it */
14156
c30e193ac112 printf --> mp_msg conversion, less verbosity
diego
parents: 14006
diff changeset
570 mp_msg( MSGT_GPLAYER,MSGL_V,"Received D&D %s\n",str );
8481
e4736a12c898 applied Gregory's patch
pontscho
parents: 8423
diff changeset
571
e4736a12c898 applied Gregory's patch
pontscho
parents: 8423
diff changeset
572 /* check if it is a subtitle file */
e4736a12c898 applied Gregory's patch
pontscho
parents: 8423
diff changeset
573 {
e4736a12c898 applied Gregory's patch
pontscho
parents: 8423
diff changeset
574 char* ext = strrchr(str,'.');
e4736a12c898 applied Gregory's patch
pontscho
parents: 8423
diff changeset
575 if (ext) {
e4736a12c898 applied Gregory's patch
pontscho
parents: 8423
diff changeset
576 static char supported[] = "utf/sub/srt/smi/rt//txt/ssa/aqt/";
e4736a12c898 applied Gregory's patch
pontscho
parents: 8423
diff changeset
577 char* type;
e4736a12c898 applied Gregory's patch
pontscho
parents: 8423
diff changeset
578 int len;
e4736a12c898 applied Gregory's patch
pontscho
parents: 8423
diff changeset
579 if((len=strlen(++ext)) && (type=strstr(supported,ext)) &&\
e4736a12c898 applied Gregory's patch
pontscho
parents: 8423
diff changeset
580 (type-supported)%4 == 0 && *(type+len) == '/'){
e4736a12c898 applied Gregory's patch
pontscho
parents: 8423
diff changeset
581 /* handle subtitle file */
e4736a12c898 applied Gregory's patch
pontscho
parents: 8423
diff changeset
582 gfree((void**)&subtitles);
e4736a12c898 applied Gregory's patch
pontscho
parents: 8423
diff changeset
583 subtitles = str;
e4736a12c898 applied Gregory's patch
pontscho
parents: 8423
diff changeset
584 continue;
e4736a12c898 applied Gregory's patch
pontscho
parents: 8423
diff changeset
585 }
e4736a12c898 applied Gregory's patch
pontscho
parents: 8423
diff changeset
586 }
e4736a12c898 applied Gregory's patch
pontscho
parents: 8423
diff changeset
587 }
e4736a12c898 applied Gregory's patch
pontscho
parents: 8423
diff changeset
588
e4736a12c898 applied Gregory's patch
pontscho
parents: 8423
diff changeset
589 /* clear playlist */
e4736a12c898 applied Gregory's patch
pontscho
parents: 8423
diff changeset
590 if (filename == NULL) {
e4736a12c898 applied Gregory's patch
pontscho
parents: 8423
diff changeset
591 filename = files[f];
e4736a12c898 applied Gregory's patch
pontscho
parents: 8423
diff changeset
592 gtkSet(gtkDelPl,0,NULL);
e4736a12c898 applied Gregory's patch
pontscho
parents: 8423
diff changeset
593 }
e4736a12c898 applied Gregory's patch
pontscho
parents: 8423
diff changeset
594
6967
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
595 item = calloc(1,sizeof(plItem));
6977
7242f1840f8d kde3 dnd fix from Gregory Kovriga and file name handling fix in dnd callback
pontscho
parents: 6967
diff changeset
596
6967
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
597 /* FIXME: decompose file name ? */
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
598 /* yes -- Pontscho */
8481
e4736a12c898 applied Gregory's patch
pontscho
parents: 8423
diff changeset
599 if ( strrchr( str,'/' ) ) {
6977
7242f1840f8d kde3 dnd fix from Gregory Kovriga and file name handling fix in dnd callback
pontscho
parents: 6967
diff changeset
600 char * s = strrchr( str,'/' ); *s=0; s++;
8481
e4736a12c898 applied Gregory's patch
pontscho
parents: 8423
diff changeset
601 item->name = gstrdup( s );
e4736a12c898 applied Gregory's patch
pontscho
parents: 8423
diff changeset
602 item->path = gstrdup( str );
e4736a12c898 applied Gregory's patch
pontscho
parents: 8423
diff changeset
603 } else {
e4736a12c898 applied Gregory's patch
pontscho
parents: 8423
diff changeset
604 item->name = strdup(str);
e4736a12c898 applied Gregory's patch
pontscho
parents: 8423
diff changeset
605 item->path = strdup("");
e4736a12c898 applied Gregory's patch
pontscho
parents: 8423
diff changeset
606 }
6967
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
607 gtkSet(gtkAddPlItem,0,(void*)item);
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
608 } else {
14156
c30e193ac112 printf --> mp_msg conversion, less verbosity
diego
parents: 14006
diff changeset
609 mp_msg( MSGT_GPLAYER,MSGL_WARN,MSGTR_NotAFile,str );
6967
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
610 }
6977
7242f1840f8d kde3 dnd fix from Gregory Kovriga and file name handling fix in dnd callback
pontscho
parents: 6967
diff changeset
611 free( str );
6967
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
612 }
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
613
8481
e4736a12c898 applied Gregory's patch
pontscho
parents: 8423
diff changeset
614 if (filename) {
e4736a12c898 applied Gregory's patch
pontscho
parents: 8423
diff changeset
615 mplSetFileName( NULL,filename,STREAMTYPE_FILE );
e4736a12c898 applied Gregory's patch
pontscho
parents: 8423
diff changeset
616 if ( guiIntfStruct.Playing == 1 ) mplEventHandling( evStop,0 );
e4736a12c898 applied Gregory's patch
pontscho
parents: 8423
diff changeset
617 mplEventHandling( evPlay,0 );
e4736a12c898 applied Gregory's patch
pontscho
parents: 8423
diff changeset
618 }
e4736a12c898 applied Gregory's patch
pontscho
parents: 8423
diff changeset
619 if (subtitles) {
e4736a12c898 applied Gregory's patch
pontscho
parents: 8423
diff changeset
620 gfree((void**)&guiIntfStruct.Subtitlename);
e4736a12c898 applied Gregory's patch
pontscho
parents: 8423
diff changeset
621 guiIntfStruct.Subtitlename = subtitles;
e4736a12c898 applied Gregory's patch
pontscho
parents: 8423
diff changeset
622 guiLoadSubtitle(guiIntfStruct.Subtitlename);
e4736a12c898 applied Gregory's patch
pontscho
parents: 8423
diff changeset
623 }
6967
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
624 }