2002-08-26 22:20:58 +00:00
|
|
|
|
2002-01-31 08:39:21 +00:00
|
|
|
#include <inttypes.h>
|
2001-08-25 21:04:29 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
2002-08-26 22:20:58 +00:00
|
|
|
#include <string.h>
|
2001-08-25 21:04:29 +00:00
|
|
|
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <signal.h>
|
|
|
|
|
2005-12-08 22:12:57 +00:00
|
|
|
#include "wm/ws.h"
|
|
|
|
#include "wm/wsxdnd.h"
|
|
|
|
#include "../config.h"
|
|
|
|
#include "../help_mp.h"
|
|
|
|
#include "../mplayer.h"
|
|
|
|
#include "../libvo/x11_common.h"
|
|
|
|
#include "../libvo/video_out.h"
|
|
|
|
#include "../input/input.h"
|
2001-08-28 15:55:02 +00:00
|
|
|
|
2005-12-08 22:12:57 +00:00
|
|
|
#include "app.h"
|
2001-08-25 21:04:29 +00:00
|
|
|
|
2005-12-08 22:12:57 +00:00
|
|
|
#include "wm/wskeys.h"
|
|
|
|
#include "interface.h"
|
2001-08-25 21:04:29 +00:00
|
|
|
|
|
|
|
#include "widgets.h"
|
|
|
|
#include "./mplayer.h"
|
|
|
|
#include "play.h"
|
|
|
|
|
2005-12-08 22:12:57 +00:00
|
|
|
#include "skin/skin.h"
|
|
|
|
#include "skin/font.h"
|
2001-08-25 21:04:29 +00:00
|
|
|
|
2005-12-08 22:12:57 +00:00
|
|
|
#include "libmpdemux/stream.h"
|
2002-08-14 23:02:45 +00:00
|
|
|
|
2001-08-27 23:56:44 +00:00
|
|
|
extern float rel_seek_secs;
|
|
|
|
extern int abs_seek_pos;
|
|
|
|
|
2003-05-26 08:34:17 +00:00
|
|
|
int mplGotoTheNext = 1;
|
2002-07-12 00:53:26 +00:00
|
|
|
|
2001-08-25 21:04:29 +00:00
|
|
|
void mplFullScreen( void )
|
|
|
|
{
|
2002-08-29 23:15:24 +00:00
|
|
|
if ( guiIntfStruct.NoWindow && guiIntfStruct.Playing ) return;
|
2003-02-01 16:42:02 +00:00
|
|
|
|
2002-05-06 15:05:07 +00:00
|
|
|
if ( ( guiIntfStruct.Playing )&&( appMPlayer.subWindow.isFullScreen ) )
|
|
|
|
{
|
|
|
|
appMPlayer.subWindow.OldWidth=guiIntfStruct.MovieWidth; appMPlayer.subWindow.OldHeight=guiIntfStruct.MovieHeight;
|
|
|
|
switch ( appMPlayer.sub.x )
|
|
|
|
{
|
2003-05-26 08:45:43 +00:00
|
|
|
case -1: appMPlayer.subWindow.OldX=( wsMaxX / 2 ) - ( appMPlayer.subWindow.OldWidth / 2 ) + wsOrgX; break;
|
|
|
|
case -2: appMPlayer.subWindow.OldX=wsMaxX - appMPlayer.subWindow.OldWidth + wsOrgX; break;
|
2002-05-06 15:05:07 +00:00
|
|
|
default: appMPlayer.subWindow.OldX=appMPlayer.sub.x; break;
|
|
|
|
}
|
|
|
|
switch ( appMPlayer.sub.y )
|
|
|
|
{
|
2003-05-26 08:45:43 +00:00
|
|
|
case -1: appMPlayer.subWindow.OldY=( wsMaxY / 2 ) - ( appMPlayer.subWindow.OldHeight / 2 ) + wsOrgY; break;
|
|
|
|
case -2: appMPlayer.subWindow.OldY=wsMaxY - appMPlayer.subWindow.OldHeight + wsOrgY; break;
|
2002-05-06 15:05:07 +00:00
|
|
|
default: appMPlayer.subWindow.OldY=appMPlayer.sub.y; break;
|
|
|
|
}
|
|
|
|
}
|
2003-02-01 16:42:02 +00:00
|
|
|
if ( guiIntfStruct.Playing || gtkShowVideoWindow ) wsFullScreen( &appMPlayer.subWindow );
|
|
|
|
fullscreen=vo_fs=appMPlayer.subWindow.isFullScreen;
|
2002-05-06 15:05:07 +00:00
|
|
|
wsSetLayer( wsDisplay,appMPlayer.mainWindow.WindowID,appMPlayer.subWindow.isFullScreen );
|
2003-05-26 08:34:17 +00:00
|
|
|
if ( appMPlayer.menuIsPresent ) wsSetLayer( wsDisplay,appMPlayer.menuWindow.WindowID,appMPlayer.subWindow.isFullScreen );
|
2002-04-29 22:00:50 +00:00
|
|
|
|
2002-02-23 15:12:55 +00:00
|
|
|
if ( guiIntfStruct.Playing ) wsSetBackgroundRGB( &appMPlayer.subWindow,0,0,0 );
|
2003-01-17 22:39:43 +00:00
|
|
|
else wsSetBackgroundRGB( &appMPlayer.subWindow,appMPlayer.sub.R,appMPlayer.sub.G,appMPlayer.sub.B );
|
2001-08-25 21:04:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
extern int mplSubRender;
|
|
|
|
|
2002-07-12 00:53:26 +00:00
|
|
|
void mplEnd( void )
|
|
|
|
{
|
|
|
|
plItem * next;
|
|
|
|
|
2003-02-05 23:02:35 +00:00
|
|
|
if ( !mplGotoTheNext && guiIntfStruct.Playing) { mplGotoTheNext=1; return; }
|
2002-07-12 00:53:26 +00:00
|
|
|
|
2002-07-25 20:26:38 +00:00
|
|
|
if ( guiIntfStruct.Playing && (next=gtkSet( gtkGetNextPlItem,0,NULL )) && plLastPlayed != next )
|
2002-07-12 00:53:26 +00:00
|
|
|
{
|
|
|
|
plLastPlayed=next;
|
|
|
|
guiSetDF( guiIntfStruct.Filename,next->path,next->name );
|
|
|
|
guiIntfStruct.StreamType=STREAMTYPE_FILE;
|
2002-12-11 01:21:12 +00:00
|
|
|
guiIntfStruct.FilenameChanged=guiIntfStruct.NewPlay=1;
|
2002-07-31 13:26:46 +00:00
|
|
|
gfree( (void **)&guiIntfStruct.AudioFile );
|
|
|
|
gfree( (void **)&guiIntfStruct.Subtitlename );
|
2002-07-25 20:26:38 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2002-12-16 22:25:17 +00:00
|
|
|
if ( guiIntfStruct.FilenameChanged || guiIntfStruct.NewPlay ) return;
|
2002-08-04 19:23:58 +00:00
|
|
|
|
2002-07-25 20:26:38 +00:00
|
|
|
guiIntfStruct.TimeSec=0;
|
|
|
|
guiIntfStruct.Position=0;
|
|
|
|
guiIntfStruct.AudioType=0;
|
2002-12-11 01:21:12 +00:00
|
|
|
guiIntfStruct.NoWindow=False;
|
|
|
|
|
2002-08-14 12:17:04 +00:00
|
|
|
#ifdef USE_DVDREAD
|
2002-08-05 01:14:14 +00:00
|
|
|
guiIntfStruct.DVD.current_title=1;
|
|
|
|
guiIntfStruct.DVD.current_chapter=1;
|
|
|
|
guiIntfStruct.DVD.current_angle=1;
|
2002-08-14 12:17:04 +00:00
|
|
|
#endif
|
2002-07-25 20:26:38 +00:00
|
|
|
|
2004-03-25 21:49:48 +00:00
|
|
|
if ( !appMPlayer.subWindow.isFullScreen && gtkShowVideoWindow)
|
2002-07-25 20:26:38 +00:00
|
|
|
{
|
|
|
|
wsResizeWindow( &appMPlayer.subWindow,appMPlayer.sub.width,appMPlayer.sub.height );
|
|
|
|
wsMoveWindow( &appMPlayer.subWindow,True,appMPlayer.sub.x,appMPlayer.sub.y );
|
|
|
|
}
|
2004-03-25 21:49:48 +00:00
|
|
|
else wsVisibleWindow( &appMPlayer.subWindow,wsHideWindow );
|
2002-07-25 20:26:38 +00:00
|
|
|
guiGetEvent( guiCEvent,guiSetStop );
|
|
|
|
mplSubRender=1;
|
2003-01-17 22:39:43 +00:00
|
|
|
wsSetBackgroundRGB( &appMPlayer.subWindow,appMPlayer.sub.R,appMPlayer.sub.G,appMPlayer.sub.B );
|
2002-07-25 20:26:38 +00:00
|
|
|
wsClearWindow( appMPlayer.subWindow );
|
|
|
|
wsPostRedisplay( &appMPlayer.subWindow );
|
|
|
|
}
|
2001-08-25 21:04:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void mplPlay( void )
|
|
|
|
{
|
2002-02-23 15:12:55 +00:00
|
|
|
if ( ( !guiIntfStruct.Filename )||
|
|
|
|
( guiIntfStruct.Filename[0] == 0 )||
|
|
|
|
( guiIntfStruct.Playing == 1 ) ) return;
|
|
|
|
if ( guiIntfStruct.Playing == 2 ) { mplPause(); return; }
|
2002-07-25 20:26:38 +00:00
|
|
|
guiGetEvent( guiCEvent,(void *)guiSetPlay );
|
2001-08-30 22:07:19 +00:00
|
|
|
mplSubRender=0;
|
2001-09-05 18:17:22 +00:00
|
|
|
wsSetBackgroundRGB( &appMPlayer.subWindow,0,0,0 );
|
2002-02-23 15:12:55 +00:00
|
|
|
wsClearWindow( appMPlayer.subWindow );
|
2001-08-25 21:04:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void mplPause( void )
|
|
|
|
{
|
2002-07-25 20:26:38 +00:00
|
|
|
if ( !guiIntfStruct.Playing ) return;
|
|
|
|
if ( guiIntfStruct.Playing == 1 )
|
|
|
|
{
|
|
|
|
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);
|
|
|
|
} else guiIntfStruct.Playing=1;
|
2001-08-25 21:04:29 +00:00
|
|
|
}
|
|
|
|
|
2002-02-01 16:34:22 +00:00
|
|
|
void mplState( void )
|
|
|
|
{
|
2002-02-23 15:12:55 +00:00
|
|
|
if ( ( guiIntfStruct.Playing == 0 )||( guiIntfStruct.Playing == 2 ) )
|
2002-02-01 16:34:22 +00:00
|
|
|
{
|
|
|
|
btnModify( evPlaySwitchToPause,btnReleased );
|
|
|
|
btnModify( evPauseSwitchToPlay,btnDisabled );
|
|
|
|
}
|
2002-02-23 15:12:55 +00:00
|
|
|
else
|
2002-02-01 16:34:22 +00:00
|
|
|
{
|
|
|
|
btnModify( evPlaySwitchToPause,btnDisabled );
|
|
|
|
btnModify( evPauseSwitchToPlay,btnReleased );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-08-25 21:04:29 +00:00
|
|
|
float mplGetPosition( void )
|
|
|
|
{ // return 0.0 ... 100.0
|
2002-02-23 15:12:55 +00:00
|
|
|
return guiIntfStruct.Position;
|
2001-08-25 21:04:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void mplRelSeek( float s )
|
|
|
|
{ // -+s
|
2001-08-27 23:56:44 +00:00
|
|
|
rel_seek_secs=s; abs_seek_pos=0;
|
2001-08-25 21:04:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void mplAbsSeek( float s )
|
|
|
|
{ // 0.0 ... 100.0
|
2002-11-25 17:33:30 +00:00
|
|
|
if ( guiIntfStruct.StreamType == STREAMTYPE_STREAM ) return;
|
2001-08-27 23:56:44 +00:00
|
|
|
rel_seek_secs=0.01*s; abs_seek_pos=3;
|
2001-08-25 21:04:29 +00:00
|
|
|
}
|
|
|
|
|
2001-08-31 12:59:04 +00:00
|
|
|
listItems tmpList;
|
|
|
|
|
2002-02-23 15:12:55 +00:00
|
|
|
void ChangeSkin( char * name )
|
2001-08-31 12:59:04 +00:00
|
|
|
{
|
2001-09-17 21:16:00 +00:00
|
|
|
int ret;
|
2003-01-13 23:38:49 +00:00
|
|
|
int prev = appMPlayer.menuIsPresent;
|
2003-01-17 22:39:43 +00:00
|
|
|
int bprev = appMPlayer.barIsPresent;
|
2002-04-18 21:24:42 +00:00
|
|
|
|
2001-09-17 21:16:00 +00:00
|
|
|
mainVisible=0;
|
2003-01-17 22:39:43 +00:00
|
|
|
|
2001-09-17 21:16:00 +00:00
|
|
|
appInitStruct( &tmpList );
|
|
|
|
skinAppMPlayer=&tmpList;
|
|
|
|
fntFreeFont();
|
2002-02-23 15:12:55 +00:00
|
|
|
ret=skinRead( name );
|
2001-08-31 12:59:04 +00:00
|
|
|
|
2001-09-17 21:16:00 +00:00
|
|
|
appInitStruct( &tmpList );
|
|
|
|
skinAppMPlayer=&appMPlayer;
|
|
|
|
appInitStruct( &appMPlayer );
|
2002-02-23 15:12:55 +00:00
|
|
|
if ( ret ) name=skinName;
|
|
|
|
if ( skinRead( name ) )
|
2001-09-17 21:16:00 +00:00
|
|
|
{
|
|
|
|
mainVisible=1;
|
|
|
|
return;
|
|
|
|
}
|
2003-01-13 23:38:49 +00:00
|
|
|
|
2003-01-17 22:39:43 +00:00
|
|
|
// --- reload menu window
|
|
|
|
|
2003-01-13 23:38:49 +00:00
|
|
|
if ( prev && appMPlayer.menuIsPresent )
|
2001-09-17 21:16:00 +00:00
|
|
|
{
|
|
|
|
if ( mplMenuDrawBuffer ) free( mplMenuDrawBuffer );
|
|
|
|
if ( ( mplMenuDrawBuffer = (unsigned char *)calloc( 1,appMPlayer.menuBase.Bitmap.ImageSize ) ) == NULL )
|
2002-02-23 15:12:55 +00:00
|
|
|
{ mp_msg( MSGT_GPLAYER,MSGL_STATUS,MSGTR_NEMDB ); return; }
|
2001-09-17 21:16:00 +00:00
|
|
|
wsResizeWindow( &appMPlayer.menuWindow,appMPlayer.menuBase.width,appMPlayer.menuBase.height );
|
|
|
|
wsResizeImage( &appMPlayer.menuWindow,appMPlayer.menuBase.width,appMPlayer.menuBase.height );
|
2002-05-28 14:12:33 +00:00
|
|
|
wsSetShape( &appMPlayer.menuWindow,appMPlayer.menuBase.Mask.Image );
|
2002-05-14 11:41:02 +00:00
|
|
|
wsVisibleWindow( &appMPlayer.menuWindow,wsHideWindow );
|
2003-01-13 23:38:49 +00:00
|
|
|
} else { mplMenuInit(); }
|
2001-08-31 12:59:04 +00:00
|
|
|
|
2003-01-17 22:39:43 +00:00
|
|
|
// --- reload sub window
|
2001-10-16 21:23:59 +00:00
|
|
|
if ( appMPlayer.sub.Bitmap.Image ) wsResizeImage( &appMPlayer.subWindow,appMPlayer.sub.Bitmap.Width,appMPlayer.sub.Bitmap.Height );
|
2002-02-23 15:12:55 +00:00
|
|
|
if ( ( !appMPlayer.subWindow.isFullScreen )&&( !guiIntfStruct.Playing ) )
|
2001-10-16 21:23:59 +00:00
|
|
|
{
|
|
|
|
wsResizeWindow( &appMPlayer.subWindow,appMPlayer.sub.width,appMPlayer.sub.height );
|
2001-11-12 15:16:13 +00:00
|
|
|
wsMoveWindow( &appMPlayer.subWindow,True,appMPlayer.sub.x,appMPlayer.sub.y );
|
2002-02-23 15:12:55 +00:00
|
|
|
}
|
2001-10-16 21:23:59 +00:00
|
|
|
if ( appMPlayer.sub.Bitmap.Image ) wsConvert( &appMPlayer.subWindow,appMPlayer.sub.Bitmap.Image,appMPlayer.sub.Bitmap.ImageSize );
|
2002-02-23 15:12:55 +00:00
|
|
|
if ( !guiIntfStruct.Playing )
|
2001-10-16 21:23:59 +00:00
|
|
|
{
|
2002-02-23 15:12:55 +00:00
|
|
|
mplSubRender=1;
|
2003-01-17 22:39:43 +00:00
|
|
|
wsSetBackgroundRGB( &appMPlayer.subWindow,appMPlayer.sub.R,appMPlayer.sub.G,appMPlayer.sub.B );
|
2001-10-16 21:23:59 +00:00
|
|
|
wsClearWindow( appMPlayer.subWindow );
|
|
|
|
wsPostRedisplay( &appMPlayer.subWindow );
|
|
|
|
}
|
2001-08-31 12:59:04 +00:00
|
|
|
|
2003-01-17 22:39:43 +00:00
|
|
|
// --- reload play bar
|
|
|
|
if ( bprev ) wsDestroyWindow( &appMPlayer.barWindow );
|
|
|
|
mplPBInit();
|
|
|
|
|
|
|
|
// --- reload main window
|
2001-09-17 21:16:00 +00:00
|
|
|
if ( mplDrawBuffer ) free( mplDrawBuffer );
|
|
|
|
if ( ( mplDrawBuffer = (unsigned char *)calloc( 1,appMPlayer.main.Bitmap.ImageSize ) ) == NULL )
|
2002-02-23 15:12:55 +00:00
|
|
|
{ mp_msg( MSGT_GPLAYER,MSGL_STATUS,MSGTR_NEMDB ); return; }
|
2002-05-20 13:56:16 +00:00
|
|
|
|
2003-01-13 23:38:49 +00:00
|
|
|
wsDestroyWindow( &appMPlayer.mainWindow );
|
2002-02-23 15:12:55 +00:00
|
|
|
|
2003-01-13 23:38:49 +00:00
|
|
|
wsCreateWindow( &appMPlayer.mainWindow,
|
|
|
|
appMPlayer.main.x,appMPlayer.main.y,appMPlayer.main.width,appMPlayer.main.height,
|
|
|
|
wsNoBorder,wsShowMouseCursor|wsHandleMouseButton|wsHandleMouseMove,wsShowFrame|wsMaxSize|wsHideWindow,"MPlayer" );
|
|
|
|
wsCreateImage( &appMPlayer.mainWindow,appMPlayer.main.Bitmap.Width,appMPlayer.main.Bitmap.Height );
|
|
|
|
wsSetShape( &appMPlayer.mainWindow,appMPlayer.main.Mask.Image );
|
|
|
|
wsSetIcon( wsDisplay,appMPlayer.mainWindow.WindowID,guiIcon,guiIconMask );
|
|
|
|
|
|
|
|
appMPlayer.mainWindow.ReDraw=(void *)mplMainDraw;
|
|
|
|
appMPlayer.mainWindow.MouseHandler=mplMainMouseHandle;
|
|
|
|
appMPlayer.mainWindow.KeyHandler=mplMainKeyHandle;
|
|
|
|
appMPlayer.mainWindow.DandDHandler=mplDandDHandler;
|
|
|
|
|
|
|
|
wsXDNDMakeAwareness( &appMPlayer.mainWindow );
|
|
|
|
if ( !appMPlayer.mainDecoration ) wsWindowDecoration( &appMPlayer.mainWindow,0 );
|
|
|
|
wsVisibleWindow( &appMPlayer.mainWindow,wsShowWindow );
|
|
|
|
mainVisible=1;
|
2003-01-17 22:39:43 +00:00
|
|
|
// ---
|
|
|
|
|
2002-02-23 15:12:55 +00:00
|
|
|
btnModify( evSetVolume,guiIntfStruct.Volume );
|
|
|
|
btnModify( evSetBalance,guiIntfStruct.Balance );
|
|
|
|
btnModify( evSetMoviePosition,guiIntfStruct.Position );
|
2001-12-13 00:25:08 +00:00
|
|
|
btnModify( evFullScreen,!appMPlayer.subWindow.isFullScreen );
|
2003-01-17 22:39:43 +00:00
|
|
|
|
|
|
|
wsSetLayer( wsDisplay,appMPlayer.mainWindow.WindowID,appMPlayer.subWindow.isFullScreen );
|
|
|
|
wsSetLayer( wsDisplay,appMPlayer.menuWindow.WindowID,appMPlayer.subWindow.isFullScreen );
|
|
|
|
|
2001-08-31 14:16:28 +00:00
|
|
|
}
|
|
|
|
|
2002-08-14 23:02:45 +00:00
|
|
|
void mplSetFileName( char * dir,char * name,int type )
|
2001-11-12 15:16:13 +00:00
|
|
|
{
|
2002-08-11 13:12:38 +00:00
|
|
|
if ( !name ) return;
|
|
|
|
|
|
|
|
if ( !dir ) guiSetFilename( guiIntfStruct.Filename,name )
|
2002-12-11 01:21:12 +00:00
|
|
|
else guiSetDF( guiIntfStruct.Filename,dir,name );
|
2002-08-11 13:12:38 +00:00
|
|
|
|
2002-12-11 01:21:12 +00:00
|
|
|
// filename=guiIntfStruct.Filename;
|
2002-08-14 23:02:45 +00:00
|
|
|
guiIntfStruct.StreamType=type;
|
2002-07-25 20:26:38 +00:00
|
|
|
gfree( (void **)&guiIntfStruct.AudioFile );
|
|
|
|
gfree( (void **)&guiIntfStruct.Subtitlename );
|
2001-11-12 15:16:13 +00:00
|
|
|
}
|
2002-04-18 18:24:08 +00:00
|
|
|
|
2003-02-05 23:02:35 +00:00
|
|
|
void mplCurr( void )
|
|
|
|
{
|
|
|
|
plItem * curr;
|
|
|
|
int stop = 0;
|
|
|
|
|
|
|
|
if ( guiIntfStruct.Playing == 2 ) return;
|
|
|
|
switch ( guiIntfStruct.StreamType )
|
|
|
|
{
|
|
|
|
#ifdef USE_DVDREAD
|
|
|
|
case STREAMTYPE_DVD:
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_VCD
|
|
|
|
case STREAMTYPE_VCD:
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
default:
|
|
|
|
if ( (curr=gtkSet( gtkGetCurrPlItem,0,NULL)) )
|
|
|
|
{
|
|
|
|
mplSetFileName( curr->path,curr->name,STREAMTYPE_FILE );
|
|
|
|
mplGotoTheNext=0;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if ( stop ) mplEventHandling( evStop,0 );
|
|
|
|
if ( guiIntfStruct.Playing == 1 ) mplEventHandling( evPlay,0 );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-04-18 18:24:08 +00:00
|
|
|
void mplPrev( void )
|
|
|
|
{
|
2002-07-12 00:53:26 +00:00
|
|
|
plItem * prev;
|
|
|
|
int stop = 0;
|
2002-06-03 15:06:32 +00:00
|
|
|
|
|
|
|
if ( guiIntfStruct.Playing == 2 ) return;
|
2002-04-18 18:24:08 +00:00
|
|
|
switch ( guiIntfStruct.StreamType )
|
|
|
|
{
|
2002-04-19 10:56:26 +00:00
|
|
|
#ifdef USE_DVDREAD
|
2002-04-18 18:24:08 +00:00
|
|
|
case STREAMTYPE_DVD:
|
|
|
|
if ( --guiIntfStruct.DVD.current_chapter == 0 )
|
|
|
|
{
|
|
|
|
guiIntfStruct.DVD.current_chapter=1;
|
|
|
|
if ( --guiIntfStruct.DVD.current_title <= 0 ) { guiIntfStruct.DVD.current_title=1; stop=1; }
|
|
|
|
}
|
|
|
|
guiIntfStruct.Track=guiIntfStruct.DVD.current_title;
|
|
|
|
break;
|
2002-04-19 10:56:26 +00:00
|
|
|
#endif
|
2002-06-03 15:06:32 +00:00
|
|
|
#ifdef HAVE_VCD
|
|
|
|
case STREAMTYPE_VCD:
|
|
|
|
if ( --guiIntfStruct.Track == 0 ) { guiIntfStruct.Track=1; stop=1; }
|
|
|
|
break;
|
|
|
|
#endif
|
2002-07-12 00:53:26 +00:00
|
|
|
default:
|
2002-07-25 20:26:38 +00:00
|
|
|
if ( (prev=gtkSet( gtkGetPrevPlItem,0,NULL)) )
|
|
|
|
{
|
2002-08-14 23:02:45 +00:00
|
|
|
mplSetFileName( prev->path,prev->name,STREAMTYPE_FILE );
|
2002-07-25 20:26:38 +00:00
|
|
|
mplGotoTheNext=0;
|
|
|
|
break;
|
|
|
|
}
|
2002-07-12 00:53:26 +00:00
|
|
|
return;
|
2002-04-18 18:24:08 +00:00
|
|
|
}
|
2002-06-03 15:06:32 +00:00
|
|
|
if ( stop ) mplEventHandling( evStop,0 );
|
|
|
|
if ( guiIntfStruct.Playing == 1 ) mplEventHandling( evPlay,0 );
|
2002-04-18 18:24:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void mplNext( void )
|
|
|
|
{
|
2002-07-12 00:53:26 +00:00
|
|
|
int stop = 0;
|
|
|
|
plItem * next;
|
2002-06-03 15:06:32 +00:00
|
|
|
|
|
|
|
if ( guiIntfStruct.Playing == 2 ) return;
|
2002-04-18 18:24:08 +00:00
|
|
|
switch ( guiIntfStruct.StreamType )
|
|
|
|
{
|
2002-04-19 10:56:26 +00:00
|
|
|
#ifdef USE_DVDREAD
|
2002-04-18 18:24:08 +00:00
|
|
|
case STREAMTYPE_DVD:
|
|
|
|
if ( guiIntfStruct.DVD.current_chapter++ == guiIntfStruct.DVD.chapters )
|
|
|
|
{
|
|
|
|
guiIntfStruct.DVD.current_chapter=1;
|
|
|
|
if ( ++guiIntfStruct.DVD.current_title > guiIntfStruct.DVD.titles ) { guiIntfStruct.DVD.current_title=guiIntfStruct.DVD.titles; stop=1; }
|
|
|
|
}
|
|
|
|
guiIntfStruct.Track=guiIntfStruct.DVD.current_title;
|
|
|
|
break;
|
2002-04-19 10:56:26 +00:00
|
|
|
#endif
|
2002-06-03 15:06:32 +00:00
|
|
|
#ifdef HAVE_VCD
|
|
|
|
case STREAMTYPE_VCD:
|
|
|
|
if ( ++guiIntfStruct.Track > guiIntfStruct.VCDTracks ) { guiIntfStruct.Track=guiIntfStruct.VCDTracks; stop=1; }
|
|
|
|
break;
|
|
|
|
#endif
|
2002-07-12 00:53:26 +00:00
|
|
|
default:
|
2002-07-25 20:26:38 +00:00
|
|
|
if ( (next=gtkSet( gtkGetNextPlItem,0,NULL)) )
|
|
|
|
{
|
2002-08-14 23:02:45 +00:00
|
|
|
mplSetFileName( next->path,next->name,STREAMTYPE_FILE );
|
2002-07-25 20:26:38 +00:00
|
|
|
mplGotoTheNext=0;
|
|
|
|
break;
|
|
|
|
}
|
2002-07-12 00:53:26 +00:00
|
|
|
return;
|
2002-04-18 18:24:08 +00:00
|
|
|
}
|
2002-06-03 15:06:32 +00:00
|
|
|
if ( stop ) mplEventHandling( evStop,0 );
|
|
|
|
if ( guiIntfStruct.Playing == 1 ) mplEventHandling( evPlay,0 );
|
2002-04-18 18:24:08 +00:00
|
|
|
}
|