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