Skip to content

Commit

Permalink
QtFifoPlayer: handle fifo load before window creation
Browse files Browse the repository at this point in the history
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 46f4f69
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions Source/Core/Core/FifoPlayer/FifoPlayer.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -168,6 +168,17 @@ std::unique_ptr<CPUCoreBase> FifoPlayer::GetCPUCore()
return std::make_unique<CPUCore>(this); 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 bool FifoPlayer::IsRunningWithFakeVideoInterfaceUpdates() const
{ {
if (!m_File || m_File->GetFrameCount() == 0) if (!m_File || m_File->GetFrameCount() == 0)
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/FifoPlayer/FifoPlayer.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class FifoPlayer
// Default is disabled // Default is disabled
void SetEarlyMemoryUpdates(bool enabled) { m_EarlyMemoryUpdates = enabled; } void SetEarlyMemoryUpdates(bool enabled) { m_EarlyMemoryUpdates = enabled; }
// Callbacks // Callbacks
void SetFileLoadedCallback(CallbackFunc callback) { m_FileLoadedCb = callback; } void SetFileLoadedCallback(CallbackFunc callback);
void SetFrameWrittenCallback(CallbackFunc callback) { m_FrameWrittenCb = callback; } void SetFrameWrittenCallback(CallbackFunc callback) { m_FrameWrittenCb = callback; }
static FifoPlayer& GetInstance(); static FifoPlayer& GetInstance();


Expand Down

0 comments on commit 46f4f69

Please sign in to comment.