AudioPanel: Refactor to use Config system. Some options were changed to a different format, for easier compatibility.

Removed VolumeChanged signal, as ConfigChanged will trigger what is needed.

Only applies UpdateSoundStream to things that can change during emulation.

Settings::SetVolume might no longer be used, but left it in.
This commit is contained in:
TryTwo
2025-03-26 12:26:01 -07:00
parent 1981f22228
commit 896b4bb1fa
5 changed files with 156 additions and 306 deletions
+1 -1
View File
@@ -5,7 +5,7 @@
namespace AudioCommon
{
enum class DPL2Quality
enum class DPL2Quality : int
{
Lowest = 0,
Low = 1,
-5
View File
@@ -438,22 +438,17 @@ int Settings::GetVolume() const
void Settings::SetVolume(int volume)
{
if (GetVolume() != volume)
{
Config::SetBaseOrCurrent(Config::MAIN_AUDIO_VOLUME, volume);
emit VolumeChanged(volume);
}
}
void Settings::IncreaseVolume(int volume)
{
AudioCommon::IncreaseVolume(Core::System::GetInstance(), volume);
emit VolumeChanged(GetVolume());
}
void Settings::DecreaseVolume(int volume)
{
AudioCommon::DecreaseVolume(Core::System::GetInstance(), volume);
emit VolumeChanged(GetVolume());
}
bool Settings::IsLogVisible() const
-1
View File
@@ -197,7 +197,6 @@ signals:
void CursorVisibilityChanged();
void LockCursorChanged();
void KeepWindowOnTopChanged(bool top);
void VolumeChanged(int volume);
void NANDRefresh();
void RegistersVisibilityChanged(bool visible);
void ThreadsVisibilityChanged(bool visible);
File diff suppressed because it is too large Load Diff
+16 -24
View File
@@ -10,13 +10,15 @@ namespace AudioCommon
enum class DPL2Quality;
}
class QCheckBox;
class QComboBox;
class ConfigBool;
class ConfigChoice;
class ConfigComplexChoice;
class ConfigRadioBool;
class ConfigSlider;
class ConfigStringChoice;
class QHBoxLayout;
class QLabel;
class QRadioButton;
class QSlider;
class QSpinBox;
class SettingsWindow;
class ConfigBool;
@@ -29,47 +31,37 @@ public:
private:
void CreateWidgets();
void ConnectWidgets();
void LoadSettings();
void SaveSettings();
void AddDescriptions();
void OnEmulationStateChanged(bool running);
void OnBackendChanged();
void OnDspChanged();
void OnVolumeChanged(int volume);
void CheckNeedForLatencyControl();
bool m_latency_control_supported;
QString GetDPL2QualityLabel(AudioCommon::DPL2Quality value) const;
QString GetDPL2ApproximateLatencyLabel(AudioCommon::DPL2Quality value) const;
void EnableDolbyQualityWidgets(bool enabled) const;
QHBoxLayout* m_main_layout;
// DSP Engine
QRadioButton* m_dsp_hle;
QRadioButton* m_dsp_lle;
QRadioButton* m_dsp_interpreter;
ConfigComplexChoice* m_dsp_combo;
// Volume
QSlider* m_volume_slider;
ConfigSlider* m_volume_slider;
QLabel* m_volume_indicator;
// Backend
QLabel* m_backend_label;
QComboBox* m_backend_combo;
QCheckBox* m_dolby_pro_logic;
ConfigStringChoice* m_backend_combo;
ConfigBool* m_dolby_pro_logic;
QLabel* m_dolby_quality_label;
QSlider* m_dolby_quality_slider;
QLabel* m_dolby_quality_low_label;
QLabel* m_dolby_quality_highest_label;
QLabel* m_dolby_quality_latency_label;
ConfigChoice* m_dolby_quality_combo;
QLabel* m_latency_label;
QSpinBox* m_latency_spin;
ConfigSlider* m_latency_slider;
#ifdef _WIN32
QLabel* m_wasapi_device_label;
QComboBox* m_wasapi_device_combo;
ConfigStringChoice* m_wasapi_device_combo;
#endif
// Misc Settings