mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-07-13 18:58:29 +12:00
Add volume slider & mute audio settings
This commit is contained in:
parent
b251f84ab1
commit
3b6190b69a
7 changed files with 70 additions and 12 deletions
|
@ -99,6 +99,11 @@ void EmulatorConfig::load() {
|
|||
|
||||
audioEnabled = toml::find_or<toml::boolean>(audio, "EnableAudio", false);
|
||||
aacEnabled = toml::find_or<toml::boolean>(audio, "EnableAACAudio", true);
|
||||
|
||||
audioDeviceConfig.muteAudio = toml::find_or<toml::boolean>(audio, "MuteAudio", false);
|
||||
// Our volume ranges from 0.0 (muted) to 2.0 (boosted, using a logarithmic scale). 1.0 is the "default" volume, ie we don't adjust the PCM
|
||||
// samples at all.
|
||||
audioDeviceConfig.volumeRaw = float(std::clamp(toml::find_or<toml::floating>(audio, "AudioVolume", 1.0), 0.0, 2.0));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -170,6 +175,8 @@ void EmulatorConfig::save() {
|
|||
data["Audio"]["DSPEmulation"] = std::string(Audio::DSPCore::typeToString(dspType));
|
||||
data["Audio"]["EnableAudio"] = audioEnabled;
|
||||
data["Audio"]["EnableAACAudio"] = aacEnabled;
|
||||
data["Audio"]["MuteAudio"] = audioDeviceConfig.muteAudio;
|
||||
data["Audio"]["AudioVolume"] = double(audioDeviceConfig.volumeRaw);
|
||||
|
||||
data["Battery"]["ChargerPlugged"] = chargerPlugged;
|
||||
data["Battery"]["BatteryPercentage"] = batteryPercentage;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue