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