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

@ -146,7 +146,8 @@ void MenuBar::OnEmulationStateChanged(Core::State state)
#else // USE_RETRO_ACHIEVEMENTS
m_recording_play->setEnabled(m_game_selected && !running);
#endif // USE_RETRO_ACHIEVEMENTS
m_recording_start->setEnabled((m_game_selected || running) && !Movie::IsPlayingInput());
m_recording_start->setEnabled((m_game_selected || running) &&
!Core::System::GetInstance().GetMovie().IsPlayingInput());
// JIT
m_jit_interpreter_core->setEnabled(running);
@ -775,8 +776,9 @@ void MenuBar::AddMovieMenu()
m_recording_read_only = movie_menu->addAction(tr("&Read-Only Mode"));
m_recording_read_only->setCheckable(true);
m_recording_read_only->setChecked(Movie::IsReadOnly());
connect(m_recording_read_only, &QAction::toggled, [](bool value) { Movie::SetReadOnly(value); });
m_recording_read_only->setChecked(Core::System::GetInstance().GetMovie().IsReadOnly());
connect(m_recording_read_only, &QAction::toggled,
[](bool value) { Core::System::GetInstance().GetMovie().SetReadOnly(value); });
movie_menu->addAction(tr("TAS Input"), this, [this] { emit ShowTASInput(); });
@ -1231,7 +1233,8 @@ void MenuBar::OnSelectionChanged(std::shared_ptr<const UICommon::GameFile> game_
m_game_selected = !!game_file;
m_recording_play->setEnabled(m_game_selected && !Core::IsRunning());
m_recording_start->setEnabled((m_game_selected || Core::IsRunning()) && !Movie::IsPlayingInput());
m_recording_start->setEnabled((m_game_selected || Core::IsRunning()) &&
!Core::System::GetInstance().GetMovie().IsPlayingInput());
}
void MenuBar::OnRecordingStatusChanged(bool recording)