summaryrefslogtreecommitdiffstats
path: root/Gui/mplayer
diff options
context:
space:
mode:
authorpontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-12-11 01:21:12 +0000
committerpontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-12-11 01:21:12 +0000
commit15dc6ef3f76c8a8060ad9cfc36fe34a33f241aba (patch)
tree3b93cb826c911fe5cff2f9bb98b6369c275119ce /Gui/mplayer
parentd9b33edbba28e29aeb94b7f4acae099175302a16 (diff)
downloadmpv-15dc6ef3f76c8a8060ad9cfc36fe34a33f241aba.tar.bz2
mpv-15dc6ef3f76c8a8060ad9cfc36fe34a33f241aba.tar.xz
- fix three submenu bug
- audio/video track hiding - normal/double/fullscreen handling - dvd audio channel setting bug - fix file/url/vcd/dvd playing - fix variables initialization - some small bug fix - applied some patch from RĂ¼diger Kuhlmann git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8424 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'Gui/mplayer')
-rw-r--r--Gui/mplayer/gtk/menu.c7
-rw-r--r--Gui/mplayer/mw.c63
-rw-r--r--Gui/mplayer/play.c9
3 files changed, 40 insertions, 39 deletions
diff --git a/Gui/mplayer/gtk/menu.c b/Gui/mplayer/gtk/menu.c
index 2f34076e14..002b75ed0f 100644
--- a/Gui/mplayer/gtk/menu.c
+++ b/Gui/mplayer/gtk/menu.c
@@ -379,14 +379,15 @@ GtkWidget * create_PopUpMenu( void )
DVDAudioLanguageMenu=AddSubMenu( DVDSubMenu,MSGTR_MENU_AudioLanguages );
if ( guiIntfStruct.DVD.nr_of_audio_channels )
{
- char tmp[64]; int i;
+ char tmp[64]; int i, id = audio_id;
for ( i=0;i < guiIntfStruct.DVD.nr_of_audio_channels;i++ )
{
snprintf( tmp,64,"%s - %s %s",GetLanguage( guiIntfStruct.DVD.audio_streams[i].language ),
ChannelTypes[ guiIntfStruct.DVD.audio_streams[i].type ],
ChannelNumbers[ guiIntfStruct.DVD.audio_streams[i].channels ] );
+ if ( id == -1 ) id=guiIntfStruct.DVD.audio_streams[i].id;
AddMenuCheckItem( DVDAudioLanguageMenu,tmp,
- audio_id == guiIntfStruct.DVD.audio_streams[i].id,
+ id == guiIntfStruct.DVD.audio_streams[i].id,
( guiIntfStruct.DVD.audio_streams[i].id << 16 ) + evSetDVDAudio );
}
}
@@ -424,7 +425,7 @@ GtkWidget * create_PopUpMenu( void )
AddMenuItem( AspectMenu,"2.35",( 4 << 16 ) + evSetAspect );
}
- if ( guiIntfStruct.demuxer && guiIntfStruct.StreamType != STREAMTYPE_DVD )
+ if ( guiIntfStruct.Playing && guiIntfStruct.demuxer && guiIntfStruct.StreamType != STREAMTYPE_DVD )
{
int i,c = 0;
diff --git a/Gui/mplayer/mw.c b/Gui/mplayer/mw.c
index 473c1a46d7..d59fd9f8e5 100644
--- a/Gui/mplayer/mw.c
+++ b/Gui/mplayer/mw.c
@@ -252,6 +252,7 @@ extern int osd_visible;
void mplEventHandling( int msg,float param )
{
int j;
+ int iparam = (int)param;
switch( msg )
{
@@ -270,22 +271,20 @@ void mplEventHandling( int msg,float param )
break;
case evSetAudio:
- if ( !guiIntfStruct.demuxer ) break;
- audio_id=(int)param;
- if ( guiIntfStruct.StreamType == STREAMTYPE_DVD ) goto play;
- guiIntfStruct.FilenameChanged=1;
+ if ( !guiIntfStruct.demuxer || audio_id == iparam ) break;
+ audio_id=iparam;
+ guiIntfStruct.NewPlay=1;
break;
case evSetVideo:
- if ( !guiIntfStruct.demuxer ) break;
- video_id=(int)param;
- if ( guiIntfStruct.StreamType == STREAMTYPE_DVD ) goto play;
- guiIntfStruct.FilenameChanged=1;
- break;
+ if ( !guiIntfStruct.demuxer || video_id == iparam ) break;
+ video_id=iparam;
+ guiIntfStruct.NewPlay=1;
+ break;
#ifdef HAVE_VCD
case evSetVCDTrack:
- guiIntfStruct.Track=(int)param;
+ guiIntfStruct.Track=iparam;
case evPlayVCD:
gtkSet( gtkClearStruct,0,(void *)guiALL );
guiIntfStruct.StreamType=STREAMTYPE_VCD;
@@ -299,6 +298,7 @@ void mplEventHandling( int msg,float param )
play_dvd_2:
gtkSet( gtkClearStruct,0,(void *)(guiALL - guiDVD) );
guiIntfStruct.StreamType=STREAMTYPE_DVD;
+ goto play;
#endif
case evPlay:
case evPlaySwitchToPause:
@@ -306,18 +306,11 @@ play:
if ( ( msg == evPlaySwitchToPause )&&( guiIntfStruct.Playing == 2 ) ) goto NoPause;
- vcd_track=0;
- dvd_title=0;
-
if ( gtkSet( gtkGetCurrPlItem,0,NULL ) &&( guiIntfStruct.StreamType == STREAMTYPE_FILE ) )
{
plItem * next = gtkSet( gtkGetCurrPlItem,0,NULL );
plLastPlayed=next;
- guiSetDF( guiIntfStruct.Filename,next->path,next->name );
- guiIntfStruct.StreamType=STREAMTYPE_FILE;
- guiIntfStruct.FilenameChanged=1;
- gfree( (void **)&guiIntfStruct.AudioFile );
- gfree( (void **)&guiIntfStruct.Subtitlename );
+ mplSetFileName( next->path,next->name,STREAMTYPE_FILE );
}
switch ( guiIntfStruct.StreamType )
@@ -335,10 +328,9 @@ play:
{
if ( !guiIntfStruct.Track )
{
- if ( guiIntfStruct.VCDTracks == 1 ) guiIntfStruct.Track=1;
- else guiIntfStruct.Track=2;
+ if ( guiIntfStruct.VCDTracks > 1 ) guiIntfStruct.Track=2;
+ else guiIntfStruct.Track=1;
}
- vcd_track=guiIntfStruct.Track;
guiIntfStruct.DiskChanged=1;
}
break;
@@ -350,31 +342,32 @@ play:
mplSetFileName( NULL,dvd_device,STREAMTYPE_DVD );
if ( guiIntfStruct.Playing != 2 )
{
- dvd_title=guiIntfStruct.DVD.current_title;
- dvd_angle=guiIntfStruct.DVD.current_angle;
- dvd_chapter=guiIntfStruct.DVD.current_chapter;
+ guiIntfStruct.Title=guiIntfStruct.DVD.current_title;
+ guiIntfStruct.Chapter=guiIntfStruct.DVD.current_chapter;
+ guiIntfStruct.Angle=guiIntfStruct.DVD.current_angle;
guiIntfStruct.DiskChanged=1;
}
break;
#endif
}
+ guiIntfStruct.NewPlay=1;
mplPlay();
break;
#ifdef USE_DVDREAD
case evSetDVDSubtitle:
- dvdsub_id=(int)param;
+ dvdsub_id=iparam;
goto play_dvd_2;
break;
case evSetDVDAudio:
- audio_id=(int)param;
+ audio_id=iparam;
goto play_dvd_2;
break;
case evSetDVDChapter:
- guiIntfStruct.DVD.current_chapter=(int)param;
+ guiIntfStruct.DVD.current_chapter=iparam;
goto play_dvd_2;
break;
case evSetDVDTitle:
- guiIntfStruct.DVD.current_title=(int)param;
+ guiIntfStruct.DVD.current_title=iparam;
guiIntfStruct.DVD.current_chapter=1;
guiIntfStruct.DVD.current_angle=1;
goto play_dvd_2;
@@ -387,7 +380,11 @@ NoPause:
mplPause();
break;
- case evStop: guiIntfStruct.Playing=guiSetStop; mplState(); break;
+ case evStop:
+ guiIntfStruct.Playing=guiSetStop;
+ mplState();
+ guiIntfStruct.NoWindow=False;
+ break;
case evLoadPlay:
mplMainAutoPlay=1;
@@ -448,7 +445,7 @@ set_volume:
case evIconify:
- switch ( (int)param )
+ switch ( iparam )
{
case 0: wsIconify( appMPlayer.mainWindow ); break;
case 1: wsIconify( appMPlayer.subWindow ); break;
@@ -489,7 +486,7 @@ set_volume:
break;
case evSetAspect:
- switch ( (int)param )
+ switch ( iparam )
{
case 2: movie_aspect=16.0f / 9.0f; break;
case 3: movie_aspect=4.0f / 3.0f; break;
@@ -499,10 +496,10 @@ set_volume:
}
wsClearWindow( appMPlayer.subWindow );
#ifdef USE_DVDREAD
- if ( guiIntfStruct.StreamType == STREAMTYPE_DVD ) goto play_dvd_2;
+ if ( guiIntfStruct.StreamType == STREAMTYPE_DVD || guiIntfStruct.StreamType == STREAMTYPE_VCD ) goto play_dvd_2;
else
#endif
- guiIntfStruct.FilenameChanged=1;
+ guiIntfStruct.NewPlay=1;
break;
// --- timer events
diff --git a/Gui/mplayer/play.c b/Gui/mplayer/play.c
index e79282fe5e..62ad3e2e90 100644
--- a/Gui/mplayer/play.c
+++ b/Gui/mplayer/play.c
@@ -10,6 +10,7 @@
#include "../wm/ws.h"
#include "../../config.h"
#include "../../help_mp.h"
+#include "../../mplayer.h"
#include "../../libvo/x11_common.h"
#include "../../input/input.h"
@@ -99,7 +100,7 @@ void mplEnd( void )
plLastPlayed=next;
guiSetDF( guiIntfStruct.Filename,next->path,next->name );
guiIntfStruct.StreamType=STREAMTYPE_FILE;
- guiIntfStruct.FilenameChanged=1;
+ guiIntfStruct.FilenameChanged=guiIntfStruct.NewPlay=1;
gfree( (void **)&guiIntfStruct.AudioFile );
gfree( (void **)&guiIntfStruct.Subtitlename );
}
@@ -110,6 +111,8 @@ void mplEnd( void )
guiIntfStruct.TimeSec=0;
guiIntfStruct.Position=0;
guiIntfStruct.AudioType=0;
+ guiIntfStruct.NoWindow=False;
+
#ifdef USE_DVDREAD
guiIntfStruct.DVD.current_title=1;
guiIntfStruct.DVD.current_chapter=1;
@@ -255,10 +258,10 @@ void mplSetFileName( char * dir,char * name,int type )
if ( !name ) return;
if ( !dir ) guiSetFilename( guiIntfStruct.Filename,name )
- else guiSetDF( guiIntfStruct.Filename,dir,name )
+ else guiSetDF( guiIntfStruct.Filename,dir,name );
+// filename=guiIntfStruct.Filename;
guiIntfStruct.StreamType=type;
- guiIntfStruct.FilenameChanged=1;
gfree( (void **)&guiIntfStruct.AudioFile );
gfree( (void **)&guiIntfStruct.Subtitlename );
}