| @@ -578,7 +578,7 @@ CarlaPlugin::ProtectedData::ProtectedData(CarlaEngine* const eng, const uint idx | |||
| postRtEvents(), | |||
| postUiEvents() | |||
| #ifndef BUILD_BRIDGE | |||
| , postProc(), | |||
| , postProc() | |||
| #endif | |||
| {} | |||
| @@ -25,13 +25,13 @@ VectorJuicePlugin::VectorJuicePlugin() | |||
| : Plugin(paramCount, 1, 0) // 1 program, 0 states | |||
| { | |||
| // set default values | |||
| d_setProgram(0); | |||
| loadProgram(0); | |||
| } | |||
| // ----------------------------------------------------------------------- | |||
| // Init | |||
| void VectorJuicePlugin::d_initParameter(uint32_t index, Parameter& parameter) | |||
| void VectorJuicePlugin::initParameter(uint32_t index, Parameter& parameter) | |||
| { | |||
| switch (index) | |||
| { | |||
| @@ -190,7 +190,7 @@ void VectorJuicePlugin::d_initParameter(uint32_t index, Parameter& parameter) | |||
| } | |||
| } | |||
| void VectorJuicePlugin::d_initProgramName(uint32_t index, d_string& programName) | |||
| void VectorJuicePlugin::initProgramName(uint32_t index, String& programName) | |||
| { | |||
| if (index != 0) | |||
| return; | |||
| @@ -201,7 +201,7 @@ void VectorJuicePlugin::d_initProgramName(uint32_t index, d_string& programName) | |||
| // ----------------------------------------------------------------------- | |||
| // Internal data | |||
| float VectorJuicePlugin::d_getParameterValue(uint32_t index) const | |||
| float VectorJuicePlugin::getParameterValue(uint32_t index) const | |||
| { | |||
| switch (index) | |||
| { | |||
| @@ -244,7 +244,7 @@ float VectorJuicePlugin::d_getParameterValue(uint32_t index) const | |||
| } | |||
| } | |||
| void VectorJuicePlugin::d_setParameterValue(uint32_t index, float value) | |||
| void VectorJuicePlugin::setParameterValue(uint32_t index, float value) | |||
| { | |||
| bool resetPhase = false; | |||
| @@ -304,7 +304,7 @@ void VectorJuicePlugin::d_setParameterValue(uint32_t index, float value) | |||
| } | |||
| } | |||
| void VectorJuicePlugin::d_setProgram(uint32_t index) | |||
| void VectorJuicePlugin::loadProgram(uint32_t index) | |||
| { | |||
| if (index != 0) | |||
| return; | |||
| @@ -325,13 +325,13 @@ void VectorJuicePlugin::d_setProgram(uint32_t index) | |||
| orbitPhaseY = 1.0f; | |||
| /* reset filter values */ | |||
| d_activate(); | |||
| activate(); | |||
| } | |||
| // ----------------------------------------------------------------------- | |||
| // Process | |||
| void VectorJuicePlugin::d_activate() | |||
| void VectorJuicePlugin::activate() | |||
| { | |||
| /* Default variable values */ | |||
| orbitX=orbitY=orbitTX=orbitTY=0.5; | |||
| @@ -349,7 +349,7 @@ void VectorJuicePlugin::d_activate() | |||
| } | |||
| } | |||
| void VectorJuicePlugin::d_run(const float** inputs, float** outputs, uint32_t frames) | |||
| void VectorJuicePlugin::run(const float** inputs, float** outputs, uint32_t frames) | |||
| { | |||
| float out1, out2, tX, tY; | |||
| @@ -97,8 +97,8 @@ public: | |||
| void animate() | |||
| { | |||
| //sync orbit with frame, bpm | |||
| const TimePosition& time(d_getTimePosition()); | |||
| bar = ((120.0/(time.bbt.valid ? time.bbt.beatsPerMinute : 120.0))*(d_getSampleRate())); | |||
| const TimePosition& time(getTimePosition()); | |||
| bar = ((120.0/(time.bbt.valid ? time.bbt.beatsPerMinute : 120.0))*(getSampleRate())); | |||
| int multiplier = 16;//2000*4; | |||
| tickX = bar/(std::round(orbitSpeedX))*multiplier; | |||
| @@ -163,27 +163,27 @@ protected: | |||
| // ------------------------------------------------------------------- | |||
| // Information | |||
| const char* d_getLabel() const noexcept override | |||
| const char* getLabel() const noexcept override | |||
| { | |||
| return "VectorJuice"; | |||
| } | |||
| const char* d_getMaker() const noexcept override | |||
| const char* getMaker() const noexcept override | |||
| { | |||
| return "Andre Sklenar"; | |||
| } | |||
| const char* d_getLicense() const noexcept override | |||
| const char* getLicense() const noexcept override | |||
| { | |||
| return "GPL v2+"; | |||
| } | |||
| uint32_t d_getVersion() const noexcept override | |||
| uint32_t getVersion() const noexcept override | |||
| { | |||
| return 0x1000; | |||
| } | |||
| int64_t d_getUniqueId() const noexcept override | |||
| int64_t getUniqueId() const noexcept override | |||
| { | |||
| return d_cconst('V', 'e', 'c', 'J'); | |||
| } | |||
| @@ -191,21 +191,21 @@ protected: | |||
| // ------------------------------------------------------------------- | |||
| // Init | |||
| void d_initParameter(uint32_t index, Parameter& parameter) override; | |||
| void d_initProgramName(uint32_t index, d_string& programName) override; | |||
| void initParameter(uint32_t index, Parameter& parameter) override; | |||
| void initProgramName(uint32_t index, String& programName) override; | |||
| // ------------------------------------------------------------------- | |||
| // Internal data | |||
| float d_getParameterValue(uint32_t index) const override; | |||
| void d_setParameterValue(uint32_t index, float value) override; | |||
| void d_setProgram(uint32_t index) override; | |||
| float getParameterValue(uint32_t index) const override; | |||
| void setParameterValue(uint32_t index, float value) override; | |||
| void loadProgram(uint32_t index) override; | |||
| // ------------------------------------------------------------------- | |||
| // Process | |||
| void d_activate() override; | |||
| void d_run(const float** inputs, float** outputs, uint32_t frames) override; | |||
| void activate() override; | |||
| void run(const float** inputs, float** outputs, uint32_t frames) override; | |||
| // ------------------------------------------------------------------- | |||
| @@ -25,10 +25,8 @@ START_NAMESPACE_DISTRHO | |||
| // ----------------------------------------------------------------------- | |||
| VectorJuiceUI::VectorJuiceUI() | |||
| : UI() | |||
| #ifndef DISTRHO_OS_MAC | |||
| , fAboutWindow(this) | |||
| #endif | |||
| : UI(), | |||
| fAboutWindow(this) | |||
| { | |||
| setSize(VectorJuiceArtwork::backgroundWidth, VectorJuiceArtwork::backgroundHeight); | |||
| @@ -57,11 +55,9 @@ VectorJuiceUI::VectorJuiceUI() | |||
| //subOrbit | |||
| fImgSubOrbit = Image(VectorJuiceArtwork::subOrbitData, VectorJuiceArtwork::subOrbitWidth, VectorJuiceArtwork::subOrbitHeight); | |||
| #ifndef DISTRHO_OS_MAC | |||
| // about | |||
| Image aboutImage(VectorJuiceArtwork::aboutData, VectorJuiceArtwork::aboutWidth, VectorJuiceArtwork::aboutHeight, GL_BGR); | |||
| fAboutWindow.setImage(aboutImage); | |||
| #endif | |||
| // about button | |||
| Image aboutImageNormal(VectorJuiceArtwork::aboutButtonNormalData, VectorJuiceArtwork::aboutButtonNormalWidth, VectorJuiceArtwork::aboutButtonNormalHeight); | |||
| @@ -189,13 +185,13 @@ VectorJuiceUI::VectorJuiceUI() | |||
| fSliderOrbitPhaseY->setCallback(this); | |||
| // set default values | |||
| d_programChanged(0); | |||
| programLoaded(0); | |||
| } | |||
| // ----------------------------------------------------------------------- | |||
| // DSP Callbacks | |||
| void VectorJuiceUI::d_parameterChanged(uint32_t index, float value) | |||
| void VectorJuiceUI::parameterChanged(uint32_t index, float value) | |||
| { | |||
| switch (index) | |||
| { | |||
| @@ -279,7 +275,7 @@ void VectorJuiceUI::d_parameterChanged(uint32_t index, float value) | |||
| } | |||
| } | |||
| void VectorJuiceUI::d_programChanged(uint32_t index) | |||
| void VectorJuiceUI::programLoaded(uint32_t index) | |||
| { | |||
| if (index != 0) | |||
| return; | |||
| @@ -307,39 +303,37 @@ void VectorJuiceUI::imageButtonClicked(ImageButton* button, int) | |||
| if (button != fButtonAbout) | |||
| return; | |||
| #ifndef DISTRHO_OS_MAC | |||
| fAboutWindow.exec(); | |||
| #endif | |||
| } | |||
| void VectorJuiceUI::imageKnobDragStarted(ImageKnob* knob) | |||
| { | |||
| d_editParameter(knob->getId(), true); | |||
| editParameter(knob->getId(), true); | |||
| } | |||
| void VectorJuiceUI::imageKnobDragFinished(ImageKnob* knob) | |||
| { | |||
| d_editParameter(knob->getId(), false); | |||
| editParameter(knob->getId(), false); | |||
| } | |||
| void VectorJuiceUI::imageKnobValueChanged(ImageKnob* knob, float value) | |||
| { | |||
| d_setParameterValue(knob->getId(), value); | |||
| setParameterValue(knob->getId(), value); | |||
| } | |||
| void VectorJuiceUI::imageSliderDragStarted(ImageSlider* slider) | |||
| { | |||
| d_editParameter(slider->getId(), true); | |||
| editParameter(slider->getId(), true); | |||
| } | |||
| void VectorJuiceUI::imageSliderDragFinished(ImageSlider* slider) | |||
| { | |||
| d_editParameter(slider->getId(), false); | |||
| editParameter(slider->getId(), false); | |||
| } | |||
| void VectorJuiceUI::imageSliderValueChanged(ImageSlider* slider, float value) | |||
| { | |||
| d_setParameterValue(slider->getId(), value); | |||
| setParameterValue(slider->getId(), value); | |||
| } | |||
| void VectorJuiceUI::onDisplay() | |||
| @@ -441,14 +435,14 @@ bool VectorJuiceUI::onMotion(const MotionEvent& ev) | |||
| if (newX != paramX) | |||
| { | |||
| paramX = newX; | |||
| d_setParameterValue(VectorJuicePlugin::paramX, paramX); | |||
| setParameterValue(VectorJuicePlugin::paramX, paramX); | |||
| repaint(); | |||
| } | |||
| if (newY != paramY) | |||
| { | |||
| paramY = newY; | |||
| d_setParameterValue(VectorJuicePlugin::paramY, paramY); | |||
| setParameterValue(VectorJuicePlugin::paramY, paramY); | |||
| repaint(); | |||
| } | |||
| @@ -20,10 +20,7 @@ | |||
| #include "DistrhoUI.hpp" | |||
| #include "ImageAboutWindow.hpp" | |||
| #include "ImageButton.hpp" | |||
| #include "ImageKnob.hpp" | |||
| #include "ImageSlider.hpp" | |||
| #include "ImageWidgets.hpp" | |||
| #include "VectorJuiceArtwork.hpp" | |||
| @@ -49,8 +46,8 @@ protected: | |||
| // ------------------------------------------------------------------- | |||
| // DSP Callbacks | |||
| void d_parameterChanged(uint32_t index, float value) override; | |||
| void d_programChanged(uint32_t index) override; | |||
| void parameterChanged(uint32_t index, float value) override; | |||
| void programLoaded(uint32_t index) override; | |||
| // ------------------------------------------------------------------- | |||
| // Widget Callbacks | |||
| @@ -74,9 +71,7 @@ private: | |||
| Image fImgRoundlet; | |||
| Image fImgOrbit; | |||
| Image fImgSubOrbit; | |||
| #ifndef DISTRHO_OS_MAC | |||
| ImageAboutWindow fAboutWindow; | |||
| #endif | |||
| ScopedPointer<ImageButton> fButtonAbout; | |||
| @@ -25,13 +25,13 @@ WobbleJuicePlugin::WobbleJuicePlugin() | |||
| : Plugin(paramCount, 1, 0) // 1 program, 0 states | |||
| { | |||
| // set default values | |||
| d_setProgram(0); | |||
| loadProgram(0); | |||
| } | |||
| // ----------------------------------------------------------------------- | |||
| // Init | |||
| void WobbleJuicePlugin::d_initParameter(uint32_t index, Parameter& parameter) | |||
| void WobbleJuicePlugin::initParameter(uint32_t index, Parameter& parameter) | |||
| { | |||
| switch (index) | |||
| { | |||
| @@ -92,7 +92,7 @@ void WobbleJuicePlugin::d_initParameter(uint32_t index, Parameter& parameter) | |||
| } | |||
| } | |||
| void WobbleJuicePlugin::d_initProgramName(uint32_t index, d_string& programName) | |||
| void WobbleJuicePlugin::initProgramName(uint32_t index, String& programName) | |||
| { | |||
| if (index != 0) | |||
| return; | |||
| @@ -103,7 +103,7 @@ void WobbleJuicePlugin::d_initProgramName(uint32_t index, d_string& programName) | |||
| // ----------------------------------------------------------------------- | |||
| // Internal data | |||
| float WobbleJuicePlugin::d_getParameterValue(uint32_t index) const | |||
| float WobbleJuicePlugin::getParameterValue(uint32_t index) const | |||
| { | |||
| switch (index) | |||
| { | |||
| @@ -124,7 +124,7 @@ float WobbleJuicePlugin::d_getParameterValue(uint32_t index) const | |||
| } | |||
| } | |||
| void WobbleJuicePlugin::d_setParameterValue(uint32_t index, float value) | |||
| void WobbleJuicePlugin::setParameterValue(uint32_t index, float value) | |||
| { | |||
| switch (index) | |||
| { | |||
| @@ -149,7 +149,7 @@ void WobbleJuicePlugin::d_setParameterValue(uint32_t index, float value) | |||
| } | |||
| } | |||
| void WobbleJuicePlugin::d_setProgram(uint32_t index) | |||
| void WobbleJuicePlugin::loadProgram(uint32_t index) | |||
| { | |||
| if (index != 0) | |||
| return; | |||
| @@ -168,24 +168,24 @@ void WobbleJuicePlugin::d_setProgram(uint32_t index) | |||
| waveType=2.0f; | |||
| /* reset filter values */ | |||
| d_activate(); | |||
| activate(); | |||
| } | |||
| // ----------------------------------------------------------------------- | |||
| // Process | |||
| void WobbleJuicePlugin::d_activate() | |||
| void WobbleJuicePlugin::activate() | |||
| { | |||
| sinePos = 0.0; | |||
| } | |||
| void WobbleJuicePlugin::d_run(const float** inputs, float** outputs, uint32_t frames) | |||
| void WobbleJuicePlugin::run(const float** inputs, float** outputs, uint32_t frames) | |||
| { | |||
| //fetch the timepos struct from host; | |||
| const TimePosition& time(d_getTimePosition()); | |||
| const TimePosition& time(getTimePosition()); | |||
| /* sample count for one bar */ | |||
| bar = ((120.0/(time.bbt.valid ? time.bbt.beatsPerMinute : 120.0))*(d_getSampleRate())); //ONE, two, three, four | |||
| bar = ((120.0/(time.bbt.valid ? time.bbt.beatsPerMinute : 120.0))*(getSampleRate())); //ONE, two, three, four | |||
| tick = bar/(std::round(division)); //size of one target wob | |||
| phaseOffset = phase*M_PI; //2pi = 1 whole cycle | |||
| @@ -225,8 +225,8 @@ void WobbleJuicePlugin::d_run(const float** inputs, float** outputs, uint32_t fr | |||
| cutoffR = std::exp((std::log(range)-std::log(500))*currentPhaseR+std::log(500)); | |||
| //output filtered signal | |||
| filterL.recalc(cutoffL, reso*4, d_getSampleRate(), drive); | |||
| filterR.recalc(cutoffR, reso*4, d_getSampleRate(), drive); | |||
| filterL.recalc(cutoffL, reso*4, getSampleRate(), drive); | |||
| filterR.recalc(cutoffR, reso*4, getSampleRate(), drive); | |||
| filterL.process(frames, inputs[0], outputs[0]); | |||
| filterR.process(frames, inputs[1], outputs[1]); | |||
| } | |||
| @@ -79,27 +79,27 @@ protected: | |||
| // ------------------------------------------------------------------- | |||
| // Information | |||
| const char* d_getLabel() const noexcept override | |||
| const char* getLabel() const noexcept override | |||
| { | |||
| return "WobbleJuice"; | |||
| } | |||
| const char* d_getMaker() const noexcept override | |||
| const char* getMaker() const noexcept override | |||
| { | |||
| return "Andre Sklenar"; | |||
| } | |||
| const char* d_getLicense() const noexcept override | |||
| const char* getLicense() const noexcept override | |||
| { | |||
| return "GPL v2+"; | |||
| } | |||
| uint32_t d_getVersion() const noexcept override | |||
| uint32_t getVersion() const noexcept override | |||
| { | |||
| return 0x1000; | |||
| } | |||
| int64_t d_getUniqueId() const noexcept override | |||
| int64_t getUniqueId() const noexcept override | |||
| { | |||
| return d_cconst('W', 'b', 'l', 'J'); | |||
| } | |||
| @@ -107,21 +107,21 @@ protected: | |||
| // ------------------------------------------------------------------- | |||
| // Init | |||
| void d_initParameter(uint32_t index, Parameter& parameter) override; | |||
| void d_initProgramName(uint32_t index, d_string& programName) override; | |||
| void initParameter(uint32_t index, Parameter& parameter) override; | |||
| void initProgramName(uint32_t index, String& programName) override; | |||
| // ------------------------------------------------------------------- | |||
| // Internal data | |||
| float d_getParameterValue(uint32_t index) const override; | |||
| void d_setParameterValue(uint32_t index, float value) override; | |||
| void d_setProgram(uint32_t index) override; | |||
| float getParameterValue(uint32_t index) const override; | |||
| void setParameterValue(uint32_t index, float value) override; | |||
| void loadProgram(uint32_t index) override; | |||
| // ------------------------------------------------------------------- | |||
| // Process | |||
| void d_activate() override; | |||
| void d_run(const float** inputs, float** outputs, uint32_t frames) override; | |||
| void activate() override; | |||
| void run(const float** inputs, float** outputs, uint32_t frames) override; | |||
| // ------------------------------------------------------------------- | |||
| @@ -23,21 +23,17 @@ START_NAMESPACE_DISTRHO | |||
| // ----------------------------------------------------------------------- | |||
| WobbleJuiceUI::WobbleJuiceUI() | |||
| : UI() | |||
| #ifndef DISTRHO_OS_MAC | |||
| , fAboutWindow(this) | |||
| #endif | |||
| : UI(), | |||
| fAboutWindow(this) | |||
| { | |||
| setSize(WobbleJuiceArtwork::backgroundWidth, WobbleJuiceArtwork::backgroundHeight); | |||
| // background | |||
| fImgBackground = Image(WobbleJuiceArtwork::backgroundData, WobbleJuiceArtwork::backgroundWidth, WobbleJuiceArtwork::backgroundHeight, GL_BGR); | |||
| #ifndef DISTRHO_OS_MAC | |||
| // about | |||
| Image aboutImage(WobbleJuiceArtwork::aboutData, WobbleJuiceArtwork::aboutWidth, WobbleJuiceArtwork::aboutHeight, GL_BGR); | |||
| fAboutWindow.setImage(aboutImage); | |||
| #endif | |||
| // knobs | |||
| Image knobImage(WobbleJuiceArtwork::knobData, WobbleJuiceArtwork::knobWidth, WobbleJuiceArtwork::knobHeight); | |||
| @@ -105,13 +101,13 @@ WobbleJuiceUI::WobbleJuiceUI() | |||
| fButtonAbout->setCallback(this); | |||
| // set default values | |||
| d_programChanged(0); | |||
| programLoaded(0); | |||
| } | |||
| // ----------------------------------------------------------------------- | |||
| // DSP Callbacks | |||
| void WobbleJuiceUI::d_parameterChanged(uint32_t index, float value) | |||
| void WobbleJuiceUI::parameterChanged(uint32_t index, float value) | |||
| { | |||
| switch (index) | |||
| { | |||
| @@ -136,7 +132,7 @@ void WobbleJuiceUI::d_parameterChanged(uint32_t index, float value) | |||
| } | |||
| } | |||
| void WobbleJuiceUI::d_programChanged(uint32_t index) | |||
| void WobbleJuiceUI::programLoaded(uint32_t index) | |||
| { | |||
| if (index != 0) | |||
| return; | |||
| @@ -158,24 +154,22 @@ void WobbleJuiceUI::imageButtonClicked(ImageButton* button, int) | |||
| if (button != fButtonAbout) | |||
| return; | |||
| #ifndef DISTRHO_OS_MAC | |||
| fAboutWindow.exec(); | |||
| #endif | |||
| } | |||
| void WobbleJuiceUI::imageKnobDragStarted(ImageKnob* knob) | |||
| { | |||
| d_editParameter(knob->getId(), true); | |||
| editParameter(knob->getId(), true); | |||
| } | |||
| void WobbleJuiceUI::imageKnobDragFinished(ImageKnob* knob) | |||
| { | |||
| d_editParameter(knob->getId(), false); | |||
| editParameter(knob->getId(), false); | |||
| } | |||
| void WobbleJuiceUI::imageKnobValueChanged(ImageKnob* knob, float value) | |||
| { | |||
| d_setParameterValue(knob->getId(), value); | |||
| setParameterValue(knob->getId(), value); | |||
| } | |||
| void WobbleJuiceUI::onDisplay() | |||
| @@ -20,9 +20,7 @@ | |||
| #include "DistrhoUI.hpp" | |||
| #include "ImageAboutWindow.hpp" | |||
| #include "ImageButton.hpp" | |||
| #include "ImageKnob.hpp" | |||
| #include "ImageWidgets.hpp" | |||
| #include "WobbleJuiceArtwork.hpp" | |||
| @@ -46,8 +44,8 @@ protected: | |||
| // ------------------------------------------------------------------- | |||
| // DSP Callbacks | |||
| void d_parameterChanged(uint32_t index, float value) override; | |||
| void d_programChanged(uint32_t index) override; | |||
| void parameterChanged(uint32_t index, float value) override; | |||
| void programLoaded(uint32_t index) override; | |||
| // ------------------------------------------------------------------- | |||
| // Widget Callbacks | |||
| @@ -61,9 +59,7 @@ protected: | |||
| private: | |||
| Image fImgBackground; | |||
| #ifndef DISTRHO_OS_MAC | |||
| ImageAboutWindow fAboutWindow; | |||
| #endif | |||
| ScopedPointer<ImageButton> fButtonAbout; | |||
| ScopedPointer<ImageKnob> fKnobDivision, fKnobResonance, fKnobRange; | |||