Update to latest dpf

This commit is contained in:
falkTX 2015-04-26 20:30:46 +02:00
parent 29a3487433
commit bc9b01070a
5 changed files with 40 additions and 43 deletions

2
dpf

@ -1 +1 @@
Subproject commit 053854daf007c4aeeda43c26de124181e6187cf2 Subproject commit 67b302dc3b038fafa20fbe6fa6bdddfbaf9d0b02

View File

@ -91,8 +91,8 @@ DistrhoPluginNekobi::DistrhoPluginNekobi()
nekobee_init_tables(); nekobee_init_tables();
// init synth // init synth
fSynth.sample_rate = d_getSampleRate(); fSynth.sample_rate = getSampleRate();
fSynth.deltat = 1.0f / (float)d_getSampleRate(); fSynth.deltat = 1.0f / (float)getSampleRate();
fSynth.nugget_remains = 0; fSynth.nugget_remains = 0;
fSynth.note_id = 0; fSynth.note_id = 0;
@ -147,7 +147,7 @@ DistrhoPluginNekobi::DistrhoPluginNekobi()
fSynth.volume = 0.75f; fSynth.volume = 0.75f;
// reset // reset
d_deactivate(); deactivate();
} }
DistrhoPluginNekobi::~DistrhoPluginNekobi() DistrhoPluginNekobi::~DistrhoPluginNekobi()
@ -158,7 +158,7 @@ DistrhoPluginNekobi::~DistrhoPluginNekobi()
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
// Init // Init
void DistrhoPluginNekobi::d_initParameter(uint32_t index, Parameter& parameter) void DistrhoPluginNekobi::initParameter(uint32_t index, Parameter& parameter)
{ {
switch (index) switch (index)
{ {
@ -238,7 +238,7 @@ void DistrhoPluginNekobi::d_initParameter(uint32_t index, Parameter& parameter)
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
// Internal data // Internal data
float DistrhoPluginNekobi::d_getParameterValue(uint32_t index) const float DistrhoPluginNekobi::getParameterValue(uint32_t index) const
{ {
switch (index) switch (index)
{ {
@ -263,7 +263,7 @@ float DistrhoPluginNekobi::d_getParameterValue(uint32_t index) const
return 0.0f; return 0.0f;
} }
void DistrhoPluginNekobi::d_setParameterValue(uint32_t index, float value) void DistrhoPluginNekobi::setParameterValue(uint32_t index, float value)
{ {
switch (index) switch (index)
{ {
@ -313,7 +313,7 @@ void DistrhoPluginNekobi::d_setParameterValue(uint32_t index, float value)
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
// Process // Process
void DistrhoPluginNekobi::d_activate() void DistrhoPluginNekobi::activate()
{ {
fSynth.nugget_remains = 0; fSynth.nugget_remains = 0;
fSynth.note_id = 0; fSynth.note_id = 0;
@ -322,13 +322,13 @@ void DistrhoPluginNekobi::d_activate()
nekobee_synth_all_voices_off(&fSynth); nekobee_synth_all_voices_off(&fSynth);
} }
void DistrhoPluginNekobi::d_deactivate() void DistrhoPluginNekobi::deactivate()
{ {
if (fSynth.voice != nullptr) if (fSynth.voice != nullptr)
nekobee_synth_all_voices_off(&fSynth); nekobee_synth_all_voices_off(&fSynth);
} }
void DistrhoPluginNekobi::d_run(const float**, float** outputs, uint32_t frames, const MidiEvent* midiEvents, uint32_t midiEventCount) void DistrhoPluginNekobi::run(const float**, float** outputs, uint32_t frames, const MidiEvent* midiEvents, uint32_t midiEventCount)
{ {
uint32_t framesDone = 0; uint32_t framesDone = 0;
uint32_t curEventIndex = 0; uint32_t curEventIndex = 0;

View File

@ -52,27 +52,27 @@ protected:
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Information // Information
const char* d_getLabel() const noexcept override const char* getLabel() const noexcept override
{ {
return "Nekobi"; return "Nekobi";
} }
const char* d_getMaker() const noexcept override const char* getMaker() const noexcept override
{ {
return "Sean Bolton, falkTX"; return "Sean Bolton, falkTX";
} }
const char* d_getLicense() const noexcept override const char* getLicense() const noexcept override
{ {
return "GPL v2+"; return "GPL v2+";
} }
uint32_t d_getVersion() const noexcept override uint32_t getVersion() const noexcept override
{ {
return 0x1000; return 0x1000;
} }
int64_t d_getUniqueId() const noexcept override int64_t getUniqueId() const noexcept override
{ {
return d_cconst('D', 'N', 'e', 'k'); return d_cconst('D', 'N', 'e', 'k');
} }
@ -80,20 +80,20 @@ protected:
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Init // Init
void d_initParameter(uint32_t index, Parameter& parameter) override; void initParameter(uint32_t index, Parameter& parameter) override;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Internal data // Internal data
float d_getParameterValue(uint32_t index) const override; float getParameterValue(uint32_t index) const override;
void d_setParameterValue(uint32_t index, float value) override; void setParameterValue(uint32_t index, float value) override;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Process // Process
void d_activate() override; void activate() override;
void d_deactivate() override; void deactivate() override;
void d_run(const float**, float** outputs, uint32_t frames, const MidiEvent* midiEvents, uint32_t midiEventCount) override; void run(const float**, float** outputs, uint32_t frames, const MidiEvent* midiEvents, uint32_t midiEventCount) override;
// ------------------------------------------------------------------- // -------------------------------------------------------------------

View File

@ -20,27 +20,24 @@
START_NAMESPACE_DISTRHO START_NAMESPACE_DISTRHO
namespace Art = DistrhoArtworkNekobi;
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
DistrhoUINekobi::DistrhoUINekobi() DistrhoUINekobi::DistrhoUINekobi()
: UI(), : UI(Art::backgroundWidth, Art::backgroundHeight),
fImgBackground(Art::backgroundData, Art::backgroundWidth, Art::backgroundHeight, GL_BGR),
fAboutWindow(this) fAboutWindow(this)
{ {
// FIXME // FIXME
fNeko.setTimerSpeed(5); fNeko.setTimerSpeed(5);
// set UI size
setSize(DistrhoArtworkNekobi::backgroundWidth, DistrhoArtworkNekobi::backgroundHeight);
// background
fImgBackground = Image(DistrhoArtworkNekobi::backgroundData, DistrhoArtworkNekobi::backgroundWidth, DistrhoArtworkNekobi::backgroundHeight, GL_BGR);
// about // about
Image aboutImage(DistrhoArtworkNekobi::aboutData, DistrhoArtworkNekobi::aboutWidth, DistrhoArtworkNekobi::aboutHeight, GL_BGR); Image aboutImage(Art::aboutData, Art::aboutWidth, Art::aboutHeight, GL_BGR);
fAboutWindow.setImage(aboutImage); fAboutWindow.setImage(aboutImage);
// slider // slider
Image sliderImage(DistrhoArtworkNekobi::sliderData, DistrhoArtworkNekobi::sliderWidth, DistrhoArtworkNekobi::sliderHeight); Image sliderImage(Art::sliderData, Art::sliderWidth, Art::sliderHeight);
fSliderWaveform = new ImageSlider(this, sliderImage); fSliderWaveform = new ImageSlider(this, sliderImage);
fSliderWaveform->setId(DistrhoPluginNekobi::paramWaveform); fSliderWaveform->setId(DistrhoPluginNekobi::paramWaveform);
@ -52,7 +49,7 @@ DistrhoUINekobi::DistrhoUINekobi()
fSliderWaveform->setCallback(this); fSliderWaveform->setCallback(this);
// knobs // knobs
Image knobImage(DistrhoArtworkNekobi::knobData, DistrhoArtworkNekobi::knobWidth, DistrhoArtworkNekobi::knobHeight); Image knobImage(Art::knobData, Art::knobWidth, Art::knobHeight);
// knob Tuning // knob Tuning
fKnobTuning = new ImageKnob(this, knobImage, ImageKnob::Vertical); fKnobTuning = new ImageKnob(this, knobImage, ImageKnob::Vertical);
@ -125,8 +122,8 @@ DistrhoUINekobi::DistrhoUINekobi()
fKnobVolume->setCallback(this); fKnobVolume->setCallback(this);
// about button // about button
Image aboutImageNormal(DistrhoArtworkNekobi::aboutButtonNormalData, DistrhoArtworkNekobi::aboutButtonNormalWidth, DistrhoArtworkNekobi::aboutButtonNormalHeight); Image aboutImageNormal(Art::aboutButtonNormalData, Art::aboutButtonNormalWidth, Art::aboutButtonNormalHeight);
Image aboutImageHover(DistrhoArtworkNekobi::aboutButtonHoverData, DistrhoArtworkNekobi::aboutButtonHoverWidth, DistrhoArtworkNekobi::aboutButtonHoverHeight); Image aboutImageHover(Art::aboutButtonHoverData, Art::aboutButtonHoverWidth, Art::aboutButtonHoverHeight);
fButtonAbout = new ImageButton(this, aboutImageNormal, aboutImageHover, aboutImageHover); fButtonAbout = new ImageButton(this, aboutImageNormal, aboutImageHover, aboutImageHover);
fButtonAbout->setAbsolutePos(505, 5); fButtonAbout->setAbsolutePos(505, 5);
fButtonAbout->setCallback(this); fButtonAbout->setCallback(this);
@ -135,7 +132,7 @@ DistrhoUINekobi::DistrhoUINekobi()
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
// DSP Callbacks // DSP Callbacks
void DistrhoUINekobi::d_parameterChanged(uint32_t index, float value) void DistrhoUINekobi::parameterChanged(uint32_t index, float value)
{ {
switch (index) switch (index)
{ {
@ -169,7 +166,7 @@ void DistrhoUINekobi::d_parameterChanged(uint32_t index, float value)
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
// UI Callbacks // UI Callbacks
void DistrhoUINekobi::d_uiIdle() void DistrhoUINekobi::uiIdle()
{ {
if (fNeko.idle()) if (fNeko.idle())
repaint(); repaint();
@ -188,32 +185,32 @@ void DistrhoUINekobi::imageButtonClicked(ImageButton* button, int)
void DistrhoUINekobi::imageKnobDragStarted(ImageKnob* knob) void DistrhoUINekobi::imageKnobDragStarted(ImageKnob* knob)
{ {
d_editParameter(knob->getId(), true); editParameter(knob->getId(), true);
} }
void DistrhoUINekobi::imageKnobDragFinished(ImageKnob* knob) void DistrhoUINekobi::imageKnobDragFinished(ImageKnob* knob)
{ {
d_editParameter(knob->getId(), false); editParameter(knob->getId(), false);
} }
void DistrhoUINekobi::imageKnobValueChanged(ImageKnob* knob, float value) void DistrhoUINekobi::imageKnobValueChanged(ImageKnob* knob, float value)
{ {
d_setParameterValue(knob->getId(), value); setParameterValue(knob->getId(), value);
} }
void DistrhoUINekobi::imageSliderDragStarted(ImageSlider* slider) void DistrhoUINekobi::imageSliderDragStarted(ImageSlider* slider)
{ {
d_editParameter(slider->getId(), true); editParameter(slider->getId(), true);
} }
void DistrhoUINekobi::imageSliderDragFinished(ImageSlider* slider) void DistrhoUINekobi::imageSliderDragFinished(ImageSlider* slider)
{ {
d_editParameter(slider->getId(), false); editParameter(slider->getId(), false);
} }
void DistrhoUINekobi::imageSliderValueChanged(ImageSlider* slider, float value) void DistrhoUINekobi::imageSliderValueChanged(ImageSlider* slider, float value)
{ {
d_setParameterValue(slider->getId(), value); setParameterValue(slider->getId(), value);
} }
void DistrhoUINekobi::onDisplay() void DistrhoUINekobi::onDisplay()

View File

@ -49,12 +49,12 @@ protected:
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// DSP Callbacks // DSP Callbacks
void d_parameterChanged(uint32_t index, float value) override; void parameterChanged(uint32_t index, float value) override;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// UI Callbacks // UI Callbacks
void d_uiIdle() override; void uiIdle() override;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Widget Callbacks // Widget Callbacks