2017-04-18 22:39:45 -04:00
|
|
|
#pragma once
|
|
|
|
#include "stdafx.h"
|
2017-04-22 13:19:21 -04:00
|
|
|
#include "MessageManager.h"
|
|
|
|
#include "EmulationSettings.h"
|
2017-04-18 22:39:45 -04:00
|
|
|
|
|
|
|
class IMovie
|
|
|
|
{
|
2017-04-22 13:19:21 -04:00
|
|
|
protected:
|
|
|
|
void EndMovie()
|
|
|
|
{
|
|
|
|
MessageManager::DisplayMessage("Movies", "MovieEnded");
|
|
|
|
MessageManager::SendNotification(ConsoleNotificationType::MovieEnded);
|
|
|
|
if(EmulationSettings::CheckFlag(EmulationFlags::PauseOnMovieEnd)) {
|
|
|
|
EmulationSettings::SetFlags(EmulationFlags::Paused);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-04-18 22:39:45 -04:00
|
|
|
public:
|
|
|
|
virtual void RecordState(uint8_t port, uint8_t value) = 0;
|
|
|
|
virtual uint8_t GetState(uint8_t port) = 0;
|
|
|
|
|
|
|
|
virtual void Record(string filename, bool reset) = 0;
|
2017-04-22 13:19:21 -04:00
|
|
|
virtual bool Play(stringstream &filestream, bool autoLoadRom) = 0;
|
2017-04-18 22:39:45 -04:00
|
|
|
|
|
|
|
virtual bool IsRecording() = 0;
|
|
|
|
virtual bool IsPlaying() = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
class MovieManager
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
static shared_ptr<IMovie> _instance;
|
|
|
|
|
|
|
|
public:
|
|
|
|
static void Record(string filename, bool reset);
|
|
|
|
static void Play(string filename);
|
2017-04-22 13:19:21 -04:00
|
|
|
static bool Play(std::stringstream &filestream, bool autoLoadRom);
|
2017-04-18 22:39:45 -04:00
|
|
|
static void Stop();
|
|
|
|
static bool Playing();
|
|
|
|
static bool Recording();
|
|
|
|
|
|
|
|
static void RecordState(uint8_t port, uint8_t value);
|
|
|
|
static uint8_t GetState(uint8_t port);
|
|
|
|
};
|