From 40e8c9163a6c697b8ac8ca0bc9c0fbccc30ece6c Mon Sep 17 00:00:00 2001 From: TotalCaesar659 <14265316+TotalCaesar659@users.noreply.github.com> Date: Thu, 16 Apr 2020 17:14:56 +0300 Subject: [PATCH 1/2] Add "Record" menu group to Linux version --- Qt/mainwindow.cpp | 35 ++++++++++++++++++++++++++++++++++- Qt/mainwindow.h | 4 ++++ 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/Qt/mainwindow.cpp b/Qt/mainwindow.cpp index 31f72c2a63..820bdd4cc5 100644 --- a/Qt/mainwindow.cpp +++ b/Qt/mainwindow.cpp @@ -253,6 +253,26 @@ void MainWindow::sstateAct() } } +void MainWindow::recordDisplayAct() +{ + g_Config.bDumpFrames = !g_Config.bDumpFrames; +} + +void MainWindow::useLosslessVideoCodecAct() +{ + g_Config.bUseFFV1 = !g_Config.bUseFFV1; +} + +void MainWindow::useOutputBufferAct() +{ + g_Config.bDumpVideoOutput = !g_Config.bDumpVideoOutput; +} + +void MainWindow::recordAudioAct() +{ + g_Config.bDumpAudio = !g_Config.bDumpAudio; +} + void MainWindow::exitAct() { closeAct(); @@ -527,7 +547,7 @@ void MainWindow::createMenus() fileMenu->add(new MenuAction(this, SLOT(closeAct()), QT_TR_NOOP("&Close"), QKeySequence::Close)) ->addDisableState(UISTATE_MENU); fileMenu->addSeparator(); - fileMenu->add(new MenuAction(this, SLOT(openmsAct()), QT_TR_NOOP("Open &Memory stick"))) + fileMenu->add(new MenuAction(this, SLOT(openmsAct()), QT_TR_NOOP("Open &Memory Stick"))) ->addEnableState(UISTATE_MENU); fileMenu->addSeparator(); MenuTree* savestateMenu = new MenuTree(this, fileMenu, QT_TR_NOOP("Saves&tate slot")); @@ -542,6 +562,19 @@ void MainWindow::createMenus() ->addDisableState(UISTATE_MENU); fileMenu->add(new MenuAction(this, SLOT(sstateAct()), QT_TR_NOOP("&Save state file..."))) ->addDisableState(UISTATE_MENU); + MenuTree* recordMenu = new MenuTree(this, fileMenu, QT_TR_NOOP("&Record")); + recordMenu->add(new MenuAction(this, SLOT(recordDisplayAct()), QT_TR_NOOP("Record &display"))) + ->addEventChecked(&g_Config.bDumpFrames); + recordMenu->add(new MenuAction(this, SLOT(useLosslessVideoCodecAct()), QT_TR_NOOP("&Use lossless video codec (FFV1)"))) + ->addEventChecked(&g_Config.bUseFFV1); + recordMenu->add(new MenuAction(this, SLOT(useOutputBufferAct()), QT_TR_NOOP("Use output buffer for video"))) + ->addEventChecked(&g_Config.bDumpVideoOutput); + /*recordGroup = new MenuActionGroup(this, recordMenu, SLOT(recordGroup_triggered(QAction *)), + QStringList() << "Record &display" << "&Use lossless video codec (FFV1)" << "Use output buffer for video", + QList() << 0 << 1 << 2);*/ + recordMenu->addSeparator(); + recordMenu->add(new MenuAction(this, SLOT(recordAudioAct()), QT_TR_NOOP("Record &audio"))) + ->addEventChecked(&g_Config.bDumpAudio); fileMenu->addSeparator(); fileMenu->add(new MenuAction(this, SLOT(exitAct()), QT_TR_NOOP("E&xit"), QKeySequence::Quit)); diff --git a/Qt/mainwindow.h b/Qt/mainwindow.h index 2da0f8e37a..be05d319be 100644 --- a/Qt/mainwindow.h +++ b/Qt/mainwindow.h @@ -82,6 +82,10 @@ private slots: void qsstateAct(); void lstateAct(); void sstateAct(); + void recordDisplayAct(); + void useLosslessVideoCodecAct(); + void useOutputBufferAct(); + void recordAudioAct(); void exitAct(); // Emulation From 9ec3ea8550f236d8ec3eaba017c141ae88c447bd Mon Sep 17 00:00:00 2001 From: TotalCaesar659 <14265316+TotalCaesar659@users.noreply.github.com> Date: Thu, 16 Apr 2020 17:17:18 +0300 Subject: [PATCH 2/2] Remove leftovers --- Qt/mainwindow.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/Qt/mainwindow.cpp b/Qt/mainwindow.cpp index 820bdd4cc5..569c634d48 100644 --- a/Qt/mainwindow.cpp +++ b/Qt/mainwindow.cpp @@ -569,9 +569,6 @@ void MainWindow::createMenus() ->addEventChecked(&g_Config.bUseFFV1); recordMenu->add(new MenuAction(this, SLOT(useOutputBufferAct()), QT_TR_NOOP("Use output buffer for video"))) ->addEventChecked(&g_Config.bDumpVideoOutput); - /*recordGroup = new MenuActionGroup(this, recordMenu, SLOT(recordGroup_triggered(QAction *)), - QStringList() << "Record &display" << "&Use lossless video codec (FFV1)" << "Use output buffer for video", - QList() << 0 << 1 << 2);*/ recordMenu->addSeparator(); recordMenu->add(new MenuAction(this, SLOT(recordAudioAct()), QT_TR_NOOP("Record &audio"))) ->addEventChecked(&g_Config.bDumpAudio);