Mercurial > mplayer.hg
changeset 7009:98bed9e12087
- add dxr3 gui support (dialogbox, etc.)
- fix one small dvd playing bug ( dvd playing don't del the playlist)
- add some ifdef() check
author | pontscho |
---|---|
date | Wed, 14 Aug 2002 23:02:45 +0000 |
parents | 2af81c9ed167 |
children | fed45d810822 |
files | Gui/cfg.c Gui/cfg.h Gui/interface.c Gui/interface.h Gui/mplayer/gtk/mb.c Gui/mplayer/gtk/opts.c Gui/mplayer/gtk/pl.c Gui/mplayer/mw.h Gui/mplayer/play.c Gui/mplayer/play.h help_mp-en.h libvo/video_out.h libvo/vo_dxr3.c mplayer.c |
diffstat | 14 files changed, 455 insertions(+), 76 deletions(-) [+] |
line wrap: on
line diff
--- a/Gui/cfg.c Wed Aug 14 21:56:31 2002 +0000 +++ b/Gui/cfg.c Wed Aug 14 23:02:45 2002 +0000 @@ -28,9 +28,12 @@ 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 @@ { "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 },
--- a/Gui/cfg.h Wed Aug 14 21:56:31 2002 +0000 +++ b/Gui/cfg.h Wed Aug 14 23:02:45 2002 +0000 @@ -14,9 +14,12 @@ 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;
--- a/Gui/interface.c Wed Aug 14 21:56:31 2002 +0000 +++ b/Gui/interface.c Wed Aug 14 23:02:45 2002 +0000 @@ -143,7 +143,7 @@ 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 @@ } #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 @@ 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 @@ btnModify( evSetBalance,guiIntfStruct.Balance ); } break; + case guiSetFileFormat: + guiIntfStruct.FileFormat=(int)arg; + break; case guiSetValues: // -- video if ( arg ) @@ -364,6 +401,9 @@ 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 @@ #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 @@ guiIntfStruct.DiskChanged=0; -// --- video opts +// --- video opts if ( !gtkVODriver ) { int i = 0; @@ -433,35 +481,38 @@ 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; - 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 ) + + { + int i = 0; + guiIntfStruct.NoWindow=False; + while ( video_out_drivers[i++] ) + if ( video_out_drivers[i - 1]->control( VOCTRL_GUISUPPORT,NULL ) == VO_TRUE ) { - 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; + 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 ) ) + { + 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 @@ break; } + return False; } extern unsigned int GetTimerMS( void ); @@ -523,7 +575,7 @@ void guiEventHandling( void ) { - if ( !guiIntfStruct.Playing || guiIntfStruct.AudioOnly ) wsHandleEvents(); + if ( !guiIntfStruct.Playing || guiIntfStruct.NoWindow ) wsHandleEvents(); gtkEventHandling(); mplTimer=GetTimerMS() / 20; } @@ -644,17 +696,18 @@ #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:
--- a/Gui/interface.h Wed Aug 14 21:56:31 2002 +0000 +++ b/Gui/interface.h Wed Aug 14 23:02:45 2002 +0000 @@ -71,6 +71,7 @@ int MovieWidth; int MovieHeight; + int NoWindow; float Volume; float Balance; @@ -82,6 +83,7 @@ int TimeSec; int LengthInSec; int FrameDrop; + int FileFormat; char * Filename; int FilenameChanged; @@ -116,6 +118,7 @@ #define guiSetVolume 11 #define guiSetDefaults 12 #define guiSetValues 13 +#define guiSetFileFormat 14 #define guiSetStop 0 #define guiSetPlay 1 @@ -130,7 +133,7 @@ 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 );
--- a/Gui/mplayer/gtk/mb.c Wed Aug 14 21:56:31 2002 +0000 +++ b/Gui/mplayer/gtk/mb.c Wed Aug 14 23:02:45 2002 +0000 @@ -133,7 +133,8 @@ 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();
--- a/Gui/mplayer/gtk/opts.c Wed Aug 14 21:56:31 2002 +0000 +++ b/Gui/mplayer/gtk/opts.c Wed Aug 14 23:02:45 2002 +0000 @@ -83,14 +83,19 @@ { 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 @@ { 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 @@ 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 @@ 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 @@ // -- 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 @@ 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 @@ // -- 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 @@ 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: -// 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; #if 0 case bLSubtitle: break; @@ -385,10 +406,16 @@ 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 @@ return Preferences; } +#ifdef USE_OSS_AUDIO GtkWidget * OSSConfig; static GtkWidget * CEOssDevice; static GtkWidget * CEOssMixer; @@ -1452,6 +1480,8 @@ static GtkWidget * BOssOk; static GtkWidget * BOssCancel; + int gtkVOSSConfig = 0; + void ShowOSSConfig( void ) { if ( gtkVOSSConfig ) gtkActive( OSSConfig ); @@ -1682,3 +1712,278 @@ 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
--- a/Gui/mplayer/gtk/pl.c Wed Aug 14 21:56:31 2002 +0000 +++ b/Gui/mplayer/gtk/pl.c Wed Aug 14 23:02:45 2002 +0000 @@ -12,6 +12,7 @@ #include "../../../config.h" #include "../../../help_mp.h" +#include "../../libmpdemux/stream.h" #include "../../interface.h" #include "../widgets.h"
--- a/Gui/mplayer/mw.h Wed Aug 14 21:56:31 2002 +0000 +++ b/Gui/mplayer/mw.h Wed Aug 14 23:02:45 2002 +0000 @@ -246,7 +246,7 @@ 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 @@ 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 @@ { 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 @@ #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 @@ free( str ); } - mplSetFileName( NULL,files[0] ); + mplSetFileName( NULL,files[0],STREAMTYPE_FILE ); if ( guiIntfStruct.Playing == 1 ) mplEventHandling( evStop,0 ); mplEventHandling( evPlay,0 );
--- a/Gui/mplayer/play.c Wed Aug 14 21:56:31 2002 +0000 +++ b/Gui/mplayer/play.c Wed Aug 14 23:02:45 2002 +0000 @@ -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 @@ 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 @@ 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 @@ default: if ( (next=gtkSet( gtkGetNextPlItem,0,NULL)) ) { - mplSetFileName( next->path,next->name ); + mplSetFileName( next->path,next->name,STREAMTYPE_FILE ); mplGotoTheNext=0; break; }
--- a/Gui/mplayer/play.h Wed Aug 14 21:56:31 2002 +0000 +++ b/Gui/mplayer/play.h Wed Aug 14 23:02:45 2002 +0000 @@ -28,6 +28,6 @@ extern void ChangeSkin( char * name ); extern void EventHandling( void ); -extern void mplSetFileName( char * dir,char * name ); +extern void mplSetFileName( char * dir,char * name,int type ); #endif
--- a/help_mp-en.h Wed Aug 14 21:56:31 2002 +0000 +++ b/help_mp-en.h Wed Aug 14 23:02:45 2002 +0000 @@ -352,6 +352,7 @@ #define MSGTR_NEMFMR "Sorry, not enough memory for menu rendering." #define MSGTR_NEMFMM "Sorry, not enough memory for main window shape mask." #define MSGTR_IDFGCVD "Sorry, i don't find gui compatible video output driver." +#define MSGTR_NEEDLAVCFAME "Sorry, you don't play non-mpeg files in your DXR3/H+ device without reencoding.\nPlease enable lavc or fame in DXR3/H+ configbox." // --- skin loader error messages #define MSGTR_SKIN_ERRORMESSAGE "[skin] error in skin config file on line %d: %s" @@ -482,6 +483,9 @@ #define MSGTR_PREFERENCES_OSS_Device "Device:" #define MSGTR_PREFERENCES_OSS_Mixer "Mixer:" #define MSGTR_PREFERENCES_Message "Please remember, some function need restart the playing." +#define MSGTR_PREFERENCES_DXR3_VENC "Video encoder:" +#define MSGTR_PREFERENCES_DXR3_LAVC "Use LAVC ( ffmpeg encoder )" +#define MSGTR_PREFERENCES_DXR3_FAME "Use FAME" // --- messagebox #define MSGTR_MSGBOX_LABEL_FatalError "fatal error ..."
--- a/libvo/video_out.h Wed Aug 14 21:56:31 2002 +0000 +++ b/libvo/video_out.h Wed Aug 14 23:02:45 2002 +0000 @@ -29,6 +29,7 @@ #define VOCTRL_RESET 3 /* true if vo driver can use GUI created windows */ #define VOCTRL_GUISUPPORT 4 +#define VOCTRL_GUI_NOWINDOW 19 /* used to switch to fullscreen */ #define VOCTRL_FULLSCREEN 5 #define VOCTRL_SCREENSHOT 6 @@ -49,6 +50,8 @@ /* equalizer controls */ #define VOCTRL_SET_EQUALIZER 17 #define VOCTRL_GET_EQUALIZER 18 +// ... 20 + #define VO_TRUE 1 #define VO_FALSE 0
--- a/libvo/vo_dxr3.c Wed Aug 14 21:56:31 2002 +0000 +++ b/libvo/vo_dxr3.c Wed Aug 14 23:02:45 2002 +0000 @@ -143,6 +143,9 @@ uint32_t control(uint32_t request, void *data, ...) { switch (request) { + case VOCTRL_GUISUPPORT: + case VOCTRL_GUI_NOWINDOW: + return VO_TRUE; case VOCTRL_RESUME: if (!noprebuf) { ioval = EM8300_PLAYMODE_PLAY;
--- a/mplayer.c Wed Aug 14 21:56:31 2002 +0000 +++ b/mplayer.c Wed Aug 14 23:02:45 2002 +0000 @@ -815,9 +815,9 @@ guiGetEvent( guiSetDefaults,NULL ); if ( ( guiIntfStruct.FilenameChanged || !filename ) -#ifdef USE_DVDREAD - && ( guiIntfStruct.StreamType != STREAMTYPE_DVD ) -#endif +//#ifdef USE_DVDREAD +// && ( guiIntfStruct.StreamType != STREAMTYPE_DVD ) +//#endif ) { play_tree_t * entry = play_tree_new(); @@ -1358,7 +1358,8 @@ guiGetEvent( guiSetFileName,filename ); if ( sh_audio ) guiIntfStruct.AudioType=sh_audio->channels; else guiIntfStruct.AudioType=0; if ( !sh_video && sh_audio ) guiGetEvent( guiSetAudioOnly,(char *)1 ); else guiGetEvent( guiSetAudioOnly,(char *)0 ); - guiGetEvent( guiSetValues,(char *)sh_video ); + guiGetEvent( guiSetFileFormat,(char *)demuxer->file_format ); + if ( guiGetEvent( guiSetValues,(char *)sh_video ) ) goto goto_next_file; } #endif