Skip to content
Permalink
Browse files

Merge pull request #7884 from JosJuice/save-movie-on-exit

DolphinQt: Save movie when closing emulation
  • Loading branch information...
JosJuice committed Mar 16, 2019
2 parents 861fc42 + 185b1cf commit 08ca9ec21f3e94a4b1f37ef5a582db14900e22b3
Showing with 9 additions and 13 deletions.
  1. +9 −13 Source/Core/DolphinQt/MainWindow.cpp
@@ -776,7 +776,7 @@ bool MainWindow::RequestStop()
}
}

// TODO: Add Movie shutdown
OnStopRecording();
// TODO: Add Debugger shutdown

if (!m_stop_requested && UICommon::TriggerSTMPowerEvent())
@@ -1565,30 +1565,26 @@ void MainWindow::OnStopRecording()
{
if (Movie::IsRecordingInput())
OnExportRecording();

Movie::EndPlayInput(false);
emit RecordingStatusChanged(true);
if (Movie::IsMovieActive())
Movie::EndPlayInput(false);
emit RecordingStatusChanged(false);
}

void MainWindow::OnExportRecording()
{
bool was_paused = Core::GetState() == Core::State::Paused;

if (was_paused)
if (!was_paused)
Core::SetState(Core::State::Paused);

QString dtm_file = QFileDialog::getSaveFileName(this, tr("Select the Recording File"), QString(),
tr("Dolphin TAS Movies (*.dtm)"));

if (was_paused)
Core::SetState(Core::State::Running);
if (!dtm_file.isEmpty())
Movie::SaveRecording(dtm_file.toStdString());

if (dtm_file.isEmpty())
return;

Core::SetState(Core::State::Running);

Movie::SaveRecording(dtm_file.toStdString());
if (!was_paused)
Core::SetState(Core::State::Running);
}

void MainWindow::ShowTASInput()

0 comments on commit 08ca9ec

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