Skip to content

Commit

Permalink
setup dx7 when dx oscillator selected (#3004)
Browse files Browse the repository at this point in the history
  • Loading branch information
m-m-adams authored and web-flow committed Dec 3, 2024
1 parent 7c3491f commit c4e8c9f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/deluge/gui/menu_item/osc/type.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down
3 changes: 3 additions & 0 deletions src/deluge/processing/source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,9 @@ void Source::setOscType(OscType newType) {
}

oscType = newType;
if (oscType == OscType::DX7) {
ensureDxPatch();
}
}

DxPatch* Source::ensureDxPatch() {
Expand Down

0 comments on commit c4e8c9f

Please sign in to comment.