From 432f68ad29df7a368ba375d75d667c954e9c80b9 Mon Sep 17 00:00:00 2001 From: lat9nq <22451773+lat9nq@users.noreply.github.com> Date: Thu, 18 May 2023 17:54:22 -0400 Subject: configure_audio: Implement ui generation Needs a considerable amount of management specific to some of the comoboboxes due to the audio engine configuration. general: Partial audio config implmentation configure_audio: Implement ui generation Needs a considerable amount of management specific to some of the comoboboxes due to the audio engine configuration. general: Partial audio config implmentation settings: Make audio settings as enums --- src/common/settings.cpp | 2 +- src/common/settings.h | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'src/common') diff --git a/src/common/settings.cpp b/src/common/settings.cpp index c8651925e..8bfda5667 100644 --- a/src/common/settings.cpp +++ b/src/common/settings.cpp @@ -90,7 +90,7 @@ void LogSettings() { log_setting("Renderer_ShaderBackend", values.shader_backend.GetValue()); log_setting("Renderer_UseAsynchronousShaders", values.use_asynchronous_shaders.GetValue()); log_setting("Renderer_AnisotropicFilteringLevel", values.max_anisotropy.GetValue()); - log_setting("Audio_OutputEngine", values.sink_id.GetValue()); + log_setting("Audio_OutputEngine", Settings::TranslateEnum(values.sink_id.GetValue())); log_setting("Audio_OutputDevice", values.audio_output_device_id.GetValue()); log_setting("Audio_InputDevice", values.audio_input_device_id.GetValue()); log_setting("DataStorage_UseVirtualSd", values.use_virtual_sd.GetValue()); 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: return value_.has_value() ? std::to_string(*value_) : "none"; } else if constexpr (std::is_same()) { return value_ ? "true" : "false"; + } else if (std::is_same()) { + return TranslateEnum(value_); } else { return std::to_string(static_cast(value_)); } @@ -309,6 +311,8 @@ public: this->SetValue(static_cast(std::stoul(input))); } else if constexpr (std::is_same()) { this->SetValue(input == "true"); + } else if constexpr (std::is_same()) { + this->SetValue(ToEnum(input)); } else { this->SetValue(static_cast(std::stoll(input))); } @@ -542,7 +546,7 @@ struct Values { Linkage linkage{}; // Audio - Setting sink_id{linkage, "auto", "output_engine", Category::Audio}; + Setting sink_id{linkage, AudioEngine::Auto, "output_engine", Category::Audio}; Setting audio_output_device_id{linkage, "auto", "output_device", Category::Audio}; Setting audio_input_device_id{linkage, "auto", "input_device", Category::Audio}; Setting audio_muted{linkage, false, "audio_muted", Category::Audio, false}; @@ -731,8 +735,9 @@ struct Values { SwitchableSetting time_zone_index{linkage, TimeZone::Auto, TimeZone::Auto, TimeZone::Zulu, "time_zone_index", Category::System}; - SwitchableSetting sound_index{ - linkage, 1, 0, 2, "sound_index", Category::SystemAudio}; + SwitchableSetting sound_index{linkage, AudioMode::Stereo, + AudioMode::Mono, AudioMode::Surround, + "sound_index", Category::SystemAudio}; SwitchableSetting use_docked_mode{linkage, true, "use_docked_mode", Category::System}; -- cgit v1.2.3