Mercurial > mplayer.hg
annotate Gui/interface.c @ 8122:272b1fda7287
more stuff
TODO ASAP: what can those new filters do?
author | arpi |
---|---|
date | Wed, 06 Nov 2002 23:51:17 +0000 |
parents | 9246adcf95f0 |
children | 851e974e6eaa |
rev | line source |
---|---|
8058 | 1 |
4845 | 2 #include <inttypes.h> |
3 #include <stdlib.h> | |
4 #include <stdio.h> | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
5 #include <string.h> |
8058 | 6 #include <sys/types.h> |
4798 | 7 |
8058 | 8 #include "wm/ws.h" |
9 #include "wm/wsxdnd.h" | |
4798 | 10 #include "interface.h" |
6619
f554e7271587
fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents:
6280
diff
changeset
|
11 #include "skin/skin.h" |
8058 | 12 |
6627 | 13 #include "mplayer/gtk/eq.h" |
8058 | 14 #include "mplayer/widgets.h" |
15 #include "mplayer/mplayer.h" | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
16 |
4798 | 17 #include "../mplayer.h" |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
18 #include "app.h" |
6794 | 19 #include "cfg.h" |
20 #include "../help_mp.h" | |
21 #include "../subreader.h" | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
22 #include "../libvo/x11_common.h" |
5789 | 23 #include "../libvo/video_out.h" |
6794 | 24 #include "../libvo/font_load.h" |
7169 | 25 #include "../libvo/sub.h" |
4858 | 26 #include "../input/input.h" |
6619
f554e7271587
fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents:
6280
diff
changeset
|
27 #include "../libao2/audio_out.h" |
6627 | 28 #include "../mixer.h" |
29 #include "../libao2/audio_plugin.h" | |
30 #include "../libao2/eq.h" | |
5789 | 31 |
6996 | 32 #ifdef USE_ICONV |
7128 | 33 #include <iconv.h> |
6996 | 34 #endif |
35 | |
5665 | 36 #include "../libmpdemux/stream.h" |
5789 | 37 #include "../libmpdemux/demuxer.h" |
7217 | 38 #include "../libmpdemux/stheader.h" |
39 #include "../libmpcodecs/dec_video.h" | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
40 |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
41 guiInterface_t guiIntfStruct; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
42 |
6627 | 43 char * gstrcat( char ** dest,char * src ) |
44 { | |
45 char * tmp = NULL; | |
46 | |
47 if ( !src ) return NULL; | |
48 | |
49 if ( *dest ) | |
50 { | |
51 tmp=malloc( strlen( *dest ) + strlen( src ) + 1 ); | |
52 strcpy( tmp,*dest ); strcat( tmp,src ); free( *dest ); | |
53 } | |
54 else | |
55 { tmp=malloc( strlen( src ) + 1 ); strcpy( tmp,src ); } | |
56 *dest=tmp; | |
57 return tmp; | |
58 } | |
59 | |
6794 | 60 int gstrcmp( char * a,char * b ) |
61 { | |
62 if ( !a && !b ) return 0; | |
63 if ( !a || !b ) return -1; | |
64 return strcmp( a,b ); | |
65 } | |
66 | |
7019 | 67 int gstrncmp( char * a,char * b,int size ) |
68 { | |
69 if ( !a && !b ) return 0; | |
70 if ( !a || !b ) return -1; | |
71 return strncmp( a,b,size ); | |
72 } | |
73 | |
6794 | 74 char * gstrdup( char * str ) |
75 { | |
76 if ( !str ) return NULL; | |
77 return strdup( str ); | |
78 } | |
79 | |
80 void gfree( void ** p ) | |
81 { | |
82 if ( *p == NULL ) return; | |
83 free( *p ); *p=NULL; | |
84 } | |
85 | |
86 void gset( char ** str,char * what ) | |
87 { | |
7887
0e5544951425
A small patch to Gui/interface.c; the first fix is a plain bug, the second is
arpi
parents:
7707
diff
changeset
|
88 if ( *str ) { if ( !strstr( *str,what ) ) { gstrcat( str,"," ); gstrcat( str,what ); }} |
6794 | 89 else gstrcat( str,what ); |
90 } | |
91 | |
7582 | 92 void gaddlist( char *** list,char * entry ) |
93 { | |
94 int i; | |
95 | |
96 if ( (*list) ) | |
97 { | |
98 for ( i=0;(*list)[i];i++ ) free( (*list)[i] ); | |
99 free( (*list) ); | |
100 } | |
101 | |
102 (*list)=malloc( 8 ); | |
103 (*list)[0]=gstrdup( entry ); | |
104 (*list)[1]=NULL; | |
105 } | |
106 | |
6996 | 107 #ifdef USE_ICONV |
108 char * gconvert_uri_to_filename( char * str ) | |
109 { | |
110 iconv_t d; | |
111 char * out = strdup( str ); | |
112 char * tmp = NULL; | |
113 char * ize; | |
114 size_t inb,outb; | |
115 char * charset = "ISO8859-1"; | |
116 char * cs; | |
117 | |
118 if ( !strchr( str,'%' ) ) return str; | |
119 | |
120 { | |
121 char * t = calloc( 1,strlen( out ) ); | |
122 int i,c = 0; | |
123 for ( i=0;i < (int)strlen( out );i++ ) | |
124 if ( out[i] != '%' ) t[c++]=out[i]; | |
125 else | |
126 { | |
127 char tmp[4] = "0xXX"; | |
128 // if ( out[++i] == '%' ) { t[c++]='%'; continue; }; | |
129 tmp[2]=out[++i]; tmp[3]=out[++i]; | |
130 t[c++]=(char)strtol( tmp,(char **)NULL,0 ); | |
131 } | |
132 free( out ); | |
133 out=t; | |
134 } | |
135 | |
136 if ( (cs=getenv( "CHARSET" )) && *cs ) charset=cs; | |
137 | |
138 inb=outb=strlen( out ); | |
139 tmp=calloc( 1,outb + 1 ); | |
140 ize=tmp; | |
141 d=iconv_open( charset,"UTF-8" ); | |
142 if ( (iconv_t)(-1) == d ) return str; | |
143 iconv( d,&out,&inb,&tmp,&outb ); | |
144 iconv_close( d ); | |
145 free( out ); | |
146 return ize; | |
147 } | |
148 #endif | |
149 | |
6218 | 150 void guiInit( void ) |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
151 { |
8058 | 152 int i; |
153 | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
154 memset( &guiIntfStruct,0,sizeof( guiIntfStruct ) ); |
6898 | 155 guiIntfStruct.Balance=50.0f; |
156 guiIntfStruct.StreamType=-1; | |
157 | |
6627 | 158 memset( >kEquChannels,0,sizeof( gtkEquChannels ) ); |
7706 | 159 if ( !gtkAOOSSMixer ) gtkAOOSSMixer=strdup( PATH_DEV_MIXER ); |
160 if ( !gtkAOOSSDevice ) gtkAOOSSDevice=strdup( PATH_DEV_DSP ); | |
7707 | 161 #ifdef HAVE_DXR3 |
7706 | 162 if ( !gtkDXR3Device ) gtkDXR3Device=strdup( "/dev/em8300-0" ); |
7707 | 163 #endif |
7538 | 164 fullscreen=gtkLoadFullscreen; |
6898 | 165 |
166 gtkInit(); | |
8043 | 167 // --- initialize X |
6912 | 168 wsXInit( (void *)mDisplay ); |
8058 | 169 // --- load skin |
8043 | 170 skinDirInHome=get_path("Skin"); |
171 skinMPlayerDir=DATADIR "/Skin"; | |
172 printf("SKIN dir 1: '%s'\n",skinDirInHome); | |
173 printf("SKIN dir 2: '%s'\n",skinMPlayerDir); | |
174 if ( !skinName ) skinName=strdup( "default" ); | |
175 switch ( skinRead( skinName ) ) | |
176 { | |
177 case -1: mp_msg( MSGT_GPLAYER,MSGL_ERR,MSGTR_SKIN_SKINCFG_SkinNotFound,skinName ); exit( 0 ); | |
178 case -2: mp_msg( MSGT_GPLAYER,MSGL_ERR,MSGTR_SKIN_SKINCFG_SkinCfgReadError,skinName ); exit( 0 ); | |
179 } | |
8058 | 180 // --- initialize windows |
181 if ( ( mplDrawBuffer = (unsigned char *)calloc( 1,appMPlayer.main.Bitmap.ImageSize ) ) == NULL ) | |
182 { | |
183 fprintf( stderr,MSGTR_NEMDB ); | |
184 exit( 0 ); | |
185 } | |
186 | |
187 wsCreateWindow( &appMPlayer.subWindow, | |
188 appMPlayer.sub.x,appMPlayer.sub.y,appMPlayer.sub.width,appMPlayer.sub.height, | |
189 wsNoBorder,wsShowMouseCursor|wsHandleMouseButton|wsHandleMouseMove,wsShowFrame|wsHideWindow,"ViDEO" ); | |
190 | |
191 wsDestroyImage( &appMPlayer.subWindow ); | |
192 wsCreateImage( &appMPlayer.subWindow,appMPlayer.sub.Bitmap.Width,appMPlayer.sub.Bitmap.Height ); | |
193 wsXDNDMakeAwareness(&appMPlayer.subWindow); | |
194 | |
195 vo_setwindow( appMPlayer.subWindow.WindowID, appMPlayer.subWindow.wGC ); | |
196 | |
197 // i=wsHideFrame|wsMaxSize|wsHideWindow; | |
198 // if ( appMPlayer.mainDecoration ) i=wsShowFrame|wsMaxSize|wsHideWindow; | |
199 i=wsShowFrame|wsMaxSize|wsHideWindow; | |
200 wsCreateWindow( &appMPlayer.mainWindow, | |
201 appMPlayer.main.x,appMPlayer.main.y,appMPlayer.main.width,appMPlayer.main.height, | |
202 wsNoBorder,wsShowMouseCursor|wsHandleMouseButton|wsHandleMouseMove,i,"MPlayer" ); //wsMinSize| | |
203 | |
204 wsSetShape( &appMPlayer.mainWindow,appMPlayer.main.Mask.Image ); | |
205 wsXDNDMakeAwareness(&appMPlayer.mainWindow); | |
206 | |
207 mplMenuInit(); | |
208 | |
209 #ifdef DEBUG | |
210 mp_msg( MSGT_GPLAYER,MSGL_DBG2,"[main] Depth on screen: %d\n",wsDepthOnScreen ); | |
211 mp_msg( MSGT_GPLAYER,MSGL_DBG2,"[main] parent: 0x%x\n",(int)appMPlayer.mainWindow.WindowID ); | |
212 mp_msg( MSGT_GPLAYER,MSGL_DBG2,"[main] sub: 0x%x\n",(int)appMPlayer.subWindow.WindowID ); | |
213 #endif | |
214 | |
215 appMPlayer.mainWindow.ReDraw=(void *)mplMainDraw; | |
216 appMPlayer.mainWindow.MouseHandler=mplMainMouseHandle; | |
217 appMPlayer.mainWindow.KeyHandler=mplMainKeyHandle; | |
218 appMPlayer.mainWindow.DandDHandler=mplDandDHandler; | |
219 | |
220 appMPlayer.subWindow.ReDraw=(void *)mplSubDraw; | |
221 appMPlayer.subWindow.MouseHandler=mplSubMouseHandle; | |
222 appMPlayer.subWindow.KeyHandler=mplMainKeyHandle; | |
223 appMPlayer.subWindow.DandDHandler=mplDandDHandler; | |
224 | |
225 wsSetBackgroundRGB( &appMPlayer.subWindow,appMPlayer.subR,appMPlayer.subG,appMPlayer.subB ); | |
226 wsClearWindow( appMPlayer.subWindow ); | |
227 if ( appMPlayer.sub.Bitmap.Image ) wsConvert( &appMPlayer.subWindow,appMPlayer.sub.Bitmap.Image,appMPlayer.sub.Bitmap.ImageSize ); | |
228 | |
229 btnModify( evSetVolume,guiIntfStruct.Volume ); | |
230 btnModify( evSetBalance,guiIntfStruct.Balance ); | |
231 btnModify( evSetMoviePosition,guiIntfStruct.Position ); | |
232 | |
233 wsSetIcon( wsDisplay,appMPlayer.mainWindow.WindowID,guiIcon,guiIconMask ); | |
234 wsSetIcon( wsDisplay,appMPlayer.subWindow.WindowID,guiIcon,guiIconMask ); | |
235 | |
236 guiIntfStruct.Playing=0; | |
237 | |
238 if ( !appMPlayer.mainDecoration ) wsWindowDecoration( &appMPlayer.mainWindow,0 ); | |
239 | |
240 wsVisibleWindow( &appMPlayer.mainWindow,wsShowWindow ); | |
241 #if 1 | |
242 wsVisibleWindow( &appMPlayer.subWindow,wsShowWindow ); | |
243 | |
244 { | |
245 XEvent xev; | |
246 do { XNextEvent( wsDisplay,&xev ); } while ( xev.type != MapNotify || xev.xmap.event != appMPlayer.subWindow.WindowID ); | |
247 appMPlayer.subWindow.Mapped=wsMapped; | |
248 } | |
249 | |
250 if ( fullscreen ) | |
251 { | |
252 mplFullScreen(); | |
253 btnModify( evFullScreen,btnPressed ); | |
254 } | |
255 #endif | |
256 mplSubRender=1; | |
8043 | 257 // --- |
7538 | 258 |
7009 | 259 if ( plCurrent && !filename ) mplSetFileName( plCurrent->path,plCurrent->name,STREAMTYPE_FILE ); |
6973 | 260 if ( sub_name ) guiSetFilename( guiIntfStruct.Subtitlename,sub_name ); |
6797
06d29dbdf20d
upsz, sorry, i forgott this :) (skin name saving:)
pontscho
parents:
6794
diff
changeset
|
261 #if defined( USE_OSD ) || defined( USE_SUB ) |
06d29dbdf20d
upsz, sorry, i forgott this :) (skin name saving:)
pontscho
parents:
6794
diff
changeset
|
262 guiLoadFont(); |
06d29dbdf20d
upsz, sorry, i forgott this :) (skin name saving:)
pontscho
parents:
6794
diff
changeset
|
263 #endif |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
264 } |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
265 |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
266 void guiDone( void ) |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
267 { |
8043 | 268 mp_msg( MSGT_GPLAYER,MSGL_V,"[gui] done.\n" ); |
6794 | 269 cfg_write(); |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
270 wsXDone(); |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
271 } |
4798 | 272 |
4858 | 273 int guiCMDArray[] = |
274 { | |
275 evLoad, | |
276 evLoadSubtitle, | |
277 evAbout, | |
278 evPlay, | |
279 evStop, | |
280 evPlayList, | |
281 evPreferences, | |
282 evFullScreen, | |
283 evSkinBrowser | |
284 }; | |
285 | |
6619
f554e7271587
fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents:
6280
diff
changeset
|
286 extern ao_functions_t * audio_out; |
6755 | 287 extern vo_functions_t * video_out; |
6794 | 288 extern int frame_dropping; |
289 extern int stream_dump_type; | |
290 extern char ** vo_plugin_args; | |
291 | |
292 #if defined( USE_OSD ) || defined( USE_SUB ) | |
293 void guiLoadFont( void ) | |
294 { | |
7122
0dc9cb756b68
freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents:
7111
diff
changeset
|
295 #ifdef HAVE_FREETYPE |
0dc9cb756b68
freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents:
7111
diff
changeset
|
296 load_font(vo_image_width, vo_image_height); |
0dc9cb756b68
freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents:
7111
diff
changeset
|
297 #else |
6794 | 298 if ( vo_font ) |
299 { | |
300 int i; | |
301 if ( vo_font->name ) free( vo_font->name ); | |
302 if ( vo_font->fpath ) free( vo_font->fpath ); | |
303 for ( i=0;i<16;i++ ) | |
304 if ( vo_font->pic_a[i] ) | |
305 { | |
306 if ( vo_font->pic_a[i]->bmp ) free( vo_font->pic_a[i]->bmp ); | |
307 if ( vo_font->pic_a[i]->pal ) free( vo_font->pic_a[i]->pal ); | |
308 } | |
309 for ( i=0;i<16;i++ ) | |
310 if ( vo_font->pic_b[i] ) | |
311 { | |
312 if ( vo_font->pic_b[i]->bmp ) free( vo_font->pic_b[i]->bmp ); | |
313 if ( vo_font->pic_b[i]->pal ) free( vo_font->pic_b[i]->pal ); | |
314 } | |
315 free( vo_font ); vo_font=NULL; | |
316 } | |
7019 | 317 if ( font_name ) |
6794 | 318 { |
7019 | 319 vo_font=read_font_desc( font_name,font_factor,0 ); |
6794 | 320 if ( !vo_font ) mp_msg( MSGT_CPLAYER,MSGL_ERR,MSGTR_CantLoadFont,font_name ); |
321 } | |
322 else | |
323 { | |
7019 | 324 font_name=gstrdup( get_path( "font/font.desc" ) ); |
325 vo_font=read_font_desc( font_name,font_factor,0 ); | |
6794 | 326 if ( !vo_font ) |
327 { | |
7019 | 328 gfree( (void **)&font_name ); font_name=gstrdup( DATADIR"/font/font.desc" ); |
329 vo_font=read_font_desc( font_name,font_factor,0 ); | |
6794 | 330 } |
331 } | |
7122
0dc9cb756b68
freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents:
7111
diff
changeset
|
332 #endif |
6794 | 333 } |
334 #endif | |
6619
f554e7271587
fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents:
6280
diff
changeset
|
335 |
7150 | 336 #ifdef USE_SUB |
7169 | 337 extern mp_osd_obj_t* vo_osd_list; |
338 | |
7150 | 339 void guiLoadSubtitle( char * name ) |
340 { | |
341 if ( guiIntfStruct.Playing == 0 ) | |
342 { | |
343 guiIntfStruct.SubtitleChanged=1; | |
344 return; | |
345 } | |
346 if ( subtitles ) | |
347 { | |
7169 | 348 mp_msg( MSGT_GPLAYER,MSGL_INFO,"[gui] Delete subtitles.\n" ); |
7150 | 349 sub_free( subtitles ); |
7169 | 350 subtitles=NULL; |
7170 | 351 gfree( (void **)&sub_name ); |
7150 | 352 vo_sub=NULL; |
7169 | 353 if ( vo_osd_list ) |
354 { | |
355 int len; | |
356 mp_osd_obj_t * osd = vo_osd_list; | |
357 while ( osd ) | |
358 { | |
359 if ( osd->type == OSDTYPE_SUBTITLE ) break; | |
360 osd=osd->next; | |
361 } | |
362 if ( osd && osd->flags&OSDFLAG_VISIBLE ) | |
363 { | |
364 len=osd->stride * ( osd->bbox.y2 - osd->bbox.y1 ); | |
365 memset( osd->bitmap_buffer,0,len ); | |
366 memset( osd->alpha_buffer,0,len ); | |
367 } | |
368 } | |
7150 | 369 } |
7169 | 370 if ( name ) |
371 { | |
372 mp_msg( MSGT_GPLAYER,MSGL_INFO,"[gui] Delete Load subtitle: %s\n",name ); | |
373 sub_name=gstrdup( name ); | |
374 subtitles=sub_read_file( sub_name,guiIntfStruct.FPS ); | |
375 } | |
7150 | 376 } |
377 #endif | |
378 | |
7009 | 379 static void add_vop( char * str ) |
380 { | |
381 mp_msg( MSGT_GPLAYER,MSGL_STATUS,"[gui] add video filter: %s\n",str ); | |
382 if ( vo_plugin_args ) | |
383 { | |
384 int i = 0; | |
385 while ( vo_plugin_args[i] ) if ( !gstrcmp( vo_plugin_args[i++],str ) ) { i=-1; break; } | |
386 if ( i != -1 ) | |
387 { vo_plugin_args=realloc( vo_plugin_args,( i + 2 ) * sizeof( char * ) ); vo_plugin_args[i]=strdup( str ); vo_plugin_args[i+1]=NULL; } | |
388 } else { vo_plugin_args=malloc( 2 * sizeof( char * ) ); vo_plugin_args[0]=strdup( str ); vo_plugin_args[1]=NULL; } | |
389 } | |
390 | |
391 static void remove_vop( char * str ) | |
392 { | |
393 int n = 0; | |
394 | |
395 if ( !vo_plugin_args ) return; | |
396 | |
397 mp_msg( MSGT_GPLAYER,MSGL_STATUS,"[gui] remove video filter: %s\n",str ); | |
398 | |
399 while ( vo_plugin_args[n++] ); n--; | |
400 if ( n > -1 ) | |
401 { | |
402 int i = 0,m = -1; | |
403 while ( vo_plugin_args[i] ) if ( !gstrcmp( vo_plugin_args[i++],str ) ) { m=i - 1; break; } | |
404 i--; | |
405 if ( m > -1 ) | |
406 { | |
407 if ( n == 1 ) { free( vo_plugin_args[0] ); free( vo_plugin_args ); vo_plugin_args=NULL; } | |
408 else memcpy( &vo_plugin_args[i],&vo_plugin_args[i + 1],( n - i ) * sizeof( char * ) ); | |
409 } | |
410 } | |
411 } | |
412 | |
413 int guiGetEvent( int type,char * arg ) | |
4798 | 414 { |
6280 | 415 stream_t * stream = (stream_t *) arg; |
5672
1f8b34f1e7c0
ifdef reading dvd args, without it non-dvd compilation fails.
eyck
parents:
5665
diff
changeset
|
416 #ifdef USE_DVDREAD |
5665 | 417 dvd_priv_t * dvdp = (dvd_priv_t *) arg; |
5672
1f8b34f1e7c0
ifdef reading dvd args, without it non-dvd compilation fails.
eyck
parents:
5665
diff
changeset
|
418 #endif |
6619
f554e7271587
fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents:
6280
diff
changeset
|
419 |
4798 | 420 switch ( type ) |
421 { | |
422 case guiXEvent: | |
423 wsEvents( wsDisplay,(XEvent *)arg,NULL ); | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
424 gtkEventHandling(); |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
425 break; |
4798 | 426 case guiCEvent: |
4963 | 427 switch ( (int)arg ) |
428 { | |
429 case guiSetPlay: guiIntfStruct.Playing=1; mplState(); break; | |
430 case guiSetStop: guiIntfStruct.Playing=0; mplState(); break; | |
431 case guiSetPause: guiIntfStruct.Playing=2; mplState(); break; | |
432 } | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
433 break; |
5665 | 434 case guiSetState: |
435 mplState(); | |
436 break; | |
437 case guiSetFileName: | |
438 if ( arg ) guiSetFilename( guiIntfStruct.Filename,arg ); | |
439 break; | |
5789 | 440 case guiSetAudioOnly: |
441 guiIntfStruct.AudioOnly=(int)arg; | |
7009 | 442 if ( (int)arg ) { guiIntfStruct.NoWindow=True; wsVisibleWindow( &appMPlayer.subWindow,wsHideWindow ); } |
5789 | 443 else wsVisibleWindow( &appMPlayer.subWindow,wsShowWindow ); |
444 break; | |
445 case guiReDrawSubWindow: | |
446 wsPostRedisplay( &appMPlayer.subWindow ); | |
447 break; | |
448 case guiSetShVideo: | |
449 { | |
5986 | 450 if ( !appMPlayer.subWindow.isFullScreen ) |
451 { | |
452 wsResizeWindow( &appMPlayer.subWindow,vo_dwidth,vo_dheight ); | |
453 wsMoveWindow( &appMPlayer.subWindow,True,appMPlayer.sub.x,appMPlayer.sub.y ); | |
454 } | |
5955
caac20b1ca79
fix xmga fs, resize to movie size and mouse auto hide + dga
pontscho
parents:
5945
diff
changeset
|
455 guiIntfStruct.MovieWidth=vo_dwidth; |
5997
b5fb9a927bf3
add WM detection, and wm specific fullscreen code. (???)
pontscho
parents:
5986
diff
changeset
|
456 guiIntfStruct.MovieHeight=vo_dheight; |
5789 | 457 } |
458 break; | |
5665 | 459 #ifdef USE_DVDREAD |
460 case guiSetDVD: | |
461 guiIntfStruct.DVD.titles=dvdp->vmg_file->tt_srpt->nr_of_srpts; | |
462 guiIntfStruct.DVD.chapters=dvdp->vmg_file->tt_srpt->title[dvd_title].nr_of_ptts; | |
463 guiIntfStruct.DVD.angles=dvdp->vmg_file->tt_srpt->title[dvd_title].nr_of_angles; | |
464 guiIntfStruct.DVD.nr_of_audio_channels=dvdp->nr_of_channels; | |
465 memcpy( guiIntfStruct.DVD.audio_streams,dvdp->audio_streams,sizeof( dvdp->audio_streams ) ); | |
466 guiIntfStruct.DVD.nr_of_subtitles=dvdp->nr_of_subtitles; | |
467 memcpy( guiIntfStruct.DVD.subtitles,dvdp->subtitles,sizeof( dvdp->subtitles ) ); | |
468 guiIntfStruct.DVD.current_title=dvd_title + 1; | |
469 guiIntfStruct.DVD.current_chapter=dvd_chapter + 1; | |
470 guiIntfStruct.DVD.current_angle=dvd_angle + 1; | |
471 guiIntfStruct.Track=dvd_title + 1; | |
472 break; | |
473 #endif | |
6280 | 474 case guiSetStream: |
475 guiIntfStruct.StreamType=stream->type; | |
476 switch( stream->type ) | |
477 { | |
7150 | 478 #ifdef USE_DVDREAD |
6280 | 479 case STREAMTYPE_DVD: |
480 guiGetEvent( guiSetDVD,(char *)stream->priv ); | |
481 break; | |
7150 | 482 #endif |
6280 | 483 #ifdef HAVE_VCD |
484 case STREAMTYPE_VCD: | |
485 { | |
486 int i; | |
487 for ( i=1;i < 100;i++ ) | |
488 if ( vcd_seek_to_track( stream->fd,i ) < 0 ) break; | |
489 vcd_seek_to_track( stream->fd,vcd_track ); | |
490 guiIntfStruct.VCDTracks=--i; | |
8043 | 491 mp_msg( MSGT_GPLAYER,MSGL_INFO,"[gui] vcd tracks: %d\n",guiIntfStruct.VCDTracks ); |
6280 | 492 guiIntfStruct.Track=vcd_track; |
493 break; | |
494 } | |
495 #endif | |
7150 | 496 default: break; |
6280 | 497 } |
498 break; | |
4858 | 499 case guiIEvent: |
500 printf( "cmd: %d\n",(int)arg ); | |
501 switch( (int)arg ) | |
502 { | |
503 case MP_CMD_QUIT: | |
504 mplEventHandling( evExit,0 ); | |
505 break; | |
506 case MP_CMD_VO_FULLSCREEN: | |
507 mplEventHandling( evFullScreen,0 ); | |
508 break; | |
509 default: | |
510 mplEventHandling( guiCMDArray[ (int)arg - MP_CMD_GUI_EVENTS - 1 ],0 ); | |
511 } | |
512 break; | |
6619
f554e7271587
fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents:
6280
diff
changeset
|
513 case guiReDraw: |
f554e7271587
fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents:
6280
diff
changeset
|
514 mplEventHandling( evRedraw,0 ); |
f554e7271587
fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents:
6280
diff
changeset
|
515 break; |
f554e7271587
fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents:
6280
diff
changeset
|
516 case guiSetVolume: |
6903 | 517 if ( audio_out ) |
518 { | |
519 float l,r; | |
520 mixer_getvolume( &l,&r ); | |
521 guiIntfStruct.Volume=(r>l?r:l); | |
522 if ( r != l ) guiIntfStruct.Balance=( ( r - l ) + 100 ) * 0.5f; | |
523 else guiIntfStruct.Balance=50.0f; | |
524 btnModify( evSetVolume,guiIntfStruct.Volume ); | |
525 btnModify( evSetBalance,guiIntfStruct.Balance ); | |
526 } | |
527 break; | |
7009 | 528 case guiSetFileFormat: |
529 guiIntfStruct.FileFormat=(int)arg; | |
530 break; | |
6903 | 531 case guiSetValues: |
6912 | 532 // -- video |
7217 | 533 guiIntfStruct.sh_video=arg; |
6912 | 534 if ( arg ) |
535 { | |
7217 | 536 sh_video_t * sh = (sh_video_t *)arg; |
7150 | 537 guiIntfStruct.FPS=sh->fps; |
6912 | 538 } |
7009 | 539 |
540 if ( guiIntfStruct.NoWindow ) wsVisibleWindow( &appMPlayer.subWindow,wsHideWindow ); | |
541 | |
6794 | 542 // -- audio |
6619
f554e7271587
fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents:
6280
diff
changeset
|
543 if ( audio_out ) |
f554e7271587
fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents:
6280
diff
changeset
|
544 { |
f554e7271587
fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents:
6280
diff
changeset
|
545 float l,r; |
f554e7271587
fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents:
6280
diff
changeset
|
546 mixer_getvolume( &l,&r ); |
f554e7271587
fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents:
6280
diff
changeset
|
547 guiIntfStruct.Volume=(r>l?r:l); |
f554e7271587
fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents:
6280
diff
changeset
|
548 if ( r != l ) guiIntfStruct.Balance=( ( r - l ) + 100 ) * 0.5f; |
6627 | 549 else guiIntfStruct.Balance=50.0f; |
6619
f554e7271587
fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents:
6280
diff
changeset
|
550 btnModify( evSetVolume,guiIntfStruct.Volume ); |
f554e7271587
fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents:
6280
diff
changeset
|
551 btnModify( evSetBalance,guiIntfStruct.Balance ); |
f554e7271587
fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents:
6280
diff
changeset
|
552 } |
6627 | 553 |
6794 | 554 if ( gtkAONoSound ) { if ( !muted ) mixer_mute(); } |
555 else if ( muted ) mixer_mute(); | |
556 | |
6627 | 557 if ( gtkEnableAudioEqualizer ) |
558 { | |
559 equalizer_t eq; | |
560 int i,j; | |
561 for ( i=0;i<6;i++ ) | |
562 for ( j=0;j<10;j++ ) | |
563 { | |
564 eq.channel=i; eq.band=j; eq.gain=gtkEquChannels[i][j]; | |
565 gtkSet( gtkSetEqualizer,0,&eq ); | |
566 } | |
567 } | |
6794 | 568 // -- subtitle |
7009 | 569 #ifdef HAVE_DXR3 |
8043 | 570 if ( video_driver_list && !gstrcmp( video_driver_list[0],"dxr3" ) && guiIntfStruct.FileFormat != DEMUXER_TYPE_MPEG_PS |
571 #ifdef USE_LIBAVCODEC | |
572 && !gtkVopLAVC | |
573 #endif | |
574 #ifdef USE_LIBFAME | |
575 && !gtkVopFAME | |
576 #endif | |
577 ) | |
7009 | 578 { |
579 gtkMessageBox( GTK_MB_FATAL,MSGTR_NEEDLAVCFAME ); | |
580 guiIntfStruct.Playing=0; | |
581 return True; | |
582 } | |
583 #endif | |
6627 | 584 break; |
585 case guiSetDefaults: | |
6857 | 586 if ( filename && !guiIntfStruct.Filename ) |
6794 | 587 { |
588 gtkSet( gtkDelPl,0,NULL ); guiIntfStruct.StreamType=STREAMTYPE_FILE; | |
589 guiSetFilename( guiIntfStruct.Filename,filename ); | |
590 } | |
591 | |
592 guiIntfStruct.DiskChanged=0; | |
593 | |
7009 | 594 // --- video opts |
7019 | 595 |
7582 | 596 if ( !video_driver_list ) |
6794 | 597 { |
6797
06d29dbdf20d
upsz, sorry, i forgott this :) (skin name saving:)
pontscho
parents:
6794
diff
changeset
|
598 int i = 0; |
6903 | 599 while ( video_out_drivers[i++] ) |
600 if ( video_out_drivers[i - 1]->control( VOCTRL_GUISUPPORT,NULL ) == VO_TRUE ) | |
601 { | |
602 const vo_info_t *info = video_out_drivers[i - 1]->get_info(); | |
7582 | 603 gaddlist( &video_driver_list,(char *)info->short_name ); |
6903 | 604 break; |
605 } | |
6794 | 606 } |
607 | |
7582 | 608 if ( !video_driver_list && !video_driver_list[0] ) { gtkMessageBox( GTK_MB_FATAL,MSGTR_IDFGCVD ); exit_player( "gui init" ); } |
7009 | 609 |
610 { | |
611 int i = 0; | |
612 guiIntfStruct.NoWindow=False; | |
613 while ( video_out_drivers[i++] ) | |
614 if ( video_out_drivers[i - 1]->control( VOCTRL_GUISUPPORT,NULL ) == VO_TRUE ) | |
6794 | 615 { |
7009 | 616 const vo_info_t *info = video_out_drivers[i - 1]->get_info(); |
7582 | 617 if ( ( video_driver_list && !gstrcmp( video_driver_list[0],(char *)info->short_name ) )&&( video_out_drivers[i - 1]->control( VOCTRL_GUI_NOWINDOW,NULL ) == VO_TRUE ) ) |
7009 | 618 { guiIntfStruct.NoWindow=True; break; } |
6794 | 619 } |
7009 | 620 } |
621 | |
622 #ifdef HAVE_DXR3 | |
8043 | 623 #ifdef USE_LIBAVCODEC |
7009 | 624 remove_vop( "lavc" ); |
8043 | 625 #endif |
626 #ifdef USE_LIBFAME | |
7009 | 627 remove_vop( "fame" ); |
8043 | 628 #endif |
7582 | 629 if ( video_driver_list && !gstrcmp( video_driver_list[0],"dxr3" ) ) |
7009 | 630 { |
631 if ( ( guiIntfStruct.StreamType != STREAMTYPE_DVD)&&( guiIntfStruct.StreamType != STREAMTYPE_VCD ) ) | |
632 { | |
8043 | 633 #ifdef USE_LIBAVCODEC |
7009 | 634 if ( gtkVopLAVC ) add_vop( "lavc" ); |
8043 | 635 #endif |
636 #ifdef USE_LIBFAME | |
7009 | 637 if ( gtkVopFAME ) add_vop( "fame" ); |
8043 | 638 #endif |
7009 | 639 } |
640 } | |
641 #endif | |
642 // --- | |
7019 | 643 if ( gtkVopPP ) add_vop( "pp" ); |
644 else remove_vop( "pp" ); | |
6794 | 645 |
646 // --- audio opts | |
7887
0e5544951425
A small patch to Gui/interface.c; the first fix is a plain bug, the second is
arpi
parents:
7707
diff
changeset
|
647 // if ( ao_plugin_cfg.plugin_list ) { free( ao_plugin_cfg.plugin_list ); ao_plugin_cfg.plugin_list=NULL; } |
6840 | 648 if ( gtkAONorm ) gset( &ao_plugin_cfg.plugin_list,"volnorm" ); |
6794 | 649 if ( gtkEnableAudioEqualizer ) gset( &ao_plugin_cfg.plugin_list,"eq" ); |
650 if ( gtkAOExtraStereo ) | |
651 { | |
652 gset( &ao_plugin_cfg.plugin_list,"extrastereo" ); | |
653 ao_plugin_cfg.pl_extrastereo_mul=gtkAOExtraStereoMul; | |
654 } | |
655 mixer_device=gtkAOOSSMixer; | |
7582 | 656 if ( audio_driver_list && !gstrncmp( audio_driver_list[0],"oss",3 ) && gtkAOOSSDevice ) |
6794 | 657 { |
7019 | 658 char * tmp = calloc( 1,strlen( gtkAOOSSDevice ) + 5 ); |
659 sprintf( tmp,"oss:%s",gtkAOOSSDevice ); | |
7582 | 660 gaddlist( &audio_driver_list,tmp ); |
7019 | 661 } |
6794 | 662 |
663 // -- subtitle | |
664 #ifdef USE_SUB | |
7170 | 665 sub_name=gstrdup( guiIntfStruct.Subtitlename ); |
6794 | 666 stream_dump_type=0; |
667 if ( gtkSubDumpMPSub ) stream_dump_type=4; | |
668 if ( gtkSubDumpSrt ) stream_dump_type=6; | |
669 gtkSubDumpMPSub=gtkSubDumpSrt=0; | |
6627 | 670 #endif |
6794 | 671 #if defined( USE_OSD ) || defined( USE_SUB ) |
672 guiLoadFont(); | |
6627 | 673 #endif |
674 | |
6794 | 675 // --- misc |
6627 | 676 if ( guiIntfStruct.AudioFile ) audio_stream=guiIntfStruct.AudioFile; |
677 else if ( guiIntfStruct.FilenameChanged ) audio_stream=NULL; | |
678 | |
679 break; | |
4798 | 680 } |
7009 | 681 return False; |
4798 | 682 } |
683 | |
684 void guiEventHandling( void ) | |
685 { | |
7009 | 686 if ( !guiIntfStruct.Playing || guiIntfStruct.NoWindow ) wsHandleEvents(); |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
687 gtkEventHandling(); |
4798 | 688 } |
6627 | 689 |
690 // --- | |
691 | |
692 float gtkEquChannels[6][10]; | |
693 | |
6713 | 694 plItem * plCurrent = NULL; |
695 plItem * plList = NULL; | |
696 plItem * plLastPlayed = NULL; | |
697 | |
7092
8e9607c5897e
- warning fixes from Dominik Mierzejewski <dominik@rangers.eu.org>
pontscho
parents:
7019
diff
changeset
|
698 URLItem *URLList = NULL; |
8e9607c5897e
- warning fixes from Dominik Mierzejewski <dominik@rangers.eu.org>
pontscho
parents:
7019
diff
changeset
|
699 |
6713 | 700 #if defined( MP_DEBUG ) && 0 |
701 void list( void ) | |
6627 | 702 { |
6713 | 703 plItem * next = plList; |
704 printf( "--- list ---\n" ); | |
705 while( next || next->next ) | |
706 { | |
707 printf( "item: %s/%s\n",next->path,next->name ); | |
708 if ( next->next ) next=next->next; else break; | |
709 } | |
710 printf( "--- end of list ---\n" ); | |
711 } | |
712 #else | |
713 #define list(); | |
714 #endif | |
715 | |
716 void * gtkSet( int cmd,float fparam, void * vparam ) | |
717 { | |
6627 | 718 equalizer_t * eq = (equalizer_t *)vparam; |
6713 | 719 plItem * item = (plItem *)vparam; |
6627 | 720 |
7092
8e9607c5897e
- warning fixes from Dominik Mierzejewski <dominik@rangers.eu.org>
pontscho
parents:
7019
diff
changeset
|
721 URLItem * url_item = (URLItem *)vparam; |
8e9607c5897e
- warning fixes from Dominik Mierzejewski <dominik@rangers.eu.org>
pontscho
parents:
7019
diff
changeset
|
722 int is_added = True; |
8e9607c5897e
- warning fixes from Dominik Mierzejewski <dominik@rangers.eu.org>
pontscho
parents:
7019
diff
changeset
|
723 |
6627 | 724 switch ( cmd ) |
725 { | |
6713 | 726 // --- handle playlist |
6755 | 727 case gtkAddPlItem: // add item to playlist |
6713 | 728 if ( plList ) |
729 { | |
730 plItem * next = plList; | |
731 while ( next->next ) { /*printf( "%s\n",next->name );*/ next=next->next; } | |
732 next->next=item; item->prev=next; | |
7092
8e9607c5897e
- warning fixes from Dominik Mierzejewski <dominik@rangers.eu.org>
pontscho
parents:
7019
diff
changeset
|
733 } else { item->prev=item->next=NULL; plCurrent=plList=item; } |
6713 | 734 list(); |
735 return NULL; | |
736 case gtkGetNextPlItem: // get current item from playlist | |
737 if ( plCurrent ) | |
738 { | |
739 plCurrent=plCurrent->next; | |
740 if ( !plCurrent && plList ) | |
741 { | |
742 plItem * next = plList; | |
743 while ( next->next ) { if ( !next->next ) break; next=next->next; } | |
744 plCurrent=next; | |
745 } | |
746 return plCurrent; | |
747 } | |
748 return NULL; | |
749 case gtkGetPrevPlItem: | |
750 if ( plCurrent ) | |
751 { | |
752 plCurrent=plCurrent->prev; | |
753 if ( !plCurrent && plList ) plCurrent=plList; | |
754 return plCurrent; | |
755 } | |
6794 | 756 return NULL; |
6713 | 757 case gtkGetCurrPlItem: // get current item |
758 return plCurrent; | |
759 case gtkDelPl: // delete list | |
760 { | |
761 plItem * curr = plList; | |
762 plItem * next; | |
763 if ( !plList ) return NULL; | |
764 if ( !curr->next ) | |
765 { | |
766 if ( curr->path ) free( curr->path ); | |
767 if ( curr->name ) free( curr->name ); | |
768 free( curr ); | |
769 } | |
770 else | |
771 { | |
772 while ( curr->next ) | |
773 { | |
774 next=curr->next; | |
775 if ( curr->path ) free( curr->path ); | |
776 if ( curr->name ) free( curr->name ); | |
777 free( curr ); | |
778 curr=next; | |
779 } | |
780 } | |
781 plList=NULL; plCurrent=NULL; | |
782 } | |
783 return NULL; | |
7092
8e9607c5897e
- warning fixes from Dominik Mierzejewski <dominik@rangers.eu.org>
pontscho
parents:
7019
diff
changeset
|
784 // ----- Handle url |
8e9607c5897e
- warning fixes from Dominik Mierzejewski <dominik@rangers.eu.org>
pontscho
parents:
7019
diff
changeset
|
785 case gtkAddURLItem: |
8e9607c5897e
- warning fixes from Dominik Mierzejewski <dominik@rangers.eu.org>
pontscho
parents:
7019
diff
changeset
|
786 if ( URLList ) |
8e9607c5897e
- warning fixes from Dominik Mierzejewski <dominik@rangers.eu.org>
pontscho
parents:
7019
diff
changeset
|
787 { |
8e9607c5897e
- warning fixes from Dominik Mierzejewski <dominik@rangers.eu.org>
pontscho
parents:
7019
diff
changeset
|
788 URLItem * next_url = URLList; |
8e9607c5897e
- warning fixes from Dominik Mierzejewski <dominik@rangers.eu.org>
pontscho
parents:
7019
diff
changeset
|
789 is_added = False; |
8e9607c5897e
- warning fixes from Dominik Mierzejewski <dominik@rangers.eu.org>
pontscho
parents:
7019
diff
changeset
|
790 while ( next_url->next ) |
8e9607c5897e
- warning fixes from Dominik Mierzejewski <dominik@rangers.eu.org>
pontscho
parents:
7019
diff
changeset
|
791 { |
8e9607c5897e
- warning fixes from Dominik Mierzejewski <dominik@rangers.eu.org>
pontscho
parents:
7019
diff
changeset
|
792 if ( !gstrcmp( next_url->url,url_item->url ) ) |
8e9607c5897e
- warning fixes from Dominik Mierzejewski <dominik@rangers.eu.org>
pontscho
parents:
7019
diff
changeset
|
793 { |
8e9607c5897e
- warning fixes from Dominik Mierzejewski <dominik@rangers.eu.org>
pontscho
parents:
7019
diff
changeset
|
794 is_added=True; |
8e9607c5897e
- warning fixes from Dominik Mierzejewski <dominik@rangers.eu.org>
pontscho
parents:
7019
diff
changeset
|
795 break; |
8e9607c5897e
- warning fixes from Dominik Mierzejewski <dominik@rangers.eu.org>
pontscho
parents:
7019
diff
changeset
|
796 } |
8e9607c5897e
- warning fixes from Dominik Mierzejewski <dominik@rangers.eu.org>
pontscho
parents:
7019
diff
changeset
|
797 next_url=next_url->next; |
8e9607c5897e
- warning fixes from Dominik Mierzejewski <dominik@rangers.eu.org>
pontscho
parents:
7019
diff
changeset
|
798 } |
8e9607c5897e
- warning fixes from Dominik Mierzejewski <dominik@rangers.eu.org>
pontscho
parents:
7019
diff
changeset
|
799 if ( ( !is_added )&&( gstrcmp( next_url->url,url_item->url ) ) ) next_url->next=url_item; |
8e9607c5897e
- warning fixes from Dominik Mierzejewski <dominik@rangers.eu.org>
pontscho
parents:
7019
diff
changeset
|
800 } else { url_item->next=NULL; URLList=url_item; } |
8e9607c5897e
- warning fixes from Dominik Mierzejewski <dominik@rangers.eu.org>
pontscho
parents:
7019
diff
changeset
|
801 return NULL; |
6794 | 802 // --- subtitle |
803 #if defined( USE_OSD ) || defined( USE_SUB ) | |
7139 | 804 #ifndef HAVE_FREETYPE |
6794 | 805 case gtkSetFontFactor: |
7019 | 806 font_factor=fparam; |
6794 | 807 guiLoadFont(); |
808 return NULL; | |
7139 | 809 #else |
810 case gtkSetFontOutLine: | |
811 subtitle_font_thickness=( 8.0f / 100.0f ) * fparam; | |
812 guiLoadFont(); | |
813 return NULL; | |
814 case gtkSetFontBlur: | |
815 subtitle_font_radius=( 8.0f / 100.0f ) * fparam; | |
816 guiLoadFont(); | |
817 return NULL; | |
818 case gtkSetFontTextScale: | |
819 text_font_scale_factor=fparam; | |
820 guiLoadFont(); | |
821 return NULL; | |
822 case gtkSetFontOSDScale: | |
823 osd_font_scale_factor=fparam; | |
824 guiLoadFont(); | |
825 return NULL; | |
826 case gtkSetFontEncoding: | |
827 if ( subtitle_font_encoding ) free( subtitle_font_encoding ); | |
828 subtitle_font_encoding=gstrdup( (char *)vparam ); | |
829 guiLoadFont(); | |
830 return NULL; | |
831 case gtkSetFontAutoScale: | |
832 subtitle_autoscale=(int)fparam; | |
833 guiLoadFont(); | |
834 return NULL; | |
835 #endif | |
6794 | 836 #endif |
837 // --- misc | |
838 case gtkClearStruct: | |
7009 | 839 if ( (unsigned int)vparam & guiFilenames ) |
6794 | 840 { |
841 gfree( (void **)&guiIntfStruct.Filename ); | |
842 gfree( (void **)&guiIntfStruct.Subtitlename ); | |
843 gfree( (void **)&guiIntfStruct.AudioFile ); | |
7009 | 844 gtkSet( gtkDelPl,0,NULL ); |
6794 | 845 } |
846 #ifdef USE_DVDREAD | |
7009 | 847 if ( (unsigned int)vparam & guiDVD ) memset( &guiIntfStruct.DVD,0,sizeof( guiDVDStruct ) ); |
6794 | 848 #endif |
849 #ifdef HAVE_VCD | |
7009 | 850 if ( (unsigned int)vparam & guiVCD ) guiIntfStruct.VCDTracks=0; |
6794 | 851 #endif |
852 return NULL; | |
853 case gtkSetExtraStereo: | |
854 gtkAOExtraStereoMul=fparam; | |
855 audio_plugin_extrastereo.control( AOCONTROL_PLUGIN_ES_SET,(int)>kAOExtraStereoMul ); | |
856 return NULL; | |
857 case gtkSetPanscan: | |
7217 | 858 { |
859 mp_cmd_t * mp_cmd; | |
860 mp_cmd=(mp_cmd_t *)calloc( 1,sizeof( *mp_cmd ) ); | |
861 mp_cmd->id=MP_CMD_PANSCAN; mp_cmd->name=strdup( "panscan" ); | |
862 mp_cmd->args[0].v.f=fparam; mp_cmd->args[1].v.i=1; | |
863 mp_input_queue_cmd( mp_cmd ); | |
864 } | |
6794 | 865 return NULL; |
866 case gtkSetAutoq: | |
7019 | 867 auto_quality=(int)fparam; |
6794 | 868 return NULL; |
6713 | 869 // --- set equalizers |
6627 | 870 case gtkSetContrast: |
7217 | 871 if ( guiIntfStruct.sh_video ) set_video_colors( guiIntfStruct.sh_video,"contrast",(int)fparam ); |
872 return NULL; | |
6627 | 873 case gtkSetBrightness: |
7217 | 874 if ( guiIntfStruct.sh_video ) set_video_colors( guiIntfStruct.sh_video,"brightness",(int)fparam ); |
875 return NULL; | |
6627 | 876 case gtkSetHue: |
7217 | 877 if ( guiIntfStruct.sh_video ) set_video_colors( guiIntfStruct.sh_video,"hue",(int)fparam ); |
878 return NULL; | |
6627 | 879 case gtkSetSaturation: |
7217 | 880 if ( guiIntfStruct.sh_video ) set_video_colors( guiIntfStruct.sh_video,"saturation",(int)fparam ); |
881 return NULL; | |
6627 | 882 case gtkSetEqualizer: |
883 if ( eq ) | |
884 { | |
885 gtkEquChannels[eq->channel][eq->band]=eq->gain; | |
886 audio_plugin_eq.control( AOCONTROL_PLUGIN_EQ_SET_GAIN,(int)eq ); | |
887 } | |
888 else | |
889 { | |
890 int i,j; equalizer_t tmp; tmp.gain=0.0f; | |
891 memset( gtkEquChannels,0,sizeof( gtkEquChannels ) ); | |
892 for ( i=0;i<6;i++ ) | |
893 for ( j=0;j<10;j++ ) | |
894 { tmp.channel=i; tmp.band=j; audio_plugin_eq.control( AOCONTROL_PLUGIN_EQ_SET_GAIN,(int)&tmp ); } | |
895 } | |
6713 | 896 return NULL; |
6627 | 897 } |
6713 | 898 return NULL; |
6627 | 899 } |