comparison Gui/interface.c @ 9623:20f0a254142d

bugfix from Raindel Shachar <raindel@techunix.technion.ac.il>
author pontscho
date Thu, 20 Mar 2003 07:51:03 +0000
parents f38fe55d0e05
children bc24dd70c6e2
comparison
equal deleted inserted replaced
9622:78ef5d3126b2 9623:20f0a254142d
36 36
37 #include "../libmpdemux/stream.h" 37 #include "../libmpdemux/stream.h"
38 #include "../libmpdemux/demuxer.h" 38 #include "../libmpdemux/demuxer.h"
39 #include "../libmpdemux/stheader.h" 39 #include "../libmpdemux/stheader.h"
40 #include "../libmpcodecs/dec_video.h" 40 #include "../libmpcodecs/dec_video.h"
41
42
43 #ifdef NEW_CONFIG
44 #include "../m_option.h"
45 #include "../m_config.h"
46 #else
47 #include "../cfgparser.h"
48 #endif
49 #include "../cfg-mplayer-def.h"
41 50
42 guiInterface_t guiIntfStruct; 51 guiInterface_t guiIntfStruct;
43 int guiWinID=-1; 52 int guiWinID=-1;
44 53
45 char * gstrcat( char ** dest,char * src ) 54 char * gstrcat( char ** dest,char * src )
341 350
342 extern ao_functions_t * audio_out; 351 extern ao_functions_t * audio_out;
343 extern vo_functions_t * video_out; 352 extern vo_functions_t * video_out;
344 extern int frame_dropping; 353 extern int frame_dropping;
345 extern int stream_dump_type; 354 extern int stream_dump_type;
346 extern char ** vo_plugin_args; 355 extern m_obj_settings_t*vo_plugin_args;
347 356
348 #if defined( USE_OSD ) || defined( USE_SUB ) 357 #if defined( USE_OSD ) || defined( USE_SUB )
349 void guiLoadFont( void ) 358 void guiLoadFont( void )
350 { 359 {
351 #ifdef HAVE_FREETYPE 360 #ifdef HAVE_FREETYPE
437 { 446 {
438 mp_msg( MSGT_GPLAYER,MSGL_STATUS,"[gui] add video filter: %s\n",str ); 447 mp_msg( MSGT_GPLAYER,MSGL_STATUS,"[gui] add video filter: %s\n",str );
439 if ( vo_plugin_args ) 448 if ( vo_plugin_args )
440 { 449 {
441 int i = 0; 450 int i = 0;
442 while ( vo_plugin_args[i] ) if ( !gstrcmp( vo_plugin_args[i++],str ) ) { i=-1; break; } 451 while ( vo_plugin_args[i].name ) if ( !gstrcmp( vo_plugin_args[i++].name,str ) ) { i=-1; break; }
443 if ( i != -1 ) 452 if ( i != -1 )
444 { vo_plugin_args=realloc( vo_plugin_args,( i + 2 ) * sizeof( char * ) ); vo_plugin_args[i]=strdup( str ); vo_plugin_args[i+1]=NULL; } 453 { vo_plugin_args=realloc( vo_plugin_args,( i + 2 ) * sizeof( m_obj_settings_t ) ); vo_plugin_args[i].name=strdup( str );vo_plugin_args[i].attribs = NULL; vo_plugin_args[i+1].name=NULL; }
445 } else { vo_plugin_args=malloc( 2 * sizeof( char * ) ); vo_plugin_args[0]=strdup( str ); vo_plugin_args[1]=NULL; } 454 } else { vo_plugin_args=malloc( 2 * sizeof( m_obj_settings_t ) ); vo_plugin_args[0].name=strdup( str );vo_plugin_args[0].attribs = NULL; vo_plugin_args[1].name=NULL; }
446 } 455 }
447 456
448 static void remove_vop( char * str ) 457 static void remove_vop( char * str )
449 { 458 {
450 int n = 0; 459 int n = 0;
451 460
452 if ( !vo_plugin_args ) return; 461 if ( !vo_plugin_args ) return;
453 462
454 mp_msg( MSGT_GPLAYER,MSGL_STATUS,"[gui] remove video filter: %s\n",str ); 463 mp_msg( MSGT_GPLAYER,MSGL_STATUS,"[gui] remove video filter: %s\n",str );
455 464
456 while ( vo_plugin_args[n++] ); n--; 465 while ( vo_plugin_args[n++].name ); n--;
457 if ( n > -1 ) 466 if ( n > -1 )
458 { 467 {
459 int i = 0,m = -1; 468 int i = 0,m = -1;
460 while ( vo_plugin_args[i] ) if ( !gstrcmp( vo_plugin_args[i++],str ) ) { m=i - 1; break; } 469 while ( vo_plugin_args[i].name ) if ( !gstrcmp( vo_plugin_args[i++].name,str ) ) { m=i - 1; break; }
461 i--; 470 i--;
462 if ( m > -1 ) 471 if ( m > -1 )
463 { 472 {
464 if ( n == 1 ) { free( vo_plugin_args[0] ); free( vo_plugin_args ); vo_plugin_args=NULL; } 473 if ( n == 1 ) { free( vo_plugin_args[0].name );free( vo_plugin_args[0].attribs ); free( vo_plugin_args ); vo_plugin_args=NULL; }
465 else memcpy( &vo_plugin_args[i],&vo_plugin_args[i + 1],( n - i ) * sizeof( char * ) ); 474 else { free( vo_plugin_args[i].name );free( vo_plugin_args[i].attribs ); memcpy( &vo_plugin_args[i],&vo_plugin_args[i + 1],( n - i ) * sizeof( m_obj_settings_t ) ); }
466 } 475 }
467 } 476 }
468 } 477 }
469 478
470 int guiGetEvent( int type,char * arg ) 479 int guiGetEvent( int type,char * arg )
1082 else 1091 else
1083 gtkSet( gtkAddPlItem,0,(void*)item ); 1092 gtkSet( gtkAddPlItem,0,(void*)item );
1084 return 1; 1093 return 1;
1085 } 1094 }
1086 1095
1087 #ifdef NEW_CONFIG
1088 #include "../m_option.h"
1089 #include "../m_config.h"
1090 #else
1091 #include "../cfgparser.h"
1092 #endif
1093 1096
1094 // This function imports the initial playtree (based on cmd-line files) into the gui playlist 1097 // This function imports the initial playtree (based on cmd-line files) into the gui playlist
1095 // by either: 1098 // by either:
1096 // - overwriting gui pl (enqueue=0) 1099 // - overwriting gui pl (enqueue=0)
1097 // - appending it to gui pl (enqueue=1) 1100 // - appending it to gui pl (enqueue=1)