Core/Movie: Refactor to class, move to System.

A bit of global state remains (the `header` in `BeginRecordingInput()`) due to unclear lifetime requirements.
This commit is contained in:
Admiral H. Curtiss
2024-01-13 13:14:48 +01:00
parent c76dee7807
commit 95cba6be2b
32 changed files with 717 additions and 609 deletions

View File

@ -6,6 +6,7 @@
#include <QMouseEvent>
#include "Core/Movie.h"
#include "Core/System.h"
#include "DolphinQt/QtUtils/QueueOnObject.h"
#include "DolphinQt/TAS/TASInputWindow.h"
@ -23,7 +24,8 @@ bool TASCheckBox::GetValue() const
if (check_state == Qt::PartiallyChecked)
{
const u64 frames_elapsed = Movie::GetCurrentFrame() - m_frame_turbo_started;
const u64 frames_elapsed =
Core::System::GetInstance().GetMovie().GetCurrentFrame() - m_frame_turbo_started;
return static_cast<int>(frames_elapsed % m_turbo_total_frames) < m_turbo_press_frames;
}
@ -50,7 +52,7 @@ void TASCheckBox::mousePressEvent(QMouseEvent* event)
return;
}
m_frame_turbo_started = Movie::GetCurrentFrame();
m_frame_turbo_started = Core::System::GetInstance().GetMovie().GetCurrentFrame();
m_turbo_press_frames = m_parent->GetTurboPressFrames();
m_turbo_total_frames = m_turbo_press_frames + m_parent->GetTurboReleaseFrames();
setCheckState(Qt::PartiallyChecked);