Implement proper microphone support (#251)

This commit is contained in:
Adrian Graber 2022-11-03 00:24:34 +01:00 committed by GitHub
parent dfa7774c4c
commit d4e14d2b05
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 682 additions and 36 deletions

View file

@ -295,8 +295,10 @@ void CemuConfig::Load(XMLConfigParser& parser)
audio_delay = audio.get("delay", 2);
tv_channels = audio.get("TVChannels", kStereo);
pad_channels = audio.get("PadChannels", kStereo);
input_channels = audio.get("InputChannels", kMono);
tv_volume = audio.get("TVVolume", 20);
pad_volume = audio.get("PadVolume", 0);
input_volume = audio.get("InputVolume", 20);
const auto tv = audio.get("TVDevice", "");
try
@ -318,6 +320,16 @@ void CemuConfig::Load(XMLConfigParser& parser)
forceLog_printf("config load error: can't load pad device: %s", pad);
}
const auto input_device_name = audio.get("InputDevice", "");
try
{
input_device = boost::nowide::widen(input_device_name);
}
catch (const std::exception&)
{
forceLog_printf("config load error: can't load input device: %s", input_device_name);
}
// account
auto acc = parser.get("Account");
account.m_persistent_id = acc.get("PersistentId", account.m_persistent_id);
@ -488,10 +500,13 @@ void CemuConfig::Save(XMLConfigParser& parser)
audio.set("delay", audio_delay);
audio.set("TVChannels", tv_channels);
audio.set("PadChannels", pad_channels);
audio.set("InputChannels", input_channels);
audio.set("TVVolume", tv_volume);
audio.set("PadVolume", pad_volume);
audio.set("InputVolume", input_volume);
audio.set("TVDevice", boost::nowide::narrow(tv_device).c_str());
audio.set("PadDevice", boost::nowide::narrow(pad_device).c_str());
audio.set("InputDevice", boost::nowide::narrow(input_device).c_str());
// account
auto acc = config.set("Account");