diff options
Diffstat (limited to 'src/common/settings.h')
| -rw-r--r-- | src/common/settings.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/common/settings.h b/src/common/settings.h index 0ac5078c6..d4b41a162 100644 --- a/src/common/settings.h +++ b/src/common/settings.h | |||
| @@ -244,6 +244,8 @@ protected: | |||
| 244 | return value_.has_value() ? std::to_string(*value_) : "none"; | 244 | return value_.has_value() ? std::to_string(*value_) : "none"; |
| 245 | } else if constexpr (std::is_same<Type, bool>()) { | 245 | } else if constexpr (std::is_same<Type, bool>()) { |
| 246 | return value_ ? "true" : "false"; | 246 | return value_ ? "true" : "false"; |
| 247 | } else if (std::is_same<Type, AudioEngine>()) { | ||
| 248 | return TranslateEnum(value_); | ||
| 247 | } else { | 249 | } else { |
| 248 | return std::to_string(static_cast<u64>(value_)); | 250 | return std::to_string(static_cast<u64>(value_)); |
| 249 | } | 251 | } |
| @@ -309,6 +311,8 @@ public: | |||
| 309 | this->SetValue(static_cast<u32>(std::stoul(input))); | 311 | this->SetValue(static_cast<u32>(std::stoul(input))); |
| 310 | } else if constexpr (std::is_same<Type, bool>()) { | 312 | } else if constexpr (std::is_same<Type, bool>()) { |
| 311 | this->SetValue(input == "true"); | 313 | this->SetValue(input == "true"); |
| 314 | } else if constexpr (std::is_same<Type, AudioEngine>()) { | ||
| 315 | this->SetValue(ToEnum<Type>(input)); | ||
| 312 | } else { | 316 | } else { |
| 313 | this->SetValue(static_cast<Type>(std::stoll(input))); | 317 | this->SetValue(static_cast<Type>(std::stoll(input))); |
| 314 | } | 318 | } |
| @@ -542,7 +546,7 @@ struct Values { | |||
| 542 | Linkage linkage{}; | 546 | Linkage linkage{}; |
| 543 | 547 | ||
| 544 | // Audio | 548 | // Audio |
| 545 | Setting<std::string> sink_id{linkage, "auto", "output_engine", Category::Audio}; | 549 | Setting<AudioEngine> sink_id{linkage, AudioEngine::Auto, "output_engine", Category::Audio}; |
| 546 | Setting<std::string> audio_output_device_id{linkage, "auto", "output_device", Category::Audio}; | 550 | Setting<std::string> audio_output_device_id{linkage, "auto", "output_device", Category::Audio}; |
| 547 | Setting<std::string> audio_input_device_id{linkage, "auto", "input_device", Category::Audio}; | 551 | Setting<std::string> audio_input_device_id{linkage, "auto", "input_device", Category::Audio}; |
| 548 | Setting<bool, false> audio_muted{linkage, false, "audio_muted", Category::Audio, false}; | 552 | Setting<bool, false> audio_muted{linkage, false, "audio_muted", Category::Audio, false}; |
| @@ -731,8 +735,9 @@ struct Values { | |||
| 731 | SwitchableSetting<TimeZone, true> time_zone_index{linkage, TimeZone::Auto, | 735 | SwitchableSetting<TimeZone, true> time_zone_index{linkage, TimeZone::Auto, |
| 732 | TimeZone::Auto, TimeZone::Zulu, | 736 | TimeZone::Auto, TimeZone::Zulu, |
| 733 | "time_zone_index", Category::System}; | 737 | "time_zone_index", Category::System}; |
| 734 | SwitchableSetting<s32, true> sound_index{ | 738 | SwitchableSetting<AudioMode, true> sound_index{linkage, AudioMode::Stereo, |
| 735 | linkage, 1, 0, 2, "sound_index", Category::SystemAudio}; | 739 | AudioMode::Mono, AudioMode::Surround, |
| 740 | "sound_index", Category::SystemAudio}; | ||
| 736 | 741 | ||
| 737 | SwitchableSetting<bool> use_docked_mode{linkage, true, "use_docked_mode", Category::System}; | 742 | SwitchableSetting<bool> use_docked_mode{linkage, true, "use_docked_mode", Category::System}; |
| 738 | 743 | ||