zynaddsubfx

ZynAddSubFX open source synthesizer
Log | Files | Refs | Submodules | LICENSE

commit 41b3fe33c85a9daaa92807112383f7c2bd987dce
parent fa6232fbce625cf9a160eaa4a67e0595d0fed53a
Author: fundamental <[email protected]>
Date:   Thu, 29 Jun 2017 13:08:32 -0400

Connect Plugin Parameters To Automation Slots

Diffstat:
Msrc/Plugin/ZynAddSubFX/ZynAddSubFX.cpp | 13+++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/Plugin/ZynAddSubFX/ZynAddSubFX.cpp b/src/Plugin/ZynAddSubFX/ZynAddSubFX.cpp @@ -228,7 +228,7 @@ protected: } if(kParamSlot1 <= index && index <= kParamSlot16) { parameter.hints = kParameterIsAutomable; - parameter.name = ("Automation Slot " + zyn::to_s(index)).c_str(); + parameter.name = ("Slot " + zyn::to_s(index)).c_str(); parameter.symbol = ("slot" + zyn::to_s(index)).c_str(); parameter.unit = ""; parameter.ranges.min = 0.0f; @@ -247,9 +247,11 @@ protected: { case kParamOscPort: return oscPort; - default: - return 0.0f; } + if(kParamSlot1 <= index && index <= kParamSlot16) { + return master->automate.getSlot(index - 1); + } + return 0.0f; } /** @@ -258,9 +260,12 @@ protected: When a parameter is marked as automable, you must ensure no non-realtime operations are performed. @note This function will only be called for parameter inputs. */ - void setParameterValue(uint32_t /*index*/, float /*value*/) noexcept override + void setParameterValue(uint32_t index, float value) noexcept override { // only an output port for now + if(kParamSlot1 <= index && index <= kParamSlot16) { + master->automate.setSlot(index - 1, value); + } } /* --------------------------------------------------------------------------------------------------------