Mercurial > mplayer.hg
changeset 9202:c2f31ca14a92
- rewrite Jan Spitalnik's patch
- fix some nice 10l
author | pontscho |
---|---|
date | Sat, 01 Feb 2003 16:42:02 +0000 |
parents | 419d7ccb0f3b |
children | 46ff68fee9dc |
files | Gui/app.c Gui/cfg.c Gui/cfg.h Gui/interface.c Gui/mplayer/gtk/fs.c Gui/mplayer/gtk/menu.c Gui/mplayer/gtk/opts.c Gui/mplayer/mw.c Gui/mplayer/play.c help/help_mp-en.h |
diffstat | 10 files changed, 95 insertions(+), 46 deletions(-) [+] |
line wrap: on
line diff
--- a/Gui/app.c Sat Feb 01 15:11:19 2003 +0000 +++ b/Gui/app.c Sat Feb 01 16:42:02 2003 +0000 @@ -210,6 +210,9 @@ { int j; for ( j=0;j<appMPlayer.NumberOfItems + 1;j++ ) - if ( appMPlayer.Items[j].msg == event ) appMPlayer.Items[j].pressed=set; + if ( appMPlayer.Items[j].msg == event ) + { appMPlayer.Items[j].pressed=set; appMPlayer.barItems[j].tmp=0; } + for ( j=0;j<appMPlayer.NumberOfBarItems + 1;j++ ) + if ( appMPlayer.barItems[j].msg == event ) + { appMPlayer.barItems[j].pressed=set; appMPlayer.barItems[j].tmp=0; } } - \ No newline at end of file
--- a/Gui/cfg.c Sat Feb 01 15:11:19 2003 +0000 +++ b/Gui/cfg.c Sat Feb 01 16:42:02 2003 +0000 @@ -57,6 +57,7 @@ int gtkSubDumpSrt = 0; int gtkLoadFullscreen = 0; +int gtkShowVideoWindow = 1; int gtkEnablePlayBar = 1; // --- @@ -133,6 +134,7 @@ { "playbar",>kEnablePlayBar,CONF_TYPE_FLAG,0,0,1,NULL }, { "load_fullscreen",>kLoadFullscreen,CONF_TYPE_FLAG,0,0,1,NULL }, + { "show_videowin", >kShowVideoWindow,CONF_TYPE_FLAG,0,0,1,NULL }, { "stopxscreensaver",&stop_xscreensaver,CONF_TYPE_FLAG,0,0,1,NULL }, { "autosync",>kAutoSyncOn,CONF_TYPE_FLAG,0,0,1,NULL },
--- a/Gui/cfg.h Sat Feb 01 15:11:19 2003 +0000 +++ b/Gui/cfg.h Sat Feb 01 16:42:02 2003 +0000 @@ -39,6 +39,7 @@ extern char * gtkEquChannel5; extern char * gtkEquChannel6; extern int gtkLoadFullscreen; +extern int gtkShowVideoWindow; extern int gtkEnablePlayBar; extern int cfg_read( void );
--- a/Gui/interface.c Sat Feb 01 15:11:19 2003 +0000 +++ b/Gui/interface.c Sat Feb 01 16:42:02 2003 +0000 @@ -193,10 +193,10 @@ fprintf( stderr,MSGTR_NEMDB ); exit( 0 ); } - + wsCreateWindow( &appMPlayer.subWindow, appMPlayer.sub.x,appMPlayer.sub.y,appMPlayer.sub.width,appMPlayer.sub.height, - wsNoBorder,wsShowMouseCursor|wsHandleMouseButton|wsHandleMouseMove,wsShowFrame|wsHideWindow,"ViDEO" ); + wsNoBorder,wsShowMouseCursor|wsHandleMouseButton|wsHandleMouseMove,wsShowFrame|wsHideWindow,"MPlayer - Video" ); wsDestroyImage( &appMPlayer.subWindow ); wsCreateImage( &appMPlayer.subWindow,appMPlayer.sub.Bitmap.Width,appMPlayer.sub.Bitmap.Height ); @@ -249,7 +249,7 @@ if ( !appMPlayer.mainDecoration ) wsWindowDecoration( &appMPlayer.mainWindow,0 ); wsVisibleWindow( &appMPlayer.mainWindow,wsShowWindow ); -#if 1 +#if 0 wsVisibleWindow( &appMPlayer.subWindow,wsShowWindow ); { @@ -264,6 +264,38 @@ mplFullScreen(); btnModify( evFullScreen,btnPressed ); } +#else + if ( gtkShowVideoWindow ) + { + wsVisibleWindow( &appMPlayer.subWindow,wsShowWindow ); + { + XEvent xev; + do { XNextEvent( wsDisplay,&xev ); } while ( xev.type != MapNotify || xev.xmap.event != appMPlayer.subWindow.WindowID ); + appMPlayer.subWindow.Mapped=wsMapped; + } + + if ( fullscreen ) + { + mplFullScreen(); + btnModify( evFullScreen,btnPressed ); + } + } + else + { + if ( fullscreen ) + { + wsVisibleWindow( &appMPlayer.subWindow,wsShowWindow ); + { + XEvent xev; + do { XNextEvent( wsDisplay,&xev ); } while ( xev.type != MapNotify || xev.xmap.event != appMPlayer.subWindow.WindowID ); + appMPlayer.subWindow.Mapped=wsMapped; + } + wsVisibleWindow( &appMPlayer.subWindow, wsShowWindow ); + + mplFullScreen(); + btnModify( evFullScreen,btnPressed ); + } + } #endif mplSubRender=1; // --- @@ -442,8 +474,14 @@ case guiCEvent: switch ( (int)arg ) { - case guiSetPlay: guiIntfStruct.Playing=1; break; - case guiSetStop: guiIntfStruct.Playing=0; break; + case guiSetPlay: + guiIntfStruct.Playing=1; + if ( !gtkShowVideoWindow ) wsVisibleWindow( &appMPlayer.subWindow,wsHideWindow ); + break; + case guiSetStop: + guiIntfStruct.Playing=0; + if ( !gtkShowVideoWindow ) wsVisibleWindow( &appMPlayer.subWindow,wsHideWindow ); + break; case guiSetPause: guiIntfStruct.Playing=2; break; } mplState();
--- a/Gui/mplayer/gtk/fs.c Sat Feb 01 15:11:19 2003 +0000 +++ b/Gui/mplayer/gtk/fs.c Sat Feb 01 16:42:02 2003 +0000 @@ -514,6 +514,7 @@ } if ( i ) fsTopList_items=g_list_prepend( fsTopList_items,(gchar *)get_current_dir_name() ); if ( mplMainAutoPlay ) { mplMainAutoPlay=0; mplEventHandling( evPlay,0 ); } + else guiGetEvent( guiCEvent,guiSetStop ); } void fs_Cancel_released( GtkButton * button,gpointer user_data )
--- a/Gui/mplayer/gtk/menu.c Sat Feb 01 15:11:19 2003 +0000 +++ b/Gui/mplayer/gtk/menu.c Sat Feb 01 16:42:02 2003 +0000 @@ -286,6 +286,7 @@ GtkWidget * Menu = NULL; GtkWidget * SubMenu = NULL; GtkWidget * MenuItem = NULL; + GtkWidget * N, * D, * F; Menu=gtk_menu_new(); @@ -478,9 +479,16 @@ ( appMPlayer.subWindow.Height == guiIntfStruct.MovieHeight * 2 ) ) b2=1; else b1=1; } else b1=!appMPlayer.subWindow.isFullScreen; - AddMenuCheckItem( Menu,MSGTR_MENU_NormalSize" ",b1,evNormalSize ); - AddMenuCheckItem( Menu,MSGTR_MENU_DoubleSize,b2,evDoubleSize ); - AddMenuCheckItem( Menu,MSGTR_MENU_FullScreen,appMPlayer.subWindow.isFullScreen,evFullScreen ); + N=AddMenuCheckItem( Menu,MSGTR_MENU_NormalSize" ",b1,evNormalSize ); + D=AddMenuCheckItem( Menu,MSGTR_MENU_DoubleSize,b2,evDoubleSize ); + F=AddMenuCheckItem( Menu,MSGTR_MENU_FullScreen,appMPlayer.subWindow.isFullScreen,evFullScreen ); + } + + if ( !gtkShowVideoWindow && !guiIntfStruct.Playing ) + { + gtk_widget_set_sensitive( N,FALSE ); + gtk_widget_set_sensitive( D,FALSE ); + gtk_widget_set_sensitive( F,FALSE ); } AddSeparator( Menu );
--- a/Gui/mplayer/gtk/opts.c Sat Feb 01 15:11:19 2003 +0000 +++ b/Gui/mplayer/gtk/opts.c Sat Feb 01 16:42:02 2003 +0000 @@ -57,6 +57,7 @@ static GtkWidget * CBFramedrop; static GtkWidget * CBHFramedrop; //static GtkWidget * CBFullScreen; +static GtkWidget * CBShowVideoWindow; static GtkWidget * CBNonInterlaved; static GtkWidget * CBIndex; static GtkWidget * CBFlip; @@ -351,6 +352,12 @@ // --- 6. page gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBPostprocess ),gtkVopPP ); gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBLoadFullscreen ),gtkLoadFullscreen ); + gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBShowVideoWindow ),gtkShowVideoWindow ); + if ( !gtkShowVideoWindow ) + { + gtk_widget_set_sensitive( CBLoadFullscreen,FALSE ); + gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBLoadFullscreen ),0 ); + } gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBStopXScreenSaver ),stop_xscreensaver ); gtk_adjustment_set_value( HSPPQualityadj,auto_quality ); @@ -406,6 +413,7 @@ gtk_signal_connect( GTK_OBJECT( CBExtraStereo ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)0 ); gtk_signal_connect( GTK_OBJECT( CBNormalize ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)1 ); gtk_signal_connect( GTK_OBJECT( CBAudioEqualizer ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)2 ); + gtk_signal_connect( GTK_OBJECT( CBShowVideoWindow ),"toggled",GTK_SIGNAL_FUNC( prToggled ), (void*)3 ); #ifdef HAVE_FREETYPE gtk_signal_connect( GTK_OBJECT( RBFontNoAutoScale ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)4 ); gtk_signal_connect( GTK_OBJECT( BRFontAutoScaleWidth ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)5 ); @@ -583,6 +591,7 @@ // --- 6. page gtkVopPP=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBPostprocess ) ); gtkLoadFullscreen=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBLoadFullscreen ) ); + gtkShowVideoWindow=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBShowVideoWindow ) ); stop_xscreensaver=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBStopXScreenSaver ) ); gtkEnablePlayBar=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBPlayBar ) ); gtkSet( gtkSetAutoq,HSPPQualityadj->value,NULL ); @@ -684,6 +693,19 @@ // case 2: // equalizer // if ( guiIntfStruct.Playing ) gtkMessageBox( GTK_MB_WARNING,"Please remember, this function need restart the playing." ); // break; + case 3: + if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBShowVideoWindow ) ) ) gtk_widget_set_sensitive( CBLoadFullscreen,TRUE ); + else + { + gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBLoadFullscreen ),0 ); + gtk_widget_set_sensitive( CBLoadFullscreen,FALSE ); + } + if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBShowVideoWindow ) ) ) + { + wsVisibleWindow( &appMPlayer.subWindow,wsShowWindow ); + gtkActive( Preferences ); + } else wsVisibleWindow( &appMPlayer.subWindow,wsHideWindow ); + break; case 4: case 5: case 6: @@ -1171,6 +1193,7 @@ AddFrame( NULL,GTK_SHADOW_NONE, AddFrame( MSGTR_PREFERENCES_FRAME_Misc,GTK_SHADOW_ETCHED_OUT,vbox601,1 ),1 ),0 ); + CBShowVideoWindow=AddCheckButton( MSGTR_PREFERENCES_ShowVideoWindow,vbox602 ); CBLoadFullscreen=AddCheckButton( MSGTR_PREFERENCES_LoadFullscreen,vbox602 ); CBStopXScreenSaver=AddCheckButton( MSGTR_PREFERENCES_XSCREENSAVER,vbox602 ); CBPlayBar=AddCheckButton( MSGTR_PREFERENCES_PlayBar,vbox602 );
--- a/Gui/mplayer/mw.c Sat Feb 01 15:11:19 2003 +0000 +++ b/Gui/mplayer/mw.c Sat Feb 01 16:42:02 2003 +0000 @@ -277,6 +277,7 @@ } break; case evDoubleSize: + btnSet( evFullScreen,btnReleased ); if ( guiIntfStruct.Playing ) { appMPlayer.subWindow.isFullScreen=True; @@ -288,6 +289,7 @@ } break; case evNormalSize: + btnSet( evFullScreen,btnReleased ); if ( guiIntfStruct.Playing ) { appMPlayer.subWindow.isFullScreen=True; @@ -299,15 +301,10 @@ break; } else if ( !appMPlayer.subWindow.isFullScreen ) break; case evFullScreen: - for ( j=0;j<appMPlayer.NumberOfItems + 1;j++ ) - { - if ( appMPlayer.Items[j].msg == evFullScreen ) - { - appMPlayer.Items[j].tmp=!appMPlayer.Items[j].tmp; - appMPlayer.Items[j].pressed=appMPlayer.Items[j].tmp; - } - } + if ( !guiIntfStruct.Playing && !gtkShowVideoWindow ) break; mplFullScreen(); + if ( appMPlayer.subWindow.isFullScreen ) btnSet( evFullScreen,btnPressed ); + else btnSet( evFullScreen,btnReleased ); break; case evSetAspect:
--- a/Gui/mplayer/play.c Sat Feb 01 15:11:19 2003 +0000 +++ b/Gui/mplayer/play.c Sat Feb 01 16:42:02 2003 +0000 @@ -37,30 +37,7 @@ void mplFullScreen( void ) { if ( guiIntfStruct.NoWindow && guiIntfStruct.Playing ) return; -#if 0 - static int sx,sy; -// if ( !guiIntfStruct.Playing ) - { - wsVisibleWindow( &appMPlayer.subWindow,wsHideWindow ); - if ( appMPlayer.subWindow.isFullScreen ) - { - wsResizeWindow( &appMPlayer.subWindow,sx,sy ); - wsMoveWindow( &appMPlayer.subWindow,True,appMPlayer.sub.x,appMPlayer.sub.y ); - wsWindowDecoration( &appMPlayer.subWindow,appMPlayer.subWindow.Decorations ); - appMPlayer.subWindow.isFullScreen=0; - } - else - { - sx=appMPlayer.subWindow.Width; sy=appMPlayer.subWindow.Height; - wsResizeWindow( &appMPlayer.subWindow,wsMaxX,wsMaxY ); - wsMoveWindow( &appMPlayer.subWindow,True,0,0 ); - wsWindowDecoration( &appMPlayer.subWindow,0 ); - appMPlayer.subWindow.isFullScreen=1; - } - vo_fs=appMPlayer.subWindow.isFullScreen; - wsVisibleWindow( &appMPlayer.subWindow,wsShowWindow ); - }// else { vo_x11_fullscreen(); appMPlayer.subWindow.isFullScreen=vo_fs; } -#else + if ( ( guiIntfStruct.Playing )&&( appMPlayer.subWindow.isFullScreen ) ) { appMPlayer.subWindow.OldWidth=guiIntfStruct.MovieWidth; appMPlayer.subWindow.OldHeight=guiIntfStruct.MovieHeight; @@ -77,13 +54,11 @@ default: appMPlayer.subWindow.OldY=appMPlayer.sub.y; break; } } - wsFullScreen( &appMPlayer.subWindow ); - vo_fs=appMPlayer.subWindow.isFullScreen; + if ( guiIntfStruct.Playing || gtkShowVideoWindow ) wsFullScreen( &appMPlayer.subWindow ); + fullscreen=vo_fs=appMPlayer.subWindow.isFullScreen; wsSetLayer( wsDisplay,appMPlayer.mainWindow.WindowID,appMPlayer.subWindow.isFullScreen ); wsSetLayer( wsDisplay,appMPlayer.menuWindow.WindowID,appMPlayer.subWindow.isFullScreen ); -#endif - fullscreen=appMPlayer.subWindow.isFullScreen; if ( guiIntfStruct.Playing ) wsSetBackgroundRGB( &appMPlayer.subWindow,0,0,0 ); else wsSetBackgroundRGB( &appMPlayer.subWindow,appMPlayer.sub.R,appMPlayer.sub.G,appMPlayer.sub.B ); }
--- a/help/help_mp-en.h Sat Feb 01 15:11:19 2003 +0000 +++ b/help/help_mp-en.h Sat Feb 01 16:42:02 2003 +0000 @@ -585,6 +585,7 @@ #define MSGTR_PREFERENCES_CDROMDevice "CD-ROM device:" #define MSGTR_PREFERENCES_DVDDevice "DVD device:" #define MSGTR_PREFERENCES_FPS "Movie FPS:" +#define MSGTR_PREFERENCES_ShowVideoWindow "Show Video Window when inactive" #define MSGTR_ABOUT_UHU "GUI development sponsored by UHU Linux\n" #define MSGTR_ABOUT_CoreTeam " MPlayer core team:\n"