Skip to content

Commit

Permalink
Feature/fm filters (#665)
Browse files Browse the repository at this point in the history
* Fixed Sticky Shift Conflict (#661)

Fixed conflict when Sticky Shift functionality is enabled with the Shift Acceleration that was added in #636

Fixed it by calling isButtonPressed instead of isShiftButtonPressed in order to check if the Shift button is actually being pressed rather than "stickily pressed."

* enable filters for testing

---------

Co-authored-by: Sean Ditny <[email protected]>
  • Loading branch information
m-m-adams and seangoodvibes authored Nov 1, 2023
1 parent b3a305f commit c9c64d2
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 9 deletions.
4 changes: 1 addition & 3 deletions src/deluge/gui/menu_item/filter/lpf_mode.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ class LPFMode final : public Selection {
l10n::getView(STRING_FOR_SVF_NOTCH),
};
}
bool isRelevant(Sound* sound, int32_t whichThing) override {
return ((sound == nullptr) || sound->synthMode != ::SynthMode::FM);
}
bool isRelevant(Sound* sound, int32_t whichThing) override { return (true); }
};
} // namespace deluge::gui::menu_item::filter
2 changes: 1 addition & 1 deletion src/deluge/gui/menu_item/patched_param/integer_non_fm.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ namespace deluge::gui::menu_item::patched_param {
class IntegerNonFM : public Integer {
public:
using Integer::Integer;
bool isRelevant(Sound* sound, int32_t whichThing) override { return (sound->synthMode != SynthMode::FM); }
bool isRelevant(Sound* sound, int32_t whichThing) override { return (true); }
};
} // namespace deluge::gui::menu_item::patched_param
2 changes: 1 addition & 1 deletion src/deluge/gui/menu_item/submenu/filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace deluge::gui::menu_item::submenu {
class Filter final : public Submenu {
public:
using Submenu::Submenu;
bool isRelevant(Sound* sound, int32_t whichThing) override { return (sound->synthMode != SynthMode::FM); }
bool isRelevant(Sound* sound, int32_t whichThing) override { return (true); }
};

} // namespace deluge::gui::menu_item::submenu
2 changes: 1 addition & 1 deletion src/deluge/gui/ui/sound_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ ActionResult SoundEditor::horizontalEncoderAction(int32_t offset) {

void SoundEditor::selectEncoderAction(int8_t offset) {

if (Buttons::isShiftButtonPressed()) {
if (Buttons::isButtonPressed(deluge::hid::button::SHIFT)) {
offset = offset * 5;
}

Expand Down
6 changes: 3 additions & 3 deletions src/deluge/processing/sound/sound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1304,14 +1304,14 @@ PatchCableAcceptance Sound::maySourcePatchToParam(PatchSource s, uint8_t p, Para
case Param::Local::LPF_FREQ:
case Param::Local::LPF_RESONANCE:
if (synthMode == SynthMode::FM) {
return PatchCableAcceptance::DISALLOWED;
//return PatchCableAcceptance::DISALLOWED;
}
break;

case Param::Local::HPF_FREQ:
case Param::Local::HPF_RESONANCE:
if (synthMode == SynthMode::FM) {
return PatchCableAcceptance::DISALLOWED;
//return PatchCableAcceptance::DISALLOWED;
}
break;

Expand Down Expand Up @@ -2916,7 +2916,7 @@ bool Sound::anyNoteIsOn() {
}

bool Sound::hasFilters() {
return (getSynthMode() != SynthMode::FM);
return true;
}

void Sound::readParamsFromFile(ParamManagerForTimeline* paramManager, int32_t readAutomationUpToPos) {
Expand Down

0 comments on commit c9c64d2

Please sign in to comment.