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 cf80b43 commit 0dca656818d7d2baa14a95518af4000b226252b1
@@ -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();

@@ -86,11 +86,6 @@ void FIFOPlayerWindow::CreateWidgets()
m_object_range_to = new QSpinBox;
m_object_range_to_label = new QLabel(tr("To:"));

// Frames can have thousands of objects
// Extend maximum range from 99 to something more reasonable
m_object_range_from->setMaximum(99999);
m_object_range_to->setMaximum(99999);

object_range_layout->addWidget(m_object_range_from_label);
object_range_layout->addWidget(m_object_range_from);
object_range_layout->addWidget(m_object_range_to_label);

0 comments on commit 0dca656

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