diff options
-rw-r--r-- | Gui/app.c | 7 | ||||
-rw-r--r-- | Gui/cfg.c | 2 | ||||
-rw-r--r-- | Gui/cfg.h | 1 | ||||
-rw-r--r-- | Gui/interface.c | 48 | ||||
-rw-r--r-- | Gui/mplayer/gtk/fs.c | 1 | ||||
-rw-r--r-- | Gui/mplayer/gtk/menu.c | 14 | ||||
-rw-r--r-- | Gui/mplayer/gtk/opts.c | 23 | ||||
-rw-r--r-- | Gui/mplayer/mw.c | 13 | ||||
-rw-r--r-- | Gui/mplayer/play.c | 31 | ||||
-rw-r--r-- | help/help_mp-en.h | 1 |
10 files changed, 95 insertions, 46 deletions
@@ -210,6 +210,9 @@ void btnSet( int event,int set ) { 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 @@ -57,6 +57,7 @@ int gtkSubDumpMPSub = 0; int gtkSubDumpSrt = 0; int gtkLoadFullscreen = 0; +int gtkShowVideoWindow = 1; int gtkEnablePlayBar = 1; // --- @@ -133,6 +134,7 @@ static config_t gui_opts[] = { "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 }, @@ -39,6 +39,7 @@ extern char * gtkEquChannel4; extern char * gtkEquChannel5; extern char * gtkEquChannel6; extern int gtkLoadFullscreen; +extern int gtkShowVideoWindow; extern int gtkEnablePlayBar; extern int cfg_read( void ); diff --git a/Gui/interface.c b/Gui/interface.c index 45430888ab..ab9bc5f1a2 100644 --- a/Gui/interface.c +++ b/Gui/interface.c @@ -193,10 +193,10 @@ void guiInit( void ) 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 @@ void guiInit( void ) if ( !appMPlayer.mainDecoration ) wsWindowDecoration( &appMPlayer.mainWindow,0 ); wsVisibleWindow( &appMPlayer.mainWindow,wsShowWindow ); -#if 1 +#if 0 wsVisibleWindow( &appMPlayer.subWindow,wsShowWindow ); { @@ -264,6 +264,38 @@ void guiInit( void ) 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 @@ int guiGetEvent( int type,char * arg ) 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(); diff --git a/Gui/mplayer/gtk/fs.c b/Gui/mplayer/gtk/fs.c index 60cbdab4a7..e4b6e6f041 100644 --- a/Gui/mplayer/gtk/fs.c +++ b/Gui/mplayer/gtk/fs.c @@ -514,6 +514,7 @@ void fs_Ok_released( GtkButton * button,gpointer user_data ) } 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 ) diff --git a/Gui/mplayer/gtk/menu.c b/Gui/mplayer/gtk/menu.c index a8c6347140..0f4c33ba8a 100644 --- a/Gui/mplayer/gtk/menu.c +++ b/Gui/mplayer/gtk/menu.c @@ -286,6 +286,7 @@ GtkWidget * create_PopUpMenu( void ) GtkWidget * Menu = NULL; GtkWidget * SubMenu = NULL; GtkWidget * MenuItem = NULL; + GtkWidget * N, * D, * F; Menu=gtk_menu_new(); @@ -478,9 +479,16 @@ GtkWidget * create_PopUpMenu( void ) ( 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 ); diff --git a/Gui/mplayer/gtk/opts.c b/Gui/mplayer/gtk/opts.c index 60f58d4f78..682c888bf5 100644 --- a/Gui/mplayer/gtk/opts.c +++ b/Gui/mplayer/gtk/opts.c @@ -57,6 +57,7 @@ static GtkWidget * CBDR; 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 @@ void ShowPreferences( void ) // --- 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 @@ void ShowPreferences( void ) 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 @@ void prButton( GtkButton * button,gpointer user_data ) // --- 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 @@ static void prToggled( GtkToggleButton * togglebutton,gpointer user_data ) // 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 @@ GtkWidget * create_Preferences( void ) 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 ); diff --git a/Gui/mplayer/mw.c b/Gui/mplayer/mw.c index 108570507e..a23a5c41ad 100644 --- a/Gui/mplayer/mw.c +++ b/Gui/mplayer/mw.c @@ -277,6 +277,7 @@ set_volume: } break; case evDoubleSize: + btnSet( evFullScreen,btnReleased ); if ( guiIntfStruct.Playing ) { appMPlayer.subWindow.isFullScreen=True; @@ -288,6 +289,7 @@ set_volume: } break; case evNormalSize: + btnSet( evFullScreen,btnReleased ); if ( guiIntfStruct.Playing ) { appMPlayer.subWindow.isFullScreen=True; @@ -299,15 +301,10 @@ set_volume: 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: diff --git a/Gui/mplayer/play.c b/Gui/mplayer/play.c index 79d85e2333..f7ad980432 100644 --- a/Gui/mplayer/play.c +++ b/Gui/mplayer/play.c @@ -37,30 +37,7 @@ static int mplGotoTheNext = 1; 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 @@ void mplFullScreen( void ) 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 ); } diff --git a/help/help_mp-en.h b/help/help_mp-en.h index 392421d8ea..d89680cbbf 100644 --- a/help/help_mp-en.h +++ b/help/help_mp-en.h @@ -585,6 +585,7 @@ static char help_text[]= #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" |