/****************************************************************

	ISL DREAMCAST LIBRARY (c) 2000 Blitz Games Ltd.		
	islvideo.c	Video player
														tgaulton
*****************************************************************/

#ifndef __ISLVIDEO_H__
#define __ISLVIDEO_H__

#include <sg_mw.h>
#include "usr.h"

/* ---------------------------------------------------------------------------
 * - CONSTANTS
 * ---------------------------------------------------------------------------
 */
 
// Streaming modes.
#define STR_MODE24				1
#define STR_MODE16				0


// Border modes.
#define STR_BORDERS_OFF			0
#define STR_BORDERS_ON			1


// PlayStream return values.
#define	PLAYSTR_END				1
#define	PLAYSTR_USER			2
#define	PLAYSTR_ERROR			3

/* ---------------------------------------------------------------------------
 * - DATA TYPE AND STRUCTURE DECLARATIONS
 * ---------------------------------------------------------------------------
 */

typedef struct _StrDataType
{
		char		*strName;					// Stream file name. 
		short		mode;						// 24-Bit or 16-Bit streaming.
		short		drawBorders;				// != 0 if borders on.
		short		scrWidth;					// Screen res width.
		short		x;							// X,Y position. 
		short		y;
		short		width;						// Stream width and height.
		short		height;
		long		endFrame;					// Last frame No.
		long		vlcBufSize;					// Size of each VLC buffer (including header).
		short		volume;						// Left and Right ADPCM volume.
} StrDataType;
			   
typedef struct {
	Sint32	term_flag;			//	Application terminate flag
	Sint32	disp_flag;			//	Display information flag
	Sint32	pause;				//	Pause flag
	char	*fname;				//	File name
	MWPLY	ply;				//	Player
	MWS_PLY_CPRM_SFD cprm;		//	Create parameter
} AP_OBJ, *AP;

			   
typedef struct _VideoInfo
{
	AP ap;
	void *vtxbuf;
	Sint32 mode, frame, count, latency;
	Bool ret;
}VideoInfo;
	 
/* ---------------------------------------------------------------------------
 * - PUBLIC FUNCTION PROTOTYPES
 * ---------------------------------------------------------------------------
 */
 

extern AP_OBJ ap_obj;
extern VideoInfo vidInfo;


void ap_mw_err_func(void *obj, char *errmsg);
void ApInitMw(AP ap,
		Sint32 mod, Sint32 frm, Sint32 cnt, Sint32 ltncy, void *vtxbuf);
void ApFinishMw(AP ap);
void ApStart(AP ap);
void ApStop(AP ap);
void ap_disp_info(AP ap);
Sint32 ApExec(AP ap);
void ApGdErrFunc(void *obj, Sint32 errcode);
void ApVsyncFunc(void);




//short videoPlayStream(StrDataType *str, int palMode, short (*keyHandler)(void));

//void videoSetAudioChannel(int channel);

#endif // __ISLVIDEO_H__
