Mercurial > mplayer.hg
annotate Gui/mplayer/mw.h @ 5965:27519699d416
applied Jonas Jermann's patch (v1)
author | gabucino |
---|---|
date | Sat, 04 May 2002 05:32:26 +0000 |
parents | 60cf2bca993f |
children | 421781c5b128 |
rev | line source |
---|---|
1693 | 1 |
2 // main window | |
3 | |
2447 | 4 #include "../../libmpdemux/stream.h" |
5 | |
1693 | 6 unsigned char * mplDrawBuffer = NULL; |
7 int mplMainRender = 1; | |
2940 | 8 |
1693 | 9 int mplMainAutoPlay = 0; |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
10 int mplMiddleMenu = 0; |
1693 | 11 |
12 int mainVisible = 1; | |
13 | |
14 int boxMoved = 0; | |
15 int sx = 0,sy = 0; | |
16 int i,pot = 0; | |
17 | |
3054 | 18 inline void TranslateFilename( int c,char * tmp ) |
19 { | |
20 int i; | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
21 switch ( guiIntfStruct.StreamType ) |
3054 | 22 { |
23 case STREAMTYPE_FILE: | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
24 if ( ( guiIntfStruct.Filename )&&( guiIntfStruct.Filename[0] ) ) |
3054 | 25 { |
4979 | 26 if ( strrchr( guiIntfStruct.Filename,'/' ) ) strcpy( tmp,strrchr( guiIntfStruct.Filename,'/' ) + 1 ); |
27 else strcpy( tmp,guiIntfStruct.Filename ); | |
3054 | 28 if ( tmp[strlen( tmp ) - 4] == '.' ) tmp[strlen( tmp ) - 4]=0; |
29 if ( tmp[strlen( tmp ) - 5] == '.' ) tmp[strlen( tmp ) - 5]=0; | |
30 } else strcpy( tmp,"no file loaded" ); | |
31 break; | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
32 #ifdef USE_DVDREAD |
3054 | 33 case STREAMTYPE_DVD: |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
34 if ( guiIntfStruct.DVD.current_chapter ) sprintf( tmp,"chapter %d",guiIntfStruct.DVD.current_chapter ); |
3054 | 35 else strcat( tmp,"no chapter" ); |
36 break; | |
37 #endif | |
38 default: strcpy( tmp,"no media opened" ); | |
39 } | |
40 if ( c ) | |
41 { | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
42 for ( i=0;i < (int)strlen( tmp );i++ ) |
3054 | 43 { |
44 int t=0; | |
45 if ( c == 1 ) { if ( ( tmp[i] >= 'A' )&&( tmp[i] <= 'Z' ) ) t=32; } | |
46 if ( c == 2 ) { if ( ( tmp[i] >= 'a' )&&( tmp[i] <= 'z' ) ) t=-32; } | |
47 tmp[i]=(char)( tmp[i] + t ); | |
48 } | |
49 } | |
50 } | |
51 | |
1693 | 52 char * Translate( char * str ) |
53 { | |
54 static char trbuf[512]; | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
55 char tmp[512]; |
1693 | 56 int i,c; |
2045 | 57 int t; |
1693 | 58 memset( trbuf,0,512 ); |
59 memset( tmp,0,128 ); | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
60 for ( c=0,i=0;i < (int)strlen( str );i++ ) |
1693 | 61 { |
62 if ( str[i] != '$' ) { trbuf[c++]=str[i]; trbuf[c]=0; } | |
63 else | |
64 { | |
65 switch ( str[++i] ) | |
66 { | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
67 case 't': sprintf( tmp,"%02d",guiIntfStruct.Track ); strcat( trbuf,tmp ); break; |
3054 | 68 case 'o': TranslateFilename( 0,tmp ); strcat( trbuf,tmp ); break; |
69 case 'f': TranslateFilename( 1,tmp ); strcat( trbuf,tmp ); break; | |
70 case 'F': TranslateFilename( 2,tmp ); strcat( trbuf,tmp ); break; | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
71 case '6': t=guiIntfStruct.LengthInSec; goto calclengthhhmmss; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
72 case '1': t=guiIntfStruct.TimeSec; |
1693 | 73 calclengthhhmmss: |
1888 | 74 sprintf( tmp,"%02d:%02d:%02d",t/3600,t/60%60,t%60 ); strcat( trbuf,tmp ); |
1693 | 75 break; |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
76 case '7': t=guiIntfStruct.LengthInSec; goto calclengthmmmmss; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
77 case '2': t=guiIntfStruct.TimeSec; |
1693 | 78 calclengthmmmmss: |
1888 | 79 sprintf( tmp,"%04d:%02d",t/60,t%60 ); strcat( trbuf,tmp ); |
1693 | 80 break; |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
81 case '3': sprintf( tmp,"%02d",guiIntfStruct.TimeSec / 3600 ); strcat( trbuf,tmp ); break; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
82 case '4': sprintf( tmp,"%02d",( ( guiIntfStruct.TimeSec / 60 ) % 60 ) ); strcat( trbuf,tmp ); break; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
83 case '5': sprintf( tmp,"%02d",guiIntfStruct.TimeSec % 60 ); strcat( trbuf,tmp ); break; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
84 case '8': sprintf( tmp,"%01d:%02d:%02d",guiIntfStruct.TimeSec / 3600,( guiIntfStruct.TimeSec / 60 ) % 60,guiIntfStruct.TimeSec % 60 ); strcat( trbuf,tmp ); break; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
85 case 'v': sprintf( tmp,"%3.2f%%",guiIntfStruct.Volume ); strcat( trbuf,tmp ); break; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
86 case 'V': sprintf( tmp,"%3.1f",guiIntfStruct.Volume ); strcat( trbuf,tmp ); break; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
87 case 'b': sprintf( tmp,"%3.2f%%",guiIntfStruct.Balance ); strcat( trbuf,tmp ); break; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
88 case 'B': sprintf( tmp,"%3.1f",guiIntfStruct.Balance ); strcat( trbuf,tmp ); break; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
89 case 'd': sprintf( tmp,"%d",guiIntfStruct.FrameDrop ); strcat( trbuf,tmp ); break; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
90 case 's': if ( guiIntfStruct.Playing == 0 ) strcat( trbuf,"s" ); break; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
91 case 'l': if ( guiIntfStruct.Playing == 1 ) strcat( trbuf,"p" ); break; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
92 case 'e': if ( guiIntfStruct.Playing == 2 ) strcat( trbuf,"e" ); break; |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
93 case 'a': |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
94 switch ( guiIntfStruct.AudioType ) |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
95 { |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
96 case 0: strcat( trbuf,"n" ); break; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
97 case 1: strcat( trbuf,"m" ); break; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
98 case 2: strcat( trbuf,"t" ); break; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
99 } |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
100 break; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
101 case 'T': |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
102 switch ( guiIntfStruct.StreamType ) |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
103 { |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
104 case STREAMTYPE_FILE: strcat( trbuf,"f" ); break; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
105 case STREAMTYPE_VCD: strcat( trbuf,"v" ); break; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
106 case STREAMTYPE_STREAM: strcat( trbuf,"u" ); break; |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
107 #ifdef USE_DVDREAD |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
108 case STREAMTYPE_DVD: strcat( trbuf,"d" ); break; |
3054 | 109 #endif |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
110 default: strcat( trbuf," " ); break; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
111 } |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
112 break; |
1707 | 113 case '$': strcat( trbuf,"$" ); break; |
1693 | 114 default: continue; |
115 } | |
116 c=strlen( trbuf ); | |
117 } | |
118 } | |
119 return trbuf; | |
120 } | |
121 | |
3054 | 122 inline void PutImage( txSample * bf,int x,int y,int max,int ofs ) |
1693 | 123 { |
124 int i=0,ix,iy; | |
125 unsigned long * buf = NULL; | |
126 unsigned long * drw = NULL; | |
127 unsigned long tmp; | |
128 | |
129 if ( ( !bf )||( bf->Image == NULL ) ) return; | |
130 | |
131 i=( bf->Width * ( bf->Height / max ) ) * ofs; | |
132 buf=(unsigned long *)mplDrawBuffer; | |
133 drw=(unsigned long *)bf->Image; | |
134 | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
135 for ( iy=y;iy < (int)(y+bf->Height / max);iy++ ) |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
136 for ( ix=x;ix < (int)(x+bf->Width);ix++ ) |
1693 | 137 { |
138 tmp=drw[i++]; | |
139 if ( tmp != 0x00ff00ff ) | |
140 buf[ iy*appMPlayer.main.Bitmap.Width+ix ]=tmp; | |
141 } | |
142 } | |
143 | |
144 void mplMainDraw( wsParamDisplay ) | |
145 { | |
146 wItem * item; | |
147 txSample * image = NULL; | |
148 int i; | |
149 | |
150 if ( appMPlayer.mainWindow.Visible == wsWindowNotVisible || | |
1729 | 151 !mainVisible ) return; |
152 // !appMPlayer.mainWindow.Mapped ) return; | |
153 | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
154 btnModify( evSetMoviePosition,guiIntfStruct.Position ); |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
155 btnModify( evSetVolume,guiIntfStruct.Volume ); |
1751 | 156 |
1693 | 157 if ( mplMainRender ) |
158 { | |
159 memcpy( mplDrawBuffer,appMPlayer.main.Bitmap.Image,appMPlayer.main.Bitmap.ImageSize ); | |
160 for( i=0;i < appMPlayer.NumberOfItems + 1;i++ ) | |
161 { | |
162 item=&appMPlayer.Items[i]; | |
163 switch( item->type ) | |
164 { | |
165 case itButton: | |
166 PutImage( &item->Bitmap,item->x,item->y,3,item->pressed ); | |
167 break; | |
1729 | 168 case itPotmeter: |
5919 | 169 PutImage( &item->Bitmap,item->x,item->y,item->phases,( item->phases - 1 ) * ( item->value / 100.0f ) ); |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
170 break; |
1693 | 171 case itHPotmeter: |
172 PutImage( &item->Bitmap,item->x,item->y,item->phases,item->phases * ( item->value / 100.0f ) ); | |
173 PutImage( &item->Mask,item->x + (int)( ( item->width - item->psx ) * item->value / 100.0f ),item->y,3,item->pressed ); | |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
174 break; |
1693 | 175 case itSLabel: |
176 image=fntRender( item->fontid,0,item->width,"%s",item->label ); | |
177 goto drawrenderedtext; | |
178 case itDLabel: | |
1729 | 179 image=fntRender( item->fontid,mplTimer%item->width,item->width,"%s",Translate( item->label ) ); |
1693 | 180 drawrenderedtext: |
181 if ( image ) | |
182 { | |
5919 | 183 PutImage( image,item->x,item->y,1,0 ); |
1693 | 184 if ( image->Image ) free( image->Image ); |
185 free( image ); | |
186 } | |
187 break; | |
188 } | |
189 } | |
190 wsConvert( &appMPlayer.mainWindow,mplDrawBuffer,appMPlayer.main.Bitmap.ImageSize ); | |
191 mplMainRender=0; | |
192 } | |
193 wsPutImage( &appMPlayer.mainWindow ); | |
2854 | 194 // XFlush( wsDisplay ); |
1693 | 195 } |
196 | |
1723
5e4214a7540e
GUI stuff. now seeking works, and xmga renders to video window
arpi
parents:
1707
diff
changeset
|
197 #define IZE(x) printf("@@@ " x " @@@\n"); |
5e4214a7540e
GUI stuff. now seeking works, and xmga renders to video window
arpi
parents:
1707
diff
changeset
|
198 |
1729 | 199 extern void exit_player(char* how); |
3618 | 200 extern int audio_id; |
201 extern int dvdsub_id; | |
5665 | 202 extern char * dvd_device; |
1729 | 203 |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
204 void mplEventHandling( int msg,float param ) |
1693 | 205 { |
206 int j; | |
207 | |
208 switch( msg ) | |
209 { | |
210 // --- user events | |
211 case evExit: | |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
212 exit_player( "Exit" ); |
1693 | 213 break; |
2994 | 214 |
3054 | 215 #ifdef USE_DVDREAD |
2994 | 216 case evPlayDVD: |
5665 | 217 guiIntfStruct.DVD.current_title=1; |
218 guiIntfStruct.DVD.current_chapter=1; | |
219 guiIntfStruct.DVD.current_angle=1; | |
3618 | 220 play_dvd_2: |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
221 guiIntfStruct.StreamType=STREAMTYPE_DVD; |
3054 | 222 #endif |
2994 | 223 case evPlay: |
224 case evPlaySwitchToPause: | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
225 mplMainAutoPlay=0; |
5665 | 226 if ( ( msg == evPlaySwitchToPause )&&( guiIntfStruct.Playing == 1 ) ) goto NoPause; |
3618 | 227 |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
228 switch ( guiIntfStruct.StreamType ) |
1693 | 229 { |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
230 case STREAMTYPE_STREAM: |
2995 | 231 case STREAMTYPE_VCD: |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
232 case STREAMTYPE_FILE: |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
233 dvd_title=0; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
234 break; |
3054 | 235 #ifdef USE_DVDREAD |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
236 case STREAMTYPE_DVD: |
5667 | 237 if ( !dvd_device ) |
238 { | |
239 dvd_device=DEFAULT_DVD_DEVICE; | |
240 guiSetFilename( guiIntfStruct.Filename,dvd_device ); | |
241 } | |
242 if ( guiIntfStruct.Playing != 2 ) | |
243 { | |
244 dvd_title=guiIntfStruct.DVD.current_title; | |
245 dvd_angle=guiIntfStruct.DVD.current_angle; | |
246 dvd_chapter=guiIntfStruct.DVD.current_chapter; | |
247 guiIntfStruct.DVDChanged=1; | |
248 } | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
249 break; |
3054 | 250 #endif |
1693 | 251 } |
252 mplPlay(); | |
4963 | 253 mplMainRender=1; |
1693 | 254 break; |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
255 #ifdef USE_DVDREAD |
3597 | 256 case evSetDVDSubtitle: |
3618 | 257 dvdsub_id=(int)param; |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
258 goto play_dvd_2; |
3597 | 259 break; |
260 case evSetDVDAudio: | |
3618 | 261 audio_id=(int)param; |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
262 goto play_dvd_2; |
3597 | 263 break; |
264 case evSetDVDChapter: | |
5665 | 265 guiIntfStruct.DVD.current_chapter=(int)param; |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
266 goto play_dvd_2; |
3597 | 267 break; |
268 case evSetDVDTitle: | |
5665 | 269 guiIntfStruct.DVD.current_title=(int)param; |
270 guiIntfStruct.DVD.current_chapter=1; | |
271 guiIntfStruct.DVD.current_angle=1; | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
272 goto play_dvd_2; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
273 break; |
3618 | 274 #endif |
1693 | 275 |
2994 | 276 case evPause: |
1693 | 277 case evPauseSwitchToPlay: |
278 NoPause: | |
4963 | 279 mplPause(); |
1693 | 280 mplMainRender=1; |
281 break; | |
282 | |
283 case evStop: | |
4963 | 284 mplStop(); |
1693 | 285 mplMainRender=1; |
286 break; | |
287 | |
288 case evLoadPlay: | |
289 mplMainAutoPlay=1; | |
290 case evLoad: | |
291 mplMainRender=1; | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
292 gtkShow( evLoad,NULL ); |
1693 | 293 break; |
3499 | 294 case evLoadSubtitle: |
295 mplMainRender=1; | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
296 gtkShow( evLoadSubtitle,NULL ); |
3499 | 297 break; |
1693 | 298 case evPrev: |
5689 | 299 mplPrev(); |
1693 | 300 mplMainRender=1; |
301 break; | |
302 case evNext: | |
5689 | 303 mplNext(); |
1693 | 304 mplMainRender=1; |
305 break; | |
306 | |
307 case evPlayList: | |
1723
5e4214a7540e
GUI stuff. now seeking works, and xmga renders to video window
arpi
parents:
1707
diff
changeset
|
308 IZE("evPlayList"); |
1693 | 309 mplMainRender=1; |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
310 gtkShow( evPlayList,NULL ); |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
311 #warning disabled old gtk code |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
312 #if 0 |
1693 | 313 if ( gtkVisiblePlayList ) |
314 { | |
315 btnModify( evPlayList,btnReleased ); | |
316 gtkShMem->vs.window=evPlayList; | |
317 gtkSendMessage( evHideWindow ); | |
318 gtkVisiblePlayList=0; | |
319 } | |
320 else | |
321 { | |
322 gtkSendMessage( evPlayList ); | |
323 btnModify( evPlayList,btnPressed ); | |
324 gtkVisiblePlayList=1; | |
325 } | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
326 #endif |
1693 | 327 break; |
328 | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
329 case evSkinBrowser: gtkShow( evSkinBrowser,skinName ); break; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
330 case evAbout: gtkShow( evAbout,NULL ); break; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
331 case evPreferences: gtkShow( evPreferences,NULL ); break; |
1693 | 332 |
333 case evForward1min: mplRelSeek( 60 ); break; | |
334 case evBackward1min: mplRelSeek( -60 ); break; | |
335 case evForward10sec: mplRelSeek( 10 ); break; | |
336 case evBackward10sec: mplRelSeek( -10 ); break; | |
337 case evSetMoviePosition: mplAbsSeek( param ); break; | |
338 | |
1860 | 339 case evIncVolume: vo_x11_putkey( wsGrayMul ); break; |
340 case evDecVolume: vo_x11_putkey( wsGrayDiv ); break; | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
341 case evMute: guiIntfStruct.Mute=1; break; |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
342 case evSetVolume: |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
343 case evSetBalance: guiIntfStruct.VolumeChanged=1; break; |
1847 | 344 |
1693 | 345 |
2994 | 346 case evIconify: |
347 switch ( (int)param ) | |
348 { | |
349 case 0: wsIconify( appMPlayer.mainWindow ); break; | |
350 case 1: wsIconify( appMPlayer.subWindow ); break; | |
351 } | |
352 break; | |
1765 | 353 case evNormalSize: |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
354 if ( guiIntfStruct.Playing ) |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
355 { |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
356 appMPlayer.subWindow.isFullScreen=True; |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
357 appMPlayer.subWindow.OldX=( wsMaxX - guiIntfStruct.MovieWidth ) / 2; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
358 appMPlayer.subWindow.OldY=( wsMaxY - guiIntfStruct.MovieHeight ) / 2; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
359 appMPlayer.subWindow.OldWidth=guiIntfStruct.MovieWidth; appMPlayer.subWindow.OldHeight=guiIntfStruct.MovieHeight; |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
360 wsFullScreen( &appMPlayer.subWindow ); |
5520 | 361 vo_fs=0; |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
362 } |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
363 break; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
364 case evDoubleSize: |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
365 if ( guiIntfStruct.Playing ) |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
366 { |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
367 appMPlayer.subWindow.isFullScreen=True; |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
368 appMPlayer.subWindow.OldX=( wsMaxX - guiIntfStruct.MovieWidth * 2 ) / 2; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
369 appMPlayer.subWindow.OldY=( wsMaxY - guiIntfStruct.MovieHeight * 2 ) / 2; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
370 appMPlayer.subWindow.OldWidth=guiIntfStruct.MovieWidth * 2; appMPlayer.subWindow.OldHeight=guiIntfStruct.MovieHeight * 2; |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
371 wsFullScreen( &appMPlayer.subWindow ); |
5520 | 372 vo_fs=0; |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
373 } |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
374 break; |
2994 | 375 case evFullScreen: |
376 for ( j=0;j<appMPlayer.NumberOfItems + 1;j++ ) | |
377 { | |
378 if ( appMPlayer.Items[j].msg == evFullScreen ) | |
379 { | |
380 appMPlayer.Items[j].tmp=!appMPlayer.Items[j].tmp; | |
381 appMPlayer.Items[j].pressed=appMPlayer.Items[j].tmp; | |
382 } | |
383 } | |
4981 | 384 mplFullScreen(); |
2994 | 385 mplMainRender=1; |
386 break; | |
1693 | 387 |
388 // --- timer events | |
389 case evRedraw: | |
390 mplMainRender=1; | |
391 wsPostRedisplay( &appMPlayer.mainWindow ); | |
392 XFlush( wsDisplay ); | |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
393 mplRedrawTimer=mplRedrawTimerConst; |
1693 | 394 break; |
395 // --- system events | |
396 case evNone: | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
397 mp_msg( MSGT_GPLAYER,MSGL_STATUS,"[mw] event none received.\n" ); |
1693 | 398 break; |
399 default: | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
400 mp_msg( MSGT_GPLAYER,MSGL_STATUS,"[mw] unknown event received ( %d,%.2f ).\n",msg,param ); |
1693 | 401 break; |
402 } | |
403 } | |
404 | |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
405 #define itPLMButton (itNULL - 1) |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
406 #define itPRMButton (itNULL - 2) |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
407 |
1693 | 408 void mplMainMouseHandle( int Button,int X,int Y,int RX,int RY ) |
409 { | |
410 static int itemtype = 0; | |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
411 int i; |
1693 | 412 wItem * item = NULL; |
413 float value = 0.0f; | |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
414 |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
415 static int SelectedItem = -1; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
416 int currentselected = -1; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
417 |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
418 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
|
419 if ( ( appMPlayer.Items[i].pressed != btnDisabled )&& |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
420 ( 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
|
421 { currentselected=i; break; } |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
422 |
1693 | 423 switch ( Button ) |
424 { | |
425 case wsPRMouseButton: | |
426 mplShowMenu( RX,RY ); | |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
427 itemtype=itPRMButton; |
1693 | 428 break; |
429 case wsRRMouseButton: | |
5919 | 430 mplHideMenu( RX,RY,0 ); |
1693 | 431 break; |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
432 |
1693 | 433 case wsPLMouseButton: |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
434 sx=X; sy=Y; boxMoved=1; itemtype=itPLMButton; // if move the main window |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
435 SelectedItem=currentselected; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
436 if ( SelectedItem == -1 ) break; // yeees, i'm move the fucking window |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
437 boxMoved=0; mplMainRender=1; // No, not move the window, i'm pressed one button |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
438 item=&appMPlayer.Items[SelectedItem]; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
439 itemtype=item->type; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
440 item->pressed=btnPressed; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
441 switch( item->type ) |
1693 | 442 { |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
443 case itButton: |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
444 if ( ( SelectedItem > -1 ) && |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
445 ( ( ( appMPlayer.Items[SelectedItem].msg == evPlaySwitchToPause && item->msg == evPauseSwitchToPlay ) ) || |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
446 ( ( appMPlayer.Items[SelectedItem].msg == evPauseSwitchToPlay && item->msg == evPlaySwitchToPause ) ) ) ) |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
447 { appMPlayer.Items[SelectedItem].pressed=btnDisabled; } |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
448 break; |
1693 | 449 } |
450 break; | |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
451 case wsRLMouseButton: |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
452 boxMoved=0; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
453 item=&appMPlayer.Items[SelectedItem]; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
454 item->pressed=btnReleased; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
455 SelectedItem=-1; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
456 if ( currentselected == - 1 ) { itemtype=0; break; } |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
457 value=0; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
458 switch( itemtype ) |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
459 { |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
460 case itPotmeter: |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
461 case itHPotmeter: |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
462 btnModify( item->msg,(float)( X - item->x ) / item->width * 100.0f ); |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
463 switch ( item->msg ) |
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 case evSetVolume: |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
466 guiIntfStruct.VolumeChanged=1; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
467 guiIntfStruct.Volume=item->value; |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
468 break; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
469 } |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
470 value=item->value; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
471 break; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
472 } |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
473 mplEventHandling( item->msg,value ); |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
474 mplMainRender=1; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
475 itemtype=0; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
476 break; |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
477 |
2902
d47cbcdce1a8
rewrite some header meg jol csinaltam menu -t koepso gombra gonosz mod ( bocs, tom, nem angol).
pontscho
parents:
2854
diff
changeset
|
478 case wsPMMouseButton: |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
479 gtkShow( evShowPopUpMenu,NULL ); |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
480 break; |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
481 |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
482 // --- rolled mouse ... de szar :))) |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
483 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
|
484 case wsP4MouseButton: value= 2.5f; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
485 rollerhandled: |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
486 item=&appMPlayer.Items[currentselected]; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
487 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
|
488 { |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
489 item->value+=value; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
490 btnModify( item->msg,item->value ); |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
491 switch ( item->msg ) |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
492 { |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
493 case evSetVolume: |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
494 guiIntfStruct.VolumeChanged=1; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
495 guiIntfStruct.Volume=item->value; |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
496 break; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
497 } |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
498 mplEventHandling( item->msg,item->value ); |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
499 mplMainRender=1; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
500 } |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
501 break; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
502 |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
503 // --- moving |
1693 | 504 case wsMoveMouse: |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
505 item=&appMPlayer.Items[SelectedItem]; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
506 switch ( itemtype ) |
1693 | 507 { |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
508 case itPLMButton: |
2854 | 509 wsMoveWindow( &appMPlayer.mainWindow,False,RX - abs( sx ),RY - abs( sy ) ); |
1693 | 510 mplMainRender=0; |
511 break; | |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
512 case itPRMButton: |
1693 | 513 mplMenuMouseHandle( X,Y,RX,RY ); |
514 break; | |
515 case itPotmeter: | |
1729 | 516 item->value=(float)( X - item->x ) / item->width * 100.0f; |
1693 | 517 goto potihandled; |
518 case itHPotmeter: | |
1729 | 519 item->value=(float)( X - item->x ) / item->width * 100.0f; |
1693 | 520 potihandled: |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
521 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
|
522 if ( item->value < 0.0f ) item->value=0.0f; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
523 switch ( item->msg ) |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
524 { |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
525 case evSetVolume: |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
526 guiIntfStruct.VolumeChanged=1; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
527 guiIntfStruct.Volume=item->value; |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
528 break; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
529 } |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
530 mplEventHandling( item->msg,item->value ); |
1693 | 531 mplMainRender=1; wsPostRedisplay( &appMPlayer.mainWindow ); |
532 break; | |
533 } | |
534 break; | |
535 } | |
536 if ( Button != wsMoveMouse ) wsPostRedisplay( &appMPlayer.mainWindow ); | |
537 } | |
538 | |
539 int keyPressed = 0; | |
540 | |
541 void mplMainKeyHandle( int State,int Type,int Key ) | |
542 { | |
543 int msg = evNone; | |
4950 | 544 |
4409 | 545 if ( Type != wsKeyPressed ) return; |
1693 | 546 switch ( Key ) |
547 { | |
4963 | 548 case wsEnter: msg=evPlay; break; |
4858 | 549 #ifndef HAVE_NEW_INPUT |
1693 | 550 case '.': |
551 case '>': msg=evNext; break; | |
552 case ',': | |
553 case '<': msg=evPrev; break; | |
554 | |
555 case wsEscape: msg=evExit; break; | |
556 | |
557 case wsSpace: msg=evPause; break; | |
558 case wsa: | |
559 case wsA: msg=evAbout; break; | |
560 case wsb: | |
561 case wsB: msg=evSkinBrowser; break; | |
562 case wse: | |
563 case wsE: msg=evEqualeaser; break; | |
564 case wsf: | |
565 case wsF: msg=evFullScreen; break; | |
566 case wsl: | |
567 case wsL: msg=evLoad; break; | |
3499 | 568 case wsu: |
569 case wsU: msg=evLoadSubtitle; break; | |
1693 | 570 case wsm: |
571 case wsM: msg=evMute; break; | |
572 case wss: | |
573 case wsS: msg=evStop; break; | |
574 case wsp: | |
575 case wsP: msg=evPlayList; break; | |
4858 | 576 #endif |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
577 |
4409 | 578 case wsXF86LowerVolume: msg=evDecVolume; break; |
579 case wsXF86RaiseVolume: msg=evIncVolume; break; | |
580 case wsXF86Mute: msg=evMute; break; | |
581 case wsXF86Play: msg=evPlaySwitchToPause; break; | |
582 case wsXF86Stop: msg=evStop; break; | |
583 case wsXF86Prev: msg=evPrev; break; | |
584 case wsXF86Next: msg=evNext; break; | |
585 case wsXF86Media: msg=evLoad; break; | |
586 | |
587 default: vo_x11_putkey( Key ); return; | |
1693 | 588 } |
4858 | 589 if ( msg != evNone ) mplEventHandling( msg,0 ); |
1693 | 590 } |