|
|
@@ -1,6 +1,6 @@ |
|
|
|
/* |
|
|
|
* DISTRHO Nekobi Plugin, based on Nekobee by Sean Bolton and others. |
|
|
|
* Copyright (C) 2013-2021 Filipe Coelho <falktx@falktx.com> |
|
|
|
* Copyright (C) 2013-2015 Filipe Coelho <falktx@falktx.com> |
|
|
|
* |
|
|
|
* This program is free software; you can redistribute it and/or |
|
|
|
* modify it under the terms of the GNU General Public License as |
|
|
@@ -26,17 +26,17 @@ namespace Art = DistrhoArtworkNekobi; |
|
|
|
|
|
|
|
DistrhoUINekobi::DistrhoUINekobi() |
|
|
|
: UI(Art::backgroundWidth, Art::backgroundHeight), |
|
|
|
fImgBackground(Art::backgroundData, Art::backgroundWidth, Art::backgroundHeight, kImageFormatBGR), |
|
|
|
fImgBackground(Art::backgroundData, Art::backgroundWidth, Art::backgroundHeight, GL_BGR), |
|
|
|
fAboutWindow(this) |
|
|
|
{ |
|
|
|
// about |
|
|
|
NekoImage aboutImage(Art::aboutData, Art::aboutWidth, Art::aboutHeight, kImageFormatBGR); |
|
|
|
Image aboutImage(Art::aboutData, Art::aboutWidth, Art::aboutHeight, GL_BGR); |
|
|
|
fAboutWindow.setImage(aboutImage); |
|
|
|
|
|
|
|
// slider |
|
|
|
NekoImage sliderImage(Art::sliderData, Art::sliderWidth, Art::sliderHeight, kImageFormatBGRA); |
|
|
|
Image sliderImage(Art::sliderData, Art::sliderWidth, Art::sliderHeight); |
|
|
|
|
|
|
|
fSliderWaveform = new NekoImageSlider(this, sliderImage); |
|
|
|
fSliderWaveform = new ImageSlider(this, sliderImage); |
|
|
|
fSliderWaveform->setId(DistrhoPluginNekobi::paramWaveform); |
|
|
|
fSliderWaveform->setStartPos(133, 40); |
|
|
|
fSliderWaveform->setEndPos(133, 60); |
|
|
@@ -46,10 +46,10 @@ DistrhoUINekobi::DistrhoUINekobi() |
|
|
|
fSliderWaveform->setCallback(this); |
|
|
|
|
|
|
|
// knobs |
|
|
|
NekoImage knobImage(Art::knobData, Art::knobWidth, Art::knobHeight, kImageFormatBGRA); |
|
|
|
Image knobImage(Art::knobData, Art::knobWidth, Art::knobHeight); |
|
|
|
|
|
|
|
// knob Tuning |
|
|
|
fKnobTuning = new NekoImageKnob(this, knobImage, NekoImageKnob::Vertical); |
|
|
|
fKnobTuning = new ImageKnob(this, knobImage, ImageKnob::Vertical); |
|
|
|
fKnobTuning->setId(DistrhoPluginNekobi::paramTuning); |
|
|
|
fKnobTuning->setAbsolutePos(41, 43); |
|
|
|
fKnobTuning->setRange(-12.0f, 12.0f); |
|
|
@@ -59,7 +59,7 @@ DistrhoUINekobi::DistrhoUINekobi() |
|
|
|
fKnobTuning->setCallback(this); |
|
|
|
|
|
|
|
// knob Cutoff |
|
|
|
fKnobCutoff = new NekoImageKnob(this, knobImage, NekoImageKnob::Vertical); |
|
|
|
fKnobCutoff = new ImageKnob(this, knobImage, ImageKnob::Vertical); |
|
|
|
fKnobCutoff->setId(DistrhoPluginNekobi::paramCutoff); |
|
|
|
fKnobCutoff->setAbsolutePos(185, 43); |
|
|
|
fKnobCutoff->setRange(0.0f, 100.0f); |
|
|
@@ -69,7 +69,7 @@ DistrhoUINekobi::DistrhoUINekobi() |
|
|
|
fKnobCutoff->setCallback(this); |
|
|
|
|
|
|
|
// knob Resonance |
|
|
|
fKnobResonance = new NekoImageKnob(this, knobImage, NekoImageKnob::Vertical); |
|
|
|
fKnobResonance = new ImageKnob(this, knobImage, ImageKnob::Vertical); |
|
|
|
fKnobResonance->setId(DistrhoPluginNekobi::paramResonance); |
|
|
|
fKnobResonance->setAbsolutePos(257, 43); |
|
|
|
fKnobResonance->setRange(0.0f, 95.0f); |
|
|
@@ -79,7 +79,7 @@ DistrhoUINekobi::DistrhoUINekobi() |
|
|
|
fKnobResonance->setCallback(this); |
|
|
|
|
|
|
|
// knob Env Mod |
|
|
|
fKnobEnvMod = new NekoImageKnob(this, knobImage, NekoImageKnob::Vertical); |
|
|
|
fKnobEnvMod = new ImageKnob(this, knobImage, ImageKnob::Vertical); |
|
|
|
fKnobEnvMod->setId(DistrhoPluginNekobi::paramEnvMod); |
|
|
|
fKnobEnvMod->setAbsolutePos(329, 43); |
|
|
|
fKnobEnvMod->setRange(0.0f, 100.0f); |
|
|
@@ -89,7 +89,7 @@ DistrhoUINekobi::DistrhoUINekobi() |
|
|
|
fKnobEnvMod->setCallback(this); |
|
|
|
|
|
|
|
// knob Decay |
|
|
|
fKnobDecay = new NekoImageKnob(this, knobImage, NekoImageKnob::Vertical); |
|
|
|
fKnobDecay = new ImageKnob(this, knobImage, ImageKnob::Vertical); |
|
|
|
fKnobDecay->setId(DistrhoPluginNekobi::paramDecay); |
|
|
|
fKnobDecay->setAbsolutePos(400, 43); |
|
|
|
fKnobDecay->setRange(0.0f, 100.0f); |
|
|
@@ -99,7 +99,7 @@ DistrhoUINekobi::DistrhoUINekobi() |
|
|
|
fKnobDecay->setCallback(this); |
|
|
|
|
|
|
|
// knob Accent |
|
|
|
fKnobAccent = new NekoImageKnob(this, knobImage, NekoImageKnob::Vertical); |
|
|
|
fKnobAccent = new ImageKnob(this, knobImage, ImageKnob::Vertical); |
|
|
|
fKnobAccent->setId(DistrhoPluginNekobi::paramAccent); |
|
|
|
fKnobAccent->setAbsolutePos(473, 43); |
|
|
|
fKnobAccent->setRange(0.0f, 100.0f); |
|
|
@@ -109,7 +109,7 @@ DistrhoUINekobi::DistrhoUINekobi() |
|
|
|
fKnobAccent->setCallback(this); |
|
|
|
|
|
|
|
// knob Volume |
|
|
|
fKnobVolume = new NekoImageKnob(this, knobImage, NekoImageKnob::Vertical); |
|
|
|
fKnobVolume = new ImageKnob(this, knobImage, ImageKnob::Vertical); |
|
|
|
fKnobVolume->setId(DistrhoPluginNekobi::paramVolume); |
|
|
|
fKnobVolume->setAbsolutePos(545, 43); |
|
|
|
fKnobVolume->setRange(0.0f, 100.0f); |
|
|
@@ -119,9 +119,9 @@ DistrhoUINekobi::DistrhoUINekobi() |
|
|
|
fKnobVolume->setCallback(this); |
|
|
|
|
|
|
|
// about button |
|
|
|
NekoImage aboutImageNormal(Art::aboutButtonNormalData, Art::aboutButtonNormalWidth, Art::aboutButtonNormalHeight, kImageFormatBGRA); |
|
|
|
NekoImage aboutImageHover(Art::aboutButtonHoverData, Art::aboutButtonHoverWidth, Art::aboutButtonHoverHeight, kImageFormatBGRA); |
|
|
|
fButtonAbout = new NekoImageButton(this, aboutImageNormal, aboutImageHover, aboutImageHover); |
|
|
|
Image aboutImageNormal(Art::aboutButtonNormalData, Art::aboutButtonNormalWidth, Art::aboutButtonNormalHeight); |
|
|
|
Image aboutImageHover(Art::aboutButtonHoverData, Art::aboutButtonHoverWidth, Art::aboutButtonHoverHeight); |
|
|
|
fButtonAbout = new ImageButton(this, aboutImageNormal, aboutImageHover, aboutImageHover); |
|
|
|
fButtonAbout->setAbsolutePos(505, 5); |
|
|
|
fButtonAbout->setCallback(this); |
|
|
|
|
|
|
@@ -166,50 +166,48 @@ void DistrhoUINekobi::parameterChanged(uint32_t index, float value) |
|
|
|
// ----------------------------------------------------------------------- |
|
|
|
// Widget Callbacks |
|
|
|
|
|
|
|
void DistrhoUINekobi::imageButtonClicked(NekoImageButton* button, int) |
|
|
|
void DistrhoUINekobi::imageButtonClicked(ImageButton* button, int) |
|
|
|
{ |
|
|
|
if (button != fButtonAbout) |
|
|
|
return; |
|
|
|
|
|
|
|
fAboutWindow.runAsModal(); |
|
|
|
fAboutWindow.exec(); |
|
|
|
} |
|
|
|
|
|
|
|
void DistrhoUINekobi::imageKnobDragStarted(NekoImageKnob* knob) |
|
|
|
void DistrhoUINekobi::imageKnobDragStarted(ImageKnob* knob) |
|
|
|
{ |
|
|
|
editParameter(knob->getId(), true); |
|
|
|
} |
|
|
|
|
|
|
|
void DistrhoUINekobi::imageKnobDragFinished(NekoImageKnob* knob) |
|
|
|
void DistrhoUINekobi::imageKnobDragFinished(ImageKnob* knob) |
|
|
|
{ |
|
|
|
editParameter(knob->getId(), false); |
|
|
|
} |
|
|
|
|
|
|
|
void DistrhoUINekobi::imageKnobValueChanged(NekoImageKnob* knob, float value) |
|
|
|
void DistrhoUINekobi::imageKnobValueChanged(ImageKnob* knob, float value) |
|
|
|
{ |
|
|
|
setParameterValue(knob->getId(), value); |
|
|
|
} |
|
|
|
|
|
|
|
void DistrhoUINekobi::imageSliderDragStarted(NekoImageSlider* slider) |
|
|
|
void DistrhoUINekobi::imageSliderDragStarted(ImageSlider* slider) |
|
|
|
{ |
|
|
|
editParameter(slider->getId(), true); |
|
|
|
} |
|
|
|
|
|
|
|
void DistrhoUINekobi::imageSliderDragFinished(NekoImageSlider* slider) |
|
|
|
void DistrhoUINekobi::imageSliderDragFinished(ImageSlider* slider) |
|
|
|
{ |
|
|
|
editParameter(slider->getId(), false); |
|
|
|
} |
|
|
|
|
|
|
|
void DistrhoUINekobi::imageSliderValueChanged(NekoImageSlider* slider, float value) |
|
|
|
void DistrhoUINekobi::imageSliderValueChanged(ImageSlider* slider, float value) |
|
|
|
{ |
|
|
|
setParameterValue(slider->getId(), value); |
|
|
|
} |
|
|
|
|
|
|
|
void DistrhoUINekobi::onDisplay() |
|
|
|
{ |
|
|
|
const GraphicsContext& context(getGraphicsContext()); |
|
|
|
|
|
|
|
fImgBackground.draw(context); |
|
|
|
fNeko.draw(context); |
|
|
|
fImgBackground.draw(); |
|
|
|
fNeko.draw(); |
|
|
|
} |
|
|
|
|
|
|
|
// ----------------------------------------------------------------------- |
|
|
|