CDROM: Add a setting and hotkey to mute CD audio

This commit is contained in:
Connor McLaughlin
2020-10-03 12:24:03 +10:00
parent f7de39f3d0
commit ca0bfc39a2
8 changed files with 36 additions and 5 deletions

View File

@ -2018,7 +2018,7 @@ void CDROM::ProcessXAADPCMSector(const u8* raw_sector, const CDImage::SubChannel
CDXA::DecodeADPCMSector(raw_sector, sample_buffer.data(), m_xa_last_samples.data());
// Only send to SPU if we're not muted.
if (m_muted || m_adpcm_muted)
if (m_muted || m_adpcm_muted || g_settings.cdrom_mute_cd_audio)
return;
g_spu.GeneratePendingSamples();
@ -2082,7 +2082,7 @@ void CDROM::ProcessCDDASector(const u8* raw_sector, const CDImage::SubChannelQ&
}
// Apply volume when pushing sectors to SPU.
if (m_muted)
if (m_muted || g_settings.cdrom_mute_cd_audio)
return;
g_spu.GeneratePendingSamples();

View File

@ -456,6 +456,7 @@ void HostInterface::SetDefaultSettings(SettingsInterface& si)
si.SetBoolValue("CDROM", "ReadThread", true);
si.SetBoolValue("CDROM", "RegionCheck", true);
si.SetBoolValue("CDROM", "LoadImageToRAM", false);
si.SetBoolValue("CDROM", "MuteCDAudio", false);
si.SetStringValue("Audio", "Backend", Settings::GetAudioBackendName(Settings::DEFAULT_AUDIO_BACKEND));
si.SetIntValue("Audio", "OutputVolume", 100);

View File

@ -175,6 +175,7 @@ void Settings::Load(SettingsInterface& si)
cdrom_read_thread = si.GetBoolValue("CDROM", "ReadThread", true);
cdrom_region_check = si.GetBoolValue("CDROM", "RegionCheck", true);
cdrom_load_image_to_ram = si.GetBoolValue("CDROM", "LoadImageToRAM", false);
cdrom_mute_cd_audio = si.GetBoolValue("CDROM", "MuteCDAudio", false);
audio_backend =
ParseAudioBackend(si.GetStringValue("Audio", "Backend", GetAudioBackendName(DEFAULT_AUDIO_BACKEND)).c_str())
@ -294,6 +295,7 @@ void Settings::Save(SettingsInterface& si) const
si.SetBoolValue("CDROM", "ReadThread", cdrom_read_thread);
si.SetBoolValue("CDROM", "RegionCheck", cdrom_region_check);
si.SetBoolValue("CDROM", "LoadImageToRAM", cdrom_load_image_to_ram);
si.SetBoolValue("CDROM", "MuteCDAudio", cdrom_mute_cd_audio);
si.SetStringValue("Audio", "Backend", GetAudioBackendName(audio_backend));
si.SetIntValue("Audio", "OutputVolume", audio_output_volume);

View File

@ -122,6 +122,7 @@ struct Settings
bool cdrom_read_thread = true;
bool cdrom_region_check = true;
bool cdrom_load_image_to_ram = false;
bool cdrom_mute_cd_audio = false;
AudioBackend audio_backend = AudioBackend::Cubeb;
s32 audio_output_volume = 100;