MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / onInputRecNewActionTriggered

Method onInputRecNewActionTriggered

pcsx2-qt/MainWindow.cpp:2251–2290  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2249}
2250
2251void MainWindow::onInputRecNewActionTriggered()
2252{
2253 const bool wasPaused = s_vm_paused;
2254 const bool wasRunning = s_vm_valid;
2255 if (wasRunning && !wasPaused)
2256 {
2257 g_emu_thread->setVMPaused(true);
2258 }
2259
2260 NewInputRecordingDlg dlg(this);
2261 const auto result = dlg.exec();
2262
2263 if (result == QDialog::Accepted)
2264 {
2265 Host::RunOnCPUThread(
2266 [filePath = dlg.getFilePath(), fromSavestate = dlg.getInputRecType() == InputRecording::Type::FROM_SAVESTATE,
2267 authorName = dlg.getAuthorName()]() {
2268 if (g_InputRecording.create(filePath, fromSavestate, authorName))
2269 {
2270 QtHost::RunOnUIThread([]() {
2271 g_main_window->m_ui.actionInputRecNew->setEnabled(false);
2272 g_main_window->m_ui.actionInputRecStop->setEnabled(true);
2273 g_main_window->m_ui.actionReset->setEnabled(!g_InputRecording.isTypeSavestate());
2274 g_main_window->m_ui.actionToolbarReset->setEnabled(!g_InputRecording.isTypeSavestate());
2275 });
2276 }
2277 else
2278 {
2279 Host::ReportErrorAsync(
2280 TRANSLATE_SV("MainWindow", "Input Recording Failed"),
2281 fmt::format(TRANSLATE_FS("MainWindow", "Failed to create file: {}"), filePath));
2282 }
2283 });
2284 }
2285
2286 if (wasRunning && !wasPaused)
2287 {
2288 g_emu_thread->setVMPaused(false);
2289 }
2290}
2291
2292void MainWindow::onInputRecPlayActionTriggered()
2293{

Callers

nothing calls this directly

Calls 7

setVMPausedMethod · 0.80
getFilePathMethod · 0.80
getInputRecTypeMethod · 0.80
getAuthorNameMethod · 0.80
isTypeSavestateMethod · 0.80
formatFunction · 0.50
createMethod · 0.45

Tested by

no test coverage detected