Qt: Add audio dumping options

This commit is contained in:
Connor McLaughlin 2020-03-15 22:04:32 +10:00
parent c4af353d54
commit fe2e6561d3
6 changed files with 50 additions and 2 deletions

View file

@ -12,6 +12,7 @@ AudioSettingsWidget::AudioSettingsWidget(QtHostInterface* host_interface, QWidge
SettingWidgetBinder::BindWidgetToEnumSetting(m_host_interface, m_ui.audioBackend, "Audio/Backend",
&Settings::ParseAudioBackend, &Settings::GetAudioBackendName);
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.syncToOutput, "Audio/Sync");
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.startDumpingOnBoot, "Audio/DumpOnBoot");
}
AudioSettingsWidget::~AudioSettingsWidget() = default;

View file

@ -86,6 +86,13 @@
</property>
</widget>
</item>
<item row="4" column="0" colspan="2">
<widget class="QCheckBox" name="startDumpingOnBoot">
<property name="text">
<string>Start Dumping On Boot</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>

View file

@ -480,11 +480,17 @@ void MainWindow::connectSignals()
m_host_interface->populateSaveStateMenus(nullptr, m_ui.menuLoadState, m_ui.menuSaveState);
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.actionDebugShowVRAM, "Debug/ShowVRAM");
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.actionDebugDumpCPUtoVRAMCopies,
"Debug/DumpCPUToVRAMCopies");
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.actionDebugDumpVRAMtoCPUCopies,
"Debug/DumpVRAMToCPUCopies");
connect(m_ui.actionDumpAudio, &QAction::toggled, [this](bool checked) {
if (checked)
m_host_interface->startDumpingAudio();
else
m_host_interface->stopDumpingAudio();
});
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.actionDebugShowVRAM, "Debug/ShowVRAM");
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.actionDebugShowGPUState, "Debug/ShowGPUState");
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.actionDebugShowCDROMState,
"Debug/ShowCDROMState");

View file

@ -121,9 +121,11 @@
<addaction name="menuCPUExecutionMode"/>
<addaction name="menuRenderer"/>
<addaction name="separator"/>
<addaction name="actionDebugShowVRAM"/>
<addaction name="actionDumpAudio"/>
<addaction name="actionDebugDumpCPUtoVRAMCopies"/>
<addaction name="actionDebugDumpVRAMtoCPUCopies"/>
<addaction name="separator"/>
<addaction name="actionDebugShowVRAM"/>
<addaction name="actionDebugShowGPUState"/>
<addaction name="actionDebugShowCDROMState"/>
<addaction name="actionDebugShowSPUState"/>
@ -394,6 +396,14 @@
<string>Dump VRAM to CPU Copies</string>
</property>
</action>
<action name="actionDumpAudio">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Dump Audio</string>
</property>
</action>
<action name="actionDebugShowGPUState">
<property name="checkable">
<bool>true</bool>

View file

@ -566,6 +566,28 @@ void QtHostInterface::saveState(bool global, qint32 slot, bool block_until_done
SaveState(global, slot);
}
void QtHostInterface::startDumpingAudio()
{
if (!isOnWorkerThread())
{
QMetaObject::invokeMethod(this, "startDumpingAudio");
return;
}
StartDumpingAudio();
}
void QtHostInterface::stopDumpingAudio()
{
if (!isOnWorkerThread())
{
QMetaObject::invokeMethod(this, "stopDumpingAudio");
return;
}
StopDumpingAudio();
}
void QtHostInterface::enableBackgroundControllerPolling()
{
if (!isOnWorkerThread())

View file

@ -95,6 +95,8 @@ public Q_SLOTS:
void loadState(const QString& filename);
void loadState(bool global, qint32 slot);
void saveState(bool global, qint32 slot, bool block_until_done = false);
void startDumpingAudio();
void stopDumpingAudio();
/// Enables controller polling even without a system active. Must be matched by a call to
/// disableBackgroundControllerPolling.