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