From e33cbd7ac283eb3a75657fbfa15913e6f0b735d4 Mon Sep 17 00:00:00 2001 From: falkTX Date: Wed, 14 May 2014 15:59:20 +0100 Subject: [PATCH] Update for param Ids --- dpf | 2 +- plugins/Nekobi/DistrhoUINekobi.cpp | 80 ++++++------------------------ 2 files changed, 16 insertions(+), 66 deletions(-) diff --git a/dpf b/dpf index 8fd0d90..1d00b38 160000 --- a/dpf +++ b/dpf @@ -1 +1 @@ -Subproject commit 8fd0d9072b164d9d83f7e34c420131aeafdc315a +Subproject commit 1d00b38275356435cd384fd89fa9e65e4d6939c8 diff --git a/plugins/Nekobi/DistrhoUINekobi.cpp b/plugins/Nekobi/DistrhoUINekobi.cpp index 18fd3c0..cc3c605 100644 --- a/plugins/Nekobi/DistrhoUINekobi.cpp +++ b/plugins/Nekobi/DistrhoUINekobi.cpp @@ -18,8 +18,6 @@ #include "DistrhoPluginNekobi.hpp" #include "DistrhoUINekobi.hpp" -using DGL::Point; - START_NAMESPACE_DISTRHO // ----------------------------------------------------------------------- @@ -29,7 +27,7 @@ DistrhoUINekobi::DistrhoUINekobi() fAboutWindow(this) { // FIXME - fNeko.setTimerSpeed(4); + fNeko.setTimerSpeed(5); // background fImgBackground = Image(DistrhoArtworkNekobi::backgroundData, DistrhoArtworkNekobi::backgroundWidth, DistrhoArtworkNekobi::backgroundHeight, GL_BGR); @@ -40,7 +38,7 @@ DistrhoUINekobi::DistrhoUINekobi() // slider Image sliderImage(DistrhoArtworkNekobi::sliderData, DistrhoArtworkNekobi::sliderWidth, DistrhoArtworkNekobi::sliderHeight); - fSliderWaveform = new ImageSlider(this, sliderImage); + fSliderWaveform = new ImageSlider(this, sliderImage, DistrhoPluginNekobi::paramWaveform); fSliderWaveform->setStartPos(133, 40); fSliderWaveform->setEndPos(133, 60); fSliderWaveform->setRange(0.0f, 1.0f); @@ -52,7 +50,7 @@ DistrhoUINekobi::DistrhoUINekobi() Image knobImage(DistrhoArtworkNekobi::knobData, DistrhoArtworkNekobi::knobWidth, DistrhoArtworkNekobi::knobHeight); // knob Tuning - fKnobTuning = new ImageKnob(this, knobImage); + fKnobTuning = new ImageKnob(this, knobImage, ImageKnob::Vertical, DistrhoPluginNekobi::paramTuning); fKnobTuning->setPos(41, 43); fKnobTuning->setRange(-12.0f, 12.0f); fKnobTuning->setValue(0.0f); @@ -60,7 +58,7 @@ DistrhoUINekobi::DistrhoUINekobi() fKnobTuning->setCallback(this); // knob Cutoff - fKnobCutoff = new ImageKnob(this, knobImage); + fKnobCutoff = new ImageKnob(this, knobImage, ImageKnob::Vertical, DistrhoPluginNekobi::paramCutoff); fKnobCutoff->setPos(185, 43); fKnobCutoff->setRange(0.0f, 100.0f); fKnobCutoff->setValue(25.0f); @@ -68,7 +66,7 @@ DistrhoUINekobi::DistrhoUINekobi() fKnobCutoff->setCallback(this); // knob Resonance - fKnobResonance = new ImageKnob(this, knobImage); + fKnobResonance = new ImageKnob(this, knobImage, ImageKnob::Vertical, DistrhoPluginNekobi::paramResonance); fKnobResonance->setPos(257, 43); fKnobResonance->setRange(0.0f, 95.0f); fKnobResonance->setValue(25.0f); @@ -76,7 +74,7 @@ DistrhoUINekobi::DistrhoUINekobi() fKnobResonance->setCallback(this); // knob Env Mod - fKnobEnvMod = new ImageKnob(this, knobImage); + fKnobEnvMod = new ImageKnob(this, knobImage, ImageKnob::Vertical, DistrhoPluginNekobi::paramEnvMod); fKnobEnvMod->setPos(329, 43); fKnobEnvMod->setRange(0.0f, 100.0f); fKnobEnvMod->setValue(50.0f); @@ -84,7 +82,7 @@ DistrhoUINekobi::DistrhoUINekobi() fKnobEnvMod->setCallback(this); // knob Decay - fKnobDecay = new ImageKnob(this, knobImage); + fKnobDecay = new ImageKnob(this, knobImage, ImageKnob::Vertical, DistrhoPluginNekobi::paramDecay); fKnobDecay->setPos(400, 43); fKnobDecay->setRange(0.0f, 100.0f); fKnobDecay->setValue(75.0f); @@ -92,7 +90,7 @@ DistrhoUINekobi::DistrhoUINekobi() fKnobDecay->setCallback(this); // knob Accent - fKnobAccent = new ImageKnob(this, knobImage); + fKnobAccent = new ImageKnob(this, knobImage, ImageKnob::Vertical, DistrhoPluginNekobi::paramAccent); fKnobAccent->setPos(473, 43); fKnobAccent->setRange(0.0f, 100.0f); fKnobAccent->setValue(25.0f); @@ -100,7 +98,7 @@ DistrhoUINekobi::DistrhoUINekobi() fKnobAccent->setCallback(this); // knob Volume - fKnobVolume = new ImageKnob(this, knobImage); + fKnobVolume = new ImageKnob(this, knobImage, ImageKnob::Vertical, DistrhoPluginNekobi::paramVolume); fKnobVolume->setPos(545, 43); fKnobVolume->setRange(0.0f, 100.0f); fKnobVolume->setValue(75.0f); @@ -171,80 +169,32 @@ void DistrhoUINekobi::imageButtonClicked(ImageButton* button, int) void DistrhoUINekobi::imageKnobDragStarted(ImageKnob* knob) { - if (knob == fKnobTuning) - d_editParameter(DistrhoPluginNekobi::paramTuning, true); - else if (knob == fKnobCutoff) - d_editParameter(DistrhoPluginNekobi::paramCutoff, true); - else if (knob == fKnobResonance) - d_editParameter(DistrhoPluginNekobi::paramResonance, true); - else if (knob == fKnobEnvMod) - d_editParameter(DistrhoPluginNekobi::paramEnvMod, true); - else if (knob == fKnobDecay) - d_editParameter(DistrhoPluginNekobi::paramDecay, true); - else if (knob == fKnobAccent) - d_editParameter(DistrhoPluginNekobi::paramAccent, true); - else if (knob == fKnobVolume) - d_editParameter(DistrhoPluginNekobi::paramVolume, true); + d_editParameter(knob->getId(), true); } void DistrhoUINekobi::imageKnobDragFinished(ImageKnob* knob) { - if (knob == fKnobTuning) - d_editParameter(DistrhoPluginNekobi::paramTuning, false); - else if (knob == fKnobCutoff) - d_editParameter(DistrhoPluginNekobi::paramCutoff, false); - else if (knob == fKnobResonance) - d_editParameter(DistrhoPluginNekobi::paramResonance, false); - else if (knob == fKnobEnvMod) - d_editParameter(DistrhoPluginNekobi::paramEnvMod, false); - else if (knob == fKnobDecay) - d_editParameter(DistrhoPluginNekobi::paramDecay, false); - else if (knob == fKnobAccent) - d_editParameter(DistrhoPluginNekobi::paramAccent, false); - else if (knob == fKnobVolume) - d_editParameter(DistrhoPluginNekobi::paramVolume, false); + d_editParameter(knob->getId(), false); } void DistrhoUINekobi::imageKnobValueChanged(ImageKnob* knob, float value) { - if (knob == fKnobTuning) - d_setParameterValue(DistrhoPluginNekobi::paramTuning, value); - else if (knob == fKnobCutoff) - d_setParameterValue(DistrhoPluginNekobi::paramCutoff, value); - else if (knob == fKnobResonance) - d_setParameterValue(DistrhoPluginNekobi::paramResonance, value); - else if (knob == fKnobEnvMod) - d_setParameterValue(DistrhoPluginNekobi::paramEnvMod, value); - else if (knob == fKnobDecay) - d_setParameterValue(DistrhoPluginNekobi::paramDecay, value); - else if (knob == fKnobAccent) - d_setParameterValue(DistrhoPluginNekobi::paramAccent, value); - else if (knob == fKnobVolume) - d_setParameterValue(DistrhoPluginNekobi::paramVolume, value); + d_setParameterValue(knob->getId(), value); } void DistrhoUINekobi::imageSliderDragStarted(ImageSlider* slider) { - if (slider != fSliderWaveform) - return; - - d_editParameter(DistrhoPluginNekobi::paramWaveform, true); + d_editParameter(slider->getId(), true); } void DistrhoUINekobi::imageSliderDragFinished(ImageSlider* slider) { - if (slider != fSliderWaveform) - return; - - d_editParameter(DistrhoPluginNekobi::paramWaveform, false); + d_editParameter(slider->getId(), false); } void DistrhoUINekobi::imageSliderValueChanged(ImageSlider* slider, float value) { - if (slider != fSliderWaveform) - return; - - d_setParameterValue(DistrhoPluginNekobi::paramWaveform, value); + d_setParameterValue(slider->getId(), value); } void DistrhoUINekobi::onDisplay()