//
// Asura_PSP_MoviePlayback.h
//
// Created by KJFL - 13 April 2005
//
// Copyright (C) 2005 Rebellion, All Rights Reserved.
//

#ifdef ASURA_USE_PRAGMA_ONCE
#pragma once
#endif

#ifndef __ASURA_PSP_MOVIEPLAYBACK_H__
#define __ASURA_PSP_MOVIEPLAYBACK_H__

#ifdef ASURA_SUPPORT_PSP_MPEG

class Asura_PSP_Movie;

class Asura_PSP_MoviePlayback
{
	public:

		static void PlayFullScreenMovie(const char* const szFilename,
										int iAudioStream = 0,
										int iVideoStream = 0,
										void (*pfnRenderSubtitleCB)(const float fTime) = NULL,
										float fTimeBeforeSkipAllowed = 5.00f,
										float fAudioVolume = 1.0f,
										bool bStreamShouldBePresent = true); // If bool is false, skip any asserts or warnings about stream id out of range.

		static void Suspend (void);
		static void Resume (void);

		// "SimpleAudio" decoding...
		static bool DecodeAudio(short* psCurrentBuffer, float& fVolume);

	private:
		static void CheckDiskStatus();


		static Asura_PSP_Movie* s_pxCurrentMovie;
		static Asura_PSP_Movie* s_pxShuttingDownMovie;
		static const char* s_szFilename;
		static int s_iAudioStream;
		static int s_iVideoStream;
		volatile static bool s_bSuspended;
		volatile static bool s_bResume;
		static bool s_bDiskOut;
		static bool s_bDiskReturned;
		volatile static bool s_bCanDecodeAudio;
};

#endif//def ASURA_SUPPORT_PSP_MPEG

#endif//__ASURA_PSP_MOVIEPLAYBACK_H__
