[Mplayer-cvslog] CVS: main/Gui/mplayer/gtk menu.c,1.24,1.25
Zoltan Ponekker
pontscho at mplayerhq.hu
Fri Nov 29 01:58:29 CET 2002
Update of /cvsroot/mplayer/main/Gui/mplayer/gtk
In directory mail:/var/tmp.root/cvs-serv16537/Gui/mplayer/gtk
Modified Files:
menu.c
Log Message:
- audio track handling in menu (idea from Rüdiger Kuhlmann)
- some userfriendly changes in menu
Index: menu.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/gtk/menu.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- menu.c 27 Nov 2002 22:48:56 -0000 1.24
+++ menu.c 29 Nov 2002 00:58:25 -0000 1.25
@@ -14,6 +14,8 @@
#include "../widgets.h"
#include "../app.h"
+#include "../../../libmpdemux/demuxer.h"
+
void ActivateMenuItem( int Item )
{
// fprintf( stderr,"[menu] item: %d.%d\n",Item&0xffff,Item>>16 );
@@ -411,11 +413,29 @@
gtk_widget_set_sensitive( MenuItem,FALSE );
}
#endif
- AspectMenu=AddSubMenu( Menu,MSGTR_MENU_AspectRatio );
- AddMenuItem( AspectMenu,MSGTR_MENU_Original,( 1 << 16 ) + evSetAspect );
- AddMenuItem( AspectMenu,"16:9",( 2 << 16 ) + evSetAspect );
- AddMenuItem( AspectMenu,"4:3",( 3 << 16 ) + evSetAspect );
- AddMenuItem( AspectMenu,"2.35",( 4 << 16 ) + evSetAspect );
+
+ if ( guiIntfStruct.Playing )
+ {
+ AspectMenu=AddSubMenu( Menu,MSGTR_MENU_AspectRatio );
+ AddMenuItem( AspectMenu,MSGTR_MENU_Original,( 1 << 16 ) + evSetAspect );
+ AddMenuItem( AspectMenu,"16:9",( 2 << 16 ) + evSetAspect );
+ AddMenuItem( AspectMenu,"4:3",( 3 << 16 ) + evSetAspect );
+ AddMenuItem( AspectMenu,"2.35",( 4 << 16 ) + evSetAspect );
+ }
+
+ if ( guiIntfStruct.demuxer )
+ {
+ int i,c = 0;
+
+ for ( i=0;i < MAX_A_STREAMS;i++ )
+ if ( ((demuxer_t *)guiIntfStruct.demuxer)->a_streams[i] )
+ {
+ char tmp[32];
+ snprintf( tmp,32,"Track %d",i );
+ if ( !c ) { SubMenu=AddSubMenu( Menu, "Audio track" ); c=1; }
+ AddMenuItem( SubMenu,tmp,( i << 16 ) + evSetAudio );
+ }
+ }
AddSeparator( Menu );
MenuItem=AddMenuCheckItem( Menu,MSGTR_MENU_Mute,muted,evMute );
@@ -424,11 +444,11 @@
AddMenuItem( Menu,MSGTR_MENU_SkinBrowser, evSkinBrowser );
AddMenuItem( Menu,MSGTR_MENU_Preferences, evPreferences );
AddMenuItem( Menu,MSGTR_Equalizer, evEqualizer );
- AddSeparator( Menu );
if ( guiIntfStruct.NoWindow == False )
{
int b1 = 0, b2 = 0;
+ AddSeparator( Menu );
if ( !appMPlayer.subWindow.isFullScreen && guiIntfStruct.Playing )
{
if ( ( appMPlayer.subWindow.Width == guiIntfStruct.MovieWidth * 2 )&&
@@ -439,12 +459,6 @@
AddMenuCheckItem( Menu,MSGTR_MENU_DoubleSize,b2,evDoubleSize );
AddMenuCheckItem( Menu,MSGTR_MENU_FullScreen,appMPlayer.subWindow.isFullScreen,evFullScreen );
}
- else
- {
- MenuItem=AddMenuCheckItem( Menu,MSGTR_MENU_NormalSize" ",0,evNormalSize ); gtk_widget_set_sensitive( MenuItem,FALSE );
- MenuItem=AddMenuCheckItem( Menu,MSGTR_MENU_DoubleSize,0,evDoubleSize ); gtk_widget_set_sensitive( MenuItem,FALSE );
- MenuItem=AddMenuCheckItem( Menu,MSGTR_MENU_FullScreen,0,evFullScreen ); gtk_widget_set_sensitive( MenuItem,FALSE );
- }
AddSeparator( Menu );
AddMenuItem( Menu,MSGTR_MENU_Exit, evExit );
More information about the MPlayer-cvslog
mailing list