///////////////////////////////////////////////////////////////////////////////
//
// File   : Asura_FMV.h
// Author : Jason Turner
// Date   : 12/02/09
//
// Copyright (C) 2009 Rebellion, All Rights Reserved.
//
// Full screen FMV playback
///////////////////////////////////////////////////////////////////////////////

#ifdef ASURA_USE_PRAGMA_ONCE
#pragma once
#endif

#ifndef __ASURA_FMV__
#define __ASURA_FMV__

#include "Core/Asura_LocalisedText.h"

class Asura_FMV
{
	public:
		/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		// Blocking function that plays an FMV full screen.
		//
		// szFilename - the FMV to play
		// bLoop - loop the video at the end
		// eOverrideLanguage - soundtrack index (usually language enum)
		//
		// NB: Subtitle rendering is hard-coded to call Asura_FMVSubtitles::RenderSubtitleByTime( float fTime )
		//     Only calls Update on minimal set of systems (sound, game timers, etc).
		/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		static bool Play(	const char* szFilename,
							bool bLoop = false,
							Asura_LocalisedText_Language eOverrideLanguage = ASURA_LT_L_NUM_LANGUAGES);

		// Allows/disallows the FMV to be skipped by input
		static void AllowSkip (bool bAllow) {s_bAllowSkip = bAllow;};

	private:
		// returns - true = continue, false = exit
		static bool Update();

		static void PrePlay();
		static void PostPlay();
		static bool Platform_Update();
		static void Platform_PrePlay();
		static void Platform_PostPlay();
		static bool Platform_CheckForFMVSkip();

		static const float	s_fTimeBeforeSkipAllowed;
		static bool			s_bAllowSkip;
};

#endif

//eof
