Skip to content
Permalink
Browse files
Merge pull request #5995 from spycrab/qt_fifoplayer
Qt: Implement FIFO Player
  • Loading branch information
leoetlino committed Nov 19, 2017
2 parents b3b58b5 + 474b1c2 commit 901e29f
Show file tree
Hide file tree
Showing 12 changed files with 450 additions and 5 deletions.
@@ -11,6 +11,7 @@
#include "Common/CommonTypes.h"
#include "Common/MsgHandler.h"
#include "Core/ConfigManager.h"
#include "Core/Core.h"
#include "Core/CoreTiming.h"
#include "Core/FifoPlayer/FifoAnalyzer.h"
#include "Core/FifoPlayer/FifoDataFile.h"
@@ -67,6 +68,11 @@ void FifoPlayer::Close()
m_FrameRangeEnd = 0;
}

bool FifoPlayer::IsPlaying() const
{
return GetFile() != nullptr && Core::IsRunning();
}

class FifoPlayer::CPUCore final : public CPUCoreBase
{
public:
@@ -4,6 +4,7 @@

#pragma once

#include <functional>
#include <memory>
#include <string>
#include <vector>
@@ -56,7 +57,7 @@ extern bool IsPlayingBackFifologWithBrokenEFBCopies;
class FifoPlayer
{
public:
typedef void (*CallbackFunc)(void);
using CallbackFunc = std::function<void()>;

~FifoPlayer();

@@ -70,6 +71,8 @@ class FifoPlayer
// PowerPC state.
std::unique_ptr<CPUCoreBase> GetCPUCore();

bool IsPlaying() const;

FifoDataFile* GetFile() const { return m_File.get(); }
u32 GetFrameObjectCount() const;
u32 GetCurrentFrameNum() const { return m_CurrentFrame; }
@@ -63,6 +63,11 @@ void FifoRecorder::StopRecording()
m_RequestedRecordingEnd = true;
}

bool FifoRecorder::IsRecordingDone() const
{
return m_WasRecording && m_File != nullptr;
}

FifoDataFile* FifoRecorder::GetRecordedFile() const
{
return m_File.get();
@@ -4,6 +4,7 @@

#pragma once

#include <functional>
#include <memory>
#include <mutex>
#include <vector>
@@ -13,13 +14,15 @@
class FifoRecorder
{
public:
typedef void (*CallbackFunc)(void);
using CallbackFunc = std::function<void()>;

FifoRecorder();

void StartRecording(s32 numFrames, CallbackFunc finishedCb);
void StopRecording();

bool IsRecordingDone() const;

FifoDataFile* GetRecordedFile() const;
// Called from video thread

@@ -54,7 +57,7 @@ class FifoRecorder
bool m_WasRecording = false;
bool m_RequestedRecordingEnd = false;
s32 m_RecordFramesRemaining = 0;
CallbackFunc m_FinishedCb = nullptr;
CallbackFunc m_FinishedCb;
std::unique_ptr<FifoDataFile> m_File;

// Accessed only from video thread
@@ -18,6 +18,7 @@ set(CMAKE_AUTOMOC ON)

set(SRCS
AboutDialog.cpp
FIFOPlayerWindow.cpp
HotkeyScheduler.cpp
Host.cpp
InDevelopmentWarning.cpp
@@ -83,6 +83,7 @@
<QtMoc Include="Config\InfoWidget.h" />
<QtMoc Include="Config\PropertiesDialog.h" />
<QtMoc Include="Config\SettingsWindow.h" />
<QtMoc Include="FIFOPlayerWindow.h" />
<QtMoc Include="GameList\GameFile.h" />
<QtMoc Include="GameList\GameList.h" />
<QtMoc Include="GameList\GameListModel.h" />
@@ -118,6 +119,7 @@
<ClCompile Include="$(QtMocOutPrefix)CheatWarningWidget.cpp" />
<ClCompile Include="$(QtMocOutPrefix)ControllersWindow.cpp" />
<ClCompile Include="$(QtMocOutPrefix)EnhancementsWidget.cpp" />
<ClCompile Include="$(QtMocOutPrefix)FIFOPlayerWindow.cpp" />
<ClCompile Include="$(QtMocOutPrefix)FilesystemWidget.cpp" />
<ClCompile Include="$(QtMocOutPrefix)WindowActivationEventFilter.cpp" />
<ClCompile Include="$(QtMocOutPrefix)GameList.cpp" />
@@ -198,6 +200,7 @@
<ClCompile Include="Config\LogWidget.cpp" />
<ClCompile Include="Config\PropertiesDialog.cpp" />
<ClCompile Include="Config\SettingsWindow.cpp" />
<ClCompile Include="FIFOPlayerWindow.cpp" />
<ClCompile Include="GameList\GameFile.cpp" />
<ClCompile Include="GameList\GameFileCache.cpp" />
<ClCompile Include="GameList\GameList.cpp" />

0 comments on commit 901e29f

Please sign in to comment.