diff options
Diffstat (limited to 'src/yuzu/configuration/config.cpp')
-rw-r--r-- | src/yuzu/configuration/config.cpp | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp index 9686412d0..1f76e86b9 100644 --- a/src/yuzu/configuration/config.cpp +++ b/src/yuzu/configuration/config.cpp @@ -143,8 +143,8 @@ void Config::ReadBasicSetting(Settings::Setting<std::string>& setting) { } } -template <typename Type> -void Config::ReadBasicSetting(Settings::Setting<Type>& setting) { +template <typename Type, bool ranged> +void Config::ReadBasicSetting(Settings::Setting<Type, ranged>& setting) { const QString name = QString::fromStdString(setting.GetLabel()); const Type default_value = setting.GetDefault(); if (qt_config->value(name + QStringLiteral("/default"), false).toBool()) { @@ -164,16 +164,16 @@ void Config::WriteBasicSetting(const Settings::Setting<std::string>& setting) { qt_config->setValue(name, QString::fromStdString(value)); } -template <typename Type> -void Config::WriteBasicSetting(const Settings::Setting<Type>& setting) { +template <typename Type, bool ranged> +void Config::WriteBasicSetting(const Settings::Setting<Type, ranged>& setting) { const QString name = QString::fromStdString(setting.GetLabel()); const Type value = setting.GetValue(); qt_config->setValue(name + QStringLiteral("/default"), value == setting.GetDefault()); qt_config->setValue(name, value); } -template <typename Type> -void Config::WriteGlobalSetting(const Settings::SwitchableSetting<Type>& setting) { +template <typename Type, bool ranged> +void Config::WriteGlobalSetting(const Settings::SwitchableSetting<Type, ranged>& setting) { const QString name = QString::fromStdString(setting.GetLabel()); const Type& value = setting.GetValue(global); if (!global) { @@ -368,12 +368,18 @@ void Config::ReadHidbusValues() { } } +void Config::ReadIrCameraValues() { + ReadBasicSetting(Settings::values.enable_ir_sensor); + ReadBasicSetting(Settings::values.ir_sensor_device); +} + void Config::ReadAudioValues() { qt_config->beginGroup(QStringLiteral("Audio")); if (global) { - ReadBasicSetting(Settings::values.audio_device_id); ReadBasicSetting(Settings::values.sink_id); + ReadBasicSetting(Settings::values.audio_output_device_id); + ReadBasicSetting(Settings::values.audio_input_device_id); } ReadGlobalSetting(Settings::values.volume); @@ -392,6 +398,7 @@ void Config::ReadControlValues() { ReadTouchscreenValues(); ReadMotionTouchValues(); ReadHidbusValues(); + ReadIrCameraValues(); #ifdef _WIN32 ReadBasicSetting(Settings::values.enable_raw_input); @@ -668,7 +675,6 @@ void Config::ReadRendererValues() { ReadGlobalSetting(Settings::values.max_anisotropy); ReadGlobalSetting(Settings::values.use_speed_limit); ReadGlobalSetting(Settings::values.speed_limit); - ReadGlobalSetting(Settings::values.fps_cap); ReadGlobalSetting(Settings::values.use_disk_shader_cache); ReadGlobalSetting(Settings::values.gpu_accuracy); ReadGlobalSetting(Settings::values.use_asynchronous_gpu_emulation); @@ -1005,6 +1011,11 @@ void Config::SaveHidbusValues() { QString::fromStdString(default_param)); } +void Config::SaveIrCameraValues() { + WriteBasicSetting(Settings::values.enable_ir_sensor); + WriteBasicSetting(Settings::values.ir_sensor_device); +} + void Config::SaveValues() { if (global) { SaveControlValues(); @@ -1028,7 +1039,8 @@ void Config::SaveAudioValues() { if (global) { WriteBasicSetting(Settings::values.sink_id); - WriteBasicSetting(Settings::values.audio_device_id); + WriteBasicSetting(Settings::values.audio_output_device_id); + WriteBasicSetting(Settings::values.audio_input_device_id); } WriteGlobalSetting(Settings::values.volume); @@ -1046,6 +1058,7 @@ void Config::SaveControlValues() { SaveTouchscreenValues(); SaveMotionTouchValues(); SaveHidbusValues(); + SaveIrCameraValues(); WriteGlobalSetting(Settings::values.use_docked_mode); WriteGlobalSetting(Settings::values.vibration_enabled); @@ -1237,7 +1250,6 @@ void Config::SaveRendererValues() { WriteGlobalSetting(Settings::values.max_anisotropy); WriteGlobalSetting(Settings::values.use_speed_limit); WriteGlobalSetting(Settings::values.speed_limit); - WriteGlobalSetting(Settings::values.fps_cap); WriteGlobalSetting(Settings::values.use_disk_shader_cache); WriteSetting(QString::fromStdString(Settings::values.gpu_accuracy.GetLabel()), static_cast<u32>(Settings::values.gpu_accuracy.GetValue(global)), @@ -1421,8 +1433,8 @@ QVariant Config::ReadSetting(const QString& name, const QVariant& default_value) return result; } -template <typename Type> -void Config::ReadGlobalSetting(Settings::SwitchableSetting<Type>& setting) { +template <typename Type, bool ranged> +void Config::ReadGlobalSetting(Settings::SwitchableSetting<Type, ranged>& setting) { QString name = QString::fromStdString(setting.GetLabel()); const bool use_global = qt_config->value(name + QStringLiteral("/use_global"), true).toBool(); setting.SetGlobal(use_global); |