From a1ef4f23a5a8cc8f7207e160e56cca0fec0f37c6 Mon Sep 17 00:00:00 2001 From: m-m-adams Date: Sun, 1 Dec 2024 22:27:58 -0500 Subject: [PATCH] setup dx7 when dx oscillator selected --- src/deluge/gui/menu_item/osc/type.h | 3 ++- src/deluge/processing/source.cpp | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/deluge/gui/menu_item/osc/type.h b/src/deluge/gui/menu_item/osc/type.h index d44889e3cb..9b6d5d6d3e 100644 --- a/src/deluge/gui/menu_item/osc/type.h +++ b/src/deluge/gui/menu_item/osc/type.h @@ -34,7 +34,7 @@ class Type final : public Selection, public FormattedTitle { Type(l10n::String name, l10n::String title_format_str) : Selection(name), FormattedTitle(title_format_str){}; void beginSession(MenuItem* navigatedBackwardFrom) override { Selection::beginSession(navigatedBackwardFrom); } - bool mayUseDx() { return soundEditor.currentSource->dxPatch != nullptr; } + bool mayUseDx() { return !soundEditor.editingKit(); } void readCurrentValue() override { int32_t rawVal = (int32_t)soundEditor.currentSource->oscType; @@ -67,6 +67,7 @@ class Type final : public Selection, public FormattedTitle { } soundEditor.currentSource->setOscType(newValue); + if (oldValue == OscType::SQUARE || newValue == OscType::SQUARE) { soundEditor.currentSound->setupPatchingForAllParamManagers(currentSong); } diff --git a/src/deluge/processing/source.cpp b/src/deluge/processing/source.cpp index 7960172db5..f39796e796 100644 --- a/src/deluge/processing/source.cpp +++ b/src/deluge/processing/source.cpp @@ -284,6 +284,9 @@ void Source::setOscType(OscType newType) { } oscType = newType; + if (oscType == OscType::DX7) { + ensureDxPatch(); + } } DxPatch* Source::ensureDxPatch() {