From de3e4cbcd057ffc62d3f8704ffdf57c863e56142 Mon Sep 17 00:00:00 2001 From: Raymond Baker Date: Tue, 25 Jan 2022 00:33:32 -0500 Subject: [PATCH] new modulator workflow fix formatting, and fix some nitpicks remove white space revert one nitpick change --- AUTHORS | 1 + src/surge-xt/gui/SurgeGUIEditorValueCallbacks.cpp | 12 +++++++++++- src/surge-xt/gui/widgets/ModulationSourceButton.cpp | 7 ++++++- src/surge-xt/gui/widgets/ModulationSourceButton.h | 1 + 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/AUTHORS b/AUTHORS index 895f46c6087..5d59db541a9 100644 --- a/AUTHORS +++ b/AUTHORS @@ -3,6 +3,7 @@ Claes Johanson Authors in the repository since 1.6 alpha was open-sourced (in alphabetical order): +Raymond Baker David Bata Alexandre Bique Hendrik van Boetzelaer diff --git a/src/surge-xt/gui/SurgeGUIEditorValueCallbacks.cpp b/src/surge-xt/gui/SurgeGUIEditorValueCallbacks.cpp index bd8efb06273..27ee8cf6b74 100644 --- a/src/surge-xt/gui/SurgeGUIEditorValueCallbacks.cpp +++ b/src/surge-xt/gui/SurgeGUIEditorValueCallbacks.cpp @@ -2520,6 +2520,7 @@ void SurgeGUIEditor::valueChanged(Surge::GUI::IComponentTagValue *control) int newindex = cms->getCurrentModIndex(); bool updated = false; + bool change_mod_view = true; if (cms->getMouseMode() == Surge::Widgets::ModulationSourceButton::CLICK) { updated = true; @@ -2582,6 +2583,15 @@ void SurgeGUIEditor::valueChanged(Surge::GUI::IComponentTagValue *control) modsource_index = newindex; refresh_mod(); } + else if (cms->getMouseMode() == Surge::Widgets::ModulationSourceButton::CLICK_ARROW || + cms->getMouseMode() == Surge::Widgets::ModulationSourceButton::CTRL_CLICK) + { + change_mod_view = false; + mod_editor = true; + modsource = newsource; + modsource_index = newindex; + refresh_mod(); + } if (updated && lfoDisplay && lfoDisplay->modsource == modsource) { @@ -2589,7 +2599,7 @@ void SurgeGUIEditor::valueChanged(Surge::GUI::IComponentTagValue *control) lfoDisplay->repaint(); } - if (isLFO(newsource)) + if (isLFO(newsource) && change_mod_view) { if (modsource_editor[current_scene] != newsource) { diff --git a/src/surge-xt/gui/widgets/ModulationSourceButton.cpp b/src/surge-xt/gui/widgets/ModulationSourceButton.cpp index 3daae20a58d..69238e06d2c 100644 --- a/src/surge-xt/gui/widgets/ModulationSourceButton.cpp +++ b/src/surge-xt/gui/widgets/ModulationSourceButton.cpp @@ -388,6 +388,11 @@ void ModulationSourceButton::mouseDown(const juce::MouseEvent &event) } } + if (event.mods.getCurrentModifiers().isCtrlDown()) + { + mouseMode = CTRL_CLICK; + } + mouseDownBounds = getBounds(); componentDragger.startDraggingComponent(this, event); } @@ -523,7 +528,7 @@ void ModulationSourceButton::mouseUp(const juce::MouseEvent &event) transientArmed = false; - if (mouseMode == CLICK || mouseMode == CLICK_ARROW) + if (mouseMode == CLICK || mouseMode == CLICK_ARROW || mouseMode == CTRL_CLICK) { notifyValueChanged(); } diff --git a/src/surge-xt/gui/widgets/ModulationSourceButton.h b/src/surge-xt/gui/widgets/ModulationSourceButton.h index 5ca48914969..1949b006ffc 100644 --- a/src/surge-xt/gui/widgets/ModulationSourceButton.h +++ b/src/surge-xt/gui/widgets/ModulationSourceButton.h @@ -185,6 +185,7 @@ struct ModulationSourceButton : public juce::Component, CLICK_TOGGLE_ARM, CLICK_SELECT_ONLY, CLICK_ARROW, + CTRL_CLICK, PREDRAG_VALUE, DRAG_VALUE, DRAG_COMPONENT_HAPPEN,