diff options
author | pontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-08-14 23:02:45 +0000 |
---|---|---|
committer | pontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-08-14 23:02:45 +0000 |
commit | 2518620787eaad6b84c0edbdea683a9338d56199 (patch) | |
tree | 7d0bed4c447620580fe7233c474ddfbaaff3dda3 /Gui | |
parent | d2673b6e3b98e23947c7e87656f48a1679c6be41 (diff) | |
download | mpv-2518620787eaad6b84c0edbdea683a9338d56199.tar.bz2 mpv-2518620787eaad6b84c0edbdea683a9338d56199.tar.xz |
- add dxr3 gui support (dialogbox, etc.)
- fix one small dvd playing bug ( dvd playing don't del the playlist)
- add some ifdef() check
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7010 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'Gui')
-rw-r--r-- | Gui/cfg.c | 10 | ||||
-rw-r--r-- | Gui/cfg.h | 5 | ||||
-rw-r--r-- | Gui/interface.c | 121 | ||||
-rw-r--r-- | Gui/interface.h | 5 | ||||
-rw-r--r-- | Gui/mplayer/gtk/mb.c | 3 | ||||
-rw-r--r-- | Gui/mplayer/gtk/opts.c | 327 | ||||
-rw-r--r-- | Gui/mplayer/gtk/pl.c | 1 | ||||
-rw-r--r-- | Gui/mplayer/mw.h | 26 | ||||
-rw-r--r-- | Gui/mplayer/play.c | 10 | ||||
-rw-r--r-- | Gui/mplayer/play.h | 2 |
10 files changed, 439 insertions, 71 deletions
@@ -28,9 +28,12 @@ int gtkVNIAVI = 0; int gtkVFlip = 0; int gtkVIndex = 1; int gtkVVFM = -1; -int gtkVPP = 0; int gtkVAutoq = 0; +int gtkVopPP = 0; +int gtkVopLAVC = 0; +int gtkVopFAME = 0; + char * gtkAODriver = NULL; int gtkAONoSound = 0; float gtkAODelay = 0.0f; @@ -72,8 +75,11 @@ static config_t gui_opts[] = { "v_ni",>kVNIAVI,CONF_TYPE_FLAG,0,0,1,NULL }, { "v_idx",>kVIndex,CONF_TYPE_FLAG,0,0,1,NULL }, { "v_vfm",>kVVFM,CONF_TYPE_INT,CONF_RANGE,-1,10,NULL }, - { "vf_pp",>kVPP,CONF_TYPE_FLAG,0,0,1,NULL }, + + { "vf_pp",>kVopPP,CONF_TYPE_FLAG,0,0,1,NULL }, { "vf_autoq",>kVAutoq,CONF_TYPE_INT,CONF_RANGE,0,100,NULL }, + { "vf_lavc",>kVopLAVC,CONF_TYPE_FLAG,0,0,1,NULL }, + { "vf_fame",>kVopFAME,CONF_TYPE_FLAG,0,0,1,NULL }, { "ao_driver",>kAODriver,CONF_TYPE_STRING,0,0,0,NULL }, { "ao_nosound",>kAONoSound,CONF_TYPE_FLAG,0,0,1,NULL }, @@ -14,9 +14,12 @@ extern int gtkVNIAVI; extern int gtkVFlip; extern int gtkVIndex; extern int gtkVVFM; -extern int gtkVPP; extern int gtkVAutoq; +extern int gtkVopPP; +extern int gtkVopLAVC; +extern int gtkVopFAME; + extern char * gtkAODriver; extern int gtkAONoSound; extern float gtkAODelay; diff --git a/Gui/interface.c b/Gui/interface.c index 1e4d107beb..83df6af60b 100644 --- a/Gui/interface.c +++ b/Gui/interface.c @@ -143,7 +143,7 @@ void guiInit( void ) cfg_read(); appInit( (void*)mDisplay ); - if ( plCurrent && !filename ) mplSetFileName( plCurrent->path,plCurrent->name ); + if ( plCurrent && !filename ) mplSetFileName( plCurrent->path,plCurrent->name,STREAMTYPE_FILE ); if ( sub_delay != 0.0f ) gtkSubDelay=sub_delay; if ( sub_name ) guiSetFilename( guiIntfStruct.Subtitlename,sub_name ); #if defined( USE_OSD ) || defined( USE_SUB ) @@ -237,7 +237,41 @@ void guiLoadFont( void ) } #endif -void guiGetEvent( int type,char * arg ) +static void add_vop( char * str ) +{ + mp_msg( MSGT_GPLAYER,MSGL_STATUS,"[gui] add video filter: %s\n",str ); + if ( vo_plugin_args ) + { + int i = 0; + while ( vo_plugin_args[i] ) if ( !gstrcmp( vo_plugin_args[i++],str ) ) { i=-1; break; } + if ( i != -1 ) + { vo_plugin_args=realloc( vo_plugin_args,( i + 2 ) * sizeof( char * ) ); vo_plugin_args[i]=strdup( str ); vo_plugin_args[i+1]=NULL; } + } else { vo_plugin_args=malloc( 2 * sizeof( char * ) ); vo_plugin_args[0]=strdup( str ); vo_plugin_args[1]=NULL; } +} + +static void remove_vop( char * str ) +{ + int n = 0; + + if ( !vo_plugin_args ) return; + + mp_msg( MSGT_GPLAYER,MSGL_STATUS,"[gui] remove video filter: %s\n",str ); + + while ( vo_plugin_args[n++] ); n--; + if ( n > -1 ) + { + int i = 0,m = -1; + while ( vo_plugin_args[i] ) if ( !gstrcmp( vo_plugin_args[i++],str ) ) { m=i - 1; break; } + i--; + if ( m > -1 ) + { + if ( n == 1 ) { free( vo_plugin_args[0] ); free( vo_plugin_args ); vo_plugin_args=NULL; } + else memcpy( &vo_plugin_args[i],&vo_plugin_args[i + 1],( n - i ) * sizeof( char * ) ); + } + } +} + +int guiGetEvent( int type,char * arg ) { stream_t * stream = (stream_t *) arg; #ifdef USE_DVDREAD @@ -266,7 +300,7 @@ void guiGetEvent( int type,char * arg ) break; case guiSetAudioOnly: guiIntfStruct.AudioOnly=(int)arg; - if ( (int)arg ) wsVisibleWindow( &appMPlayer.subWindow,wsHideWindow ); + if ( (int)arg ) { guiIntfStruct.NoWindow=True; wsVisibleWindow( &appMPlayer.subWindow,wsHideWindow ); } else wsVisibleWindow( &appMPlayer.subWindow,wsShowWindow ); break; case guiReDrawSubWindow: @@ -351,6 +385,9 @@ void guiGetEvent( int type,char * arg ) btnModify( evSetBalance,guiIntfStruct.Balance ); } break; + case guiSetFileFormat: + guiIntfStruct.FileFormat=(int)arg; + break; case guiSetValues: // -- video if ( arg ) @@ -364,6 +401,9 @@ void guiGetEvent( int type,char * arg ) if ( vo_gamma_saturation == 1000 ) { vo_gamma_saturation=0; get_video_colors( (void *)arg,"saturation",&vo_gamma_saturation ); } } + + if ( guiIntfStruct.NoWindow ) wsVisibleWindow( &appMPlayer.subWindow,wsHideWindow ); + // -- audio if ( audio_out ) { @@ -398,6 +438,14 @@ void guiGetEvent( int type,char * arg ) #ifdef USE_OSD gtkSubFFactor=font_factor; #endif +#ifdef HAVE_DXR3 + if ( !gstrcmp( gtkVODriver,"dxr3" ) && guiIntfStruct.FileFormat != DEMUXER_TYPE_MPEG_PS && !gtkVopLAVC && !gtkVopFAME ) + { + gtkMessageBox( GTK_MB_FATAL,MSGTR_NEEDLAVCFAME ); + guiIntfStruct.Playing=0; + return True; + } +#endif break; case guiSetDefaults: if ( filename && !guiIntfStruct.Filename ) @@ -408,7 +456,7 @@ void guiGetEvent( int type,char * arg ) guiIntfStruct.DiskChanged=0; -// --- video opts +// --- video opts if ( !gtkVODriver ) { int i = 0; @@ -433,35 +481,38 @@ void guiGetEvent( int type,char * arg ) if ( gtkVODriver ) { gfree( (void **)&video_driver ); video_driver=gstrdup( gtkVODriver ); } else { gtkMessageBox( GTK_MB_FATAL,MSGTR_IDFGCVD ); exit_player( "gui init" ); } - - if ( gtkVPP ) - { - if ( vo_plugin_args ) + + { + int i = 0; + guiIntfStruct.NoWindow=False; + while ( video_out_drivers[i++] ) + if ( video_out_drivers[i - 1]->control( VOCTRL_GUISUPPORT,NULL ) == VO_TRUE ) { - int i = 0; - while ( vo_plugin_args[i] ) if ( !gstrcmp( vo_plugin_args[i++],"pp" ) ) { i=-1; break; } - if ( i != -1 ) - { vo_plugin_args=realloc( vo_plugin_args,( i + 2 ) * sizeof( char * ) ); vo_plugin_args[i]=strdup( "pp" ); vo_plugin_args[i+1]=NULL; } - } else { vo_plugin_args=malloc( 2 * sizeof( char * ) ); vo_plugin_args[0]=strdup( "pp" ); vo_plugin_args[1]=NULL; } - auto_quality=gtkVAutoq; - } - else - if ( vo_plugin_args ) + const vo_info_t *info = video_out_drivers[i - 1]->get_info(); + if ( ( !gstrcmp( gtkVODriver,(char *)info->short_name ) )&&( video_out_drivers[i - 1]->control( VOCTRL_GUI_NOWINDOW,NULL ) == VO_TRUE ) ) + { guiIntfStruct.NoWindow=True; break; } + } + } + +#ifdef HAVE_DXR3 + remove_vop( "lavc" ); + remove_vop( "fame" ); + if ( !gstrcmp( gtkVODriver,"dxr3" ) ) + { + #warning workaround for this moment. + osd_level=0; + // --- + if ( ( guiIntfStruct.StreamType != STREAMTYPE_DVD)&&( guiIntfStruct.StreamType != STREAMTYPE_VCD ) ) { - int n = 0; - while ( vo_plugin_args[n++] ); n--; - if ( n > -1 ) - { - int i = 0; - while ( vo_plugin_args[i] ) if ( !gstrcmp( vo_plugin_args[i++],"pp" ) ) break; i--; - if ( n == i ) - { - if ( n == 1 ) { free( vo_plugin_args[0] ); free( vo_plugin_args ); vo_plugin_args=NULL; } - else memcpy( &vo_plugin_args[i],&vo_plugin_args[i+1],( n - i ) * sizeof( char * ) ); - } - } - auto_quality=0; + if ( gtkVopLAVC ) add_vop( "lavc" ); + if ( gtkVopFAME ) add_vop( "fame" ); } + } +#endif +// --- + if ( gtkVopPP ) { add_vop( "pp" ); auto_quality=gtkVAutoq; } + else { remove_vop( "pp" ); auto_quality=0; } + vo_doublebuffering=gtkVODoubleBuffer; vo_directrendering=gtkVODirectRendering; frame_dropping=gtkVFrameDrop; @@ -516,6 +567,7 @@ void guiGetEvent( int type,char * arg ) break; } + return False; } extern unsigned int GetTimerMS( void ); @@ -523,7 +575,7 @@ extern int mplTimer; void guiEventHandling( void ) { - if ( !guiIntfStruct.Playing || guiIntfStruct.AudioOnly ) wsHandleEvents(); + if ( !guiIntfStruct.Playing || guiIntfStruct.NoWindow ) wsHandleEvents(); gtkEventHandling(); mplTimer=GetTimerMS() / 20; } @@ -644,17 +696,18 @@ void * gtkSet( int cmd,float fparam, void * vparam ) #endif // --- misc case gtkClearStruct: - if ( (unsigned int)fparam & guiFilenames ) + if ( (unsigned int)vparam & guiFilenames ) { gfree( (void **)&guiIntfStruct.Filename ); gfree( (void **)&guiIntfStruct.Subtitlename ); gfree( (void **)&guiIntfStruct.AudioFile ); + gtkSet( gtkDelPl,0,NULL ); } #ifdef USE_DVDREAD - if ( (unsigned int)fparam & guiDVD ) memset( &guiIntfStruct.DVD,0,sizeof( guiDVDStruct ) ); + if ( (unsigned int)vparam & guiDVD ) memset( &guiIntfStruct.DVD,0,sizeof( guiDVDStruct ) ); #endif #ifdef HAVE_VCD - if ( (unsigned int)fparam & guiVCD ) guiIntfStruct.VCDTracks=0; + if ( (unsigned int)vparam & guiVCD ) guiIntfStruct.VCDTracks=0; #endif return NULL; case gtkSetExtraStereo: diff --git a/Gui/interface.h b/Gui/interface.h index 89b93bfae4..9a28da66ae 100644 --- a/Gui/interface.h +++ b/Gui/interface.h @@ -71,6 +71,7 @@ typedef struct int MovieWidth; int MovieHeight; + int NoWindow; float Volume; float Balance; @@ -82,6 +83,7 @@ typedef struct int TimeSec; int LengthInSec; int FrameDrop; + int FileFormat; char * Filename; int FilenameChanged; @@ -116,6 +118,7 @@ extern guiInterface_t guiIntfStruct; #define guiSetVolume 11 #define guiSetDefaults 12 #define guiSetValues 13 +#define guiSetFileFormat 14 #define guiSetStop 0 #define guiSetPlay 1 @@ -130,7 +133,7 @@ extern char *get_path(char *filename); extern void guiInit( void ); extern void guiDone( void ); -extern void guiGetEvent( int type,char * arg ); +extern int guiGetEvent( int type,char * arg ); extern void guiEventHandling( void ); extern void guiLoadFont( void ); diff --git a/Gui/mplayer/gtk/mb.c b/Gui/mplayer/gtk/mb.c index 3be3e1136c..2593c21d6e 100644 --- a/Gui/mplayer/gtk/mb.c +++ b/Gui/mplayer/gtk/mb.c @@ -133,7 +133,8 @@ GtkWidget * create_MessageBox( int type ) gtk_object_set_data_full( GTK_OBJECT( MessageBox ),"gtkMessageBoxText",gtkMessageBoxText,(GtkDestroyNotify)gtk_widget_unref ); gtk_widget_show( gtkMessageBoxText ); gtk_box_pack_start( GTK_BOX( hbox1 ),gtkMessageBoxText,TRUE,TRUE,0 ); - gtk_label_set_justify( GTK_LABEL( gtkMessageBoxText ),GTK_JUSTIFY_FILL ); +// gtk_label_set_justify( GTK_LABEL( gtkMessageBoxText ),GTK_JUSTIFY_FILL ); + gtk_label_set_justify( GTK_LABEL( gtkMessageBoxText ),GTK_JUSTIFY_CENTER ); gtk_label_set_line_wrap( GTK_LABEL( gtkMessageBoxText ),FALSE ); hseparator1=gtk_hseparator_new(); diff --git a/Gui/mplayer/gtk/opts.c b/Gui/mplayer/gtk/opts.c index 33549c066d..e96d594154 100644 --- a/Gui/mplayer/gtk/opts.c +++ b/Gui/mplayer/gtk/opts.c @@ -83,14 +83,19 @@ static struct { 10,MSGTR_PREFERENCES_Codec6 } }; int gtkVPreferences = 0; -static int gtkVOSSConfig = 0; static int old_audio_driver = 0; static char * ao_driver[3]; static char * vo_driver[3]; static int old_video_driver = 0; -void ShowOSSConfig( void ); -void HideOSSConfig( void ); +#ifdef USE_OSS_AUDIO + void ShowOSSConfig( void ); + void HideOSSConfig( void ); +#endif +#ifdef HAVE_DXR3 + void ShowDXR3Config( void ); + void HideDXR3Config( void ); +#endif static gboolean prHScaler( GtkWidget * widget,GdkEventMotion * event,gpointer user_data ); static void prToggled( GtkToggleButton * togglebutton,gpointer user_data ); static void prCListRow( GtkCList * clist,gint row,gint column,GdkEvent * event,gpointer user_data ); @@ -121,13 +126,15 @@ void ShowPreferences( void ) { const ao_info_t *info = audio_out_drivers[i++]->info; if ( !strcmp( info->short_name,"plugin" ) ) continue; - if ( !gstrcmp( gtkAODriver,info->short_name ) ) old_audio_driver=i - 1; + if ( !gstrcmp( gtkAODriver,(char *)info->short_name ) ) old_audio_driver=i - 1; tmp[0]=(char *)info->short_name; tmp[1]=(char *)info->name; gtk_clist_append( GTK_CLIST( CLADrivers ),tmp ); } gtk_clist_select_row( GTK_CLIST( CLADrivers ),old_audio_driver,0 ); gtk_clist_get_text( GTK_CLIST( CLADrivers ),old_audio_driver,0,(char **)&ao_driver ); gtk_widget_set_sensitive( AConfig,FALSE ); - if ( !strcmp( ao_driver[0],"oss" ) ) gtk_widget_set_sensitive( AConfig,TRUE ); +#ifdef USE_OSS_AUDIO + if ( !gstrcmp( ao_driver[0],"oss" ) ) gtk_widget_set_sensitive( AConfig,TRUE ); +#endif } // -- 2. page @@ -147,7 +154,7 @@ void ShowPreferences( void ) if ( video_out_drivers[i++]->control( VOCTRL_GUISUPPORT,NULL ) == VO_TRUE ) { const vo_info_t *info = video_out_drivers[i - 1]->get_info(); - if ( !gstrcmp( video_driver,info->short_name ) ) gtkVODriver=gstrdup( video_driver ); + if ( !gstrcmp( video_driver,(char *)info->short_name ) ) gtkVODriver=gstrdup( video_driver ); } } i=0; @@ -155,12 +162,15 @@ void ShowPreferences( void ) if ( video_out_drivers[i++]->control( VOCTRL_GUISUPPORT,NULL ) == VO_TRUE ) { const vo_info_t *info = video_out_drivers[i - 1]->get_info(); - if ( !gstrcmp( gtkVODriver,info->short_name ) ) old_video_driver=c; c++; + if ( !gstrcmp( gtkVODriver,(char *)info->short_name ) ) old_video_driver=c; c++; tmp[0]=(char *)info->short_name; tmp[1]=(char *)info->name; gtk_clist_append( GTK_CLIST( CLVDrivers ),tmp ); } gtk_clist_select_row( GTK_CLIST( CLVDrivers ),old_video_driver,0 ); gtk_clist_get_text( GTK_CLIST( CLVDrivers ),old_video_driver,0,(char **)&vo_driver ); gtk_widget_set_sensitive( VConfig,FALSE ); +#ifdef HAVE_DXR3 + if ( !gstrcmp( vo_driver[0],"dxr3" ) ) gtk_widget_set_sensitive( VConfig,TRUE ); +#endif } // -- 3. page @@ -186,7 +196,7 @@ void ShowPreferences( void ) // -- 4. page gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBNonInterlaved ),gtkVNIAVI ); gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBIndex ),gtkVIndex ); - gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBPostprocess ),gtkVPP ); + gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBPostprocess ),gtkVopPP ); gtk_adjustment_set_value( HSPPQualityadj,gtkVAutoq ); { int i = 0; @@ -246,7 +256,12 @@ void HidePreferences( void ) if ( !gtkVPreferences ) return; gtkVPreferences=0; gtk_widget_hide( Preferences ); gtk_widget_destroy( Preferences ); +#ifdef USE_OSS_AUDIO HideOSSConfig(); +#endif +#ifdef HAVE_DXR3 + HideDXR3Config(); +#endif } static void prDestroy( GtkObject * object,gpointer user_data ) @@ -303,7 +318,7 @@ void prButton( GtkButton * button,gpointer user_data ) // -- 4. page gtkVNIAVI=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBNonInterlaved ) ); gtkVIndex=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBIndex ) ); - gtkVPP=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBPostprocess ) ); + gtkVopPP=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBPostprocess ) ); gtkSet( gtkSetAutoq,HSPPQualityadj->value,NULL ); { int i; @@ -318,10 +333,16 @@ void prButton( GtkButton * button,gpointer user_data ) break; case bAConfig: gtk_widget_set_sensitive( AConfig,FALSE ); +#ifdef USE_OSS_AUDIO if ( !strcmp( ao_driver[0],"oss" ) ) { ShowOSSConfig(); gtk_widget_set_sensitive( AConfig,TRUE ); } +#endif + break; + case bVconfig: + gtk_widget_set_sensitive( VConfig,FALSE ); +#ifdef HAVE_DXR3 + if ( !gstrcmp( vo_driver[0],"dxr3" ) ) { ShowDXR3Config(); gtk_widget_set_sensitive( VConfig,TRUE ); } +#endif break; -// case bVconfig: -// break; #if 0 case bLSubtitle: break; @@ -385,10 +406,16 @@ static void prCListRow( GtkCList * clist,gint row,gint column,GdkEvent * event,g case 0: // audio driver gtk_clist_get_text( GTK_CLIST( CLADrivers ),row,0,(char **)&ao_driver ); gtk_widget_set_sensitive( AConfig,FALSE ); +#ifdef USE_OSS_AUDIO if ( !strcmp( ao_driver[0],"oss" ) ) gtk_widget_set_sensitive( AConfig,TRUE ); +#endif break; case 1: // video driver gtk_clist_get_text( GTK_CLIST( CLVDrivers ),row,0,(char **)&vo_driver ); + gtk_widget_set_sensitive( VConfig,FALSE ); +#ifdef HAVE_DXR3 + if ( !gstrcmp( vo_driver[0],"dxr3" ) ) gtk_widget_set_sensitive( VConfig,TRUE ); +#endif break; } } @@ -1444,6 +1471,7 @@ GtkWidget * create_Preferences( void ) return Preferences; } +#ifdef USE_OSS_AUDIO GtkWidget * OSSConfig; static GtkWidget * CEOssDevice; static GtkWidget * CEOssMixer; @@ -1452,6 +1480,8 @@ static GtkWidget * CBOssDevice; static GtkWidget * BOssOk; static GtkWidget * BOssCancel; + int gtkVOSSConfig = 0; + void ShowOSSConfig( void ) { if ( gtkVOSSConfig ) gtkActive( OSSConfig ); @@ -1682,3 +1712,278 @@ GtkWidget * create_OSSConfig( void ) return OSSConfig; } +#endif + +#ifdef HAVE_DXR3 +// --- dxr3 config box + +static GtkWidget * DXR3Config; +static GtkWidget * CBDevice; +static GtkWidget * CEDXR3Device; +static GtkWidget * RBVNone; +static GtkWidget * RBVLavc; +static GtkWidget * RBVFame; +static GtkWidget * dxr3BOk; +static GtkWidget * dxr3BCancel; + +static int gtkVDXR3Config = 0; + +GtkWidget * create_DXR3Config( void ); + +void ShowDXR3Config( void ) +{ + if ( gtkVDXR3Config ) gtkActive( DXR3Config ); + else DXR3Config=create_DXR3Config(); + + gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( RBVNone ),TRUE ); + if ( gtkVopLAVC ) gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( RBVLavc ),TRUE ); + if ( gtkVopFAME ) gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( RBVFame ),TRUE ); + + gtk_widget_show( DXR3Config ); + gtkSetLayer( DXR3Config ); + gtkVDXR3Config=1; +} + +void HideDXR3Config( void ) +{ + if ( !gtkVDXR3Config ) return; + gtk_widget_hide( DXR3Config ); + gtk_widget_destroy( DXR3Config ); + gtkVDXR3Config=0; +} + +static void dxr3Button( GtkButton * button,gpointer user_data ) +{ + switch ( (int)user_data ) + { + case 0: // Ok + gtkVopLAVC=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( RBVLavc ) ); + gtkVopFAME=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( RBVFame ) ); + case 2: // Destroy + case 1: // Cancel + HideDXR3Config(); + break; + case 3: // Show + gtkVDXR3Config=1; + break; + case 4: // Hide + gtkVDXR3Config=0; + break; + } +} + +GtkWidget * create_DXR3Config( void ) +{ + GtkWidget * frame1; + GtkWidget * frame2; + GtkWidget * frame3; + GtkWidget * frame4; + GtkWidget * vbox1; + GtkWidget * vbox2; + GtkWidget * hbox1; + GtkWidget * label1; + GList * CBDevice_items = NULL; + GtkWidget * hseparator2; + GtkWidget * vbox3; + GtkWidget * label2; + GSList * VEncoder_group = NULL; + GtkWidget * hseparator1; + GtkWidget * hbuttonbox1; + GtkAccelGroup * accel_group; + + accel_group=gtk_accel_group_new(); + + DXR3Config=gtk_window_new( GTK_WINDOW_DIALOG ); + gtk_widget_set_name( DXR3Config,"DXR3Config" ); + gtk_object_set_data( GTK_OBJECT( DXR3Config ),"DXR3Config",DXR3Config ); + gtk_widget_set_usize( DXR3Config,300,156 ); + GTK_WIDGET_SET_FLAGS( DXR3Config,GTK_CAN_DEFAULT ); + gtk_window_set_title( GTK_WINDOW( DXR3Config ),"DXR3/H+" ); + gtk_window_set_position( GTK_WINDOW( DXR3Config ),GTK_WIN_POS_CENTER ); + gtk_window_set_modal( GTK_WINDOW( DXR3Config ),TRUE ); + gtk_window_set_policy( GTK_WINDOW( DXR3Config ),FALSE,FALSE,FALSE ); + gtk_window_set_wmclass( GTK_WINDOW( DXR3Config ),"DXR3","MPlayer" ); + + gtk_widget_realize( DXR3Config ); + gtkAddIcon( DXR3Config ); + + frame1=gtk_frame_new( NULL ); + gtk_widget_set_name( frame1,"frame1" ); + gtk_widget_ref( frame1 ); + gtk_object_set_data_full( GTK_OBJECT( DXR3Config ),"frame1",frame1,(GtkDestroyNotify)gtk_widget_unref ); + gtk_widget_show( frame1 ); + gtk_container_add( GTK_CONTAINER( DXR3Config ),frame1 ); + gtk_container_set_border_width( GTK_CONTAINER( frame1 ),1 ); + gtk_frame_set_shadow_type( GTK_FRAME( frame1 ),GTK_SHADOW_IN ); + + frame2=gtk_frame_new( NULL ); + gtk_widget_set_name( frame2,"frame2" ); + gtk_widget_ref( frame2 ); + gtk_object_set_data_full( GTK_OBJECT( DXR3Config ),"frame2",frame2,(GtkDestroyNotify)gtk_widget_unref ); + gtk_widget_show( frame2 ); + gtk_container_add( GTK_CONTAINER( frame1 ),frame2 ); + gtk_frame_set_shadow_type( GTK_FRAME( frame2 ),GTK_SHADOW_NONE ); + + frame3=gtk_frame_new( NULL ); + gtk_widget_set_name( frame3,"frame3" ); + gtk_widget_ref( frame3 ); + gtk_object_set_data_full( GTK_OBJECT( DXR3Config ),"frame3",frame3,(GtkDestroyNotify)gtk_widget_unref ); + gtk_widget_show( frame3 ); + gtk_container_add( GTK_CONTAINER( frame2 ),frame3 ); + gtk_frame_set_shadow_type( GTK_FRAME( frame3 ),GTK_SHADOW_ETCHED_OUT ); + + frame4=gtk_frame_new( NULL ); + gtk_widget_set_name( frame4,"frame4" ); + gtk_widget_ref( frame4 ); + gtk_object_set_data_full( GTK_OBJECT( DXR3Config ),"frame4",frame4,(GtkDestroyNotify)gtk_widget_unref ); + gtk_widget_show( frame4 ); + gtk_container_add( GTK_CONTAINER( frame3 ),frame4 ); + gtk_frame_set_shadow_type( GTK_FRAME( frame4 ),GTK_SHADOW_NONE ); + + vbox1=gtk_vbox_new( FALSE,0 ); + gtk_widget_set_name( vbox1,"vbox1" ); + gtk_widget_ref( vbox1 ); + gtk_object_set_data_full( GTK_OBJECT( DXR3Config ),"vbox1",vbox1,(GtkDestroyNotify)gtk_widget_unref ); + gtk_widget_show( vbox1 ); + gtk_container_add( GTK_CONTAINER( frame4 ),vbox1 ); + + vbox2=gtk_vbox_new( FALSE,0 ); + gtk_widget_set_name( vbox2,"vbox2" ); + gtk_widget_ref( vbox2 ); + gtk_object_set_data_full( GTK_OBJECT( DXR3Config ),"vbox2",vbox2,(GtkDestroyNotify)gtk_widget_unref ); + gtk_widget_show( vbox2 ); + gtk_box_pack_start( GTK_BOX( vbox1 ),vbox2,TRUE,TRUE,0 ); + + hbox1=gtk_hbox_new( FALSE,0 ); + gtk_widget_set_name( hbox1,"hbox1" ); + gtk_widget_ref( hbox1 ); + gtk_object_set_data_full( GTK_OBJECT( DXR3Config ),"hbox1",hbox1,(GtkDestroyNotify)gtk_widget_unref ); + gtk_widget_show( hbox1 ); + gtk_box_pack_start( GTK_BOX( vbox2 ),hbox1,FALSE,FALSE,0 ); + + label1=gtk_label_new( MSGTR_PREFERENCES_OSS_Device ); + gtk_widget_set_name( label1,"label1" ); + gtk_widget_ref( label1 ); + gtk_object_set_data_full( GTK_OBJECT( DXR3Config ),"label1",label1,(GtkDestroyNotify)gtk_widget_unref ); + gtk_widget_show( label1 ); + gtk_box_pack_start( GTK_BOX( hbox1 ),label1,FALSE,FALSE,0 ); + gtk_misc_set_alignment( GTK_MISC( label1 ),7.45058e-09,0.5 ); + gtk_misc_set_padding( GTK_MISC( label1 ),4,0 ); + + CBDevice=gtk_combo_new(); + gtk_widget_set_name( CBDevice,"CBDevice" ); + gtk_widget_ref( CBDevice ); + gtk_object_set_data_full( GTK_OBJECT( DXR3Config ),"CBDevice",CBDevice,(GtkDestroyNotify)gtk_widget_unref ); + gtk_widget_show( CBDevice ); + gtk_box_pack_start( GTK_BOX( hbox1 ),CBDevice,TRUE,TRUE,0 ); + CBDevice_items=g_list_append( CBDevice_items,( gpointer ) "/dev/em8300" ); + gtk_combo_set_popdown_strings( GTK_COMBO( CBDevice ),CBDevice_items ); + g_list_free( CBDevice_items ); + + CEDXR3Device=GTK_COMBO( CBDevice )->entry; + gtk_widget_set_name( CEDXR3Device,"CEDXR3Device" ); + gtk_widget_ref( CEDXR3Device ); + gtk_object_set_data_full( GTK_OBJECT( DXR3Config ),"CEDXR3Device",CEDXR3Device,(GtkDestroyNotify)gtk_widget_unref ); + gtk_widget_show( CEDXR3Device ); + gtk_entry_set_text( GTK_ENTRY( CEDXR3Device ),"/dev/em8300" ); + + hseparator2=gtk_hseparator_new(); + gtk_widget_set_name( hseparator2,"hseparator2" ); + gtk_widget_ref( hseparator2 ); + gtk_object_set_data_full( GTK_OBJECT( DXR3Config ),"hseparator2",hseparator2,(GtkDestroyNotify)gtk_widget_unref ); + gtk_widget_show( hseparator2 ); + gtk_box_pack_start( GTK_BOX( vbox2 ),hseparator2,FALSE,FALSE,0 ); + gtk_widget_set_usize( hseparator2,-2,6 ); + + vbox3=gtk_vbox_new( FALSE,0 ); + gtk_widget_set_name( vbox3,"vbox3" ); + gtk_widget_ref( vbox3 ); + gtk_object_set_data_full( GTK_OBJECT( DXR3Config ),"vbox3",vbox3,(GtkDestroyNotify)gtk_widget_unref ); + gtk_widget_show( vbox3 ); + gtk_box_pack_start( GTK_BOX( vbox2 ),vbox3,TRUE,TRUE,0 ); + + label2=gtk_label_new( MSGTR_PREFERENCES_DXR3_VENC ); + gtk_widget_set_name( label2,"label2" ); + gtk_widget_ref( label2 ); + gtk_object_set_data_full( GTK_OBJECT( DXR3Config ),"label2",label2,(GtkDestroyNotify)gtk_widget_unref ); + gtk_widget_show( label2 ); + gtk_box_pack_start( GTK_BOX( vbox3 ),label2,FALSE,FALSE,0 ); + gtk_misc_set_alignment( GTK_MISC( label2 ),7.45058e-09,0.5 ); + gtk_misc_set_padding( GTK_MISC( label2 ),4,0 ); + + RBVNone=gtk_radio_button_new_with_label( VEncoder_group,MSGTR_PREFERENCES_None ); + VEncoder_group=gtk_radio_button_group( GTK_RADIO_BUTTON( RBVNone ) ); + gtk_widget_set_name( RBVNone,"RBVNone" ); + gtk_widget_ref( RBVNone ); + gtk_object_set_data_full( GTK_OBJECT( DXR3Config ),"RBVNone",RBVNone,(GtkDestroyNotify)gtk_widget_unref ); + gtk_widget_show( RBVNone ); + gtk_box_pack_start( GTK_BOX( vbox3 ),RBVNone,FALSE,FALSE,0 ); + gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( RBVNone ),TRUE ); + + RBVLavc=gtk_radio_button_new_with_label( VEncoder_group,MSGTR_PREFERENCES_DXR3_LAVC ); + VEncoder_group=gtk_radio_button_group( GTK_RADIO_BUTTON( RBVLavc ) ); + gtk_widget_set_name( RBVLavc,"RBVLavc" ); + gtk_widget_ref( RBVLavc ); + gtk_object_set_data_full( GTK_OBJECT( DXR3Config ),"RBVLavc",RBVLavc,(GtkDestroyNotify)gtk_widget_unref ); + gtk_widget_show( RBVLavc ); + gtk_box_pack_start( GTK_BOX( vbox3 ),RBVLavc,FALSE,FALSE,0 ); + + RBVFame=gtk_radio_button_new_with_label( VEncoder_group,MSGTR_PREFERENCES_DXR3_FAME ); + VEncoder_group=gtk_radio_button_group( GTK_RADIO_BUTTON( RBVFame ) ); + gtk_widget_set_name( RBVFame,"RBVFame" ); + gtk_widget_ref( RBVFame ); + gtk_object_set_data_full( GTK_OBJECT( DXR3Config ),"RBVFame",RBVFame,(GtkDestroyNotify)gtk_widget_unref ); + gtk_widget_show( RBVFame ); + gtk_box_pack_start( GTK_BOX( vbox3 ),RBVFame,FALSE,FALSE,0 ); + + hseparator1=gtk_hseparator_new(); + gtk_widget_set_name( hseparator1,"hseparator1" ); + gtk_widget_ref( hseparator1 ); + gtk_object_set_data_full( GTK_OBJECT( DXR3Config ),"hseparator1",hseparator1,(GtkDestroyNotify)gtk_widget_unref ); + gtk_widget_show( hseparator1 ); + gtk_box_pack_start( GTK_BOX( vbox1 ),hseparator1,FALSE,FALSE,0 ); + gtk_widget_set_usize( hseparator1,-2,6 ); + + hbuttonbox1=gtk_hbutton_box_new(); + gtk_widget_set_name( hbuttonbox1,"hbuttonbox1" ); + gtk_widget_ref( hbuttonbox1 ); + gtk_object_set_data_full( GTK_OBJECT( DXR3Config ),"hbuttonbox1",hbuttonbox1,(GtkDestroyNotify)gtk_widget_unref ); + gtk_widget_show( hbuttonbox1 ); + gtk_box_pack_start( GTK_BOX( vbox1 ),hbuttonbox1,FALSE,FALSE,0 ); + gtk_button_box_set_layout( GTK_BUTTON_BOX( hbuttonbox1 ),GTK_BUTTONBOX_END ); + gtk_button_box_set_spacing( GTK_BUTTON_BOX( hbuttonbox1 ),10 ); + gtk_button_box_set_child_size( GTK_BUTTON_BOX( hbuttonbox1 ),85,20 ); + gtk_button_box_set_child_ipadding( GTK_BUTTON_BOX( hbuttonbox1 ),0,0 ); + + dxr3BOk=gtk_button_new_with_label( MSGTR_Ok ); + gtk_widget_set_name( dxr3BOk,"dxr3BOk" ); + gtk_widget_ref( dxr3BOk ); + gtk_object_set_data_full( GTK_OBJECT( DXR3Config ),"dxr3BOk",dxr3BOk,(GtkDestroyNotify)gtk_widget_unref ); + gtk_widget_show( dxr3BOk ); + gtk_container_add( GTK_CONTAINER( hbuttonbox1 ),dxr3BOk ); +// GTK_WIDGET_UNSET_FLAGS( bOk,GTK_CAN_FOCUS ); + + dxr3BCancel=gtk_button_new_with_label( MSGTR_Cancel ); + gtk_widget_set_name( dxr3BCancel,"dxr3BCancel" ); + gtk_widget_ref( dxr3BCancel ); + gtk_object_set_data_full( GTK_OBJECT( DXR3Config ),"dxr3BCancel",dxr3BCancel,(GtkDestroyNotify)gtk_widget_unref ); + gtk_widget_show( dxr3BCancel ); + gtk_container_add( GTK_CONTAINER( hbuttonbox1 ),dxr3BCancel ); +// GTK_WIDGET_UNSET_FLAGS( bCancel,GTK_CAN_FOCUS ); + + gtk_widget_add_accelerator( dxr3BOk,"released",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE ); + gtk_widget_add_accelerator( dxr3BCancel,"released",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE ); + + gtk_signal_connect( GTK_OBJECT( DXR3Config ),"destroy",GTK_SIGNAL_FUNC( dxr3Button ),(void *)2 ); + gtk_signal_connect( GTK_OBJECT( DXR3Config ),"show",GTK_SIGNAL_FUNC( dxr3Button ),(void *)3 ); + gtk_signal_connect( GTK_OBJECT( DXR3Config ),"hide",GTK_SIGNAL_FUNC( dxr3Button ),(void *)4 ); + + gtk_signal_connect( GTK_OBJECT( dxr3BOk ),"released",GTK_SIGNAL_FUNC( dxr3Button ),(void *)0 ); + gtk_signal_connect( GTK_OBJECT( dxr3BCancel ),"released",GTK_SIGNAL_FUNC( dxr3Button ),(void *)1 ); + + gtk_window_add_accel_group( GTK_WINDOW( DXR3Config ),accel_group ); + + return DXR3Config; +} + +#endif diff --git a/Gui/mplayer/gtk/pl.c b/Gui/mplayer/gtk/pl.c index c56f3bbab5..f171ba8c12 100644 --- a/Gui/mplayer/gtk/pl.c +++ b/Gui/mplayer/gtk/pl.c @@ -12,6 +12,7 @@ #include "../../../config.h" #include "../../../help_mp.h" +#include "../../libmpdemux/stream.h" #include "../../interface.h" #include "../widgets.h" diff --git a/Gui/mplayer/mw.h b/Gui/mplayer/mw.h index 15983e218c..c02f337e54 100644 --- a/Gui/mplayer/mw.h +++ b/Gui/mplayer/mw.h @@ -246,7 +246,7 @@ void mplEventHandling( int msg,float param ) case evSetVCDTrack: guiIntfStruct.Track=(int)param; case evPlayVCD: - gtkSet( gtkClearStruct,guiALL,NULL ); + gtkSet( gtkClearStruct,0,(void *)guiALL ); guiIntfStruct.StreamType=STREAMTYPE_VCD; goto play; #endif @@ -256,7 +256,7 @@ void mplEventHandling( int msg,float param ) guiIntfStruct.DVD.current_chapter=1; guiIntfStruct.DVD.current_angle=1; play_dvd_2: - gtkSet( gtkClearStruct,guiALL - guiDVD,NULL ); + gtkSet( gtkClearStruct,0,(void *)(guiALL - guiDVD) ); guiIntfStruct.StreamType=STREAMTYPE_DVD; #endif case evPlay: @@ -283,16 +283,13 @@ play: { case STREAMTYPE_STREAM: case STREAMTYPE_FILE: - gtkSet( gtkClearStruct,guiALL - guiFilenames,NULL ); + gtkSet( gtkClearStruct,0,(void *)(guiALL - guiFilenames) ); break; #ifdef HAVE_VCD case STREAMTYPE_VCD: - gtkSet( gtkClearStruct,guiALL - guiVCD - guiFilenames,NULL ); - if ( !cdrom_device ) - { - cdrom_device=DEFAULT_CDROM_DEVICE; - guiSetFilename( guiIntfStruct.Filename,cdrom_device ); - } + gtkSet( gtkClearStruct,0,(void *)(guiALL - guiVCD - guiFilenames) ); + if ( !cdrom_device ) cdrom_device=DEFAULT_CDROM_DEVICE; + mplSetFileName( NULL,cdrom_device,STREAMTYPE_VCD ); if ( guiIntfStruct.Playing != 2 ) { if ( !guiIntfStruct.Track ) @@ -307,12 +304,9 @@ play: #endif #ifdef USE_DVDREAD case STREAMTYPE_DVD: - gtkSet( gtkClearStruct,guiALL - guiDVD - guiFilenames,NULL ); - if ( !dvd_device ) - { - dvd_device=DEFAULT_DVD_DEVICE; - guiSetFilename( guiIntfStruct.Filename,dvd_device ) - } + gtkSet( gtkClearStruct,0,(void *)(guiALL - guiDVD - guiFilenames) ); + if ( !dvd_device ) dvd_device=DEFAULT_DVD_DEVICE; + mplSetFileName( NULL,dvd_device,STREAMTYPE_DVD ); if ( guiIntfStruct.Playing != 2 ) { dvd_title=guiIntfStruct.DVD.current_title; @@ -696,7 +690,7 @@ void mplDandDHandler(int num,const char** files) free( str ); } - mplSetFileName( NULL,files[0] ); + mplSetFileName( NULL,files[0],STREAMTYPE_FILE ); if ( guiIntfStruct.Playing == 1 ) mplEventHandling( evStop,0 ); mplEventHandling( evPlay,0 ); diff --git a/Gui/mplayer/play.c b/Gui/mplayer/play.c index 58946f7e49..0e6df5fd55 100644 --- a/Gui/mplayer/play.c +++ b/Gui/mplayer/play.c @@ -24,6 +24,8 @@ #include "../skin/skin.h" #include "../skin/font.h" +#include "../libmpdemux/stream.h" + extern float rel_seek_secs; extern int abs_seek_pos; @@ -246,14 +248,14 @@ void ChangeSkin( char * name ) btnModify( evFullScreen,!appMPlayer.subWindow.isFullScreen ); } -void mplSetFileName( char * dir,char * name ) +void mplSetFileName( char * dir,char * name,int type ) { if ( !name ) return; if ( !dir ) guiSetFilename( guiIntfStruct.Filename,name ) else guiSetDF( guiIntfStruct.Filename,dir,name ) - guiIntfStruct.StreamType=STREAMTYPE_FILE; + guiIntfStruct.StreamType=type; guiIntfStruct.FilenameChanged=1; gfree( (void **)&guiIntfStruct.AudioFile ); gfree( (void **)&guiIntfStruct.Subtitlename ); @@ -285,7 +287,7 @@ void mplPrev( void ) default: if ( (prev=gtkSet( gtkGetPrevPlItem,0,NULL)) ) { - mplSetFileName( prev->path,prev->name ); + mplSetFileName( prev->path,prev->name,STREAMTYPE_FILE ); mplGotoTheNext=0; break; } @@ -321,7 +323,7 @@ void mplNext( void ) default: if ( (next=gtkSet( gtkGetNextPlItem,0,NULL)) ) |