From e3e60b52b4e6ea35f60eb745cae2d2b1ad236874 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Nusser?= Date: Fri, 26 May 2017 01:01:26 +0200 Subject: Connect the bleed control frame switch and add settings value for that. --- plugin/drumgizmo_plugin.cc | 7 +++++++ plugingui/maintab.cc | 9 ++++++++- plugingui/maintab.h | 1 + src/settings.h | 5 +++++ 4 files changed, 21 insertions(+), 1 deletion(-) 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()) + "\n" " " + bool2str(settings.disk_cache_enable.load()) + "\n" + " " + + bool2str(settings.enable_bleed_control.load()) + "\n" " " + float2str(settings.master_bleed.load()) + "\n" ""; @@ -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 number_of_files_loaded{0}; Atomic current_file{""}; + Atomic enable_bleed_control{false}; Atomic master_bleed{1.0f}; }; @@ -126,6 +127,7 @@ struct SettingsGetter SettingRef number_of_files_loaded; SettingRef current_file; + SettingRef enable_bleed_control; SettingRef 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 number_of_files_loaded; Notifier current_file; + Notifier enable_bleed_control; Notifier master_bleed; void evaluate() @@ -235,6 +239,7 @@ public: EVAL(number_of_files_loaded); EVAL(current_file); + EVAL(enable_bleed_control); EVAL(master_bleed); } -- cgit v1.2.3