summaryrefslogtreecommitdiffstats
path: root/Gui/mplayer/mw.c
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/mw.c
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/mw.c')
-rw-r--r--Gui/mplayer/mw.c63
1 files changed, 30 insertions, 33 deletions
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