This commit is contained in:
Nayla Hanegan 2024-01-27 04:44:26 -05:00
commit 0af9a3ae8f
212 changed files with 50301 additions and 41718 deletions

View file

@ -279,7 +279,7 @@ MainWindow::MainWindow(std::unique_ptr<BootParameters> boot_parameters,
if (!movie_path.empty())
{
std::optional<std::string> savestate_path;
if (Movie::PlayInput(movie_path, &savestate_path))
if (Core::System::GetInstance().GetMovie().PlayInput(movie_path, &savestate_path))
{
m_pending_boot->boot_session_data.SetSavestateData(std::move(savestate_path),
DeleteSavestateAfterBoot::No);
@ -646,8 +646,9 @@ void MainWindow::ConnectHotkeys()
connect(m_hotkey_scheduler, &HotkeyScheduler::ConnectWiiRemote, this,
&MainWindow::OnConnectWiiRemote);
connect(m_hotkey_scheduler, &HotkeyScheduler::ToggleReadOnlyMode, [this] {
bool read_only = !Movie::IsReadOnly();
Movie::SetReadOnly(read_only);
auto& movie = Core::System::GetInstance().GetMovie();
bool read_only = !movie.IsReadOnly();
movie.SetReadOnly(read_only);
emit ReadOnlyModeChanged(read_only);
});
@ -1117,9 +1118,10 @@ void MainWindow::ForceStop()
void MainWindow::Reset()
{
if (Movie::IsRecordingInput())
Movie::SetReset(true);
auto& system = Core::System::GetInstance();
auto& movie = system.GetMovie();
if (movie.IsRecordingInput())
movie.SetReset(true);
system.GetProcessorInterface().ResetButton_Tap();
}
@ -1469,7 +1471,8 @@ void MainWindow::ShowFIFOPlayer()
{
if (!m_fifo_window)
{
m_fifo_window = new FIFOPlayerWindow;
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); });
}
@ -1959,15 +1962,16 @@ void MainWindow::OnPlayRecording()
if (dtm_file.isEmpty())
return;
if (!Movie::IsReadOnly())
auto& movie = Core::System::GetInstance().GetMovie();
if (!movie.IsReadOnly())
{
// let's make the read-only flag consistent at the start of a movie.
Movie::SetReadOnly(true);
movie.SetReadOnly(true);
emit ReadOnlyModeChanged(true);
}
std::optional<std::string> savestate_path;
if (Movie::PlayInput(dtm_file.toStdString(), &savestate_path))
if (movie.PlayInput(dtm_file.toStdString(), &savestate_path))
{
emit RecordingStatusChanged(true);
@ -1977,14 +1981,17 @@ void MainWindow::OnPlayRecording()
void MainWindow::OnStartRecording()
{
if ((!Core::IsRunningAndStarted() && Core::IsRunning()) || Movie::IsRecordingInput() ||
Movie::IsPlayingInput())
auto& movie = Core::System::GetInstance().GetMovie();
if ((!Core::IsRunningAndStarted() && Core::IsRunning()) || movie.IsRecordingInput() ||
movie.IsPlayingInput())
{
return;
}
if (Movie::IsReadOnly())
if (movie.IsReadOnly())
{
// The user just chose to record a movie, so that should take precedence
Movie::SetReadOnly(false);
movie.SetReadOnly(false);
emit ReadOnlyModeChanged(true);
}
@ -2003,7 +2010,7 @@ void MainWindow::OnStartRecording()
wiimotes[i] = Config::Get(Config::GetInfoForWiimoteSource(i)) != WiimoteSource::None;
}
if (Movie::BeginRecordingInput(controllers, wiimotes))
if (movie.BeginRecordingInput(controllers, wiimotes))
{
emit RecordingStatusChanged(true);
@ -2014,10 +2021,11 @@ void MainWindow::OnStartRecording()
void MainWindow::OnStopRecording()
{
if (Movie::IsRecordingInput())
auto& movie = Core::System::GetInstance().GetMovie();
if (movie.IsRecordingInput())
OnExportRecording();
if (Movie::IsMovieActive())
Movie::EndPlayInput(false);
if (movie.IsMovieActive())
movie.EndPlayInput(false);
emit RecordingStatusChanged(false);
}
@ -2027,7 +2035,7 @@ void MainWindow::OnExportRecording()
QString dtm_file = DolphinFileDialog::getSaveFileName(
this, tr("Save Recording File As"), QString(), tr("Dolphin TAS Movies (*.dtm)"));
if (!dtm_file.isEmpty())
Movie::SaveRecording(dtm_file.toStdString());
Core::System::GetInstance().GetMovie().SaveRecording(dtm_file.toStdString());
});
}