2001-08-25 21:04:29 +00:00
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <signal.h>
|
|
|
|
|
|
|
|
int mplParent = 1;
|
|
|
|
|
2001-08-30 10:55:17 +00:00
|
|
|
int moviex,moviey,moviewidth,movieheight;
|
2001-08-28 15:55:02 +00:00
|
|
|
|
2001-08-25 21:04:29 +00:00
|
|
|
#include "../app.h"
|
|
|
|
|
|
|
|
#include "../wm/ws.h"
|
|
|
|
#include "../wm/wskeys.h"
|
|
|
|
#include "../wm/widget.h"
|
|
|
|
|
|
|
|
#include "../../config.h"
|
2001-08-27 23:56:44 +00:00
|
|
|
#include "../../libvo/x11_common.h"
|
2001-08-25 21:04:29 +00:00
|
|
|
|
|
|
|
#include "widgets.h"
|
|
|
|
#include "./mplayer.h"
|
|
|
|
#include "psignal.h"
|
|
|
|
#include "play.h"
|
|
|
|
|
|
|
|
mplCommStruct * mplShMem;
|
|
|
|
char * Filename = NULL;
|
|
|
|
|
2001-08-27 23:56:44 +00:00
|
|
|
extern float rel_seek_secs;
|
|
|
|
extern int abs_seek_pos;
|
|
|
|
|
|
|
|
|
2001-08-25 21:04:29 +00:00
|
|
|
void mplPlayerThread( void )
|
|
|
|
{
|
|
|
|
// mplayer( 0,NULL,NULL );
|
|
|
|
}
|
|
|
|
|
|
|
|
void mplFullScreen( void )
|
|
|
|
{
|
2001-08-30 10:55:17 +00:00
|
|
|
// if ( appMPlayer.subWindow.isFullScreen )
|
|
|
|
// {
|
|
|
|
// }
|
|
|
|
wsFullScreen( &appMPlayer.subWindow );
|
2001-08-29 17:48:06 +00:00
|
|
|
mplResize( 0,0,appMPlayer.subWindow.Width,appMPlayer.subWindow.Height );
|
2001-08-25 21:04:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
extern int mplSubRender;
|
|
|
|
|
|
|
|
void mplStop()
|
|
|
|
{
|
|
|
|
if ( !mplShMem->Playing ) return;
|
|
|
|
// ---
|
|
|
|
printf("%%%%%% STOP \n");
|
|
|
|
// ---
|
|
|
|
mplShMem->Playing=0;
|
|
|
|
}
|
|
|
|
|
|
|
|
void mplPlay( void )
|
|
|
|
{
|
2001-08-30 16:52:57 +00:00
|
|
|
if ( mplShMem->Filename[0] == 0 ) return;
|
2001-08-25 21:04:29 +00:00
|
|
|
if ( mplShMem->Playing ) mplStop();
|
|
|
|
// ---
|
|
|
|
printf("%%%%%% PLAY \n");
|
|
|
|
// ---
|
|
|
|
mplShMem->Playing=1;
|
|
|
|
}
|
|
|
|
|
|
|
|
void mplPause( void )
|
|
|
|
{
|
|
|
|
if ( mplShMem->Playing != 1 ) return;
|
|
|
|
// ---
|
|
|
|
printf("%%%%%% PAUSE \n");
|
|
|
|
// ---
|
|
|
|
mplShMem->Playing=2;
|
|
|
|
}
|
|
|
|
|
|
|
|
void mplResize( unsigned int X,unsigned int Y,unsigned int width,unsigned int height )
|
|
|
|
{
|
2001-08-30 12:17:12 +00:00
|
|
|
vo_setwindowsize( width,height );
|
|
|
|
vo_resize=1;
|
2001-08-25 21:04:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void mplMPlayerInit( int argc,char* argv[], char *envp[] )
|
|
|
|
{
|
2001-08-28 15:55:02 +00:00
|
|
|
#if 0
|
2001-08-25 21:04:29 +00:00
|
|
|
mplShMem=shmem_alloc( ShMemSize );
|
2001-08-28 15:55:02 +00:00
|
|
|
#else
|
|
|
|
mplShMem=calloc( 1,ShMemSize );
|
|
|
|
#endif
|
2001-08-25 21:04:29 +00:00
|
|
|
signal( SIGTYPE,mplMainSigHandler );
|
2001-08-29 15:07:40 +00:00
|
|
|
// signal( SIGCHLD,SIG_IGN );
|
2001-08-25 21:04:29 +00:00
|
|
|
|
|
|
|
mplShMem->Playing=0;
|
|
|
|
mplShMem->Volume=0.0f;
|
|
|
|
mplShMem->Position=0.0f;
|
|
|
|
mplShMem->Balance=50.0f;
|
|
|
|
mplShMem->Track=0;
|
|
|
|
mplShMem->AudioType=0;
|
|
|
|
mplShMem->StreamType=0;
|
|
|
|
mplShMem->TimeSec=0;
|
|
|
|
mplShMem->LengthInSec=0;
|
|
|
|
|
|
|
|
// ---
|
|
|
|
// ---
|
|
|
|
}
|
|
|
|
|
|
|
|
float mplGetPosition( void )
|
|
|
|
{ // return 0.0 ... 100.0
|
2001-08-28 15:55:02 +00:00
|
|
|
return mplShMem->Position;
|
2001-08-25 21:04:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void mplRelSeek( float s )
|
|
|
|
{ // -+s
|
|
|
|
// ---
|
2001-08-29 15:07:40 +00:00
|
|
|
//printf("%%%%%% RelSEEK=%5.3f \n",s);
|
2001-08-25 21:04:29 +00:00
|
|
|
// ---
|
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
|
|
|
|
// ---
|
2001-08-29 15:07:40 +00:00
|
|
|
//printf("%%%%%% AbsSEEK=%5.3f \n",s);
|
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
|
|
|
// ---
|
|
|
|
}
|
|
|
|
|