summaryrefslogtreecommitdiffstats
path: root/Gui
diff options
context:
space:
mode:
authorpontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-04-17 21:12:12 +0000
committerpontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-04-17 21:12:12 +0000
commita195f967f1665fc96af726095e41c5d973d31eb7 (patch)
treeb0e5f5c57346b199a9dc85723a313d7e8653cbe3 /Gui
parent76ad9ef86e6243c70a8359e0341dea372801a48d (diff)
downloadmpv-a195f967f1665fc96af726095e41c5d973d31eb7.tar.bz2
mpv-a195f967f1665fc96af726095e41c5d973d31eb7.tar.xz
fix dvd playing under gui
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5666 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'Gui')
-rw-r--r--Gui/app.c1
-rw-r--r--Gui/app.h1
-rw-r--r--Gui/interface.c23
-rw-r--r--Gui/interface.h9
-rw-r--r--Gui/mplayer/mw.h39
-rw-r--r--Gui/mplayer/play.c17
-rw-r--r--Gui/skin/skin.c1
7 files changed, 50 insertions, 41 deletions
diff --git a/Gui/app.c b/Gui/app.c
index 4eb0b371d3..726eba5db8 100644
--- a/Gui/app.c
+++ b/Gui/app.c
@@ -38,7 +38,6 @@ void appClearItem( wItem * item )
item->fontid=0;
if ( item->label ) free( item->label ); item->label=NULL;
item->event=0;
- item->used=0;
}
void appCopy( listItems * dest,listItems * source )
diff --git a/Gui/app.h b/Gui/app.h
index 16320f418b..ab14d46b5a 100644
--- a/Gui/app.h
+++ b/Gui/app.h
@@ -34,7 +34,6 @@ typedef struct
int pressed,disabled,tmp;
int key,key2;
int phases;
- int used;
float value;
txSample Bitmap;
txSample Mask;
diff --git a/Gui/interface.c b/Gui/interface.c
index 376a8ef056..a00fdf3f41 100644
--- a/Gui/interface.c
+++ b/Gui/interface.c
@@ -14,6 +14,7 @@
#include "app.h"
#include "../libvo/x11_common.h"
#include "../input/input.h"
+#include "../libmpdemux/stream.h"
guiInterface_t guiIntfStruct;
@@ -46,6 +47,7 @@ int guiCMDArray[] =
void guiGetEvent( int type,char * arg )
{
+ dvd_priv_t * dvdp = (dvd_priv_t *) arg;
switch ( type )
{
case guiXEvent:
@@ -60,6 +62,27 @@ void guiGetEvent( int type,char * arg )
case guiSetPause: guiIntfStruct.Playing=2; mplState(); break;
}
break;
+ case guiSetState:
+ mplState();
+ break;
+ case guiSetFileName:
+ if ( arg ) guiSetFilename( guiIntfStruct.Filename,arg );
+ break;
+#ifdef USE_DVDREAD
+ case guiSetDVD:
+ guiIntfStruct.DVD.titles=dvdp->vmg_file->tt_srpt->nr_of_srpts;
+ guiIntfStruct.DVD.chapters=dvdp->vmg_file->tt_srpt->title[dvd_title].nr_of_ptts;
+ guiIntfStruct.DVD.angles=dvdp->vmg_file->tt_srpt->title[dvd_title].nr_of_angles;
+ guiIntfStruct.DVD.nr_of_audio_channels=dvdp->nr_of_channels;
+ memcpy( guiIntfStruct.DVD.audio_streams,dvdp->audio_streams,sizeof( dvdp->audio_streams ) );
+ guiIntfStruct.DVD.nr_of_subtitles=dvdp->nr_of_subtitles;
+ memcpy( guiIntfStruct.DVD.subtitles,dvdp->subtitles,sizeof( dvdp->subtitles ) );
+ guiIntfStruct.DVD.current_title=dvd_title + 1;
+ guiIntfStruct.DVD.current_chapter=dvd_chapter + 1;
+ guiIntfStruct.DVD.current_angle=dvd_angle + 1;
+ guiIntfStruct.Track=dvd_title + 1;
+ break;
+#endif
#ifdef HAVE_NEW_INPUT
case guiIEvent:
printf( "cmd: %d\n",(int)arg );
diff --git a/Gui/interface.h b/Gui/interface.h
index 612babfdfc..d7a1a4b006 100644
--- a/Gui/interface.h
+++ b/Gui/interface.h
@@ -93,9 +93,12 @@ typedef struct
extern guiInterface_t guiIntfStruct;
-#define guiXEvent 0
-#define guiCEvent 1
-#define guiIEvent 2
+#define guiXEvent 0
+#define guiCEvent 1
+#define guiIEvent 2
+#define guiSetDVD 3
+#define guiSetFileName 4
+#define guiSetState 5
#define guiSetStop 0
#define guiSetPlay 1
diff --git a/Gui/mplayer/mw.h b/Gui/mplayer/mw.h
index 9f334dd2a2..6495520fa3 100644
--- a/Gui/mplayer/mw.h
+++ b/Gui/mplayer/mw.h
@@ -200,6 +200,7 @@ drawrenderedtext:
extern void exit_player(char* how);
extern int audio_id;
extern int dvdsub_id;
+extern char * dvd_device;
void mplEventHandling( int msg,float param )
{
@@ -214,16 +215,16 @@ void mplEventHandling( int msg,float param )
#ifdef USE_DVDREAD
case evPlayDVD:
- dvd_title=1;
- dvd_chapter=1;
- dvd_angle=1;
+ guiIntfStruct.DVD.current_title=1;
+ guiIntfStruct.DVD.current_chapter=1;
+ guiIntfStruct.DVD.current_angle=1;
play_dvd_2:
guiIntfStruct.StreamType=STREAMTYPE_DVD;
#endif
case evPlay:
case evPlaySwitchToPause:
mplMainAutoPlay=0;
- if ( ( msg == evPlaySwitchToPause )&( guiIntfStruct.Playing == 1 ) ) goto NoPause;
+ if ( ( msg == evPlaySwitchToPause )&&( guiIntfStruct.Playing == 1 ) ) goto NoPause;
switch ( guiIntfStruct.StreamType )
{
@@ -234,7 +235,12 @@ play_dvd_2:
break;
#ifdef USE_DVDREAD
case STREAMTYPE_DVD:
- guiSetFilename( guiIntfStruct.Filename,"/dev/dvd" );
+ if ( !dvd_device ) dvd_device=DEFAULT_DVD_DEVICE;
+ guiSetFilename( guiIntfStruct.Filename,dvd_device );
+ dvd_title=guiIntfStruct.DVD.current_title;
+ dvd_angle=guiIntfStruct.DVD.current_angle;
+ dvd_chapter=guiIntfStruct.DVD.current_chapter;
+ guiIntfStruct.DVDChanged=1;
break;
#endif
}
@@ -244,32 +250,20 @@ play_dvd_2:
#ifdef USE_DVDREAD
case evSetDVDSubtitle:
dvdsub_id=(int)param;
- dvd_title=guiIntfStruct.DVD.current_title;
- dvd_angle=guiIntfStruct.DVD.current_angle;
- dvd_chapter=guiIntfStruct.DVD.current_chapter;
- guiIntfStruct.DVDChanged=1;
goto play_dvd_2;
break;
case evSetDVDAudio:
audio_id=(int)param;
- dvd_title=guiIntfStruct.DVD.current_title;
- dvd_angle=guiIntfStruct.DVD.current_angle;
- dvd_chapter=guiIntfStruct.DVD.current_chapter;
- guiIntfStruct.DVDChanged=1;
goto play_dvd_2;
break;
case evSetDVDChapter:
- dvd_title=guiIntfStruct.DVD.current_title;
- dvd_angle=guiIntfStruct.DVD.current_angle;
- dvd_chapter=(int)param;
- guiIntfStruct.DVDChanged=1;
+ guiIntfStruct.DVD.current_chapter=(int)param;
goto play_dvd_2;
break;
case evSetDVDTitle:
- dvd_title=(int)param;
- dvd_chapter=1;
- dvd_angle=1;
- guiIntfStruct.DVDChanged=1;
+ guiIntfStruct.DVD.current_title=(int)param;
+ guiIntfStruct.DVD.current_chapter=1;
+ guiIntfStruct.DVD.current_angle=1;
goto play_dvd_2;
break;
#endif
@@ -439,7 +433,6 @@ void mplMainMouseHandle( int Button,int X,int Y,int RX,int RY )
item=&appMPlayer.Items[SelectedItem];
itemtype=item->type;
item->pressed=btnPressed;
- item->used=1;
switch( item->type )
{
case itButton:
@@ -461,7 +454,6 @@ void mplMainMouseHandle( int Button,int X,int Y,int RX,int RY )
{
case itPotmeter:
case itHPotmeter:
- item->used=0;
btnModify( item->msg,(float)( X - item->x ) / item->width * 100.0f );
switch ( item->msg )
{
@@ -489,7 +481,6 @@ rollerhandled:
item=&appMPlayer.Items[currentselected];
if ( ( item->type == itHPotmeter )||( item->type == itVPotmeter )||( item->type == itPotmeter ) )
{
- item->used=0;
item->value+=value;
btnModify( item->msg,item->value );
switch ( item->msg )
diff --git a/Gui/mplayer/play.c b/Gui/mplayer/play.c
index 0155c91ae2..4442e88380 100644
--- a/Gui/mplayer/play.c
+++ b/Gui/mplayer/play.c
@@ -9,6 +9,7 @@
#include "../../config.h"
#include "../../help_mp.h"
#include "../../libvo/x11_common.h"
+#include "../../input/input.h"
#include "../app.h"
@@ -65,13 +66,13 @@ void mplStop()
guiIntfStruct.TimeSec=0;
guiIntfStruct.Position=0;
guiIntfStruct.AudioType=0;
+ mplState();
// if ( !guiIntfStruct.Playing ) return;
if ( !appMPlayer.subWindow.isFullScreen )
{
wsResizeWindow( &appMPlayer.subWindow,appMPlayer.sub.width,appMPlayer.sub.height );
wsMoveWindow( &appMPlayer.subWindow,True,appMPlayer.sub.x,appMPlayer.sub.y );
}
- guiGetEvent( guiCEvent,guiSetStop );
mplSubRender=1;
wsSetBackgroundRGB( &appMPlayer.subWindow,appMPlayer.subR,appMPlayer.subG,appMPlayer.subB );
wsClearWindow( appMPlayer.subWindow );
@@ -93,16 +94,10 @@ void mplPlay( void )
void mplPause( void )
{
- switch( guiIntfStruct.Playing )
- {
- case 1: // playing
- guiIntfStruct.Playing=2;
- break;
- case 2: // paused
- guiIntfStruct.Playing=1;
- break;
- }
- mplState();
+ mp_cmd_t * cmd = (mp_cmd_t *)calloc( 1,sizeof( *cmd ) );
+ cmd->id=MP_CMD_PAUSE;
+ cmd->name=strdup("pause");
+ mp_input_queue_cmd(cmd);
mplSubRender=0;
}
diff --git a/Gui/skin/skin.c b/Gui/skin/skin.c
index a80d69519b..9b17d23065 100644
--- a/Gui/skin/skin.c
+++ b/Gui/skin/skin.c
@@ -648,7 +648,6 @@ void btnModify( int event,float state )
for ( j=0;j<appMPlayer.NumberOfItems + 1;j++ )
if ( appMPlayer.Items[j].msg == event )
{
- if ( appMPlayer.Items[j].used ) continue;
switch ( appMPlayer.Items[j].type )
{
case itButton: