Skip to content
Permalink
Browse files

QtFifoPlayer: handle fifo load before window creation

Fixes a bug where if you loaded a fifo before opening the fifo
player window (which you can do by dragging a .dff onto dolphin's
main window) then the player's widgets wouldn't be initilized
correctly.

Importantly, the object range widgets would be broken.
  • Loading branch information...
phire committed Sep 8, 2019
1 parent 828dc0f commit 46f4f69cfd62231f37b7924070a98c5d3ff4b282
Showing with 12 additions and 1 deletion.
  1. +11 −0 Source/Core/Core/FifoPlayer/FifoPlayer.cpp
  2. +1 −1 Source/Core/Core/FifoPlayer/FifoPlayer.h
@@ -168,6 +168,17 @@ std::unique_ptr<CPUCoreBase> FifoPlayer::GetCPUCore()
return std::make_unique<CPUCore>(this);
}

void FifoPlayer::SetFileLoadedCallback(CallbackFunc callback)
{
m_FileLoadedCb = callback;

// Trigger the callback immediatly if the file is already loaded.
if (GetFile() != nullptr)
{
m_FileLoadedCb();
}
}

bool FifoPlayer::IsRunningWithFakeVideoInterfaceUpdates() const
{
if (!m_File || m_File->GetFrameCount() == 0)
@@ -93,7 +93,7 @@ class FifoPlayer
// Default is disabled
void SetEarlyMemoryUpdates(bool enabled) { m_EarlyMemoryUpdates = enabled; }
// Callbacks
void SetFileLoadedCallback(CallbackFunc callback) { m_FileLoadedCb = callback; }
void SetFileLoadedCallback(CallbackFunc callback);
void SetFrameWrittenCallback(CallbackFunc callback) { m_FrameWrittenCb = callback; }
static FifoPlayer& GetInstance();

0 comments on commit 46f4f69

Please sign in to comment.
You can’t perform that action at this time.