Mercurial > mplayer.hg
annotate Gui/mplayer/mw.h @ 5028:ddc28e9aa726
fixed strides for packed fourccs
author | nick |
---|---|
date | Sun, 10 Mar 2002 17:51:52 +0000 |
parents | bfc652fc7f43 |
children | b3bd4b29a03b |
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: |
169 PutImage( &item->Bitmap,item->x,item->y,item->phases,item->phases * ( 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 ) ); |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
180 //// image=fntRender( item->fontid,( mplRedrawTimer / 10 )%item->width,item->width,"%s",Translate( item->label ) ); |
1693 | 181 drawrenderedtext: |
182 PutImage( image,item->x,item->y,1,0 ); | |
183 if ( image ) | |
184 { | |
185 if ( image->Image ) free( image->Image ); | |
186 free( image ); | |
187 } | |
188 break; | |
189 } | |
190 } | |
191 wsConvert( &appMPlayer.mainWindow,mplDrawBuffer,appMPlayer.main.Bitmap.ImageSize ); | |
192 mplMainRender=0; | |
193 } | |
194 wsPutImage( &appMPlayer.mainWindow ); | |
2854 | 195 // XFlush( wsDisplay ); |
1693 | 196 } |
197 | |
1723
5e4214a7540e
GUI stuff. now seeking works, and xmga renders to video window
arpi
parents:
1707
diff
changeset
|
198 #define IZE(x) printf("@@@ " x " @@@\n"); |
5e4214a7540e
GUI stuff. now seeking works, and xmga renders to video window
arpi
parents:
1707
diff
changeset
|
199 |
1729 | 200 extern void exit_player(char* how); |
3618 | 201 extern int audio_id; |
202 extern int dvdsub_id; | |
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: |
3618 | 217 dvd_title=1; |
218 dvd_chapter=1; | |
219 dvd_angle=1; | |
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; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
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: |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
237 guiSetFilename( guiIntfStruct.Filename,"/dev/dvd" ); |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
238 break; |
3054 | 239 #endif |
1693 | 240 } |
241 mplPlay(); | |
4963 | 242 mplMainRender=1; |
1693 | 243 break; |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
244 #ifdef USE_DVDREAD |
3597 | 245 case evSetDVDSubtitle: |
3618 | 246 dvdsub_id=(int)param; |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
247 dvd_title=guiIntfStruct.DVD.current_title; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
248 dvd_angle=guiIntfStruct.DVD.current_angle; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
249 dvd_chapter=guiIntfStruct.DVD.current_chapter; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
250 guiIntfStruct.DVDChanged=1; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
251 goto play_dvd_2; |
3597 | 252 break; |
253 case evSetDVDAudio: | |
3618 | 254 audio_id=(int)param; |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
255 dvd_title=guiIntfStruct.DVD.current_title; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
256 dvd_angle=guiIntfStruct.DVD.current_angle; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
257 dvd_chapter=guiIntfStruct.DVD.current_chapter; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
258 guiIntfStruct.DVDChanged=1; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
259 goto play_dvd_2; |
3597 | 260 break; |
261 case evSetDVDChapter: | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
262 dvd_title=guiIntfStruct.DVD.current_title; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
263 dvd_angle=guiIntfStruct.DVD.current_angle; |
3597 | 264 dvd_chapter=(int)param; |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
265 guiIntfStruct.DVDChanged=1; |
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: | |
269 dvd_title=(int)param; | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
270 dvd_chapter=1; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
271 dvd_angle=1; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
272 guiIntfStruct.DVDChanged=1; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
273 goto play_dvd_2; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
274 break; |
3618 | 275 #endif |
1693 | 276 |
2994 | 277 case evPause: |
1693 | 278 case evPauseSwitchToPlay: |
279 NoPause: | |
4963 | 280 mplPause(); |
1693 | 281 mplMainRender=1; |
282 break; | |
283 | |
284 case evStop: | |
4963 | 285 mplStop(); |
1693 | 286 mplMainRender=1; |
287 break; | |
288 | |
289 case evLoadPlay: | |
290 mplMainAutoPlay=1; | |
291 case evLoad: | |
292 mplMainRender=1; | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
293 gtkShow( evLoad,NULL ); |
1693 | 294 break; |
3499 | 295 case evLoadSubtitle: |
296 mplMainRender=1; | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
297 gtkShow( evLoadSubtitle,NULL ); |
3499 | 298 break; |
1693 | 299 case evPrev: |
300 mplMainRender=1; | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
301 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[mw.h] previous stream ...\n" ); |
1693 | 302 break; |
303 case evNext: | |
304 mplMainRender=1; | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
305 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[mw.h] next stream ...\n" ); |
1693 | 306 break; |
307 | |
308 case evPlayList: | |
1723
5e4214a7540e
GUI stuff. now seeking works, and xmga renders to video window
arpi
parents:
1707
diff
changeset
|
309 IZE("evPlayList"); |
1693 | 310 mplMainRender=1; |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
311 gtkShow( evPlayList,NULL ); |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
312 #warning disabled old gtk code |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
313 #if 0 |
1693 | 314 if ( gtkVisiblePlayList ) |
315 { | |
316 btnModify( evPlayList,btnReleased ); | |
317 gtkShMem->vs.window=evPlayList; | |
318 gtkSendMessage( evHideWindow ); | |
319 gtkVisiblePlayList=0; | |
320 } | |
321 else | |
322 { | |
323 gtkSendMessage( evPlayList ); | |
324 btnModify( evPlayList,btnPressed ); | |
325 gtkVisiblePlayList=1; | |
326 } | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
327 #endif |
1693 | 328 break; |
329 | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
330 case evSkinBrowser: gtkShow( evSkinBrowser,skinName ); break; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
331 case evAbout: gtkShow( evAbout,NULL ); break; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
332 case evPreferences: gtkShow( evPreferences,NULL ); break; |
1693 | 333 |
334 case evForward1min: mplRelSeek( 60 ); break; | |
335 case evBackward1min: mplRelSeek( -60 ); break; | |
336 case evForward10sec: mplRelSeek( 10 ); break; | |
337 case evBackward10sec: mplRelSeek( -10 ); break; | |
338 case evSetMoviePosition: mplAbsSeek( param ); break; | |
339 | |
1860 | 340 case evIncVolume: vo_x11_putkey( wsGrayMul ); break; |
341 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
|
342 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
|
343 case evSetVolume: |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
344 case evSetBalance: guiIntfStruct.VolumeChanged=1; break; |
1847 | 345 |
1693 | 346 |
2994 | 347 case evIconify: |
348 switch ( (int)param ) | |
349 { | |
350 case 0: wsIconify( appMPlayer.mainWindow ); break; | |
351 case 1: wsIconify( appMPlayer.subWindow ); break; | |
352 } | |
353 break; | |
1765 | 354 case evNormalSize: |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
355 if ( guiIntfStruct.Playing ) |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
356 { |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
357 appMPlayer.subWindow.isFullScreen=True; |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
358 appMPlayer.subWindow.OldX=( wsMaxX - guiIntfStruct.MovieWidth ) / 2; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
359 appMPlayer.subWindow.OldY=( wsMaxY - guiIntfStruct.MovieHeight ) / 2; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
360 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
|
361 wsFullScreen( &appMPlayer.subWindow ); |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
362 mplResize( appMPlayer.subWindow.X,appMPlayer.subWindow.Y,guiIntfStruct.MovieWidth,guiIntfStruct.MovieHeight ); |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
363 } |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
364 break; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
365 case evDoubleSize: |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
366 if ( guiIntfStruct.Playing ) |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
367 { |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
368 appMPlayer.subWindow.isFullScreen=True; |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
369 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
|
370 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
|
371 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
|
372 wsFullScreen( &appMPlayer.subWindow ); |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
373 mplResize( appMPlayer.subWindow.X,appMPlayer.subWindow.Y,guiIntfStruct.MovieWidth,guiIntfStruct.MovieHeight ); |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
374 } |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
375 break; |
2994 | 376 case evFullScreen: |
377 for ( j=0;j<appMPlayer.NumberOfItems + 1;j++ ) | |
378 { | |
379 if ( appMPlayer.Items[j].msg == evFullScreen ) | |
380 { | |
381 appMPlayer.Items[j].tmp=!appMPlayer.Items[j].tmp; | |
382 appMPlayer.Items[j].pressed=appMPlayer.Items[j].tmp; | |
383 } | |
384 } | |
4981 | 385 mplFullScreen(); |
2994 | 386 mplMainRender=1; |
387 break; | |
1693 | 388 |
389 // --- timer events | |
390 case evHideMouseCursor: | |
391 wsVisibleMouse( &appMPlayer.subWindow,wsHideMouseCursor ); | |
392 break; | |
393 case evRedraw: | |
394 mplMainRender=1; | |
395 wsPostRedisplay( &appMPlayer.mainWindow ); | |
396 XFlush( wsDisplay ); | |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
397 mplRedrawTimer=mplRedrawTimerConst; |
1693 | 398 break; |
399 // --- system events | |
400 case evNone: | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
401 mp_msg( MSGT_GPLAYER,MSGL_STATUS,"[mw] event none received.\n" ); |
1693 | 402 break; |
403 default: | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
404 mp_msg( MSGT_GPLAYER,MSGL_STATUS,"[mw] unknown event received ( %d,%.2f ).\n",msg,param ); |
1693 | 405 break; |
406 } | |
407 } | |
408 | |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
409 #define itPLMButton (itNULL - 1) |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
410 #define itPRMButton (itNULL - 2) |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
411 |
1693 | 412 void mplMainMouseHandle( int Button,int X,int Y,int RX,int RY ) |
413 { | |
414 static int itemtype = 0; | |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
415 int i; |
1693 | 416 wItem * item = NULL; |
417 float value = 0.0f; | |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
418 |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
419 static int SelectedItem = -1; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
420 int currentselected = -1; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
421 |
1693 | 422 wsVisibleMouse( &appMPlayer.subWindow,wsShowMouseCursor ); |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
423 |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
424 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
|
425 if ( ( appMPlayer.Items[i].pressed != btnDisabled )&& |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
426 ( 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
|
427 { currentselected=i; break; } |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
428 |
1693 | 429 switch ( Button ) |
430 { | |
431 case wsPRMouseButton: | |
432 mplShowMenu( RX,RY ); | |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
433 itemtype=itPRMButton; |
1693 | 434 break; |
435 case wsRRMouseButton: | |
436 mplHideMenu( RX,RY ); | |
437 break; | |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
438 |
1693 | 439 case wsPLMouseButton: |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
440 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
|
441 SelectedItem=currentselected; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
442 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
|
443 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
|
444 item=&appMPlayer.Items[SelectedItem]; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
445 itemtype=item->type; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
446 item->pressed=btnPressed; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
447 item->used=1; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
448 switch( item->type ) |
1693 | 449 { |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
450 case itButton: |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
451 if ( ( SelectedItem > -1 ) && |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
452 ( ( ( 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
|
453 ( ( 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
|
454 { appMPlayer.Items[SelectedItem].pressed=btnDisabled; } |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
455 break; |
1693 | 456 } |
457 break; | |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
458 case wsRLMouseButton: |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
459 boxMoved=0; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
460 item=&appMPlayer.Items[SelectedItem]; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
461 item->pressed=btnReleased; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
462 SelectedItem=-1; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
463 if ( currentselected == - 1 ) { itemtype=0; break; } |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
464 value=0; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
465 switch( itemtype ) |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
466 { |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
467 case itPotmeter: |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
468 case itHPotmeter: |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
469 item->used=0; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
470 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
|
471 switch ( item->msg ) |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
472 { |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
473 case evSetVolume: |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
474 guiIntfStruct.VolumeChanged=1; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
475 guiIntfStruct.Volume=item->value; |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
476 break; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
477 } |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
478 value=item->value; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
479 break; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
480 } |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
481 mplEventHandling( item->msg,value ); |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
482 mplMainRender=1; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
483 itemtype=0; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
484 break; |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
485 |
2902
d47cbcdce1a8
rewrite some header meg jol csinaltam menu -t koepso gombra gonosz mod ( bocs, tom, nem angol).
pontscho
parents:
2854
diff
changeset
|
486 case wsPMMouseButton: |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
487 gtkShow( evShowPopUpMenu,NULL ); |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
488 break; |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
489 |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
490 // --- rolled mouse ... de szar :))) |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
491 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
|
492 case wsP4MouseButton: value= 2.5f; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
493 rollerhandled: |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
494 item=&appMPlayer.Items[currentselected]; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
495 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
|
496 { |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
497 item->used=0; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
498 item->value+=value; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
499 btnModify( item->msg,item->value ); |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
500 switch ( item->msg ) |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
501 { |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
502 case evSetVolume: |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
503 guiIntfStruct.VolumeChanged=1; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
504 guiIntfStruct.Volume=item->value; |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
505 break; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
506 } |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
507 mplEventHandling( item->msg,item->value ); |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
508 mplMainRender=1; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
509 } |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
510 break; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
511 |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
512 // --- moving |
1693 | 513 case wsMoveMouse: |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
514 item=&appMPlayer.Items[SelectedItem]; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
515 switch ( itemtype ) |
1693 | 516 { |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
517 case itPLMButton: |
2854 | 518 wsMoveWindow( &appMPlayer.mainWindow,False,RX - abs( sx ),RY - abs( sy ) ); |
1693 | 519 mplMainRender=0; |
520 break; | |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
521 case itPRMButton: |
1693 | 522 mplMenuMouseHandle( X,Y,RX,RY ); |
523 break; | |
524 case itPotmeter: | |
1729 | 525 item->value=(float)( X - item->x ) / item->width * 100.0f; |
1693 | 526 goto potihandled; |
527 case itHPotmeter: | |
1729 | 528 item->value=(float)( X - item->x ) / item->width * 100.0f; |
1693 | 529 potihandled: |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
530 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
|
531 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
|
532 switch ( item->msg ) |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
533 { |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
534 case evSetVolume: |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
535 guiIntfStruct.VolumeChanged=1; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
536 guiIntfStruct.Volume=item->value; |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
537 break; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
538 } |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
539 mplEventHandling( item->msg,item->value ); |
1693 | 540 mplMainRender=1; wsPostRedisplay( &appMPlayer.mainWindow ); |
541 break; | |
542 } | |
543 break; | |
544 } | |
545 if ( Button != wsMoveMouse ) wsPostRedisplay( &appMPlayer.mainWindow ); | |
546 } | |
547 | |
548 int keyPressed = 0; | |
549 | |
550 void mplMainKeyHandle( int State,int Type,int Key ) | |
551 { | |
552 int msg = evNone; | |
4950 | 553 |
4409 | 554 if ( Type != wsKeyPressed ) return; |
1693 | 555 switch ( Key ) |
556 { | |
4963 | 557 case wsEnter: msg=evPlay; break; |
4858 | 558 #ifndef HAVE_NEW_INPUT |
1693 | 559 case '.': |
560 case '>': msg=evNext; break; | |
561 case ',': | |
562 case '<': msg=evPrev; break; | |
563 | |
564 case wsEscape: msg=evExit; break; | |
565 | |
566 case wsSpace: msg=evPause; break; | |
567 case wsa: | |
568 case wsA: msg=evAbout; break; | |
569 case wsb: | |
570 case wsB: msg=evSkinBrowser; break; | |
571 case wse: | |
572 case wsE: msg=evEqualeaser; break; | |
573 case wsf: | |
574 case wsF: msg=evFullScreen; break; | |
575 case wsl: | |
576 case wsL: msg=evLoad; break; | |
3499 | 577 case wsu: |
578 case wsU: msg=evLoadSubtitle; break; | |
1693 | 579 case wsm: |
580 case wsM: msg=evMute; break; | |
581 case wss: | |
582 case wsS: msg=evStop; break; | |
583 case wsp: | |
584 case wsP: msg=evPlayList; break; | |
4858 | 585 #endif |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
586 |
4409 | 587 case wsXF86LowerVolume: msg=evDecVolume; break; |
588 case wsXF86RaiseVolume: msg=evIncVolume; break; | |
589 case wsXF86Mute: msg=evMute; break; | |
590 case wsXF86Play: msg=evPlaySwitchToPause; break; | |
591 case wsXF86Stop: msg=evStop; break; | |
592 case wsXF86Prev: msg=evPrev; break; | |
593 case wsXF86Next: msg=evNext; break; | |
594 case wsXF86Media: msg=evLoad; break; | |
595 | |
596 default: vo_x11_putkey( Key ); return; | |
1693 | 597 } |
4858 | 598 if ( msg != evNone ) mplEventHandling( msg,0 ); |
1693 | 599 } |