#pragma once #include "stdafx.h" #include #include "INotificationListener.h" #include "../Utilities/AutoResetEvent.h" class VirtualFile; class RecordedRomTest : public INotificationListener { private: bool _recording; bool _runningTest; int _badFrameCount; bool _recordingFromMovie; uint8_t _previousHash[16]; std::deque _screenshotHashes; std::deque _repetitionCount; uint8_t _currentCount; //Used when making a test out of an existing movie/test vector _movieData; stringstream _romStream; string _filename; ofstream _file; AutoResetEvent _signal; private: void Reset(); void ValidateFrame(uint16_t* ppuFrameBuffer); void SaveFrame(uint16_t* ppuFrameBuffer); void Save(); public: RecordedRomTest(); virtual ~RecordedRomTest(); void ProcessNotification(ConsoleNotificationType type, void* parameter) override; void Record(string filename, bool reset); void RecordFromMovie(string testFilename, VirtualFile movieFile); void RecordFromTest(string newTestFilename, string existingTestFilename); int32_t Run(string filename); void Stop(); };