mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
FifoRecorder: Move instance to System.
This commit is contained in:
@ -32,8 +32,9 @@
|
||||
#include "DolphinQt/Resources.h"
|
||||
#include "DolphinQt/Settings.h"
|
||||
|
||||
FIFOPlayerWindow::FIFOPlayerWindow(FifoPlayer& fifo_player, QWidget* parent)
|
||||
: QWidget(parent), m_fifo_player(fifo_player)
|
||||
FIFOPlayerWindow::FIFOPlayerWindow(FifoPlayer& fifo_player, FifoRecorder& fifo_recorder,
|
||||
QWidget* parent)
|
||||
: QWidget(parent), m_fifo_player(fifo_player), m_fifo_recorder(fifo_recorder)
|
||||
{
|
||||
setWindowTitle(tr("FIFO Player"));
|
||||
setWindowIcon(Resources::GetAppIcon());
|
||||
@ -229,7 +230,7 @@ void FIFOPlayerWindow::SaveRecording()
|
||||
if (path.isEmpty())
|
||||
return;
|
||||
|
||||
FifoDataFile* file = FifoRecorder::GetInstance().GetRecordedFile();
|
||||
FifoDataFile* file = m_fifo_recorder.GetRecordedFile();
|
||||
|
||||
bool result = file->Save(path.toStdString());
|
||||
|
||||
@ -242,9 +243,8 @@ void FIFOPlayerWindow::SaveRecording()
|
||||
void FIFOPlayerWindow::StartRecording()
|
||||
{
|
||||
// Start recording
|
||||
FifoRecorder::GetInstance().StartRecording(m_frame_record_count->value(), [this] {
|
||||
QueueOnObject(this, [this] { OnRecordingDone(); });
|
||||
});
|
||||
m_fifo_recorder.StartRecording(m_frame_record_count->value(),
|
||||
[this] { QueueOnObject(this, [this] { OnRecordingDone(); }); });
|
||||
|
||||
UpdateControls();
|
||||
|
||||
@ -253,7 +253,7 @@ void FIFOPlayerWindow::StartRecording()
|
||||
|
||||
void FIFOPlayerWindow::StopRecording()
|
||||
{
|
||||
FifoRecorder::GetInstance().StopRecording();
|
||||
m_fifo_recorder.StopRecording();
|
||||
|
||||
UpdateControls();
|
||||
UpdateInfo();
|
||||
@ -270,7 +270,7 @@ void FIFOPlayerWindow::OnEmulationStarted()
|
||||
void FIFOPlayerWindow::OnEmulationStopped()
|
||||
{
|
||||
// If we have previously been recording, stop now.
|
||||
if (FifoRecorder::GetInstance().IsRecording())
|
||||
if (m_fifo_recorder.IsRecording())
|
||||
StopRecording();
|
||||
|
||||
UpdateControls();
|
||||
@ -297,9 +297,9 @@ void FIFOPlayerWindow::UpdateInfo()
|
||||
return;
|
||||
}
|
||||
|
||||
if (FifoRecorder::GetInstance().IsRecordingDone())
|
||||
if (m_fifo_recorder.IsRecordingDone())
|
||||
{
|
||||
FifoDataFile* file = FifoRecorder::GetInstance().GetRecordedFile();
|
||||
FifoDataFile* file = m_fifo_recorder.GetRecordedFile();
|
||||
size_t fifo_bytes = 0;
|
||||
size_t mem_bytes = 0;
|
||||
|
||||
@ -316,7 +316,7 @@ void FIFOPlayerWindow::UpdateInfo()
|
||||
return;
|
||||
}
|
||||
|
||||
if (Core::IsRunning() && FifoRecorder::GetInstance().IsRecording())
|
||||
if (Core::IsRunning() && m_fifo_recorder.IsRecording())
|
||||
{
|
||||
m_info_label->setText(tr("Recording..."));
|
||||
return;
|
||||
@ -376,7 +376,7 @@ void FIFOPlayerWindow::UpdateLimits()
|
||||
void FIFOPlayerWindow::UpdateControls()
|
||||
{
|
||||
bool running = Core::IsRunning();
|
||||
bool is_recording = FifoRecorder::GetInstance().IsRecording();
|
||||
bool is_recording = m_fifo_recorder.IsRecording();
|
||||
bool is_playing = m_fifo_player.IsPlaying();
|
||||
|
||||
m_frame_range_from->setEnabled(is_playing);
|
||||
@ -399,7 +399,7 @@ void FIFOPlayerWindow::UpdateControls()
|
||||
m_stop->setVisible(running && is_recording);
|
||||
m_record->setVisible(!m_stop->isVisible());
|
||||
|
||||
m_save->setEnabled(FifoRecorder::GetInstance().IsRecordingDone());
|
||||
m_save->setEnabled(m_fifo_recorder.IsRecordingDone());
|
||||
}
|
||||
|
||||
bool FIFOPlayerWindow::eventFilter(QObject* object, QEvent* event)
|
||||
|
@ -14,13 +14,15 @@ class QSpinBox;
|
||||
class QTabWidget;
|
||||
class ToolTipCheckBox;
|
||||
class FifoPlayer;
|
||||
class FifoRecorder;
|
||||
class FIFOAnalyzer;
|
||||
|
||||
class FIFOPlayerWindow : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit FIFOPlayerWindow(FifoPlayer& fifo_player, QWidget* parent = nullptr);
|
||||
explicit FIFOPlayerWindow(FifoPlayer& fifo_player, FifoRecorder& fifo_recorder,
|
||||
QWidget* parent = nullptr);
|
||||
~FIFOPlayerWindow();
|
||||
|
||||
signals:
|
||||
@ -51,6 +53,7 @@ private:
|
||||
bool eventFilter(QObject* object, QEvent* event) final override;
|
||||
|
||||
FifoPlayer& m_fifo_player;
|
||||
FifoRecorder& m_fifo_recorder;
|
||||
|
||||
QLabel* m_info_label;
|
||||
QPushButton* m_load;
|
||||
|
@ -1363,7 +1363,8 @@ void MainWindow::ShowFIFOPlayer()
|
||||
{
|
||||
if (!m_fifo_window)
|
||||
{
|
||||
m_fifo_window = new FIFOPlayerWindow(Core::System::GetInstance().GetFifoPlayer());
|
||||
m_fifo_window = new FIFOPlayerWindow(Core::System::GetInstance().GetFifoPlayer(),
|
||||
Core::System::GetInstance().GetFifoRecorder());
|
||||
connect(m_fifo_window, &FIFOPlayerWindow::LoadFIFORequested, this,
|
||||
[this](const QString& path) { StartGame(path, ScanForSecondDisc::No); });
|
||||
}
|
||||
|
Reference in New Issue
Block a user