From 906ad7fdb943551b9139b27503ff5ed333fe7f58 Mon Sep 17 00:00:00 2001 From: pontscho Date: Sun, 12 Jan 2003 23:38:55 +0000 Subject: [PATCH] add DVD and CDRom device entry's, and fix two 10l bug git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8934 b3059339-0415-0410-9bf9-f77b7e298cf2 --- Gui/cfg.c | 3 +++ Gui/mplayer/gtk/opts.c | 33 +++++++++++++++++++++++++++++++++ Gui/mplayer/mw.c | 6 ++---- help/help_mp-en.h | 2 ++ mplayer.h | 3 +++ 5 files changed, 43 insertions(+), 4 deletions(-) diff --git a/Gui/cfg.c b/Gui/cfg.c index 210fc872b1..96b4c9d1ce 100644 --- a/Gui/cfg.c +++ b/Gui/cfg.c @@ -106,6 +106,9 @@ static config_t gui_opts[] = #ifdef HAVE_SDL { "ao_sdl_subdriver",>kAOSDLDriver,CONF_TYPE_STRING,0,0,0,NULL }, #endif + + { "dvd_device",&dvd_device,CONF_TYPE_STRING,0,0,0,NULL }, + { "cdrom_device",&cdrom_device,CONF_TYPE_STRING,0,0,0,NULL }, { "osd_level",&osd_level,CONF_TYPE_INT,CONF_RANGE,0,3,NULL }, { "sub_auto_load",&sub_auto,CONF_TYPE_FLAG,0,0,1,NULL }, diff --git a/Gui/mplayer/gtk/opts.c b/Gui/mplayer/gtk/opts.c index 8bbe302893..abd73bf929 100644 --- a/Gui/mplayer/gtk/opts.c +++ b/Gui/mplayer/gtk/opts.c @@ -40,6 +40,8 @@ static GtkWidget * CLVDrivers; //static GtkWidget * ESubtitleName; GtkWidget * prEFontName; + GtkWidget * prEDVDDevice; + GtkWidget * prECDRomDevice; static GtkWidget * EVFM; static GtkWidget * EAFM; @@ -337,6 +339,11 @@ void ShowPreferences( void ) if ( !gtkAutoSyncOn ) gtk_widget_set_sensitive( SBAutoSync,FALSE ); else gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBAutoSync ),TRUE ); + if ( dvd_device ) gtk_entry_set_text( GTK_ENTRY( prEDVDDevice ),dvd_device ); + else gtk_entry_set_text( GTK_ENTRY( prEDVDDevice ),DEFAULT_DVD_DEVICE ); + if ( cdrom_device ) gtk_entry_set_text( GTK_ENTRY( prECDRomDevice ),cdrom_device ); + else gtk_entry_set_text( GTK_ENTRY( prECDRomDevice ),DEFAULT_CDROM_DEVICE ); + // -- disables #ifndef USE_SUB gtk_widget_set_sensitive( AConfig,FALSE ); @@ -522,6 +529,9 @@ void prButton( GtkButton * button,gpointer user_data ) { gaddlist( &audio_fm_list,(char *)mpcodecs_ad_drivers[i]->info->short_name ); break; } } + guiSetFilename( dvd_device,gtk_entry_get_text( GTK_ENTRY( prEDVDDevice ) ) ); + guiSetFilename( cdrom_device,gtk_entry_get_text( GTK_ENTRY( prECDRomDevice ) ) ); + case bCancel: HidePreferences(); break; @@ -1054,6 +1064,29 @@ GtkWidget * create_Preferences( void ) gtk_widget_show( SBAutoSync ); gtk_box_pack_start( GTK_BOX( hbox5 ),SBAutoSync,TRUE,TRUE,0 ); + AddHSeparator( vbox602 ); + + table1=gtk_table_new( 2,2,FALSE ); + gtk_widget_set_name( table1,"table1" ); + gtk_widget_show( table1 ); + gtk_box_pack_start( GTK_BOX( vbox602 ),table1,FALSE,FALSE,0 ); + + label=AddLabel( MSGTR_PREFERENCES_DVDDevice,NULL ); + gtk_table_attach( GTK_TABLE( table1 ),label,0,1,0,1,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); + prEDVDDevice=gtk_entry_new(); + gtk_widget_set_name( prEDVDDevice,"prEDVDDevice" ); + gtk_widget_show( prEDVDDevice ); + gtk_table_attach( GTK_TABLE( table1 ),prEDVDDevice,1,2,0,1,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); + + label=AddLabel( MSGTR_PREFERENCES_CDROMDevice,NULL ); + gtk_table_attach( GTK_TABLE( table1 ),label,0,1,1,2,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); + prECDRomDevice=gtk_entry_new(); + gtk_widget_set_name( prECDRomDevice,"prECDRomDevice" ); + gtk_widget_show( prECDRomDevice ); + gtk_table_attach( GTK_TABLE( table1 ),prECDRomDevice,1,2,1,2,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); + +// AddHSeparator( vbox602 ); + label=AddLabel( MSGTR_PREFERENCES_Misc,NULL ); gtk_notebook_set_tab_label( GTK_NOTEBOOK( notebook1 ),gtk_notebook_get_nth_page( GTK_NOTEBOOK( notebook1 ),3 ),label ); diff --git a/Gui/mplayer/mw.c b/Gui/mplayer/mw.c index 56627a80fe..b653ff7721 100644 --- a/Gui/mplayer/mw.c +++ b/Gui/mplayer/mw.c @@ -238,9 +238,7 @@ void mplMainDraw( void ) } extern void exit_player(char* how); -extern char * dvd_device; extern int vcd_track; -extern char * cdrom_device; extern int osd_visible; void mplEventHandling( int msg,float param ) @@ -314,7 +312,7 @@ play: #ifdef HAVE_VCD case STREAMTYPE_VCD: gtkSet( gtkClearStruct,0,(void *)(guiALL - guiVCD - guiFilenames) ); - if ( !cdrom_device ) cdrom_device=DEFAULT_CDROM_DEVICE; + if ( !cdrom_device ) cdrom_device=gstrdup( DEFAULT_CDROM_DEVICE ); mplSetFileName( NULL,cdrom_device,STREAMTYPE_VCD ); if ( guiIntfStruct.Playing != 2 ) { @@ -330,7 +328,7 @@ play: #ifdef USE_DVDREAD case STREAMTYPE_DVD: gtkSet( gtkClearStruct,0,(void *)(guiALL - guiDVD - guiFilenames) ); - if ( !dvd_device ) dvd_device=DEFAULT_DVD_DEVICE; + if ( !dvd_device ) dvd_device=gstrdup( DEFAULT_DVD_DEVICE ); mplSetFileName( NULL,dvd_device,STREAMTYPE_DVD ); if ( guiIntfStruct.Playing != 2 ) { diff --git a/help/help_mp-en.h b/help/help_mp-en.h index 8cd006d2d7..57f39a31c0 100644 --- a/help/help_mp-en.h +++ b/help/help_mp-en.h @@ -571,6 +571,8 @@ static char help_text[]= #define MSGTR_PREFERENCES_XSCREENSAVER "Stop XScreenSaver" #define MSGTR_PREFERENCES_AutoSync "AutoSync on/off" #define MSGTR_PREFERENCES_AutoSyncValue "Autosync: " +#define MSGTR_PREFERENCES_CDROMDevice "CD-Rom device:" +#define MSGTR_PREFERENCES_DVDDevice "DVD device:" // --- messagebox #define MSGTR_MSGBOX_LABEL_FatalError "Fatal error!" diff --git a/mplayer.h b/mplayer.h index f58cf95148..6e9a09a9ca 100644 --- a/mplayer.h +++ b/mplayer.h @@ -9,6 +9,9 @@ extern int use_gui; extern char* current_module; extern int vcd_track; +extern char * dvd_device; +extern char * cdrom_device; + extern char ** audio_fm_list; extern char ** video_fm_list; extern char ** video_driver_list;