mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-03 21:41:19 +12:00
save config properly
This commit is contained in:
parent
c9c7afaa0f
commit
9bb6b32417
2 changed files with 21 additions and 1 deletions
|
@ -275,9 +275,11 @@ void CemuConfig::Load(XMLConfigParser& parser)
|
||||||
tv_channels = audio.get("TVChannels", kStereo);
|
tv_channels = audio.get("TVChannels", kStereo);
|
||||||
pad_channels = audio.get("PadChannels", kStereo);
|
pad_channels = audio.get("PadChannels", kStereo);
|
||||||
input_channels = audio.get("InputChannels", kMono);
|
input_channels = audio.get("InputChannels", kMono);
|
||||||
|
portal_channels = audio.get("PortalChannels", kMono);
|
||||||
tv_volume = audio.get("TVVolume", 20);
|
tv_volume = audio.get("TVVolume", 20);
|
||||||
pad_volume = audio.get("PadVolume", 0);
|
pad_volume = audio.get("PadVolume", 0);
|
||||||
input_volume = audio.get("InputVolume", 20);
|
input_volume = audio.get("InputVolume", 20);
|
||||||
|
portal_volume = audio.get("PortalVolume", 20);
|
||||||
|
|
||||||
const auto tv = audio.get("TVDevice", "");
|
const auto tv = audio.get("TVDevice", "");
|
||||||
try
|
try
|
||||||
|
@ -309,6 +311,16 @@ void CemuConfig::Load(XMLConfigParser& parser)
|
||||||
cemuLog_log(LogType::Force, "config load error: can't load input device: {}", input_device_name);
|
cemuLog_log(LogType::Force, "config load error: can't load input device: {}", input_device_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const auto portal_device_name = audio.get("PortalDevice", "");
|
||||||
|
try
|
||||||
|
{
|
||||||
|
portal_device = boost::nowide::widen(portal_device_name);
|
||||||
|
}
|
||||||
|
catch (const std::exception&)
|
||||||
|
{
|
||||||
|
cemuLog_log(LogType::Force, "config load error: can't load input device: {}", portal_device_name);
|
||||||
|
}
|
||||||
|
|
||||||
// account
|
// account
|
||||||
auto acc = parser.get("Account");
|
auto acc = parser.get("Account");
|
||||||
account.m_persistent_id = acc.get("PersistentId", account.m_persistent_id);
|
account.m_persistent_id = acc.get("PersistentId", account.m_persistent_id);
|
||||||
|
@ -508,12 +520,15 @@ void CemuConfig::Save(XMLConfigParser& parser)
|
||||||
audio.set("TVChannels", tv_channels);
|
audio.set("TVChannels", tv_channels);
|
||||||
audio.set("PadChannels", pad_channels);
|
audio.set("PadChannels", pad_channels);
|
||||||
audio.set("InputChannels", input_channels);
|
audio.set("InputChannels", input_channels);
|
||||||
|
audio.set("InputChannels", portal_channels);
|
||||||
audio.set("TVVolume", tv_volume);
|
audio.set("TVVolume", tv_volume);
|
||||||
audio.set("PadVolume", pad_volume);
|
audio.set("PadVolume", pad_volume);
|
||||||
audio.set("InputVolume", input_volume);
|
audio.set("InputVolume", input_volume);
|
||||||
|
audio.set("PortalVolume", portal_volume);
|
||||||
audio.set("TVDevice", boost::nowide::narrow(tv_device).c_str());
|
audio.set("TVDevice", boost::nowide::narrow(tv_device).c_str());
|
||||||
audio.set("PadDevice", boost::nowide::narrow(pad_device).c_str());
|
audio.set("PadDevice", boost::nowide::narrow(pad_device).c_str());
|
||||||
audio.set("InputDevice", boost::nowide::narrow(input_device).c_str());
|
audio.set("InputDevice", boost::nowide::narrow(input_device).c_str());
|
||||||
|
audio.set("PortalDevice", boost::nowide::narrow(portal_device).c_str());
|
||||||
|
|
||||||
// account
|
// account
|
||||||
auto acc = config.set("Account");
|
auto acc = config.set("Account");
|
||||||
|
|
|
@ -1183,11 +1183,16 @@ void GeneralSettings2::OnVolumeChanged(wxCommandEvent& event)
|
||||||
g_padVolume = event.GetInt();
|
g_padVolume = event.GetInt();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else if (event.GetEventObject() == m_tv_volume)
|
||||||
{
|
{
|
||||||
if (g_tvAudio)
|
if (g_tvAudio)
|
||||||
g_tvAudio->SetVolume(event.GetInt());
|
g_tvAudio->SetVolume(event.GetInt());
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(g_portalAudio)
|
||||||
|
g_portalAudio->SetVolume(event.GetInt());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue