diff options
-rw-r--r-- | plugin/drumgizmo_plugin.cc | 7 | ||||
-rw-r--r-- | plugingui/maintab.cc | 9 | ||||
-rw-r--r-- | plugingui/maintab.h | 1 | ||||
-rw-r--r-- | src/settings.h | 5 |
4 files changed, 21 insertions, 1 deletions
diff --git a/plugin/drumgizmo_plugin.cc b/plugin/drumgizmo_plugin.cc index 641faac..debe630 100644 --- a/plugin/drumgizmo_plugin.cc +++ b/plugin/drumgizmo_plugin.cc @@ -565,6 +565,8 @@ std::string DrumGizmoPlugin::ConfigStringIO::get() int2str(settings.disk_cache_chunk_size.load()) + "</value>\n" " <value name=\"disk_cache_enable\">" + bool2str(settings.disk_cache_enable.load()) + "</value>\n" + " <value name=\"enable_bleed_control\">" + + bool2str(settings.enable_bleed_control.load()) + "</value>\n" " <value name=\"master_bleed\">" + float2str(settings.master_bleed.load()) + "</value>\n" "</config>"; @@ -626,6 +628,11 @@ bool DrumGizmoPlugin::ConfigStringIO::set(std::string config_string) settings.disk_cache_enable.store(p.value("disk_cache_enable") == "true"); } + if(p.value("enable_bleed_control") != "") + { + settings.enable_bleed_control.store(p.value("enable_bleed_control") == "true"); + } + if(p.value("master_bleed") != "") { settings.master_bleed.store(str2float(p.value("master_bleed"))); diff --git a/plugingui/maintab.cc b/plugingui/maintab.cc index 8bc4962..8b6e478 100644 --- a/plugingui/maintab.cc +++ b/plugingui/maintab.cc @@ -54,6 +54,7 @@ MainTab::MainTab(Widget* parent, add("Resampling", resampling_frame, resamplingframe_content, 14, 1); humanizer_frame.setOnSwitch(settings.enable_velocity_modifier); + bleedcontrol_frame.setOnSwitch(settings.enable_bleed_control); resampling_frame.setOnSwitch(settings.enable_resampling); CONNECT(this, settings_notifier.enable_velocity_modifier, @@ -62,7 +63,8 @@ MainTab::MainTab(Widget* parent, &resampling_frame, &FrameWidget::setOnSwitch); CONNECT(&humanizer_frame, onSwitchChangeNotifier, this, &MainTab::humanizerOnChange); - // TODO: Connect bleed control switch to settings + CONNECT(&bleedcontrol_frame, onSwitchChangeNotifier, + this, &MainTab::bleedcontrolOnChange); CONNECT(&resampling_frame, onSwitchChangeNotifier, this, &MainTab::resamplingOnChange); } @@ -82,6 +84,11 @@ void MainTab::humanizerOnChange(bool on) settings.enable_velocity_modifier.store(on); } +void MainTab::bleedcontrolOnChange(bool on) +{ + settings.enable_bleed_control.store(on); +} + void MainTab::resamplingOnChange(bool on) { settings.enable_resampling.store(on); diff --git a/plugingui/maintab.h b/plugingui/maintab.h index de78474..ce1e5b4 100644 --- a/plugingui/maintab.h +++ b/plugingui/maintab.h @@ -57,6 +57,7 @@ public: private: void humanizerOnChange(bool on); + void bleedcontrolOnChange(bool on); void resamplingOnChange(bool on); Image logo{":resources/logo.png"}; diff --git a/src/settings.h b/src/settings.h index b23f919..89f898c 100644 --- a/src/settings.h +++ b/src/settings.h @@ -87,6 +87,7 @@ struct Settings Atomic<std::size_t> number_of_files_loaded{0}; Atomic<std::string> current_file{""}; + Atomic<bool> enable_bleed_control{false}; Atomic<float> master_bleed{1.0f}; }; @@ -126,6 +127,7 @@ struct SettingsGetter SettingRef<std::size_t> number_of_files_loaded; SettingRef<std::string> current_file; + SettingRef<bool> enable_bleed_control; SettingRef<float> master_bleed; SettingsGetter(Settings& settings) @@ -154,6 +156,7 @@ struct SettingsGetter , number_of_files{settings.number_of_files} , number_of_files_loaded{settings.number_of_files_loaded} , current_file{settings.current_file} + , enable_bleed_control{settings.enable_bleed_control} , master_bleed{settings.master_bleed} { } @@ -196,6 +199,7 @@ public: Notifier<std::size_t> number_of_files_loaded; Notifier<std::string> current_file; + Notifier<bool> enable_bleed_control; Notifier<float> master_bleed; void evaluate() @@ -235,6 +239,7 @@ public: EVAL(number_of_files_loaded); EVAL(current_file); + EVAL(enable_bleed_control); EVAL(master_bleed); } |