@@ -8,9 +8,7 @@ include ../../Makefile.mk | |||||
# -------------------------------------------------------------- | # -------------------------------------------------------------- | ||||
BACKEND_FLAGS = -I. -I.. -I../../includes -I../../libs -I../../utils | |||||
BACKEND_FLAGS += -pedantic -pedantic-errors -Wunused-parameter -Wuninitialized -Wno-vla | |||||
BACKEND_FLAGS += -Wcast-qual -Wconversion -Wsign-conversion -Wlogical-op -Waggregate-return | |||||
BACKEND_FLAGS = -I. -I.. -I../../includes -I../../modules -I../../modules/utils | |||||
BUILD_C_FLAGS += $(BACKEND_FLAGS) | BUILD_C_FLAGS += $(BACKEND_FLAGS) | ||||
BUILD_CXX_FLAGS += $(BACKEND_FLAGS) | BUILD_CXX_FLAGS += $(BACKEND_FLAGS) | ||||
@@ -12,7 +12,7 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU General Public License for more details. | * GNU General Public License for more details. | ||||
* | * | ||||
* For a full copy of the GNU General Public License see the GPL.txt file | |||||
* For a full copy of the GNU General Public License see the doc/GPL.txt file. | |||||
*/ | */ | ||||
#include "CarlaEngineInternal.hpp" | #include "CarlaEngineInternal.hpp" | ||||
@@ -12,7 +12,7 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU General Public License for more details. | * GNU General Public License for more details. | ||||
* | * | ||||
* For a full copy of the GNU General Public License see the GPL.txt file | |||||
* For a full copy of the GNU General Public License see the doc/GPL.txt file. | |||||
*/ | */ | ||||
#ifdef BUILD_BRIDGE | #ifdef BUILD_BRIDGE | ||||
@@ -12,7 +12,7 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU General Public License for more details. | * GNU General Public License for more details. | ||||
* | * | ||||
* For a full copy of the GNU General Public License see the GPL.txt file | |||||
* For a full copy of the GNU General Public License see the doc/GPL.txt file. | |||||
*/ | */ | ||||
#ifndef CARLA_ENGINE_INTERNAL_HPP_INCLUDED | #ifndef CARLA_ENGINE_INTERNAL_HPP_INCLUDED | ||||
@@ -12,7 +12,7 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU General Public License for more details. | * GNU General Public License for more details. | ||||
* | * | ||||
* For a full copy of the GNU General Public License see the GPL.txt file | |||||
* For a full copy of the GNU General Public License see the doc/GPL.txt file. | |||||
*/ | */ | ||||
#include "CarlaEngineInternal.hpp" | #include "CarlaEngineInternal.hpp" | ||||
@@ -12,7 +12,7 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU General Public License for more details. | * GNU General Public License for more details. | ||||
* | * | ||||
* For a full copy of the GNU General Public License see the GPL.txt file | |||||
* For a full copy of the GNU General Public License see the doc/GPL.txt file. | |||||
*/ | */ | ||||
#ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
@@ -12,7 +12,7 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU General Public License for more details. | * GNU General Public License for more details. | ||||
* | * | ||||
* For a full copy of the GNU General Public License see the GPL.txt file | |||||
* For a full copy of the GNU General Public License see the doc/GPL.txt file. | |||||
*/ | */ | ||||
#include "CarlaEngineOsc.hpp" | #include "CarlaEngineOsc.hpp" | ||||
@@ -12,7 +12,7 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU General Public License for more details. | * GNU General Public License for more details. | ||||
* | * | ||||
* For a full copy of the GNU General Public License see the GPL.txt file | |||||
* For a full copy of the GNU General Public License see the doc/GPL.txt file. | |||||
*/ | */ | ||||
#ifndef CARLA_ENGINE_OSC_HPP_INCLUDED | #ifndef CARLA_ENGINE_OSC_HPP_INCLUDED | ||||
@@ -12,7 +12,7 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU General Public License for more details. | * GNU General Public License for more details. | ||||
* | * | ||||
* For a full copy of the GNU General Public License see the GPL.txt file | |||||
* For a full copy of the GNU General Public License see the doc/GPL.txt file. | |||||
*/ | */ | ||||
#include "CarlaEngineInternal.hpp" | #include "CarlaEngineInternal.hpp" | ||||
@@ -12,7 +12,7 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU General Public License for more details. | * GNU General Public License for more details. | ||||
* | * | ||||
* For a full copy of the GNU General Public License see the GPL.txt file | |||||
* For a full copy of the GNU General Public License see the doc/GPL.txt file. | |||||
*/ | */ | ||||
#ifdef WANT_RTAUDIO | #ifdef WANT_RTAUDIO | ||||
@@ -12,7 +12,7 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU General Public License for more details. | * GNU General Public License for more details. | ||||
* | * | ||||
* For a full copy of the GNU General Public License see the GPL.txt file | |||||
* For a full copy of the GNU General Public License see the doc/GPL.txt file. | |||||
*/ | */ | ||||
#include "CarlaEngineThread.hpp" | #include "CarlaEngineThread.hpp" | ||||
@@ -25,7 +25,7 @@ CARLA_BACKEND_START_NAMESPACE | |||||
// ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
CarlaEngineThread::CarlaEngineThread(CarlaEngine* const engine) | CarlaEngineThread::CarlaEngineThread(CarlaEngine* const engine) | ||||
: kEngine(engine), | |||||
: fEngine(engine), | |||||
fStopNow(true) | fStopNow(true) | ||||
{ | { | ||||
carla_debug("CarlaEngineThread::CarlaEngineThread(%p)", engine); | carla_debug("CarlaEngineThread::CarlaEngineThread(%p)", engine); | ||||
@@ -12,20 +12,20 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU Lesser General Public License for more details. | * GNU Lesser General Public License for more details. | ||||
* | * | ||||
* For a full copy of the license see the LGPL.txt file | |||||
* For a full copy of the license see the doc/LGPL.txt file. | |||||
*/ | */ | ||||
#include "DistrhoPlugin3BandEQ.hpp" | #include "DistrhoPlugin3BandEQ.hpp" | ||||
#include <cmath> | #include <cmath> | ||||
static const float cfAMP_DB = 8.656170245f; | |||||
static const float cfDC_ADD = 1e-30f; | |||||
static const float cfPI = 3.141592654f; | |||||
static const float kAMP_DB = 8.656170245f; | |||||
static const float kDC_ADD = 1e-30f; | |||||
static const float kPI = 3.141592654f; | |||||
START_NAMESPACE_DISTRHO | START_NAMESPACE_DISTRHO | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
DistrhoPlugin3BandEQ::DistrhoPlugin3BandEQ() | DistrhoPlugin3BandEQ::DistrhoPlugin3BandEQ() | ||||
: Plugin(paramCount, 1, 0) // 1 program, 0 states | : Plugin(paramCount, 1, 0) // 1 program, 0 states | ||||
@@ -41,7 +41,7 @@ DistrhoPlugin3BandEQ::~DistrhoPlugin3BandEQ() | |||||
{ | { | ||||
} | } | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
// Init | // Init | ||||
void DistrhoPlugin3BandEQ::d_initParameter(uint32_t index, Parameter& parameter) | void DistrhoPlugin3BandEQ::d_initParameter(uint32_t index, Parameter& parameter) | ||||
@@ -118,10 +118,10 @@ void DistrhoPlugin3BandEQ::d_initProgramName(uint32_t index, d_string& programNa | |||||
programName = "Default"; | programName = "Default"; | ||||
} | } | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
// Internal data | // Internal data | ||||
float DistrhoPlugin3BandEQ::d_parameterValue(uint32_t index) | |||||
float DistrhoPlugin3BandEQ::d_getParameterValue(uint32_t index) const | |||||
{ | { | ||||
switch (index) | switch (index) | ||||
{ | { | ||||
@@ -144,38 +144,38 @@ float DistrhoPlugin3BandEQ::d_parameterValue(uint32_t index) | |||||
void DistrhoPlugin3BandEQ::d_setParameterValue(uint32_t index, float value) | void DistrhoPlugin3BandEQ::d_setParameterValue(uint32_t index, float value) | ||||
{ | { | ||||
if (d_sampleRate() <= 0.0) | |||||
if (d_getSampleRate() <= 0.0) | |||||
return; | return; | ||||
switch (index) | switch (index) | ||||
{ | { | ||||
case paramLow: | case paramLow: | ||||
fLow = value; | fLow = value; | ||||
lowVol = std::exp( (fLow/48.0f) * 48 / cfAMP_DB); | |||||
lowVol = std::exp( (fLow/48.0f) * 48 / kAMP_DB); | |||||
break; | break; | ||||
case paramMid: | case paramMid: | ||||
fMid = value; | fMid = value; | ||||
midVol = std::exp( (fMid/48.0f) * 48 / cfAMP_DB); | |||||
midVol = std::exp( (fMid/48.0f) * 48 / kAMP_DB); | |||||
break; | break; | ||||
case paramHigh: | case paramHigh: | ||||
fHigh = value; | fHigh = value; | ||||
highVol = std::exp( (fHigh/48.0f) * 48 / cfAMP_DB); | |||||
highVol = std::exp( (fHigh/48.0f) * 48 / kAMP_DB); | |||||
break; | break; | ||||
case paramMaster: | case paramMaster: | ||||
fMaster = value; | fMaster = value; | ||||
outVol = std::exp( (fMaster/48.0f) * 48 / cfAMP_DB); | |||||
outVol = std::exp( (fMaster/48.0f) * 48 / kAMP_DB); | |||||
break; | break; | ||||
case paramLowMidFreq: | case paramLowMidFreq: | ||||
fLowMidFreq = std::fmin(value, fMidHighFreq); | fLowMidFreq = std::fmin(value, fMidHighFreq); | ||||
freqLP = fLowMidFreq; //fLowMidFreq * (fLowMidFreq / 24000.0f) * (fLowMidFreq / 24000.0f); | freqLP = fLowMidFreq; //fLowMidFreq * (fLowMidFreq / 24000.0f) * (fLowMidFreq / 24000.0f); | ||||
xLP = std::exp(-2.0f * cfPI * freqLP / (float)d_sampleRate()); | |||||
xLP = std::exp(-2.0f * kPI * freqLP / (float)d_getSampleRate()); | |||||
a0LP = 1.0f - xLP; | a0LP = 1.0f - xLP; | ||||
b1LP = -xLP; | b1LP = -xLP; | ||||
break; | break; | ||||
case paramMidHighFreq: | case paramMidHighFreq: | ||||
fMidHighFreq = std::fmax(value, fLowMidFreq); | fMidHighFreq = std::fmax(value, fLowMidFreq); | ||||
freqHP = fMidHighFreq; //fMidHighFreq * (fMidHighFreq / 24000.0f) * (fMidHighFreq / 24000.0f); | freqHP = fMidHighFreq; //fMidHighFreq * (fMidHighFreq / 24000.0f) * (fMidHighFreq / 24000.0f); | ||||
xHP = std::exp(-2.0f * cfPI * freqHP / (float)d_sampleRate()); | |||||
xHP = std::exp(-2.0f * kPI * freqHP / (float)d_getSampleRate()); | |||||
a0HP = 1.0f - xHP; | a0HP = 1.0f - xHP; | ||||
b1HP = -xHP; | b1HP = -xHP; | ||||
break; | break; | ||||
@@ -204,16 +204,16 @@ void DistrhoPlugin3BandEQ::d_setProgram(uint32_t index) | |||||
d_activate(); | d_activate(); | ||||
} | } | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
// Process | // Process | ||||
void DistrhoPlugin3BandEQ::d_activate() | void DistrhoPlugin3BandEQ::d_activate() | ||||
{ | { | ||||
xLP = std::exp(-2.0f * cfPI * freqLP / (float)d_sampleRate()); | |||||
xLP = std::exp(-2.0f * kPI * freqLP / (float)d_getSampleRate()); | |||||
a0LP = 1.0f - xLP; | a0LP = 1.0f - xLP; | ||||
b1LP = -xLP; | b1LP = -xLP; | ||||
xHP = std::exp(-2.0f * cfPI * freqHP / (float)d_sampleRate()); | |||||
xHP = std::exp(-2.0f * kPI * freqHP / (float)d_getSampleRate()); | |||||
a0HP = 1.0f - xHP; | a0HP = 1.0f - xHP; | ||||
b1HP = -xHP; | b1HP = -xHP; | ||||
} | } | ||||
@@ -233,28 +233,28 @@ void DistrhoPlugin3BandEQ::d_run(float** inputs, float** outputs, uint32_t frame | |||||
for (uint32_t i=0; i < frames; ++i) | for (uint32_t i=0; i < frames; ++i) | ||||
{ | { | ||||
tmp1LP = a0LP * in1[i] - b1LP * tmp1LP + cfDC_ADD; | |||||
tmp2LP = a0LP * in2[i] - b1LP * tmp2LP + cfDC_ADD; | |||||
out1LP = tmp1LP - cfDC_ADD; | |||||
out2LP = tmp2LP - cfDC_ADD; | |||||
tmp1LP = a0LP * in1[i] - b1LP * tmp1LP + kDC_ADD; | |||||
tmp2LP = a0LP * in2[i] - b1LP * tmp2LP + kDC_ADD; | |||||
out1LP = tmp1LP - kDC_ADD; | |||||
out2LP = tmp2LP - kDC_ADD; | |||||
tmp1HP = a0HP * in1[i] - b1HP * tmp1HP + cfDC_ADD; | |||||
tmp2HP = a0HP * in2[i] - b1HP * tmp2HP + cfDC_ADD; | |||||
out1HP = in1[i] - tmp1HP - cfDC_ADD; | |||||
out2HP = in2[i] - tmp2HP - cfDC_ADD; | |||||
tmp1HP = a0HP * in1[i] - b1HP * tmp1HP + kDC_ADD; | |||||
tmp2HP = a0HP * in2[i] - b1HP * tmp2HP + kDC_ADD; | |||||
out1HP = in1[i] - tmp1HP - kDC_ADD; | |||||
out2HP = in2[i] - tmp2HP - kDC_ADD; | |||||
out1[i] = (out1LP*lowVol + (in1[i] - out1LP - out1HP)*midVol + out1HP*highVol) * outVol; | out1[i] = (out1LP*lowVol + (in1[i] - out1LP - out1HP)*midVol + out1HP*highVol) * outVol; | ||||
out2[i] = (out2LP*lowVol + (in2[i] - out2LP - out2HP)*midVol + out2HP*highVol) * outVol; | out2[i] = (out2LP*lowVol + (in2[i] - out2LP - out2HP)*midVol + out2HP*highVol) * outVol; | ||||
} | } | ||||
} | } | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
Plugin* createPlugin() | Plugin* createPlugin() | ||||
{ | { | ||||
return new DistrhoPlugin3BandEQ(); | return new DistrhoPlugin3BandEQ(); | ||||
} | } | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
END_NAMESPACE_DISTRHO | END_NAMESPACE_DISTRHO |
@@ -12,7 +12,7 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU Lesser General Public License for more details. | * GNU Lesser General Public License for more details. | ||||
* | * | ||||
* For a full copy of the license see the LGPL.txt file | |||||
* For a full copy of the license see the doc/LGPL.txt file. | |||||
*/ | */ | ||||
#ifndef DISTRHO_PLUGIN_3BANDEQ_HPP_INCLUDED | #ifndef DISTRHO_PLUGIN_3BANDEQ_HPP_INCLUDED | ||||
@@ -22,6 +22,8 @@ | |||||
START_NAMESPACE_DISTRHO | START_NAMESPACE_DISTRHO | ||||
// ----------------------------------------------------------------------- | |||||
class DistrhoPlugin3BandEQ : public Plugin | class DistrhoPlugin3BandEQ : public Plugin | ||||
{ | { | ||||
public: | public: | ||||
@@ -37,58 +39,58 @@ public: | |||||
}; | }; | ||||
DistrhoPlugin3BandEQ(); | DistrhoPlugin3BandEQ(); | ||||
~DistrhoPlugin3BandEQ(); | |||||
~DistrhoPlugin3BandEQ() override; | |||||
protected: | protected: | ||||
// --------------------------------------------- | |||||
// ------------------------------------------------------------------- | |||||
// Information | // Information | ||||
const char* d_label() const | |||||
const char* d_getLabel() const noexcept override | |||||
{ | { | ||||
return "3BandEQ"; | return "3BandEQ"; | ||||
} | } | ||||
const char* d_maker() const | |||||
const char* d_getMaker() const noexcept override | |||||
{ | { | ||||
return "DISTRHO"; | return "DISTRHO"; | ||||
} | } | ||||
const char* d_license() const | |||||
const char* d_getLicense() const noexcept override | |||||
{ | { | ||||
return "LGPL"; | return "LGPL"; | ||||
} | } | ||||
uint32_t d_version() const | |||||
uint32_t d_getVersion() const noexcept override | |||||
{ | { | ||||
return 0x1000; | return 0x1000; | ||||
} | } | ||||
long d_uniqueId() const | |||||
long d_getUniqueId() const noexcept override | |||||
{ | { | ||||
return d_cconst('D', '3', 'E', 'Q'); | return d_cconst('D', '3', 'E', 'Q'); | ||||
} | } | ||||
// --------------------------------------------- | |||||
// ------------------------------------------------------------------- | |||||
// Init | // Init | ||||
void d_initParameter(uint32_t index, Parameter& parameter); | |||||
void d_initProgramName(uint32_t index, d_string& programName); | |||||
void d_initParameter(uint32_t index, Parameter& parameter) override; | |||||
void d_initProgramName(uint32_t index, d_string& programName) override; | |||||
// --------------------------------------------- | |||||
// ------------------------------------------------------------------- | |||||
// Internal data | // Internal data | ||||
float d_parameterValue(uint32_t index); | |||||
void d_setParameterValue(uint32_t index, float value); | |||||
void d_setProgram(uint32_t index); | |||||
float d_getParameterValue(uint32_t index) const override; | |||||
void d_setParameterValue(uint32_t index, float value) override; | |||||
void d_setProgram(uint32_t index) override; | |||||
// --------------------------------------------- | |||||
// ------------------------------------------------------------------- | |||||
// Process | // Process | ||||
void d_activate(); | |||||
void d_deactivate(); | |||||
void d_run(float** inputs, float** outputs, uint32_t frames, uint32_t midiEventCount, const MidiEvent* midiEvents); | |||||
void d_activate() override; | |||||
void d_deactivate() override; | |||||
void d_run(float** inputs, float** outputs, uint32_t frames, uint32_t midiEventCount, const MidiEvent* midiEvents) override; | |||||
// --------------------------------------------- | |||||
// ------------------------------------------------------------------- | |||||
private: | private: | ||||
float fLow, fMid, fHigh, fMaster, fLowMidFreq, fMidHighFreq; | float fLow, fMid, fHigh, fMaster, fLowMidFreq, fMidHighFreq; | ||||
@@ -103,6 +105,8 @@ private: | |||||
float tmp1LP, tmp2LP, tmp1HP, tmp2HP; | float tmp1LP, tmp2LP, tmp1HP, tmp2HP; | ||||
}; | }; | ||||
// ----------------------------------------------------------------------- | |||||
END_NAMESPACE_DISTRHO | END_NAMESPACE_DISTRHO | ||||
#endif // DISTRHO_PLUGIN_3BANDEQ_HPP_INCLUDED | #endif // DISTRHO_PLUGIN_3BANDEQ_HPP_INCLUDED |
@@ -11,7 +11,7 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU Lesser General Public License for more details. | * GNU Lesser General Public License for more details. | ||||
* | * | ||||
* For a full copy of the license see the LGPL.txt file | |||||
* For a full copy of the license see the doc/LGPL.txt file. | |||||
*/ | */ | ||||
#ifndef DISTRHO_PLUGIN_INFO_H_INCLUDED | #ifndef DISTRHO_PLUGIN_INFO_H_INCLUDED | ||||
@@ -11,14 +11,14 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU Lesser General Public License for more details. | * GNU Lesser General Public License for more details. | ||||
* | * | ||||
* For a full copy of the license see the LGPL.txt file | |||||
* For a full copy of the license see the doc/LGPL.txt file. | |||||
*/ | */ | ||||
#include "DistrhoUI3BandEQ.hpp" | #include "DistrhoUI3BandEQ.hpp" | ||||
START_NAMESPACE_DISTRHO | START_NAMESPACE_DISTRHO | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
DistrhoUI3BandEQ::DistrhoUI3BandEQ() | DistrhoUI3BandEQ::DistrhoUI3BandEQ() | ||||
: OpenGLUI(), | : OpenGLUI(), | ||||
@@ -103,7 +103,7 @@ DistrhoUI3BandEQ::~DistrhoUI3BandEQ() | |||||
delete fButtonAbout; | delete fButtonAbout; | ||||
} | } | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
// DSP Callbacks | // DSP Callbacks | ||||
void DistrhoUI3BandEQ::d_parameterChanged(uint32_t index, float value) | void DistrhoUI3BandEQ::d_parameterChanged(uint32_t index, float value) | ||||
@@ -145,7 +145,7 @@ void DistrhoUI3BandEQ::d_programChanged(uint32_t index) | |||||
fKnobMidHigh->setValue(2000.0f); | fKnobMidHigh->setValue(2000.0f); | ||||
} | } | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
// Widget Callbacks | // Widget Callbacks | ||||
void DistrhoUI3BandEQ::imageButtonClicked(ImageButton* button, int) | void DistrhoUI3BandEQ::imageButtonClicked(ImageButton* button, int) | ||||
@@ -221,13 +221,13 @@ void DistrhoUI3BandEQ::onDisplay() | |||||
fImgBackground.draw(); | fImgBackground.draw(); | ||||
} | } | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
UI* createUI() | UI* createUI() | ||||
{ | { | ||||
return new DistrhoUI3BandEQ(); | return new DistrhoUI3BandEQ(); | ||||
} | } | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
END_NAMESPACE_DISTRHO | END_NAMESPACE_DISTRHO |
@@ -11,7 +11,7 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU Lesser General Public License for more details. | * GNU Lesser General Public License for more details. | ||||
* | * | ||||
* For a full copy of the license see the LGPL.txt file | |||||
* For a full copy of the license see the doc/LGPL.txt file. | |||||
*/ | */ | ||||
#ifndef DISTRHO_UI_3BANDEQ_HPP_INCLUDED | #ifndef DISTRHO_UI_3BANDEQ_HPP_INCLUDED | ||||
@@ -29,7 +29,7 @@ | |||||
START_NAMESPACE_DISTRHO | START_NAMESPACE_DISTRHO | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
class DistrhoUI3BandEQ : public OpenGLUI, | class DistrhoUI3BandEQ : public OpenGLUI, | ||||
public ImageButton::Callback, | public ImageButton::Callback, | ||||
@@ -41,26 +41,26 @@ public: | |||||
~DistrhoUI3BandEQ() override; | ~DistrhoUI3BandEQ() override; | ||||
protected: | protected: | ||||
// --------------------------------------------- | |||||
// ------------------------------------------------------------------- | |||||
// Information | // Information | ||||
unsigned int d_width() const override | |||||
unsigned int d_getWidth() const noexcept override | |||||
{ | { | ||||
return DistrhoArtwork3BandEQ::backgroundWidth; | return DistrhoArtwork3BandEQ::backgroundWidth; | ||||
} | } | ||||
unsigned int d_height() const override | |||||
unsigned int d_getHeight() const noexcept override | |||||
{ | { | ||||
return DistrhoArtwork3BandEQ::backgroundHeight; | return DistrhoArtwork3BandEQ::backgroundHeight; | ||||
} | } | ||||
// --------------------------------------------- | |||||
// ------------------------------------------------------------------- | |||||
// DSP Callbacks | // DSP Callbacks | ||||
void d_parameterChanged(uint32_t index, float value) override; | void d_parameterChanged(uint32_t index, float value) override; | ||||
void d_programChanged(uint32_t index) override; | void d_programChanged(uint32_t index) override; | ||||
// --------------------------------------------- | |||||
// ------------------------------------------------------------------- | |||||
// Widget Callbacks | // Widget Callbacks | ||||
void imageButtonClicked(ImageButton* button, int) override; | void imageButtonClicked(ImageButton* button, int) override; | ||||
@@ -86,7 +86,7 @@ private: | |||||
ImageButton* fButtonAbout; | ImageButton* fButtonAbout; | ||||
}; | }; | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
END_NAMESPACE_DISTRHO | END_NAMESPACE_DISTRHO | ||||
@@ -12,20 +12,20 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU Lesser General Public License for more details. | * GNU Lesser General Public License for more details. | ||||
* | * | ||||
* For a full copy of the license see the LGPL.txt file | |||||
* For a full copy of the license see the doc/LGPL.txt file. | |||||
*/ | */ | ||||
#include "DistrhoPlugin3BandSplitter.hpp" | #include "DistrhoPlugin3BandSplitter.hpp" | ||||
#include <cmath> | #include <cmath> | ||||
static const float cfAMP_DB = 8.656170245f; | |||||
static const float cfDC_ADD = 1e-30f; | |||||
static const float cfPI = 3.141592654f; | |||||
static const float kAMP_DB = 8.656170245f; | |||||
static const float kDC_ADD = 1e-30f; | |||||
static const float kPI = 3.141592654f; | |||||
START_NAMESPACE_DISTRHO | START_NAMESPACE_DISTRHO | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
DistrhoPlugin3BandSplitter::DistrhoPlugin3BandSplitter() | DistrhoPlugin3BandSplitter::DistrhoPlugin3BandSplitter() | ||||
: Plugin(paramCount, 1, 0) // 1 program, 0 states | : Plugin(paramCount, 1, 0) // 1 program, 0 states | ||||
@@ -41,7 +41,7 @@ DistrhoPlugin3BandSplitter::~DistrhoPlugin3BandSplitter() | |||||
{ | { | ||||
} | } | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
// Init | // Init | ||||
void DistrhoPlugin3BandSplitter::d_initParameter(uint32_t index, Parameter& parameter) | void DistrhoPlugin3BandSplitter::d_initParameter(uint32_t index, Parameter& parameter) | ||||
@@ -118,10 +118,10 @@ void DistrhoPlugin3BandSplitter::d_initProgramName(uint32_t index, d_string& pro | |||||
programName = "Default"; | programName = "Default"; | ||||
} | } | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
// Internal data | // Internal data | ||||
float DistrhoPlugin3BandSplitter::d_parameterValue(uint32_t index) | |||||
float DistrhoPlugin3BandSplitter::d_getParameterValue(uint32_t index) const | |||||
{ | { | ||||
switch (index) | switch (index) | ||||
{ | { | ||||
@@ -144,38 +144,38 @@ float DistrhoPlugin3BandSplitter::d_parameterValue(uint32_t index) | |||||
void DistrhoPlugin3BandSplitter::d_setParameterValue(uint32_t index, float value) | void DistrhoPlugin3BandSplitter::d_setParameterValue(uint32_t index, float value) | ||||
{ | { | ||||
if (d_sampleRate() <= 0.0) | |||||
if (d_getSampleRate() <= 0.0) | |||||
return; | return; | ||||
switch (index) | switch (index) | ||||
{ | { | ||||
case paramLow: | case paramLow: | ||||
fLow = value; | fLow = value; | ||||
lowVol = std::exp( (fLow/48.0f) * 48 / cfAMP_DB); | |||||
lowVol = std::exp( (fLow/48.0f) * 48 / kAMP_DB); | |||||
break; | break; | ||||
case paramMid: | case paramMid: | ||||
fMid = value; | fMid = value; | ||||
midVol = std::exp( (fMid/48.0f) * 48 / cfAMP_DB); | |||||
midVol = std::exp( (fMid/48.0f) * 48 / kAMP_DB); | |||||
break; | break; | ||||
case paramHigh: | case paramHigh: | ||||
fHigh = value; | fHigh = value; | ||||
highVol = std::exp( (fHigh/48.0f) * 48 / cfAMP_DB); | |||||
highVol = std::exp( (fHigh/48.0f) * 48 / kAMP_DB); | |||||
break; | break; | ||||
case paramMaster: | case paramMaster: | ||||
fMaster = value; | fMaster = value; | ||||
outVol = std::exp( (fMaster/48.0f) * 48 / cfAMP_DB); | |||||
outVol = std::exp( (fMaster/48.0f) * 48 / kAMP_DB); | |||||
break; | break; | ||||
case paramLowMidFreq: | case paramLowMidFreq: | ||||
fLowMidFreq = std::fmin(value, fMidHighFreq); | fLowMidFreq = std::fmin(value, fMidHighFreq); | ||||
freqLP = fLowMidFreq; //fLowMidFreq * (fLowMidFreq / 24000.0f) * (fLowMidFreq / 24000.0f); | freqLP = fLowMidFreq; //fLowMidFreq * (fLowMidFreq / 24000.0f) * (fLowMidFreq / 24000.0f); | ||||
xLP = std::exp(-2.0f * cfPI * freqLP / (float)d_sampleRate()); | |||||
xLP = std::exp(-2.0f * kPI * freqLP / (float)d_getSampleRate()); | |||||
a0LP = 1.0f - xLP; | a0LP = 1.0f - xLP; | ||||
b1LP = -xLP; | b1LP = -xLP; | ||||
break; | break; | ||||
case paramMidHighFreq: | case paramMidHighFreq: | ||||
fMidHighFreq = std::fmax(value, fLowMidFreq); | fMidHighFreq = std::fmax(value, fLowMidFreq); | ||||
freqHP = fMidHighFreq; //fMidHighFreq * (fMidHighFreq / 24000.0f) * (fMidHighFreq / 24000.0f); | freqHP = fMidHighFreq; //fMidHighFreq * (fMidHighFreq / 24000.0f) * (fMidHighFreq / 24000.0f); | ||||
xHP = std::exp(-2.0f * cfPI * freqHP / (float)d_sampleRate()); | |||||
xHP = std::exp(-2.0f * kPI * freqHP / (float)d_getSampleRate()); | |||||
a0HP = 1.0f - xHP; | a0HP = 1.0f - xHP; | ||||
b1HP = -xHP; | b1HP = -xHP; | ||||
break; | break; | ||||
@@ -204,16 +204,16 @@ void DistrhoPlugin3BandSplitter::d_setProgram(uint32_t index) | |||||
d_activate(); | d_activate(); | ||||
} | } | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
// Process | // Process | ||||
void DistrhoPlugin3BandSplitter::d_activate() | void DistrhoPlugin3BandSplitter::d_activate() | ||||
{ | { | ||||
xLP = std::exp(-2.0f * cfPI * freqLP / (float)d_sampleRate()); | |||||
xLP = std::exp(-2.0f * kPI * freqLP / (float)d_getSampleRate()); | |||||
a0LP = 1.0f - xLP; | a0LP = 1.0f - xLP; | ||||
b1LP = -xLP; | b1LP = -xLP; | ||||
xHP = std::exp(-2.0f * cfPI * freqHP / (float)d_sampleRate()); | |||||
xHP = std::exp(-2.0f * kPI * freqHP / (float)d_getSampleRate()); | |||||
a0HP = 1.0f - xHP; | a0HP = 1.0f - xHP; | ||||
b1HP = -xHP; | b1HP = -xHP; | ||||
} | } | ||||
@@ -237,15 +237,15 @@ void DistrhoPlugin3BandSplitter::d_run(float** inputs, float** outputs, uint32_t | |||||
for (uint32_t i=0; i < frames; ++i) | for (uint32_t i=0; i < frames; ++i) | ||||
{ | { | ||||
tmp1LP = a0LP * in1[i] - b1LP * tmp1LP + cfDC_ADD; | |||||
tmp2LP = a0LP * in2[i] - b1LP * tmp2LP + cfDC_ADD; | |||||
out1LP = tmp1LP - cfDC_ADD; | |||||
out2LP = tmp2LP - cfDC_ADD; | |||||
tmp1LP = a0LP * in1[i] - b1LP * tmp1LP + kDC_ADD; | |||||
tmp2LP = a0LP * in2[i] - b1LP * tmp2LP + kDC_ADD; | |||||
out1LP = tmp1LP - kDC_ADD; | |||||
out2LP = tmp2LP - kDC_ADD; | |||||
tmp1HP = a0HP * in1[i] - b1HP * tmp1HP + cfDC_ADD; | |||||
tmp2HP = a0HP * in2[i] - b1HP * tmp2HP + cfDC_ADD; | |||||
out1HP = in1[i] - tmp1HP - cfDC_ADD; | |||||
out2HP = in2[i] - tmp2HP - cfDC_ADD; | |||||
tmp1HP = a0HP * in1[i] - b1HP * tmp1HP + kDC_ADD; | |||||
tmp2HP = a0HP * in2[i] - b1HP * tmp2HP + kDC_ADD; | |||||
out1HP = in1[i] - tmp1HP - kDC_ADD; | |||||
out2HP = in2[i] - tmp2HP - kDC_ADD; | |||||
out1[i] = out1LP*lowVol * outVol; | out1[i] = out1LP*lowVol * outVol; | ||||
out2[i] = out2LP*lowVol * outVol; | out2[i] = out2LP*lowVol * outVol; | ||||
@@ -256,13 +256,13 @@ void DistrhoPlugin3BandSplitter::d_run(float** inputs, float** outputs, uint32_t | |||||
} | } | ||||
} | } | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
Plugin* createPlugin() | Plugin* createPlugin() | ||||
{ | { | ||||
return new DistrhoPlugin3BandSplitter(); | return new DistrhoPlugin3BandSplitter(); | ||||
} | } | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
END_NAMESPACE_DISTRHO | END_NAMESPACE_DISTRHO |
@@ -12,7 +12,7 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU Lesser General Public License for more details. | * GNU Lesser General Public License for more details. | ||||
* | * | ||||
* For a full copy of the license see the LGPL.txt file | |||||
* For a full copy of the license see the doc/LGPL.txt file. | |||||
*/ | */ | ||||
#ifndef DISTRHO_PLUGIN_3BANDSPLITTER_HPP_INCLUDED | #ifndef DISTRHO_PLUGIN_3BANDSPLITTER_HPP_INCLUDED | ||||
@@ -22,6 +22,8 @@ | |||||
START_NAMESPACE_DISTRHO | START_NAMESPACE_DISTRHO | ||||
// ----------------------------------------------------------------------- | |||||
class DistrhoPlugin3BandSplitter : public Plugin | class DistrhoPlugin3BandSplitter : public Plugin | ||||
{ | { | ||||
public: | public: | ||||
@@ -37,58 +39,58 @@ public: | |||||
}; | }; | ||||
DistrhoPlugin3BandSplitter(); | DistrhoPlugin3BandSplitter(); | ||||
~DistrhoPlugin3BandSplitter(); | |||||
~DistrhoPlugin3BandSplitter() override; | |||||
protected: | protected: | ||||
// --------------------------------------------- | |||||
// ------------------------------------------------------------------- | |||||
// Information | // Information | ||||
const char* d_label() const | |||||
const char* d_getLabel() const noexcept override | |||||
{ | { | ||||
return "3BandSplitter"; | return "3BandSplitter"; | ||||
} | } | ||||
const char* d_maker() const | |||||
const char* d_getMaker() const noexcept override | |||||
{ | { | ||||
return "DISTRHO"; | return "DISTRHO"; | ||||
} | } | ||||
const char* d_license() const | |||||
const char* d_getLicense() const noexcept override | |||||
{ | { | ||||
return "LGPL"; | return "LGPL"; | ||||
} | } | ||||
uint32_t d_version() const | |||||
uint32_t d_getVersion() const noexcept override | |||||
{ | { | ||||
return 0x1000; | return 0x1000; | ||||
} | } | ||||
long d_uniqueId() const | |||||
long d_getUniqueId() const noexcept override | |||||
{ | { | ||||
return d_cconst('D', '3', 'E', 'S'); | return d_cconst('D', '3', 'E', 'S'); | ||||
} | } | ||||
// --------------------------------------------- | |||||
// ------------------------------------------------------------------- | |||||
// Init | // Init | ||||
void d_initParameter(uint32_t index, Parameter& parameter); | |||||
void d_initProgramName(uint32_t index, d_string& programName); | |||||
void d_initParameter(uint32_t index, Parameter& parameter) override; | |||||
void d_initProgramName(uint32_t index, d_string& programName) override; | |||||
// --------------------------------------------- | |||||
// ------------------------------------------------------------------- | |||||
// Internal data | // Internal data | ||||
float d_parameterValue(uint32_t index); | |||||
void d_setParameterValue(uint32_t index, float value); | |||||
void d_setProgram(uint32_t index); | |||||
float d_getParameterValue(uint32_t index) const override; | |||||
void d_setParameterValue(uint32_t index, float value) override; | |||||
void d_setProgram(uint32_t index) override; | |||||
// --------------------------------------------- | |||||
// ------------------------------------------------------------------- | |||||
// Process | // Process | ||||
void d_activate(); | |||||
void d_deactivate(); | |||||
void d_run(float** inputs, float** outputs, uint32_t frames, uint32_t midiEventCount, const MidiEvent* midiEvents); | |||||
void d_activate() override; | |||||
void d_deactivate() override; | |||||
void d_run(float** inputs, float** outputs, uint32_t frames, uint32_t midiEventCount, const MidiEvent* midiEvents) override; | |||||
// --------------------------------------------- | |||||
// ------------------------------------------------------------------- | |||||
private: | private: | ||||
float fLow, fMid, fHigh, fMaster, fLowMidFreq, fMidHighFreq; | float fLow, fMid, fHigh, fMaster, fLowMidFreq, fMidHighFreq; | ||||
@@ -103,6 +105,8 @@ private: | |||||
float tmp1LP, tmp2LP, tmp1HP, tmp2HP; | float tmp1LP, tmp2LP, tmp1HP, tmp2HP; | ||||
}; | }; | ||||
// ----------------------------------------------------------------------- | |||||
END_NAMESPACE_DISTRHO | END_NAMESPACE_DISTRHO | ||||
#endif // DISTRHO_PLUGIN_3BANDSPLITTER_HPP_INCLUDED | #endif // DISTRHO_PLUGIN_3BANDSPLITTER_HPP_INCLUDED |
@@ -11,7 +11,7 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU Lesser General Public License for more details. | * GNU Lesser General Public License for more details. | ||||
* | * | ||||
* For a full copy of the license see the LGPL.txt file | |||||
* For a full copy of the license see the doc/LGPL.txt file. | |||||
*/ | */ | ||||
#ifndef DISTRHO_PLUGIN_INFO_H_INCLUDED | #ifndef DISTRHO_PLUGIN_INFO_H_INCLUDED | ||||
@@ -11,14 +11,14 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU Lesser General Public License for more details. | * GNU Lesser General Public License for more details. | ||||
* | * | ||||
* For a full copy of the license see the LGPL.txt file | |||||
* For a full copy of the license see the doc/LGPL.txt file. | |||||
*/ | */ | ||||
#include "DistrhoUI3BandSplitter.hpp" | #include "DistrhoUI3BandSplitter.hpp" | ||||
START_NAMESPACE_DISTRHO | START_NAMESPACE_DISTRHO | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
DistrhoUI3BandSplitter::DistrhoUI3BandSplitter() | DistrhoUI3BandSplitter::DistrhoUI3BandSplitter() | ||||
: OpenGLUI(), | : OpenGLUI(), | ||||
@@ -103,7 +103,7 @@ DistrhoUI3BandSplitter::~DistrhoUI3BandSplitter() | |||||
delete fButtonAbout; | delete fButtonAbout; | ||||
} | } | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
// DSP Callbacks | // DSP Callbacks | ||||
void DistrhoUI3BandSplitter::d_parameterChanged(uint32_t index, float value) | void DistrhoUI3BandSplitter::d_parameterChanged(uint32_t index, float value) | ||||
@@ -145,7 +145,7 @@ void DistrhoUI3BandSplitter::d_programChanged(uint32_t index) | |||||
fKnobMidHigh->setValue(2000.0f); | fKnobMidHigh->setValue(2000.0f); | ||||
} | } | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
// Widget Callbacks | // Widget Callbacks | ||||
void DistrhoUI3BandSplitter::imageButtonClicked(ImageButton* button, int) | void DistrhoUI3BandSplitter::imageButtonClicked(ImageButton* button, int) | ||||
@@ -221,13 +221,13 @@ void DistrhoUI3BandSplitter::onDisplay() | |||||
fImgBackground.draw(); | fImgBackground.draw(); | ||||
} | } | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
UI* createUI() | UI* createUI() | ||||
{ | { | ||||
return new DistrhoUI3BandSplitter(); | return new DistrhoUI3BandSplitter(); | ||||
} | } | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
END_NAMESPACE_DISTRHO | END_NAMESPACE_DISTRHO |
@@ -11,7 +11,7 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU Lesser General Public License for more details. | * GNU Lesser General Public License for more details. | ||||
* | * | ||||
* For a full copy of the license see the LGPL.txt file | |||||
* For a full copy of the license see the doc/LGPL.txt file. | |||||
*/ | */ | ||||
#ifndef DISTRHO_UI_3BANDSPLITTER_HPP_INCLUDED | #ifndef DISTRHO_UI_3BANDSPLITTER_HPP_INCLUDED | ||||
@@ -29,7 +29,7 @@ | |||||
START_NAMESPACE_DISTRHO | START_NAMESPACE_DISTRHO | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
class DistrhoUI3BandSplitter : public OpenGLUI, | class DistrhoUI3BandSplitter : public OpenGLUI, | ||||
public ImageButton::Callback, | public ImageButton::Callback, | ||||
@@ -41,26 +41,26 @@ public: | |||||
~DistrhoUI3BandSplitter() override; | ~DistrhoUI3BandSplitter() override; | ||||
protected: | protected: | ||||
// --------------------------------------------- | |||||
// ------------------------------------------------------------------- | |||||
// Information | // Information | ||||
unsigned int d_width() const override | |||||
unsigned int d_getWidth() const noexcept override | |||||
{ | { | ||||
return DistrhoArtwork3BandSplitter::backgroundWidth; | return DistrhoArtwork3BandSplitter::backgroundWidth; | ||||
} | } | ||||
unsigned int d_height() const override | |||||
unsigned int d_getHeight() const noexcept override | |||||
{ | { | ||||
return DistrhoArtwork3BandSplitter::backgroundHeight; | return DistrhoArtwork3BandSplitter::backgroundHeight; | ||||
} | } | ||||
// --------------------------------------------- | |||||
// ------------------------------------------------------------------- | |||||
// DSP Callbacks | // DSP Callbacks | ||||
void d_parameterChanged(uint32_t index, float value) override; | void d_parameterChanged(uint32_t index, float value) override; | ||||
void d_programChanged(uint32_t index) override; | void d_programChanged(uint32_t index) override; | ||||
// --------------------------------------------- | |||||
// ------------------------------------------------------------------- | |||||
// Widget Callbacks | // Widget Callbacks | ||||
void imageButtonClicked(ImageButton* button, int) override; | void imageButtonClicked(ImageButton* button, int) override; | ||||
@@ -86,7 +86,7 @@ private: | |||||
ImageButton* fButtonAbout; | ImageButton* fButtonAbout; | ||||
}; | }; | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
END_NAMESPACE_DISTRHO | END_NAMESPACE_DISTRHO | ||||
@@ -6,10 +6,6 @@ | |||||
include ../Makefile.mk | include ../Makefile.mk | ||||
# -------------------------------------------------------------- | |||||
BUILD_CXX_FLAGS += -I. -I../../libs/distrho -I../../widgets | |||||
ifeq ($(HAVE_QT4),true) | ifeq ($(HAVE_QT4),true) | ||||
BUILD_CXX_FLAGS += $(shell pkg-config --cflags QtCore QtGui) | BUILD_CXX_FLAGS += $(shell pkg-config --cflags QtCore QtGui) | ||||
else | else | ||||
@@ -19,30 +15,34 @@ endif | |||||
# -------------------------------------------------------------- | # -------------------------------------------------------------- | ||||
ifeq ($(HAVE_AF_DEPS),true) | ifeq ($(HAVE_AF_DEPS),true) | ||||
AF_C_FLAGS = $(BUILD_C_FLAGS) | |||||
AF_C_FLAGS += $(shell pkg-config --cflags sndfile) | |||||
AF_C_FLAGS = $(BUILD_C_FLAGS) | |||||
AF_C_FLAGS += $(shell pkg-config --cflags sndfile) | |||||
ifeq ($(HAVE_FFMPEG),true) | ifeq ($(HAVE_FFMPEG),true) | ||||
AF_C_FLAGS += -DHAVE_FFMPEG | |||||
AF_C_FLAGS += $(shell pkg-config --cflags libavcodec libavformat libavutil) | |||||
AF_C_FLAGS += -DHAVE_FFMPEG | |||||
AF_C_FLAGS += $(shell pkg-config --cflags libavcodec libavformat libavutil) | |||||
endif | endif | ||||
endif | endif | ||||
ifeq ($(HAVE_MF_DEPS),true) | ifeq ($(HAVE_MF_DEPS),true) | ||||
MF_CXX_FLAGS = $(BUILD_CXX_FLAGS) | |||||
MF_CXX_FLAGS += $(shell pkg-config --cflags smf) | |||||
MF_CXX_FLAGS = $(BUILD_CXX_FLAGS) | |||||
MF_CXX_FLAGS += $(shell pkg-config --cflags smf) | |||||
endif | endif | ||||
ifeq ($(HAVE_OPENGL),true) | ifeq ($(HAVE_OPENGL),true) | ||||
GL_CXX_FLAGS = $(BUILD_CXX_FLAGS) | |||||
GL_CXX_FLAGS += $(shell pkg-config --cflags gl) | |||||
GL_CXX_FLAGS = $(BUILD_CXX_FLAGS) | |||||
GL_CXX_FLAGS += -I../../modules/distrho | |||||
GL_CXX_FLAGS += $(shell pkg-config --cflags gl) | |||||
endif | endif | ||||
QT_CXX_FLAGS = $(BUILD_CXX_FLAGS) | |||||
QT_CXX_FLAGS += -I../../modules/distrho -I../../modules/widgets | |||||
ifeq ($(HAVE_ZYN_DEPS),true) | ifeq ($(HAVE_ZYN_DEPS),true) | ||||
ZYN_CXX_FLAGS = $(BUILD_CXX_FLAGS) | |||||
ZYN_CXX_FLAGS += $(shell pkg-config --cflags fftw3 mxml zlib) | |||||
ZYN_CXX_FLAGS = $(BUILD_CXX_FLAGS) | |||||
ZYN_CXX_FLAGS += $(shell pkg-config --cflags fftw3 mxml zlib) | |||||
ifeq ($(HAVE_ZYN_UI_DEPS),true) | ifeq ($(HAVE_ZYN_UI_DEPS),true) | ||||
ZYN_CXX_FLAGS += -DNTK_GUI | |||||
ZYN_CXX_FLAGS += $(shell pkg-config --cflags ntk ntk_images) | |||||
ZYN_CXX_FLAGS += -DNTK_GUI | |||||
ZYN_CXX_FLAGS += $(shell pkg-config --cflags ntk ntk_images) | |||||
endif | endif | ||||
endif | endif | ||||
@@ -56,8 +56,7 @@ OBJS = \ | |||||
midi-split.c.o \ | midi-split.c.o \ | ||||
midi-through.c.o \ | midi-through.c.o \ | ||||
midi-transpose.c.o \ | midi-transpose.c.o \ | ||||
nekofilter.c.o \ | |||||
sunvox-file.cpp.o | |||||
nekofilter.c.o | |||||
# AudioFile | # AudioFile | ||||
ifeq ($(HAVE_AF_DEPS),true) | ifeq ($(HAVE_AF_DEPS),true) | ||||
@@ -80,13 +79,13 @@ OBJS += \ | |||||
distrho-3bandeq.cpp.o \ | distrho-3bandeq.cpp.o \ | ||||
distrho-3bandsplitter.cpp.o \ | distrho-3bandsplitter.cpp.o \ | ||||
distrho-nekobi.cpp.o \ | distrho-nekobi.cpp.o \ | ||||
distrho-pingpongpan.cpp.o | |||||
# distrho-stereoenhancer.cpp.o | |||||
distrho-pingpongpan.cpp.o \ | |||||
distrho-stereoenhancer.cpp.o | |||||
endif | endif | ||||
# DISTRHO plugins (Qt) | # DISTRHO plugins (Qt) | ||||
# OBJS += \ | |||||
# distrho-notes.cpp.o | |||||
OBJS += \ | |||||
distrho-notes.cpp.o | |||||
ifeq ($(HAVE_ZYN_DEPS),true) | ifeq ($(HAVE_ZYN_DEPS),true) | ||||
# ZynAddSubFX | # ZynAddSubFX | ||||
@@ -142,9 +141,7 @@ TARGET = ../libcarla_native.a | |||||
all: $(TARGET) | all: $(TARGET) | ||||
clean: | clean: | ||||
rm -f $(OBJS) $(TARGET) | |||||
rm -f $(ZYN_UI_FILES_CPP) | |||||
rm -f $(ZYN_UI_FILES_H) | |||||
rm -f $(OBJS) $(TARGET) $(ZYN_UI_FILES_H) $(ZYN_UI_FILES_CPP) | |||||
rm -f moc_*.cpp | rm -f moc_*.cpp | ||||
debug: | debug: | ||||
@@ -182,7 +179,7 @@ distrho-stereoenhancer.cpp.o: distrho-stereoenhancer.cpp stereoenhancer/*.cpp st | |||||
$(CXX) $< $(GL_CXX_FLAGS) -Istereoenhancer -DDISTRHO_NAMESPACE=DISTRHO_StereoEnhancer -c -o $@ | $(CXX) $< $(GL_CXX_FLAGS) -Istereoenhancer -DDISTRHO_NAMESPACE=DISTRHO_StereoEnhancer -c -o $@ | ||||
distrho-notes.cpp.o: distrho-notes.cpp notes/moc_DistrhoUINotes.cpp notes/*.cpp notes/*.h notes/*.hpp distrho/DistrhoPluginCarla.cpp $(CXXDEPS) | distrho-notes.cpp.o: distrho-notes.cpp notes/moc_DistrhoUINotes.cpp notes/*.cpp notes/*.h notes/*.hpp distrho/DistrhoPluginCarla.cpp $(CXXDEPS) | ||||
$(CXX) $< $(BUILD_CXX_FLAGS) -Inotes -DDISTRHO_NAMESPACE=DISTRHO_Notes -c -o $@ | |||||
$(CXX) $< $(QT_CXX_FLAGS) -Inotes -DDISTRHO_NAMESPACE=DISTRHO_Notes -c -o $@ | |||||
midi-file.cpp.o: midi-file.cpp midi-base.hpp $(CXXDEPS) | midi-file.cpp.o: midi-file.cpp midi-base.hpp $(CXXDEPS) | ||||
$(CXX) $< $(MF_CXX_FLAGS) -c -o $@ | $(CXX) $< $(MF_CXX_FLAGS) -c -o $@ | ||||
@@ -196,7 +193,7 @@ nekofilter.c.o: nekofilter.c nekofilter/*.c nekofilter/*.h $(CDEPS) | |||||
zynaddsubfx.cpp.o: zynaddsubfx.cpp $(CXXDEPS) $(ZYN_UI_FILES_H) | zynaddsubfx.cpp.o: zynaddsubfx.cpp $(CXXDEPS) $(ZYN_UI_FILES_H) | ||||
$(CXX) $< $(ZYN_CXX_FLAGS) -c -o $@ | $(CXX) $< $(ZYN_CXX_FLAGS) -c -o $@ | ||||
zynaddsubfx-src.cpp.o: zynaddsubfx-src.cpp $(ZYN_UI_FILES_CPP) | |||||
zynaddsubfx-src.cpp.o: zynaddsubfx-src.cpp $(ZYN_UI_FILES_H) $(ZYN_UI_FILES_CPP) | |||||
$(CXX) $< $(ZYN_CXX_FLAGS) -c -o $@ | $(CXX) $< $(ZYN_CXX_FLAGS) -c -o $@ | ||||
zynaddsubfx-ui.cpp.o: zynaddsubfx-ui.cpp $(ZYN_UI_FILES_H) | zynaddsubfx-ui.cpp.o: zynaddsubfx-ui.cpp $(ZYN_UI_FILES_H) | ||||
@@ -204,11 +201,11 @@ zynaddsubfx-ui.cpp.o: zynaddsubfx-ui.cpp $(ZYN_UI_FILES_H) | |||||
# -------------------------------------------------------------- | # -------------------------------------------------------------- | ||||
%.c.o: %.c $(CDEPS) | |||||
$(CC) $< $(BUILD_C_FLAGS) -c -o $@ | |||||
%.cpp.o: %.cpp $(CXXDEPS) | |||||
$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@ | |||||
# %.c.o: %.c | |||||
# $(CC) $< $(BUILD_C_FLAGS) -c -o $@ | |||||
# | |||||
# %.cpp.o: %.cpp | |||||
# $(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@ | |||||
moc_%.cpp: %.hpp | moc_%.cpp: %.hpp | ||||
$(MOC) $< -DMOC_PARSING -o $@ | $(MOC) $< -DMOC_PARSING -o $@ | ||||
@@ -12,7 +12,7 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU General Public License for more details. | * GNU General Public License for more details. | ||||
* | * | ||||
* For a full copy of the GNU General Public License see the GPL.txt file | |||||
* For a full copy of the GNU General Public License see the doc/GPL.txt file. | |||||
*/ | */ | ||||
#ifndef AUDIO_BASE_HPP_INCLUDED | #ifndef AUDIO_BASE_HPP_INCLUDED | ||||
@@ -20,7 +20,7 @@ | |||||
#include "CarlaMutex.hpp" | #include "CarlaMutex.hpp" | ||||
#include <QtCore/QThread> | |||||
#include "JuceHeader.h" | |||||
extern "C" { | extern "C" { | ||||
#include "audio_decoder/ad.h" | #include "audio_decoder/ad.h" | ||||
@@ -109,14 +109,13 @@ public: | |||||
virtual uint32_t getLastFrame() const = 0; | virtual uint32_t getLastFrame() const = 0; | ||||
}; | }; | ||||
class AudioFileThread : public QThread | |||||
class AudioFileThread : public juce::Thread | |||||
{ | { | ||||
public: | public: | ||||
AudioFileThread(AbstractAudioPlayer* const player, const double sampleRate) | AudioFileThread(AbstractAudioPlayer* const player, const double sampleRate) | ||||
: QThread(nullptr), | |||||
: juce::Thread("AudioFileThread"), | |||||
kPlayer(player), | kPlayer(player), | ||||
fNeedsRead(false), | fNeedsRead(false), | ||||
fQuitNow(true), | |||||
fFilePtr(nullptr) | fFilePtr(nullptr) | ||||
{ | { | ||||
CARLA_ASSERT(kPlayer != nullptr); | CARLA_ASSERT(kPlayer != nullptr); | ||||
@@ -136,8 +135,7 @@ public: | |||||
~AudioFileThread() override | ~AudioFileThread() override | ||||
{ | { | ||||
CARLA_ASSERT(fQuitNow); | |||||
CARLA_ASSERT(! isRunning()); | |||||
CARLA_ASSERT(! isThreadRunning()); | |||||
if (fFilePtr != nullptr) | if (fFilePtr != nullptr) | ||||
ad_close(fFilePtr); | ad_close(fFilePtr); | ||||
@@ -148,17 +146,13 @@ public: | |||||
void startNow() | void startNow() | ||||
{ | { | ||||
fNeedsRead = true; | fNeedsRead = true; | ||||
fQuitNow = false; | |||||
start(IdlePriority); | |||||
startThread(2); | |||||
} | } | ||||
void stopNow() | void stopNow() | ||||
{ | { | ||||
fNeedsRead = false; | fNeedsRead = false; | ||||
fQuitNow = true; | |||||
if (isRunning() && ! wait(1000)) | |||||
terminate(); | |||||
stopThread(1000); | |||||
const CarlaMutex::ScopedLocker sl(fMutex); | const CarlaMutex::ScopedLocker sl(fMutex); | ||||
fPool.reset(); | fPool.reset(); | ||||
@@ -176,7 +170,7 @@ public: | |||||
bool loadFilename(const char* const filename) | bool loadFilename(const char* const filename) | ||||
{ | { | ||||
CARLA_ASSERT(! isRunning()); | |||||
CARLA_ASSERT(! isThreadRunning()); | |||||
CARLA_ASSERT(filename != nullptr); | CARLA_ASSERT(filename != nullptr); | ||||
fPool.startFrame = 0; | fPool.startFrame = 0; | ||||
@@ -362,7 +356,7 @@ public: | |||||
protected: | protected: | ||||
void run() override | void run() override | ||||
{ | { | ||||
while (! fQuitNow) | |||||
while (! threadShouldExit()) | |||||
{ | { | ||||
const uint32_t lastFrame(kPlayer->getLastFrame()); | const uint32_t lastFrame(kPlayer->getLastFrame()); | ||||
@@ -377,7 +371,6 @@ private: | |||||
AbstractAudioPlayer* const kPlayer; | AbstractAudioPlayer* const kPlayer; | ||||
bool fNeedsRead; | bool fNeedsRead; | ||||
bool fQuitNow; | |||||
void* fFilePtr; | void* fFilePtr; | ||||
ADInfo fFileNfo; | ADInfo fFileNfo; | ||||
@@ -12,7 +12,7 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU General Public License for more details. | * GNU General Public License for more details. | ||||
* | * | ||||
* For a full copy of the GNU General Public License see the GPL.txt file | |||||
* For a full copy of the GNU General Public License see the doc/GPL.txt file. | |||||
*/ | */ | ||||
#include "CarlaNative.hpp" | #include "CarlaNative.hpp" | ||||
@@ -245,7 +245,7 @@ private: | |||||
static const PluginDescriptor audiofileDesc = { | static const PluginDescriptor audiofileDesc = { | ||||
/* category */ PLUGIN_CATEGORY_UTILITY, | /* category */ PLUGIN_CATEGORY_UTILITY, | ||||
/* hints */ static_cast<PluginHints>(PLUGIN_IS_RTSAFE|PLUGIN_HAS_GUI|PLUGIN_USES_GUI_AS_FILE), | |||||
/* hints */ static_cast<PluginHints>(PLUGIN_IS_RTSAFE|PLUGIN_HAS_GUI), | |||||
/* supports */ static_cast<PluginSupports>(0x0), | /* supports */ static_cast<PluginSupports>(0x0), | ||||
/* audioIns */ 0, | /* audioIns */ 0, | ||||
/* audioOuts */ 2, | /* audioOuts */ 2, | ||||
@@ -12,18 +12,17 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU General Public License for more details. | * GNU General Public License for more details. | ||||
* | * | ||||
* For a full copy of the GNU General Public License see the GPL.txt file | |||||
* For a full copy of the GNU General Public License see the doc/GPL.txt file. | |||||
*/ | */ | ||||
#include "CarlaNative.h" | #include "CarlaNative.h" | ||||
static PluginHandle bypass_instantiate(const PluginDescriptor* _this_, HostDescriptor* host) | |||||
static PluginHandle bypass_instantiate(HostDescriptor* host) | |||||
{ | { | ||||
// dummy, return non-NULL | // dummy, return non-NULL | ||||
return (PluginHandle)0x1; | return (PluginHandle)0x1; | ||||
// unused | // unused | ||||
(void)_this_; | |||||
(void)host; | (void)host; | ||||
} | } | ||||
@@ -12,7 +12,7 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU General Public License for more details. | * GNU General Public License for more details. | ||||
* | * | ||||
* For a full copy of the GNU General Public License see the GPL.txt file | |||||
* For a full copy of the GNU General Public License see the doc/GPL.txt file. | |||||
*/ | */ | ||||
#include "CarlaNative.hpp" | #include "CarlaNative.hpp" | ||||
@@ -12,7 +12,7 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU General Public License for more details. | * GNU General Public License for more details. | ||||
* | * | ||||
* For a full copy of the GNU General Public License see the GPL.txt file | |||||
* For a full copy of the GNU General Public License see the doc/GPL.txt file. | |||||
*/ | */ | ||||
#include "CarlaNative.hpp" | #include "CarlaNative.hpp" | ||||
@@ -12,7 +12,7 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU General Public License for more details. | * GNU General Public License for more details. | ||||
* | * | ||||
* For a full copy of the GNU General Public License see the GPL.txt file | |||||
* For a full copy of the GNU General Public License see the doc/GPL.txt file. | |||||
*/ | */ | ||||
#include "CarlaNative.hpp" | #include "CarlaNative.hpp" | ||||
@@ -12,7 +12,7 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU General Public License for more details. | * GNU General Public License for more details. | ||||
* | * | ||||
* For a full copy of the GNU General Public License see the GPL.txt file | |||||
* For a full copy of the GNU General Public License see the doc/GPL.txt file. | |||||
*/ | */ | ||||
#include "CarlaNative.hpp" | #include "CarlaNative.hpp" | ||||
@@ -12,7 +12,7 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU General Public License for more details. | * GNU General Public License for more details. | ||||
* | * | ||||
* For a full copy of the GNU General Public License see the GPL.txt file | |||||
* For a full copy of the GNU General Public License see the doc/GPL.txt file. | |||||
*/ | */ | ||||
#include "CarlaNative.hpp" | #include "CarlaNative.hpp" | ||||
@@ -12,7 +12,7 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU General Public License for more details. | * GNU General Public License for more details. | ||||
* | * | ||||
* For a full copy of the GNU General Public License see the GPL.txt file | |||||
* For a full copy of the GNU General Public License see the doc/GPL.txt file. | |||||
*/ | */ | ||||
#include "CarlaNative.hpp" | #include "CarlaNative.hpp" | ||||
@@ -15,7 +15,6 @@ | |||||
*/ | */ | ||||
#include "CarlaNative.hpp" | #include "CarlaNative.hpp" | ||||
#include "CarlaUtils.hpp" | |||||
#include "DistrhoPluginMain.cpp" | #include "DistrhoPluginMain.cpp" | ||||
@@ -30,6 +29,8 @@ | |||||
# include "DistrhoUIMain.cpp" | # include "DistrhoUIMain.cpp" | ||||
#endif | #endif | ||||
using juce::ScopedPointer; | |||||
// ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
START_NAMESPACE_DISTRHO | START_NAMESPACE_DISTRHO | ||||
@@ -60,12 +61,12 @@ public: | |||||
setCentralWidget(qtUi); | setCentralWidget(qtUi); | ||||
#endif | #endif | ||||
setWindowIcon(QIcon(":/scalable/distrho.svg")); | setWindowIcon(QIcon(":/scalable/distrho.svg")); | ||||
setWindowTitle(QString("%1 (GUI)").arg(fUi.name())); | |||||
setWindowTitle(QString("%1 (GUI)").arg(fUi.getName())); | |||||
#ifdef DISTRHO_UI_OPENGL | #ifdef DISTRHO_UI_OPENGL | ||||
fUi.fixSize(); | |||||
fUi.fixWindowSize(); | |||||
#endif | #endif | ||||
uiResize(fUi.width(), fUi.height()); | |||||
uiResize(fUi.getWidth(), fUi.getHeight()); | |||||
{ | { | ||||
QSettings settings; | QSettings settings; | ||||
@@ -148,7 +149,7 @@ protected: | |||||
fWidget.setFixedSize(width, height); | fWidget.setFixedSize(width, height); | ||||
setFixedSize(width, height); | setFixedSize(width, height); | ||||
#else | #else | ||||
if (fUi.resizable()) | |||||
if (fUi.isResizable()) | |||||
resize(width, height); | resize(width, height); | ||||
else | else | ||||
setFixedSize(width, height); | setFixedSize(width, height); | ||||
@@ -243,7 +244,7 @@ protected: | |||||
uint32_t getParameterCount() override | uint32_t getParameterCount() override | ||||
{ | { | ||||
return fPlugin.parameterCount(); | |||||
return fPlugin.getParameterCount(); | |||||
} | } | ||||
const ::Parameter* getParameterInfo(const uint32_t index) override | const ::Parameter* getParameterInfo(const uint32_t index) override | ||||
@@ -259,7 +260,7 @@ protected: | |||||
{ | { | ||||
int nativeParamHints = ::PARAMETER_IS_ENABLED; | int nativeParamHints = ::PARAMETER_IS_ENABLED; | ||||
const uint32_t paramHints = fPlugin.parameterHints(index); | |||||
const uint32_t paramHints = fPlugin.getParameterHints(index); | |||||
if (paramHints & PARAMETER_IS_AUTOMABLE) | if (paramHints & PARAMETER_IS_AUTOMABLE) | ||||
nativeParamHints |= ::PARAMETER_IS_AUTOMABLE; | nativeParamHints |= ::PARAMETER_IS_AUTOMABLE; | ||||
@@ -275,11 +276,11 @@ protected: | |||||
param.hints = static_cast<ParameterHints>(nativeParamHints); | param.hints = static_cast<ParameterHints>(nativeParamHints); | ||||
} | } | ||||
param.name = fPlugin.parameterName(index); | |||||
param.unit = fPlugin.parameterUnit(index); | |||||
param.name = fPlugin.getParameterName(index); | |||||
param.unit = fPlugin.getParameterUnit(index); | |||||
{ | { | ||||
const ParameterRanges& ranges(fPlugin.parameterRanges(index)); | |||||
const ParameterRanges& ranges(fPlugin.getParameterRanges(index)); | |||||
param.ranges.def = ranges.def; | param.ranges.def = ranges.def; | ||||
param.ranges.min = ranges.min; | param.ranges.min = ranges.min; | ||||
@@ -296,7 +297,7 @@ protected: | |||||
{ | { | ||||
CARLA_ASSERT(index < getParameterCount()); | CARLA_ASSERT(index < getParameterCount()); | ||||
return fPlugin.parameterValue(index); | |||||
return fPlugin.getParameterValue(index); | |||||
} | } | ||||
// getParameterText unused | // getParameterText unused | ||||
@@ -307,21 +308,21 @@ protected: | |||||
#if DISTRHO_PLUGIN_WANT_PROGRAMS | #if DISTRHO_PLUGIN_WANT_PROGRAMS | ||||
uint32_t getMidiProgramCount() override | uint32_t getMidiProgramCount() override | ||||
{ | { | ||||
return fPlugin.programCount(); | |||||
return fPlugin.getProgramCount(); | |||||
} | } | ||||
const ::MidiProgram* getMidiProgramInfo(const uint32_t index) override | const ::MidiProgram* getMidiProgramInfo(const uint32_t index) override | ||||
{ | { | ||||
CARLA_ASSERT(index < getMidiProgramCount()); | CARLA_ASSERT(index < getMidiProgramCount()); | ||||
if (index >= fPlugin.programCount()) | |||||
if (index >= fPlugin.getProgramCount()) | |||||
return nullptr; | return nullptr; | ||||
static ::MidiProgram midiProgram; | static ::MidiProgram midiProgram; | ||||
midiProgram.bank = index / 128; | midiProgram.bank = index / 128; | ||||
midiProgram.program = index % 128; | midiProgram.program = index % 128; | ||||
midiProgram.name = fPlugin.programName(index); | |||||
midiProgram.name = fPlugin.getProgramName(index); | |||||
return &midiProgram; | return &midiProgram; | ||||
} | } | ||||
@@ -342,7 +343,7 @@ protected: | |||||
{ | { | ||||
const uint32_t realProgram(bank * 128 + program); | const uint32_t realProgram(bank * 128 + program); | ||||
if (realProgram >= fPlugin.programCount()) | |||||
if (realProgram >= fPlugin.getProgramCount()) | |||||
return; | return; | ||||
fPlugin.setProgram(realProgram); | fPlugin.setProgram(realProgram); | ||||
@@ -436,7 +437,7 @@ protected: | |||||
const uint32_t realProgram(bank * 128 + program); | const uint32_t realProgram(bank * 128 + program); | ||||
if (realProgram >= fPlugin.programCount()) | |||||
if (realProgram >= fPlugin.getProgramCount()) | |||||
return; | return; | ||||
if (fUiPtr != nullptr) | if (fUiPtr != nullptr) | ||||
@@ -476,7 +477,7 @@ private: | |||||
if (fUiPtr == nullptr) | if (fUiPtr == nullptr) | ||||
{ | { | ||||
d_lastUiSampleRate = getSampleRate(); | d_lastUiSampleRate = getSampleRate(); | ||||
fUiPtr = new UICarla(hostHandle(), &fPlugin); | |||||
fUiPtr = new UICarla(getHostHandle(), &fPlugin); | |||||
if (! fUiGeometry.isNull()) | if (! fUiGeometry.isNull()) | ||||
fUiPtr->restoreGeometry(fUiGeometry); | fUiPtr->restoreGeometry(fUiGeometry); | ||||
@@ -489,7 +490,7 @@ private: | |||||
// ------------------------------------------------------------------- | // ------------------------------------------------------------------- | ||||
public: | public: | ||||
static PluginHandle _instantiate(const PluginDescriptor*, HostDescriptor* host) | |||||
static PluginHandle _instantiate(HostDescriptor* host) | |||||
{ | { | ||||
d_lastBufferSize = host->get_buffer_size(host->handle); | d_lastBufferSize = host->get_buffer_size(host->handle); | ||||
d_lastSampleRate = host->get_sample_rate(host->handle); | d_lastSampleRate = host->get_sample_rate(host->handle); | ||||
@@ -43,7 +43,7 @@ typedef struct _LfoHandle { | |||||
float value; | float value; | ||||
} LfoHandle; | } LfoHandle; | ||||
static PluginHandle lfo_instantiate(const PluginDescriptor* _this_, HostDescriptor* host) | |||||
static PluginHandle lfo_instantiate(HostDescriptor* host) | |||||
{ | { | ||||
LfoHandle* const handle = (LfoHandle*)malloc(sizeof(LfoHandle)); | LfoHandle* const handle = (LfoHandle*)malloc(sizeof(LfoHandle)); | ||||
@@ -59,9 +59,6 @@ static PluginHandle lfo_instantiate(const PluginDescriptor* _this_, HostDescript | |||||
handle->baseStart = 0.0f; | handle->baseStart = 0.0f; | ||||
handle->value = 0.0f; | handle->value = 0.0f; | ||||
return handle; | return handle; | ||||
// unused | |||||
(void)_this_; | |||||
} | } | ||||
#define handlePtr ((LfoHandle*)handle) | #define handlePtr ((LfoHandle*)handle) | ||||
@@ -12,7 +12,7 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU General Public License for more details. | * GNU General Public License for more details. | ||||
* | * | ||||
* For a full copy of the GNU General Public License see the GPL.txt file | |||||
* For a full copy of the GNU General Public License see the doc/GPL.txt file. | |||||
*/ | */ | ||||
#ifndef MIDI_BASE_HPP_INCLUDED | #ifndef MIDI_BASE_HPP_INCLUDED | ||||
@@ -83,7 +83,7 @@ public: | |||||
void addChannelPressure(const uint32_t time, const uint8_t channel, const uint8_t pressure) | void addChannelPressure(const uint32_t time, const uint8_t channel, const uint8_t pressure) | ||||
{ | { | ||||
RawMidiEvent* pressureEvent(new RawMidiEvent()); | RawMidiEvent* pressureEvent(new RawMidiEvent()); | ||||
pressureEvent->data[0] = MIDI_STATUS_AFTERTOUCH | (channel & 0x0F); | |||||
pressureEvent->data[0] = MIDI_STATUS_CHANNEL_PRESSURE | (channel & 0x0F); | |||||
pressureEvent->data[1] = pressure; | pressureEvent->data[1] = pressure; | ||||
pressureEvent->size = 2; | pressureEvent->size = 2; | ||||
pressureEvent->time = time; | pressureEvent->time = time; | ||||
@@ -12,7 +12,7 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU General Public License for more details. | * GNU General Public License for more details. | ||||
* | * | ||||
* For a full copy of the GNU General Public License see the GPL.txt file | |||||
* For a full copy of the GNU General Public License see the doc/GPL.txt file. | |||||
*/ | */ | ||||
#include "CarlaNative.hpp" | #include "CarlaNative.hpp" | ||||
@@ -220,7 +220,7 @@ private: | |||||
static const PluginDescriptor midifileDesc = { | static const PluginDescriptor midifileDesc = { | ||||
/* category */ PLUGIN_CATEGORY_UTILITY, | /* category */ PLUGIN_CATEGORY_UTILITY, | ||||
/* hints */ static_cast<PluginHints>(PLUGIN_IS_RTSAFE|PLUGIN_HAS_GUI|PLUGIN_USES_GUI_AS_FILE), | |||||
/* hints */ static_cast<PluginHints>(PLUGIN_IS_RTSAFE|PLUGIN_HAS_GUI), | |||||
/* supports */ static_cast<PluginSupports>(0x0), | /* supports */ static_cast<PluginSupports>(0x0), | ||||
/* audioIns */ 0, | /* audioIns */ 0, | ||||
/* audioOuts */ 0, | /* audioOuts */ 0, | ||||
@@ -12,7 +12,7 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU General Public License for more details. | * GNU General Public License for more details. | ||||
* | * | ||||
* For a full copy of the GNU General Public License see the GPL.txt file | |||||
* For a full copy of the GNU General Public License see the doc/GPL.txt file. | |||||
*/ | */ | ||||
#include "CarlaNative.hpp" | #include "CarlaNative.hpp" | ||||
@@ -12,7 +12,7 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU General Public License for more details. | * GNU General Public License for more details. | ||||
* | * | ||||
* For a full copy of the GNU General Public License see the GPL.txt file | |||||
* For a full copy of the GNU General Public License see the doc/GPL.txt file. | |||||
*/ | */ | ||||
#include "CarlaNative.h" | #include "CarlaNative.h" | ||||
@@ -24,7 +24,7 @@ typedef struct _MidiSplitHandle { | |||||
HostDescriptor* host; | HostDescriptor* host; | ||||
} MidiSplitHandle; | } MidiSplitHandle; | ||||
static PluginHandle midiSplit_instantiate(const PluginDescriptor* _this_, HostDescriptor* host) | |||||
static PluginHandle midiSplit_instantiate(HostDescriptor* host) | |||||
{ | { | ||||
MidiSplitHandle* const handle = (MidiSplitHandle*)malloc(sizeof(MidiSplitHandle)); | MidiSplitHandle* const handle = (MidiSplitHandle*)malloc(sizeof(MidiSplitHandle)); | ||||
@@ -33,9 +33,6 @@ static PluginHandle midiSplit_instantiate(const PluginDescriptor* _this_, HostDe | |||||
handle->host = host; | handle->host = host; | ||||
return handle; | return handle; | ||||
// unused | |||||
(void)_this_; | |||||
} | } | ||||
#define handlePtr ((MidiSplitHandle*)handle) | #define handlePtr ((MidiSplitHandle*)handle) | ||||
@@ -12,7 +12,7 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU General Public License for more details. | * GNU General Public License for more details. | ||||
* | * | ||||
* For a full copy of the GNU General Public License see the GPL.txt file | |||||
* For a full copy of the GNU General Public License see the doc/GPL.txt file. | |||||
*/ | */ | ||||
#include "CarlaNative.h" | #include "CarlaNative.h" | ||||
@@ -24,7 +24,7 @@ typedef struct _MidiThroughHandle { | |||||
HostDescriptor* host; | HostDescriptor* host; | ||||
} MidiThroughHandle; | } MidiThroughHandle; | ||||
static PluginHandle midiThrough_instantiate(const PluginDescriptor* _this_, HostDescriptor* host) | |||||
static PluginHandle midiThrough_instantiate(HostDescriptor* host) | |||||
{ | { | ||||
MidiThroughHandle* const handle = (MidiThroughHandle*)malloc(sizeof(MidiThroughHandle)); | MidiThroughHandle* const handle = (MidiThroughHandle*)malloc(sizeof(MidiThroughHandle)); | ||||
@@ -33,9 +33,6 @@ static PluginHandle midiThrough_instantiate(const PluginDescriptor* _this_, Host | |||||
handle->host = host; | handle->host = host; | ||||
return handle; | return handle; | ||||
// unused | |||||
(void)_this_; | |||||
} | } | ||||
#define handlePtr ((MidiThroughHandle*)handle) | #define handlePtr ((MidiThroughHandle*)handle) | ||||
@@ -12,7 +12,7 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU General Public License for more details. | * GNU General Public License for more details. | ||||
* | * | ||||
* For a full copy of the GNU General Public License see the GPL.txt file | |||||
* For a full copy of the GNU General Public License see the doc/GPL.txt file. | |||||
*/ | */ | ||||
#include "CarlaNative.h" | #include "CarlaNative.h" | ||||
@@ -25,7 +25,7 @@ typedef struct _MidiTransposeHandle { | |||||
int octaves; | int octaves; | ||||
} MidiTransposeHandle; | } MidiTransposeHandle; | ||||
static PluginHandle midiTranspose_instantiate(const PluginDescriptor* _this_, HostDescriptor* host) | |||||
static PluginHandle midiTranspose_instantiate(HostDescriptor* host) | |||||
{ | { | ||||
MidiTransposeHandle* const handle = (MidiTransposeHandle*)malloc(sizeof(MidiTransposeHandle)); | MidiTransposeHandle* const handle = (MidiTransposeHandle*)malloc(sizeof(MidiTransposeHandle)); | ||||
@@ -35,9 +35,6 @@ static PluginHandle midiTranspose_instantiate(const PluginDescriptor* _this_, Ho | |||||
handle->host = host; | handle->host = host; | ||||
handle->octaves = 0; | handle->octaves = 0; | ||||
return handle; | return handle; | ||||
// unused | |||||
(void)_this_; | |||||
} | } | ||||
#define handlePtr ((MidiTransposeHandle*)handle) | #define handlePtr ((MidiTransposeHandle*)handle) | ||||
@@ -12,7 +12,7 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU General Public License for more details. | * GNU General Public License for more details. | ||||
* | * | ||||
* For a full copy of the GNU General Public License see the GPL.txt file | |||||
* For a full copy of the GNU General Public License see the doc/GPL.txt file. | |||||
*/ | */ | ||||
#ifndef DISTRHO_PLUGIN_INFO_H_INCLUDED | #ifndef DISTRHO_PLUGIN_INFO_H_INCLUDED | ||||
@@ -13,7 +13,7 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU General Public License for more details. | * GNU General Public License for more details. | ||||
* | * | ||||
* For a full copy of the GNU General Public License see the GPL.txt file | |||||
* For a full copy of the GNU General Public License see the doc/GPL.txt file. | |||||
*/ | */ | ||||
#include "DistrhoPluginNekobi.hpp" | #include "DistrhoPluginNekobi.hpp" | ||||
@@ -30,7 +30,8 @@ extern "C" { | |||||
#include "nekobee-src/nekobee_voice_render.c" | #include "nekobee-src/nekobee_voice_render.c" | ||||
#include "nekobee-src/minblep_tables.c" | #include "nekobee-src/minblep_tables.c" | ||||
/* ---- mutual exclusion ---- */ | |||||
// ----------------------------------------------------------------------- | |||||
// mutual exclusion | |||||
bool dssp_voicelist_mutex_trylock(nekobee_synth_t* synth) | bool dssp_voicelist_mutex_trylock(nekobee_synth_t* synth) | ||||
{ | { | ||||
@@ -61,9 +62,9 @@ bool dssp_voicelist_mutex_unlock(nekobee_synth_t *synth) | |||||
return (pthread_mutex_unlock(&synth->voicelist_mutex) == 0); | return (pthread_mutex_unlock(&synth->voicelist_mutex) == 0); | ||||
} | } | ||||
/* | |||||
* nekobee_handle_raw_event | |||||
*/ | |||||
// ----------------------------------------------------------------------- | |||||
// nekobee_handle_raw_event | |||||
void nekobee_handle_raw_event(nekobee_synth_t* synth, uint8_t size, const uint8_t* data) | void nekobee_handle_raw_event(nekobee_synth_t* synth, uint8_t size, const uint8_t* data) | ||||
{ | { | ||||
if (size != 3) | if (size != 3) | ||||
@@ -92,7 +93,7 @@ void nekobee_handle_raw_event(nekobee_synth_t* synth, uint8_t size, const uint8_ | |||||
START_NAMESPACE_DISTRHO | START_NAMESPACE_DISTRHO | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
DistrhoPluginNekobi::DistrhoPluginNekobi() | DistrhoPluginNekobi::DistrhoPluginNekobi() | ||||
: Plugin(paramCount, 0, 0) // 0 programs, 0 states | : Plugin(paramCount, 0, 0) // 0 programs, 0 states | ||||
@@ -102,8 +103,8 @@ DistrhoPluginNekobi::DistrhoPluginNekobi() | |||||
// init synth | // init synth | ||||
fSynth = new nekobee_synth_t; | fSynth = new nekobee_synth_t; | ||||
fSynth->sample_rate = d_sampleRate(); | |||||
fSynth->deltat = 1.0f / (float)d_sampleRate(); | |||||
fSynth->sample_rate = d_getSampleRate(); | |||||
fSynth->deltat = 1.0f / (float)d_getSampleRate(); | |||||
fSynth->nugget_remains = 0; | fSynth->nugget_remains = 0; | ||||
fSynth->note_id = 0; | fSynth->note_id = 0; | ||||
@@ -167,7 +168,7 @@ DistrhoPluginNekobi::~DistrhoPluginNekobi() | |||||
delete fSynth; | delete fSynth; | ||||
} | } | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
// Init | // Init | ||||
void DistrhoPluginNekobi::d_initParameter(uint32_t index, Parameter& parameter) | void DistrhoPluginNekobi::d_initParameter(uint32_t index, Parameter& parameter) | ||||
@@ -247,10 +248,10 @@ void DistrhoPluginNekobi::d_initParameter(uint32_t index, Parameter& parameter) | |||||
} | } | ||||
} | } | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
// Internal data | // Internal data | ||||
float DistrhoPluginNekobi::d_parameterValue(uint32_t index) | |||||
float DistrhoPluginNekobi::d_getParameterValue(uint32_t index) const | |||||
{ | { | ||||
switch (index) | switch (index) | ||||
{ | { | ||||
@@ -322,7 +323,7 @@ void DistrhoPluginNekobi::d_setParameterValue(uint32_t index, float value) | |||||
} | } | ||||
} | } | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
// Process | // Process | ||||
void DistrhoPluginNekobi::d_activate() | void DistrhoPluginNekobi::d_activate() | ||||
@@ -397,13 +398,13 @@ void DistrhoPluginNekobi::d_run(float**, float** outputs, uint32_t frames, uint3 | |||||
dssp_voicelist_mutex_unlock(fSynth); | dssp_voicelist_mutex_unlock(fSynth); | ||||
} | } | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
Plugin* createPlugin() | Plugin* createPlugin() | ||||
{ | { | ||||
return new DistrhoPluginNekobi(); | return new DistrhoPluginNekobi(); | ||||
} | } | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
END_NAMESPACE_DISTRHO | END_NAMESPACE_DISTRHO |
@@ -13,11 +13,11 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU General Public License for more details. | * GNU General Public License for more details. | ||||
* | * | ||||
* For a full copy of the GNU General Public License see the GPL.txt file | |||||
* For a full copy of the GNU General Public License see the doc/GPL.txt file. | |||||
*/ | */ | ||||
#ifndef DISTRHO_PLUGIN_3BANDEQ_HPP_INCLUDED | |||||
#define DISTRHO_PLUGIN_3BANDEQ_HPP_INCLUDED | |||||
#ifndef DISTRHO_PLUGIN_NEKOBI_HPP_INCLUDED | |||||
#define DISTRHO_PLUGIN_NEKOBI_HPP_INCLUDED | |||||
#include "DistrhoPlugin.hpp" | #include "DistrhoPlugin.hpp" | ||||
@@ -27,6 +27,8 @@ extern "C" { | |||||
START_NAMESPACE_DISTRHO | START_NAMESPACE_DISTRHO | ||||
// ----------------------------------------------------------------------- | |||||
class DistrhoPluginNekobi : public Plugin | class DistrhoPluginNekobi : public Plugin | ||||
{ | { | ||||
public: | public: | ||||
@@ -44,56 +46,56 @@ public: | |||||
}; | }; | ||||
DistrhoPluginNekobi(); | DistrhoPluginNekobi(); | ||||
~DistrhoPluginNekobi(); | |||||
~DistrhoPluginNekobi() override; | |||||
protected: | protected: | ||||
// --------------------------------------------- | |||||
// ------------------------------------------------------------------- | |||||
// Information | // Information | ||||
const char* d_label() const | |||||
const char* d_getLabel() const noexcept override | |||||
{ | { | ||||
return "Nekobi"; | return "Nekobi"; | ||||
} | } | ||||
const char* d_maker() const | |||||
const char* d_getMaker() const noexcept override | |||||
{ | { | ||||
return "DISTRHO"; | return "DISTRHO"; | ||||
} | } | ||||
const char* d_license() const | |||||
const char* d_getLicense() const noexcept override | |||||
{ | { | ||||
return "GPL v2+"; | return "GPL v2+"; | ||||
} | } | ||||
uint32_t d_version() const | |||||
uint32_t d_getVersion() const noexcept override | |||||
{ | { | ||||
return 0x1000; | return 0x1000; | ||||
} | } | ||||
long d_uniqueId() const | |||||
long d_getUniqueId() const noexcept override | |||||
{ | { | ||||
return d_cconst('D', 'N', 'e', 'k'); | return d_cconst('D', 'N', 'e', 'k'); | ||||
} | } | ||||
// --------------------------------------------- | |||||
// ------------------------------------------------------------------- | |||||
// Init | // Init | ||||
void d_initParameter(uint32_t index, Parameter& parameter); | |||||
void d_initParameter(uint32_t index, Parameter& parameter) override; | |||||
// --------------------------------------------- | |||||
// ------------------------------------------------------------------- | |||||
// Internal data | // Internal data | ||||
float d_parameterValue(uint32_t index); | |||||
void d_setParameterValue(uint32_t index, float value); | |||||
float d_getParameterValue(uint32_t index) const override; | |||||
void d_setParameterValue(uint32_t index, float value) override; | |||||
// --------------------------------------------- | |||||
// ------------------------------------------------------------------- | |||||
// Process | // Process | ||||
void d_activate(); | |||||
void d_deactivate(); | |||||
void d_run(float** inputs, float** outputs, uint32_t frames, uint32_t midiEventCount, const MidiEvent* midiEvents); | |||||
void d_activate() override; | |||||
void d_deactivate() override; | |||||
void d_run(float** inputs, float** outputs, uint32_t frames, uint32_t midiEventCount, const MidiEvent* midiEvents) override; | |||||
// --------------------------------------------- | |||||
// ------------------------------------------------------------------- | |||||
private: | private: | ||||
struct ParamValues { | struct ParamValues { | ||||
@@ -110,6 +112,8 @@ private: | |||||
nekobee_synth_t* fSynth; | nekobee_synth_t* fSynth; | ||||
}; | }; | ||||
// ----------------------------------------------------------------------- | |||||
END_NAMESPACE_DISTRHO | END_NAMESPACE_DISTRHO | ||||
#endif // DISTRHO_PLUGIN_3BANDEQ_HPP_INCLUDED | |||||
#endif // DISTRHO_PLUGIN_NEKOBI_HPP_INCLUDED |
@@ -12,7 +12,7 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU General Public License for more details. | * GNU General Public License for more details. | ||||
* | * | ||||
* For a full copy of the GNU General Public License see the GPL.txt file | |||||
* For a full copy of the GNU General Public License see the doc/GPL.txt file. | |||||
*/ | */ | ||||
#include "DistrhoUINekobi.hpp" | #include "DistrhoUINekobi.hpp" | ||||
@@ -21,7 +21,7 @@ | |||||
START_NAMESPACE_DISTRHO | START_NAMESPACE_DISTRHO | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
DistrhoUINekobi::DistrhoUINekobi() | DistrhoUINekobi::DistrhoUINekobi() | ||||
: OpenGLUI(), | : OpenGLUI(), | ||||
@@ -127,7 +127,7 @@ DistrhoUINekobi::~DistrhoUINekobi() | |||||
delete fButtonAbout; | delete fButtonAbout; | ||||
} | } | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
// DSP Callbacks | // DSP Callbacks | ||||
void DistrhoUINekobi::d_parameterChanged(uint32_t index, float value) | void DistrhoUINekobi::d_parameterChanged(uint32_t index, float value) | ||||
@@ -161,15 +161,7 @@ void DistrhoUINekobi::d_parameterChanged(uint32_t index, float value) | |||||
} | } | ||||
} | } | ||||
void DistrhoUINekobi::d_noteReceived(bool onOff, uint8_t, uint8_t note, uint8_t) | |||||
{ | |||||
return; | |||||
(void)onOff; | |||||
(void)note; | |||||
} | |||||
// --------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
// UI Callbacks | // UI Callbacks | ||||
void DistrhoUINekobi::d_uiIdle() | void DistrhoUINekobi::d_uiIdle() | ||||
@@ -178,7 +170,7 @@ void DistrhoUINekobi::d_uiIdle() | |||||
repaint(); | repaint(); | ||||
} | } | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
// Widget Callbacks | // Widget Callbacks | ||||
void DistrhoUINekobi::imageButtonClicked(ImageButton* button, int) | void DistrhoUINekobi::imageButtonClicked(ImageButton* button, int) | ||||
@@ -273,13 +265,13 @@ void DistrhoUINekobi::onDisplay() | |||||
fNeko.draw(); | fNeko.draw(); | ||||
} | } | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
UI* createUI() | UI* createUI() | ||||
{ | { | ||||
return new DistrhoUINekobi(); | return new DistrhoUINekobi(); | ||||
} | } | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
END_NAMESPACE_DISTRHO | END_NAMESPACE_DISTRHO |
@@ -12,11 +12,11 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU General Public License for more details. | * GNU General Public License for more details. | ||||
* | * | ||||
* For a full copy of the GNU General Public License see the GPL.txt file | |||||
* For a full copy of the GNU General Public License see the doc/GPL.txt file. | |||||
*/ | */ | ||||
#ifndef DISTRHO_UI_3BANDEQ_HPP_INCLUDED | |||||
#define DISTRHO_UI_3BANDEQ_HPP_INCLUDED | |||||
#ifndef DISTRHO_UI_NEKOBI_HPP_INCLUDED | |||||
#define DISTRHO_UI_NEKOBI_HPP_INCLUDED | |||||
#include "DistrhoUIOpenGL.hpp" | #include "DistrhoUIOpenGL.hpp" | ||||
@@ -31,7 +31,7 @@ | |||||
START_NAMESPACE_DISTRHO | START_NAMESPACE_DISTRHO | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
class DistrhoUINekobi : public OpenGLUI, | class DistrhoUINekobi : public OpenGLUI, | ||||
public ImageButton::Callback, | public ImageButton::Callback, | ||||
@@ -43,31 +43,31 @@ public: | |||||
~DistrhoUINekobi() override; | ~DistrhoUINekobi() override; | ||||
protected: | protected: | ||||
// --------------------------------------------- | |||||
// ------------------------------------------------------------------- | |||||
// Information | // Information | ||||
unsigned int d_width() const override | |||||
unsigned int d_getWidth() const noexcept override | |||||
{ | { | ||||
return DistrhoArtworkNekobi::backgroundWidth; | return DistrhoArtworkNekobi::backgroundWidth; | ||||
} | } | ||||
unsigned int d_height() const override | |||||
unsigned int d_getHeight() const noexcept override | |||||
{ | { | ||||
return DistrhoArtworkNekobi::backgroundHeight; | return DistrhoArtworkNekobi::backgroundHeight; | ||||
} | } | ||||
// --------------------------------------------- | |||||
// ------------------------------------------------------------------- | |||||
// DSP Callbacks | // DSP Callbacks | ||||
void d_parameterChanged(uint32_t index, float value) override; | void d_parameterChanged(uint32_t index, float value) override; | ||||
void d_noteReceived(bool onOff, uint8_t channel, uint8_t note, uint8_t velocity) override; | |||||
void d_noteReceived(bool, uint8_t, uint8_t, uint8_t) override {} | |||||
// --------------------------------------------- | |||||
// ------------------------------------------------------------------- | |||||
// UI Callbacks | // UI Callbacks | ||||
void d_uiIdle() override; | void d_uiIdle() override; | ||||
// --------------------------------------------- | |||||
// ------------------------------------------------------------------- | |||||
// Widget Callbacks | // Widget Callbacks | ||||
void imageButtonClicked(ImageButton* button, int) override; | void imageButtonClicked(ImageButton* button, int) override; | ||||
@@ -97,8 +97,8 @@ private: | |||||
ImageAboutWindow fAboutWindow; | ImageAboutWindow fAboutWindow; | ||||
}; | }; | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
END_NAMESPACE_DISTRHO | END_NAMESPACE_DISTRHO | ||||
#endif // DISTRHO_UI_3BANDEQ_HPP_INCLUDED | |||||
#endif // DISTRHO_UI_NEKOBI_HPP_INCLUDED |
@@ -1,5 +1,5 @@ | |||||
/* | /* | ||||
* Carla Tests | |||||
* Neko widget animation | |||||
* Copyright (C) 2013 Filipe Coelho <falktx@falktx.com> | * Copyright (C) 2013 Filipe Coelho <falktx@falktx.com> | ||||
* | * | ||||
* This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | ||||
@@ -12,9 +12,12 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU General Public License for more details. | * GNU General Public License for more details. | ||||
* | * | ||||
* For a full copy of the GNU General Public License see the GPL.txt file | |||||
* For a full copy of the GNU General Public License see the doc/GPL.txt file. | |||||
*/ | */ | ||||
#ifndef NEKO_WIDGET_HPP_INCLUDED | |||||
#define NEKO_WIDGET_HPP_INCLUDED | |||||
#include "dgl/Image.hpp" | #include "dgl/Image.hpp" | ||||
#include "dgl/Widget.hpp" | #include "dgl/Widget.hpp" | ||||
@@ -24,6 +27,8 @@ | |||||
USE_NAMESPACE_DGL; | USE_NAMESPACE_DGL; | ||||
// ----------------------------------------------------------------------- | |||||
class NekoWidget | class NekoWidget | ||||
{ | { | ||||
public: | public: | ||||
@@ -159,6 +164,8 @@ public: | |||||
fTimerSpeed = speed; | fTimerSpeed = speed; | ||||
} | } | ||||
// ------------------------------------------------------------------- | |||||
private: | private: | ||||
enum Action { | enum Action { | ||||
kActionNone, // bounce tail | kActionNone, // bounce tail | ||||
@@ -189,3 +196,7 @@ private: | |||||
Action fCurAction; | Action fCurAction; | ||||
Image* fCurImage; | Image* fCurImage; | ||||
}; | }; | ||||
// ----------------------------------------------------------------------- | |||||
#endif // NEKO_WIDGET_HPP_INCLUDED |
@@ -12,7 +12,7 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU General Public License for more details. | * GNU General Public License for more details. | ||||
* | * | ||||
* For a full copy of the GNU General Public License see the GPL.txt file | |||||
* For a full copy of the GNU General Public License see the doc/GPL.txt file. | |||||
*/ | */ | ||||
#include "CarlaNative.h" | #include "CarlaNative.h" | ||||
@@ -55,7 +55,6 @@ struct nekofilter | |||||
PluginHandle | PluginHandle | ||||
nekofilter_instantiate( | nekofilter_instantiate( | ||||
const struct _PluginDescriptor* _this_, | |||||
HostDescriptor* host) | HostDescriptor* host) | ||||
{ | { | ||||
struct nekofilter * nekofilter_ptr; | struct nekofilter * nekofilter_ptr; | ||||
@@ -66,7 +65,7 @@ nekofilter_instantiate( | |||||
nekofilter_ptr = malloc(sizeof(struct nekofilter)); | nekofilter_ptr = malloc(sizeof(struct nekofilter)); | ||||
if (nekofilter_ptr == NULL) | if (nekofilter_ptr == NULL) | ||||
{ | { | ||||
goto fail; | |||||
return NULL; | |||||
} | } | ||||
nekofilter_ptr->host = host; | nekofilter_ptr->host = host; | ||||
@@ -74,9 +73,10 @@ nekofilter_instantiate( | |||||
nekofilter_ptr->ui = NULL; | nekofilter_ptr->ui = NULL; | ||||
#endif | #endif | ||||
if (!filter_create(host->get_sample_rate(host->handle), BANDS_COUNT, &nekofilter_ptr->filter)) | |||||
if (! filter_create(host->get_sample_rate(host->handle), BANDS_COUNT, &nekofilter_ptr->filter)) | |||||
{ | { | ||||
goto fail_destroy_filter; | |||||
free(nekofilter_ptr); | |||||
return NULL; | |||||
} | } | ||||
nekofilter_ptr->params_global[GLOBAL_PARAMETER_ACTIVE] = 1.0f; | nekofilter_ptr->params_global[GLOBAL_PARAMETER_ACTIVE] = 1.0f; | ||||
@@ -135,16 +135,6 @@ nekofilter_instantiate( | |||||
} | } | ||||
return (PluginHandle)nekofilter_ptr; | return (PluginHandle)nekofilter_ptr; | ||||
fail_destroy_filter: | |||||
filter_destroy(nekofilter_ptr->filter); | |||||
free(nekofilter_ptr); | |||||
fail: | |||||
return NULL; | |||||
// unused | |||||
(void)_this_; | |||||
} | } | ||||
#define nekofilter_ptr ((struct nekofilter *)handle) | #define nekofilter_ptr ((struct nekofilter *)handle) | ||||
@@ -373,13 +373,13 @@ nekoui_instantiate( | |||||
snprintf(ui_recv_pipe, sizeof(ui_recv_pipe), "%d", pipe1[0]); /* [0] means reading end */ | snprintf(ui_recv_pipe, sizeof(ui_recv_pipe), "%d", pipe1[0]); /* [0] means reading end */ | ||||
snprintf(ui_send_pipe, sizeof(ui_send_pipe), "%d", pipe2[1]); /* [1] means writting end */ | snprintf(ui_send_pipe, sizeof(ui_send_pipe), "%d", pipe2[1]); /* [1] means writting end */ | ||||
filename = malloc(strlen(host->resource_dir) + strlen(UI_EXECUTABLE) + 1); | |||||
filename = malloc(strlen(host->resourceDir) + strlen(UI_EXECUTABLE) + 1); | |||||
if (filename == NULL) | if (filename == NULL) | ||||
{ | { | ||||
goto fail_free_control; | goto fail_free_control; | ||||
} | } | ||||
strcpy(filename, host->resource_dir); | |||||
strcpy(filename, host->resourceDir); | |||||
strcat(filename, UI_EXECUTABLE); | strcat(filename, UI_EXECUTABLE); | ||||
char sample_rate_str[12] = { 0 }; | char sample_rate_str[12] = { 0 }; | ||||
@@ -12,7 +12,7 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU General Public License for more details. | * GNU General Public License for more details. | ||||
* | * | ||||
* For a full copy of the GNU General Public License see the GPL.txt file | |||||
* For a full copy of the GNU General Public License see the doc/GPL.txt file. | |||||
*/ | */ | ||||
#ifndef DISTRHO_PLUGIN_INFO_H_INCLUDED | #ifndef DISTRHO_PLUGIN_INFO_H_INCLUDED | ||||
@@ -12,7 +12,7 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU General Public License for more details. | * GNU General Public License for more details. | ||||
* | * | ||||
* For a full copy of the GNU General Public License see the GPL.txt file | |||||
* For a full copy of the GNU General Public License see the doc/GPL.txt file. | |||||
*/ | */ | ||||
#include "DistrhoPluginNotes.hpp" | #include "DistrhoPluginNotes.hpp" | ||||
@@ -21,7 +21,7 @@ | |||||
START_NAMESPACE_DISTRHO | START_NAMESPACE_DISTRHO | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
DistrhoPluginNotes::DistrhoPluginNotes() | DistrhoPluginNotes::DistrhoPluginNotes() | ||||
: Plugin(1, 0, 103) // 1 parameter, 0 programs, 103 states | : Plugin(1, 0, 103) // 1 parameter, 0 programs, 103 states | ||||
@@ -33,7 +33,7 @@ DistrhoPluginNotes::~DistrhoPluginNotes() | |||||
{ | { | ||||
} | } | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
// Init | // Init | ||||
void DistrhoPluginNotes::d_initParameter(uint32_t index, Parameter& parameter) | void DistrhoPluginNotes::d_initParameter(uint32_t index, Parameter& parameter) | ||||
@@ -71,10 +71,10 @@ void DistrhoPluginNotes::d_initStateKey(uint32_t index, d_string& stateKey) | |||||
} | } | ||||
} | } | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
// Internal data | // Internal data | ||||
float DistrhoPluginNotes::d_parameterValue(uint32_t index) | |||||
float DistrhoPluginNotes::d_getParameterValue(uint32_t index) const | |||||
{ | { | ||||
if (index != 0) | if (index != 0) | ||||
return 0.0f; | return 0.0f; | ||||
@@ -95,7 +95,7 @@ void DistrhoPluginNotes::d_setState(const char*, const char*) | |||||
// do nothing, used only for UI state | // do nothing, used only for UI state | ||||
} | } | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
// Process | // Process | ||||
void DistrhoPluginNotes::d_run(float** inputs, float** outputs, uint32_t frames, uint32_t, const MidiEvent*) | void DistrhoPluginNotes::d_run(float** inputs, float** outputs, uint32_t frames, uint32_t, const MidiEvent*) | ||||
@@ -109,13 +109,13 @@ void DistrhoPluginNotes::d_run(float** inputs, float** outputs, uint32_t frames, | |||||
std::memcpy(out2, in2, sizeof(float)*frames); | std::memcpy(out2, in2, sizeof(float)*frames); | ||||
} | } | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
Plugin* createPlugin() | Plugin* createPlugin() | ||||
{ | { | ||||
return new DistrhoPluginNotes(); | return new DistrhoPluginNotes(); | ||||
} | } | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
END_NAMESPACE_DISTRHO | END_NAMESPACE_DISTRHO |
@@ -12,7 +12,7 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU General Public License for more details. | * GNU General Public License for more details. | ||||
* | * | ||||
* For a full copy of the GNU General Public License see the GPL.txt file | |||||
* For a full copy of the GNU General Public License see the doc/GPL.txt file. | |||||
*/ | */ | ||||
#ifndef DISTRHO_PLUGIN_NOTES_HPP_INCLUDED | #ifndef DISTRHO_PLUGIN_NOTES_HPP_INCLUDED | ||||
@@ -22,65 +22,69 @@ | |||||
START_NAMESPACE_DISTRHO | START_NAMESPACE_DISTRHO | ||||
// ----------------------------------------------------------------------- | |||||
class DistrhoPluginNotes : public Plugin | class DistrhoPluginNotes : public Plugin | ||||
{ | { | ||||
public: | public: | ||||
DistrhoPluginNotes(); | DistrhoPluginNotes(); | ||||
~DistrhoPluginNotes(); | |||||
~DistrhoPluginNotes() override; | |||||
protected: | protected: | ||||
// --------------------------------------------- | |||||
// ------------------------------------------------------------------- | |||||
// Information | // Information | ||||
const char* d_label() const | |||||
const char* d_getLabel() const noexcept override | |||||
{ | { | ||||
return "Notes"; | return "Notes"; | ||||
} | } | ||||
const char* d_maker() const | |||||
const char* d_getMaker() const noexcept override | |||||
{ | { | ||||
return "DISTRHO"; | return "DISTRHO"; | ||||
} | } | ||||
const char* d_license() const | |||||
const char* d_getLicense() const noexcept override | |||||
{ | { | ||||
return "GPL v2+"; | return "GPL v2+"; | ||||
} | } | ||||
uint32_t d_version() const | |||||
uint32_t d_getVersion() const noexcept override | |||||
{ | { | ||||
return 0x1000; | return 0x1000; | ||||
} | } | ||||
long d_uniqueId() const | |||||
long d_getUniqueId() const noexcept override | |||||
{ | { | ||||
return d_cconst('D', 'N', 'o', 't'); | return d_cconst('D', 'N', 'o', 't'); | ||||
} | } | ||||
// --------------------------------------------- | |||||
// ------------------------------------------------------------------- | |||||
// Init | // Init | ||||
void d_initParameter(uint32_t index, Parameter& parameter); | |||||
void d_initStateKey(uint32_t index, d_string& stateKeyName); | |||||
void d_initParameter(uint32_t index, Parameter& parameter) override; | |||||
void d_initStateKey(uint32_t index, d_string& stateKeyName) override; | |||||
// --------------------------------------------- | |||||
// ------------------------------------------------------------------- | |||||
// Internal data | // Internal data | ||||
float d_parameterValue(uint32_t index); | |||||
void d_setParameterValue(uint32_t index, float value); | |||||
void d_setState(const char* key, const char* value); | |||||
float d_getParameterValue(uint32_t index) const override; | |||||
void d_setParameterValue(uint32_t index, float value) override; | |||||
void d_setState(const char* key, const char* value) override; | |||||
// --------------------------------------------- | |||||
// ------------------------------------------------------------------- | |||||
// Process | // Process | ||||
void d_run(float** inputs, float** outputs, uint32_t frames, uint32_t midiEventCount, const MidiEvent* midiEvents); | |||||
void d_run(float** inputs, float** outputs, uint32_t frames, uint32_t midiEventCount, const MidiEvent* midiEvents) override; | |||||
// --------------------------------------------- | |||||
// ------------------------------------------------------------------- | |||||
private: | private: | ||||
int fCurPage; | int fCurPage; | ||||
}; | }; | ||||
// ----------------------------------------------------------------------- | |||||
END_NAMESPACE_DISTRHO | END_NAMESPACE_DISTRHO | ||||
#endif // DISTRHO_PLUGIN_NOTES_HPP_INCLUDED | #endif // DISTRHO_PLUGIN_NOTES_HPP_INCLUDED |
@@ -12,7 +12,7 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU General Public License for more details. | * GNU General Public License for more details. | ||||
* | * | ||||
* For a full copy of the GNU General Public License see the GPL.txt file | |||||
* For a full copy of the GNU General Public License see the doc/GPL.txt file. | |||||
*/ | */ | ||||
#include "DistrhoUINotes.hpp" | #include "DistrhoUINotes.hpp" | ||||
@@ -23,7 +23,7 @@ START_NAMESPACE_DISTRHO | |||||
#include "moc_DistrhoUINotes.cpp" | #include "moc_DistrhoUINotes.cpp" | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
DistrhoUINotes::DistrhoUINotes() | DistrhoUINotes::DistrhoUINotes() | ||||
: QtUI(), | : QtUI(), | ||||
@@ -80,7 +80,7 @@ void DistrhoUINotes::saveCurrentTextState() | |||||
} | } | ||||
} | } | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
// DSP Callbacks | // DSP Callbacks | ||||
void DistrhoUINotes::d_parameterChanged(uint32_t index, float value) | void DistrhoUINotes::d_parameterChanged(uint32_t index, float value) | ||||
@@ -143,7 +143,7 @@ void DistrhoUINotes::d_stateChanged(const char* key, const char* value) | |||||
} | } | ||||
} | } | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
// UI Callbacks | // UI Callbacks | ||||
void DistrhoUINotes::d_uiIdle() | void DistrhoUINotes::d_uiIdle() | ||||
@@ -174,7 +174,7 @@ void DistrhoUINotes::resizeEvent(QResizeEvent* event) | |||||
QtUI::resizeEvent(event); | QtUI::resizeEvent(event); | ||||
} | } | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
void DistrhoUINotes::buttonClicked(bool click) | void DistrhoUINotes::buttonClicked(bool click) | ||||
{ | { | ||||
@@ -210,13 +210,13 @@ void DistrhoUINotes::textChanged() | |||||
fSaveTextNowChecker = 0; | fSaveTextNowChecker = 0; | ||||
} | } | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
UI* createUI() | UI* createUI() | ||||
{ | { | ||||
return new DistrhoUINotes; | |||||
return new DistrhoUINotes(); | |||||
} | } | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
END_NAMESPACE_DISTRHO | END_NAMESPACE_DISTRHO |
@@ -12,7 +12,7 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU General Public License for more details. | * GNU General Public License for more details. | ||||
* | * | ||||
* For a full copy of the GNU General Public License see the GPL.txt file | |||||
* For a full copy of the GNU General Public License see the doc/GPL.txt file. | |||||
*/ | */ | ||||
#ifndef DISTRHO_UI_NOTES_HPP_INCLUDED | #ifndef DISTRHO_UI_NOTES_HPP_INCLUDED | ||||
@@ -38,7 +38,7 @@ class QResizeEvent; | |||||
START_NAMESPACE_DISTRHO | START_NAMESPACE_DISTRHO | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
class DistrhoUINotes : public QtUI | class DistrhoUINotes : public QtUI | ||||
{ | { | ||||
@@ -49,40 +49,42 @@ public: | |||||
~DistrhoUINotes() override; | ~DistrhoUINotes() override; | ||||
protected: | protected: | ||||
// --------------------------------------------- | |||||
// ------------------------------------------------------------------- | |||||
// Information | // Information | ||||
bool d_resizable() const override | |||||
bool d_isResizable() const noexcept override | |||||
{ | { | ||||
return true; | return true; | ||||
} | } | ||||
uint d_minimumWidth() const override | |||||
uint d_getMinimumWidth() const noexcept override | |||||
{ | { | ||||
return 180; | return 180; | ||||
} | } | ||||
uint d_minimumHeight() const override | |||||
uint d_getMinimumHeight() const noexcept override | |||||
{ | { | ||||
return 150; | return 150; | ||||
} | } | ||||
// --------------------------------------------- | |||||
// ------------------------------------------------------------------- | |||||
// DSP Callbacks | // DSP Callbacks | ||||
void d_parameterChanged(uint32_t index, float value) override; | void d_parameterChanged(uint32_t index, float value) override; | ||||
void d_stateChanged(const char* key, const char* value) override; | void d_stateChanged(const char* key, const char* value) override; | ||||
// --------------------------------------------- | |||||
// ------------------------------------------------------------------- | |||||
// UI Callbacks | // UI Callbacks | ||||
void d_uiIdle() override; | void d_uiIdle() override; | ||||
// --------------------------------------------- | |||||
// ------------------------------------------------------------------- | |||||
// listen for resize events | // listen for resize events | ||||
void resizeEvent(QResizeEvent*) override; | void resizeEvent(QResizeEvent*) override; | ||||
// ------------------------------------------------------------------- | |||||
private slots: | private slots: | ||||
void buttonClicked(bool click); | void buttonClicked(bool click); | ||||
void progressBarValueChanged(float value); | void progressBarValueChanged(float value); | ||||
@@ -104,6 +106,8 @@ private: | |||||
void saveCurrentTextState(); | void saveCurrentTextState(); | ||||
}; | }; | ||||
// ----------------------------------------------------------------------- | |||||
END_NAMESPACE_DISTRHO | END_NAMESPACE_DISTRHO | ||||
#endif // DISTRHO_UI_NOTES_HPP_INCLUDED | #endif // DISTRHO_UI_NOTES_HPP_INCLUDED |
@@ -11,7 +11,7 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU Lesser General Public License for more details. | * GNU Lesser General Public License for more details. | ||||
* | * | ||||
* For a full copy of the license see the LGPL.txt file | |||||
* For a full copy of the license see the doc/LGPL.txt file. | |||||
*/ | */ | ||||
#ifndef DISTRHO_PLUGIN_INFO_H_INCLUDED | #ifndef DISTRHO_PLUGIN_INFO_H_INCLUDED | ||||
@@ -12,18 +12,18 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU Lesser General Public License for more details. | * GNU Lesser General Public License for more details. | ||||
* | * | ||||
* For a full copy of the license see the LGPL.txt file | |||||
* For a full copy of the license see the doc/LGPL.txt file. | |||||
*/ | */ | ||||
#include "DistrhoPluginPingPongPan.hpp" | #include "DistrhoPluginPingPongPan.hpp" | ||||
#include <cmath> | #include <cmath> | ||||
static const float cf2PI = 6.283185307f; | |||||
static const float k2PI = 6.283185307f; | |||||
START_NAMESPACE_DISTRHO | START_NAMESPACE_DISTRHO | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
DistrhoPluginPingPongPan::DistrhoPluginPingPongPan() | DistrhoPluginPingPongPan::DistrhoPluginPingPongPan() | ||||
: Plugin(paramCount, 1, 0) // 1 program, 0 states | : Plugin(paramCount, 1, 0) // 1 program, 0 states | ||||
@@ -39,7 +39,7 @@ DistrhoPluginPingPongPan::~DistrhoPluginPingPongPan() | |||||
{ | { | ||||
} | } | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
// Init | // Init | ||||
void DistrhoPluginPingPongPan::d_initParameter(uint32_t index, Parameter& parameter) | void DistrhoPluginPingPongPan::d_initParameter(uint32_t index, Parameter& parameter) | ||||
@@ -75,10 +75,10 @@ void DistrhoPluginPingPongPan::d_initProgramName(uint32_t index, d_string& progr | |||||
programName = "Default"; | programName = "Default"; | ||||
} | } | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
// Internal data | // Internal data | ||||
float DistrhoPluginPingPongPan::d_parameterValue(uint32_t index) | |||||
float DistrhoPluginPingPongPan::d_getParameterValue(uint32_t index) const | |||||
{ | { | ||||
switch (index) | switch (index) | ||||
{ | { | ||||
@@ -93,14 +93,14 @@ float DistrhoPluginPingPongPan::d_parameterValue(uint32_t index) | |||||
void DistrhoPluginPingPongPan::d_setParameterValue(uint32_t index, float value) | void DistrhoPluginPingPongPan::d_setParameterValue(uint32_t index, float value) | ||||
{ | { | ||||
if (d_sampleRate() <= 0.0) | |||||
if (d_getSampleRate() <= 0.0) | |||||
return; | return; | ||||
switch (index) | switch (index) | ||||
{ | { | ||||
case paramFreq: | case paramFreq: | ||||
fFreq = value; | fFreq = value; | ||||
waveSpeed = (cf2PI * fFreq / 100.0f)/(float)d_sampleRate(); | |||||
waveSpeed = (k2PI * fFreq / 100.0f)/(float)d_getSampleRate(); | |||||
break; | break; | ||||
case paramWidth: | case paramWidth: | ||||
fWidth = value; | fWidth = value; | ||||
@@ -121,12 +121,12 @@ void DistrhoPluginPingPongPan::d_setProgram(uint32_t index) | |||||
d_activate(); | d_activate(); | ||||
} | } | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
// Process | // Process | ||||
void DistrhoPluginPingPongPan::d_activate() | void DistrhoPluginPingPongPan::d_activate() | ||||
{ | { | ||||
waveSpeed = (cf2PI * fFreq / 100.0f)/(float)d_sampleRate(); | |||||
waveSpeed = (k2PI * fFreq / 100.0f)/(float)d_getSampleRate(); | |||||
} | } | ||||
void DistrhoPluginPingPongPan::d_deactivate() | void DistrhoPluginPingPongPan::d_deactivate() | ||||
@@ -145,21 +145,21 @@ void DistrhoPluginPingPongPan::d_run(float** inputs, float** outputs, uint32_t f | |||||
{ | { | ||||
pan = std::fmin(std::fmax(std::sin(wavePos) * (fWidth/100.0f), -1.0f), 1.0f); | pan = std::fmin(std::fmax(std::sin(wavePos) * (fWidth/100.0f), -1.0f), 1.0f); | ||||
if ((wavePos += waveSpeed) >= cf2PI) | |||||
wavePos -= cf2PI; | |||||
if ((wavePos += waveSpeed) >= k2PI) | |||||
wavePos -= k2PI; | |||||
out1[i] = in1[i] * (pan > 0.0f ? 1.0f-pan : 1.0f); | out1[i] = in1[i] * (pan > 0.0f ? 1.0f-pan : 1.0f); | ||||
out2[i] = in2[i] * (pan < 0.0f ? 1.0f+pan : 1.0f); | out2[i] = in2[i] * (pan < 0.0f ? 1.0f+pan : 1.0f); | ||||
} | } | ||||
} | } | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
Plugin* createPlugin() | Plugin* createPlugin() | ||||
{ | { | ||||
return new DistrhoPluginPingPongPan(); | return new DistrhoPluginPingPongPan(); | ||||
} | } | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
END_NAMESPACE_DISTRHO | END_NAMESPACE_DISTRHO |
@@ -12,7 +12,7 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU Lesser General Public License for more details. | * GNU Lesser General Public License for more details. | ||||
* | * | ||||
* For a full copy of the license see the LGPL.txt file | |||||
* For a full copy of the license see the doc/LGPL.txt file. | |||||
*/ | */ | ||||
#ifndef DISTRHO_PLUGIN_PINGPONGPAN_HPP_INCLUDED | #ifndef DISTRHO_PLUGIN_PINGPONGPAN_HPP_INCLUDED | ||||
@@ -22,6 +22,8 @@ | |||||
START_NAMESPACE_DISTRHO | START_NAMESPACE_DISTRHO | ||||
// ----------------------------------------------------------------------- | |||||
class DistrhoPluginPingPongPan : public Plugin | class DistrhoPluginPingPongPan : public Plugin | ||||
{ | { | ||||
public: | public: | ||||
@@ -33,58 +35,58 @@ public: | |||||
}; | }; | ||||
DistrhoPluginPingPongPan(); | DistrhoPluginPingPongPan(); | ||||
~DistrhoPluginPingPongPan(); | |||||
~DistrhoPluginPingPongPan() override; | |||||
protected: | protected: | ||||
// --------------------------------------------- | |||||
// ------------------------------------------------------------------- | |||||
// Information | // Information | ||||
const char* d_label() const | |||||
const char* d_getLabel() const noexcept override | |||||
{ | { | ||||
return "PingPongPan"; | return "PingPongPan"; | ||||
} | } | ||||
const char* d_maker() const | |||||
const char* d_getMaker() const noexcept override | |||||
{ | { | ||||
return "DISTRHO"; | return "DISTRHO"; | ||||
} | } | ||||
const char* d_license() const | |||||
const char* d_getLicense() const noexcept override | |||||
{ | { | ||||
return "LGPL"; | return "LGPL"; | ||||
} | } | ||||
uint32_t d_version() const | |||||
uint32_t d_getVersion() const noexcept override | |||||
{ | { | ||||
return 0x1000; | return 0x1000; | ||||
} | } | ||||
long d_uniqueId() const | |||||
long d_getUniqueId() const noexcept override | |||||
{ | { | ||||
return d_cconst('D', 'P', 'P', 'P'); | return d_cconst('D', 'P', 'P', 'P'); | ||||
} | } | ||||
// --------------------------------------------- | |||||
// ------------------------------------------------------------------- | |||||
// Init | // Init | ||||
void d_initParameter(uint32_t index, Parameter& parameter); | |||||
void d_initProgramName(uint32_t index, d_string& programName); | |||||
void d_initParameter(uint32_t index, Parameter& parameter) override; | |||||
void d_initProgramName(uint32_t index, d_string& programName) override; | |||||
// --------------------------------------------- | |||||
// ------------------------------------------------------------------- | |||||
// Internal data | // Internal data | ||||
float d_parameterValue(uint32_t index); | |||||
void d_setParameterValue(uint32_t index, float value); | |||||
void d_setProgram(uint32_t index); | |||||
float d_getParameterValue(uint32_t index) const override; | |||||
void d_setParameterValue(uint32_t index, float value) override; | |||||
void d_setProgram(uint32_t index) override; | |||||
// --------------------------------------------- | |||||
// ------------------------------------------------------------------- | |||||
// Process | // Process | ||||
void d_activate(); | |||||
void d_deactivate(); | |||||
void d_run(float** inputs, float** outputs, uint32_t frames, uint32_t midiEventCount, const MidiEvent* midiEvents); | |||||
void d_activate() override; | |||||
void d_deactivate() override; | |||||
void d_run(float** inputs, float** outputs, uint32_t frames, uint32_t midiEventCount, const MidiEvent* midiEvents) override; | |||||
// --------------------------------------------- | |||||
// ------------------------------------------------------------------- | |||||
private: | private: | ||||
float fFreq; | float fFreq; | ||||
@@ -94,6 +96,8 @@ private: | |||||
float pan, wavePos; | float pan, wavePos; | ||||
}; | }; | ||||
// ----------------------------------------------------------------------- | |||||
END_NAMESPACE_DISTRHO | END_NAMESPACE_DISTRHO | ||||
#endif // DISTRHO_PLUGIN_PINGPONGPAN_HPP_INCLUDED | #endif // DISTRHO_PLUGIN_PINGPONGPAN_HPP_INCLUDED |
@@ -11,7 +11,7 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU Lesser General Public License for more details. | * GNU Lesser General Public License for more details. | ||||
* | * | ||||
* For a full copy of the license see the LGPL.txt file | |||||
* For a full copy of the license see the doc/LGPL.txt file. | |||||
*/ | */ | ||||
#include "DistrhoUIPingPongPan.hpp" | #include "DistrhoUIPingPongPan.hpp" | ||||
@@ -20,7 +20,7 @@ | |||||
START_NAMESPACE_DISTRHO | START_NAMESPACE_DISTRHO | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
DistrhoUIPingPongPan::DistrhoUIPingPongPan() | DistrhoUIPingPongPan::DistrhoUIPingPongPan() | ||||
: OpenGLUI(), | : OpenGLUI(), | ||||
@@ -66,7 +66,7 @@ DistrhoUIPingPongPan::~DistrhoUIPingPongPan() | |||||
delete fButtonAbout; | delete fButtonAbout; | ||||
} | } | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
// DSP Callbacks | // DSP Callbacks | ||||
void DistrhoUIPingPongPan::d_parameterChanged(uint32_t index, float value) | void DistrhoUIPingPongPan::d_parameterChanged(uint32_t index, float value) | ||||
@@ -92,7 +92,7 @@ void DistrhoUIPingPongPan::d_programChanged(uint32_t index) | |||||
fKnobWidth->setValue(75.0f); | fKnobWidth->setValue(75.0f); | ||||
} | } | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
// Widget Callbacks | // Widget Callbacks | ||||
void DistrhoUIPingPongPan::imageButtonClicked(ImageButton* button, int) | void DistrhoUIPingPongPan::imageButtonClicked(ImageButton* button, int) | ||||
@@ -133,13 +133,13 @@ void DistrhoUIPingPongPan::onDisplay() | |||||
fImgBackground.draw(); | fImgBackground.draw(); | ||||
} | } | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
UI* createUI() | UI* createUI() | ||||
{ | { | ||||
return new DistrhoUIPingPongPan(); | return new DistrhoUIPingPongPan(); | ||||
} | } | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
END_NAMESPACE_DISTRHO | END_NAMESPACE_DISTRHO |
@@ -11,7 +11,7 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU Lesser General Public License for more details. | * GNU Lesser General Public License for more details. | ||||
* | * | ||||
* For a full copy of the license see the LGPL.txt file | |||||
* For a full copy of the license see the doc/LGPL.txt file. | |||||
*/ | */ | ||||
#ifndef DISTRHO_UI_PINGPONGPAN_HPP_INCLUDED | #ifndef DISTRHO_UI_PINGPONGPAN_HPP_INCLUDED | ||||
@@ -28,7 +28,7 @@ | |||||
START_NAMESPACE_DISTRHO | START_NAMESPACE_DISTRHO | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
class DistrhoUIPingPongPan : public OpenGLUI, | class DistrhoUIPingPongPan : public OpenGLUI, | ||||
public ImageButton::Callback, | public ImageButton::Callback, | ||||
@@ -39,27 +39,26 @@ public: | |||||
~DistrhoUIPingPongPan() override; | ~DistrhoUIPingPongPan() override; | ||||
protected: | protected: | ||||
// --------------------------------------------- | |||||
// ------------------------------------------------------------------- | |||||
// Information | // Information | ||||
unsigned int d_width() const override | |||||
unsigned int d_getWidth() const noexcept override | |||||
{ | { | ||||
return DistrhoArtworkPingPongPan::backgroundWidth; | return DistrhoArtworkPingPongPan::backgroundWidth; | ||||
} | } | ||||
unsigned int d_height() const override | |||||
unsigned int d_getHeight() const noexcept override | |||||
{ | { | ||||
return DistrhoArtworkPingPongPan::backgroundHeight; | return DistrhoArtworkPingPongPan::backgroundHeight; | ||||
} | } | ||||
// --------------------------------------------- | |||||
// ------------------------------------------------------------------- | |||||
// DSP Callbacks | // DSP Callbacks | ||||
void d_parameterChanged(uint32_t index, float value) override; | void d_parameterChanged(uint32_t index, float value) override; | ||||
void d_programChanged(uint32_t index) override; | void d_programChanged(uint32_t index) override; | ||||
// --------------------------------------------- | |||||
// ------------------------------------------------------------------- | |||||
// Widget Callbacks | // Widget Callbacks | ||||
void imageButtonClicked(ImageButton* button, int) override; | void imageButtonClicked(ImageButton* button, int) override; | ||||
@@ -78,6 +77,8 @@ private: | |||||
ImageButton* fButtonAbout; | ImageButton* fButtonAbout; | ||||
}; | }; | ||||
// ----------------------------------------------------------------------- | |||||
END_NAMESPACE_DISTRHO | END_NAMESPACE_DISTRHO | ||||
#endif // DISTRHO_UI_PINGPONGPAN_HPP_INCLUDED | #endif // DISTRHO_UI_PINGPONGPAN_HPP_INCLUDED |
@@ -11,7 +11,7 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU Lesser General Public License for more details. | * GNU Lesser General Public License for more details. | ||||
* | * | ||||
* For a full copy of the license see the LGPL.txt file | |||||
* For a full copy of the license see the doc/LGPL.txt file. | |||||
*/ | */ | ||||
#ifndef DISTRHO_PLUGIN_INFO_H_INCLUDED | #ifndef DISTRHO_PLUGIN_INFO_H_INCLUDED | ||||
@@ -12,19 +12,19 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU Lesser General Public License for more details. | * GNU Lesser General Public License for more details. | ||||
* | * | ||||
* For a full copy of the license see the LGPL.txt file | |||||
* For a full copy of the license see the doc/LGPL.txt file. | |||||
*/ | */ | ||||
#include "DistrhoPluginStereoEnhancer.hpp" | #include "DistrhoPluginStereoEnhancer.hpp" | ||||
#include <cmath> | #include <cmath> | ||||
static const float cfDC_ADD = 1e-30f; | |||||
static const float cfPI = 3.141592654f; | |||||
static const float kDC_ADD = 1e-30f; | |||||
static const float kPI = 3.141592654f; | |||||
START_NAMESPACE_DISTRHO | START_NAMESPACE_DISTRHO | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
DistrhoPluginStereoEnhancer::DistrhoPluginStereoEnhancer() | DistrhoPluginStereoEnhancer::DistrhoPluginStereoEnhancer() | ||||
: Plugin(paramCount, 1, 0) // 1 program, 0 states | : Plugin(paramCount, 1, 0) // 1 program, 0 states | ||||
@@ -40,7 +40,7 @@ DistrhoPluginStereoEnhancer::~DistrhoPluginStereoEnhancer() | |||||
{ | { | ||||
} | } | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
// Init | // Init | ||||
void DistrhoPluginStereoEnhancer::d_initParameter(uint32_t index, Parameter& parameter) | void DistrhoPluginStereoEnhancer::d_initParameter(uint32_t index, Parameter& parameter) | ||||
@@ -87,10 +87,10 @@ void DistrhoPluginStereoEnhancer::d_initProgramName(uint32_t index, d_string& pr | |||||
programName = "Default"; | programName = "Default"; | ||||
} | } | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
// Internal data | // Internal data | ||||
float DistrhoPluginStereoEnhancer::d_parameterValue(uint32_t index) | |||||
float DistrhoPluginStereoEnhancer::d_getParameterValue(uint32_t index) const | |||||
{ | { | ||||
switch (index) | switch (index) | ||||
{ | { | ||||
@@ -107,7 +107,7 @@ float DistrhoPluginStereoEnhancer::d_parameterValue(uint32_t index) | |||||
void DistrhoPluginStereoEnhancer::d_setParameterValue(uint32_t index, float value) | void DistrhoPluginStereoEnhancer::d_setParameterValue(uint32_t index, float value) | ||||
{ | { | ||||
if (d_sampleRate() <= 0.0) | |||||
if (d_getSampleRate() <= 0.0) | |||||
return; | return; | ||||
switch (index) | switch (index) | ||||
@@ -123,7 +123,7 @@ void DistrhoPluginStereoEnhancer::d_setParameterValue(uint32_t index, float valu | |||||
case paramCrossover: | case paramCrossover: | ||||
freqHPFader = value; | freqHPFader = value; | ||||
freqHP = freqHPFader*freqHPFader*freqHPFader*24000.0f; | freqHP = freqHPFader*freqHPFader*freqHPFader*24000.0f; | ||||
xHP = std::exp(-2.0f * cfPI * freqHP / (float)d_sampleRate()); | |||||
xHP = std::exp(-2.0f * kPI * freqHP / (float)d_getSampleRate()); | |||||
a0HP = 1.0f-xHP; | a0HP = 1.0f-xHP; | ||||
b1HP = -xHP; | b1HP = -xHP; | ||||
break; | break; | ||||
@@ -149,12 +149,12 @@ void DistrhoPluginStereoEnhancer::d_setProgram(uint32_t index) | |||||
d_activate(); | d_activate(); | ||||
} | } | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
// Process | // Process | ||||
void DistrhoPluginStereoEnhancer::d_activate() | void DistrhoPluginStereoEnhancer::d_activate() | ||||
{ | { | ||||
xHP = std::exp(-2.0f * cfPI * freqHP/ (float)d_sampleRate()); | |||||
xHP = std::exp(-2.0f * kPI * freqHP/ (float)d_getSampleRate()); | |||||
a0HP = 1.0f-xHP; | a0HP = 1.0f-xHP; | ||||
b1HP = -xHP; | b1HP = -xHP; | ||||
} | } | ||||
@@ -177,11 +177,11 @@ void DistrhoPluginStereoEnhancer::d_run(float** inputs, float** outputs, uint32_ | |||||
out1HP = in1[i]; | out1HP = in1[i]; | ||||
out2HP = in2[i]; | out2HP = in2[i]; | ||||
in1[i] = (tmp1HP = a0HP * in1[i] - b1HP * tmp1HP + cfDC_ADD); | |||||
in2[i] = (tmp2HP = a0HP * in2[i] - b1HP * tmp2HP + cfDC_ADD); | |||||
in1[i] = (tmp1HP = a0HP * in1[i] - b1HP * tmp1HP + kDC_ADD); | |||||
in2[i] = (tmp2HP = a0HP * in2[i] - b1HP * tmp2HP + kDC_ADD); | |||||
out1HP -= in1[i]; | |||||
out2HP -= in2[i]; | |||||
out1HP -= in1[i] - kDC_ADD; | |||||
out2HP -= in2[i] - kDC_ADD; | |||||
monoLP = (in1[i] + in2[i]) / 2.0f; | monoLP = (in1[i] + in2[i]) / 2.0f; | ||||
stereoLP = in1[i] - in2[i]; | stereoLP = in1[i] - in2[i]; | ||||
@@ -190,6 +190,7 @@ void DistrhoPluginStereoEnhancer::d_run(float** inputs, float** outputs, uint32_ | |||||
monoHP = (out1HP + out2HP) / 2.0f; | monoHP = (out1HP + out2HP) / 2.0f; | ||||
stereoHP = out1HP - out2HP; | stereoHP = out1HP - out2HP; | ||||
out1HP = (monoHP + stereoHP * widthHP) / widthCoeffHP; | out1HP = (monoHP + stereoHP * widthHP) / widthCoeffHP; | ||||
out2HP = (monoHP - stereoHP * widthHP) / widthCoeffHP; | out2HP = (monoHP - stereoHP * widthHP) / widthCoeffHP; | ||||
@@ -198,13 +199,13 @@ void DistrhoPluginStereoEnhancer::d_run(float** inputs, float** outputs, uint32_ | |||||
} | } | ||||
} | } | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
Plugin* createPlugin() | Plugin* createPlugin() | ||||
{ | { | ||||
return new DistrhoPluginStereoEnhancer(); | return new DistrhoPluginStereoEnhancer(); | ||||
} | } | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
END_NAMESPACE_DISTRHO | END_NAMESPACE_DISTRHO |
@@ -12,7 +12,7 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU Lesser General Public License for more details. | * GNU Lesser General Public License for more details. | ||||
* | * | ||||
* For a full copy of the license see the LGPL.txt file | |||||
* For a full copy of the license see the doc/LGPL.txt file. | |||||
*/ | */ | ||||
#ifndef DISTRHO_PLUGIN_STEREO_ENHANCER_HPP_INCLUDED | #ifndef DISTRHO_PLUGIN_STEREO_ENHANCER_HPP_INCLUDED | ||||
@@ -22,6 +22,8 @@ | |||||
START_NAMESPACE_DISTRHO | START_NAMESPACE_DISTRHO | ||||
// ----------------------------------------------------------------------- | |||||
class DistrhoPluginStereoEnhancer : public Plugin | class DistrhoPluginStereoEnhancer : public Plugin | ||||
{ | { | ||||
public: | public: | ||||
@@ -34,58 +36,58 @@ public: | |||||
}; | }; | ||||
DistrhoPluginStereoEnhancer(); | DistrhoPluginStereoEnhancer(); | ||||
~DistrhoPluginStereoEnhancer(); | |||||
~DistrhoPluginStereoEnhancer() override; | |||||
protected: | protected: | ||||
// --------------------------------------------- | |||||
// ------------------------------------------------------------------- | |||||
// Information | // Information | ||||
const char* d_label() const | |||||
const char* d_getLabel() const noexcept override | |||||
{ | { | ||||
return "StereoEnhancer"; | return "StereoEnhancer"; | ||||
} | } | ||||
const char* d_maker() const | |||||
const char* d_getMaker() const noexcept override | |||||
{ | { | ||||
return "DISTRHO"; | return "DISTRHO"; | ||||
} | } | ||||
const char* d_license() const | |||||
const char* d_getLicense() const noexcept override | |||||
{ | { | ||||
return "LGPL"; | return "LGPL"; | ||||
} | } | ||||
uint32_t d_version() const | |||||
uint32_t d_getVersion() const noexcept override | |||||
{ | { | ||||
return 0x1000; | return 0x1000; | ||||
} | } | ||||
long d_uniqueId() const | |||||
long d_getUniqueId() const noexcept override | |||||
{ | { | ||||
return d_cconst('D', 'S', 't', 'E'); | return d_cconst('D', 'S', 't', 'E'); | ||||
} | } | ||||
// --------------------------------------------- | |||||
// ------------------------------------------------------------------- | |||||
// Init | // Init | ||||
void d_initParameter(uint32_t index, Parameter& parameter); | |||||
void d_initProgramName(uint32_t index, d_string& programName); | |||||
void d_initParameter(uint32_t index, Parameter& parameter) override; | |||||
void d_initProgramName(uint32_t index, d_string& programName) override; | |||||
// --------------------------------------------- | |||||
// ------------------------------------------------------------------- | |||||
// Internal data | // Internal data | ||||
float d_parameterValue(uint32_t index); | |||||
void d_setParameterValue(uint32_t index, float value); | |||||
void d_setProgram(uint32_t index); | |||||
float d_getParameterValue(uint32_t index) const override; | |||||
void d_setParameterValue(uint32_t index, float value) override; | |||||
void d_setProgram(uint32_t index) override; | |||||
// --------------------------------------------- | |||||
// ------------------------------------------------------------------- | |||||
// Process | // Process | ||||
void d_activate(); | |||||
void d_deactivate(); | |||||
void d_run(float** inputs, float** outputs, uint32_t frames, uint32_t midiEventCount, const MidiEvent* midiEvents); | |||||
void d_activate() override; | |||||
void d_deactivate() override; | |||||
void d_run(float** inputs, float** outputs, uint32_t frames, uint32_t midiEventCount, const MidiEvent* midiEvents) override; | |||||
// --------------------------------------------- | |||||
// ------------------------------------------------------------------- | |||||
private: | private: | ||||
float widthLP, widthCoeffLP; | float widthLP, widthCoeffLP; | ||||
@@ -101,6 +103,8 @@ private: | |||||
float monoLP, stereoLP; | float monoLP, stereoLP; | ||||
}; | }; | ||||
// ----------------------------------------------------------------------- | |||||
END_NAMESPACE_DISTRHO | END_NAMESPACE_DISTRHO | ||||
#endif // DISTRHO_PLUGIN_STEREO_ENHANCER_HPP_INCLUDED | #endif // DISTRHO_PLUGIN_STEREO_ENHANCER_HPP_INCLUDED |
@@ -11,7 +11,7 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU Lesser General Public License for more details. | * GNU Lesser General Public License for more details. | ||||
* | * | ||||
* For a full copy of the license see the LGPL.txt file | |||||
* For a full copy of the license see the doc/LGPL.txt file. | |||||
*/ | */ | ||||
#include "DistrhoUIStereoEnhancer.hpp" | #include "DistrhoUIStereoEnhancer.hpp" | ||||
@@ -20,7 +20,7 @@ | |||||
START_NAMESPACE_DISTRHO | START_NAMESPACE_DISTRHO | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
DistrhoUIStereoEnhancer::DistrhoUIStereoEnhancer() | DistrhoUIStereoEnhancer::DistrhoUIStereoEnhancer() | ||||
: OpenGLUI(), | : OpenGLUI(), | ||||
@@ -69,7 +69,7 @@ DistrhoUIStereoEnhancer::~DistrhoUIStereoEnhancer() | |||||
delete fButtonAbout; | delete fButtonAbout; | ||||
} | } | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
// DSP Callbacks | // DSP Callbacks | ||||
void DistrhoUIStereoEnhancer::d_parameterChanged(uint32_t index, float value) | void DistrhoUIStereoEnhancer::d_parameterChanged(uint32_t index, float value) | ||||
@@ -99,7 +99,7 @@ void DistrhoUIStereoEnhancer::d_programChanged(uint32_t index) | |||||
fKnobCrossover->setValue(27.51604f); | fKnobCrossover->setValue(27.51604f); | ||||
} | } | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
// Widget Callbacks | // Widget Callbacks | ||||
void DistrhoUIStereoEnhancer::imageButtonClicked(ImageButton* button, int) | void DistrhoUIStereoEnhancer::imageButtonClicked(ImageButton* button, int) | ||||
@@ -145,13 +145,13 @@ void DistrhoUIStereoEnhancer::onDisplay() | |||||
fImgBackground.draw(); | fImgBackground.draw(); | ||||
} | } | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
UI* createUI() | UI* createUI() | ||||
{ | { | ||||
return new DistrhoUIStereoEnhancer(); | return new DistrhoUIStereoEnhancer(); | ||||
} | } | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
END_NAMESPACE_DISTRHO | END_NAMESPACE_DISTRHO |
@@ -11,7 +11,7 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU Lesser General Public License for more details. | * GNU Lesser General Public License for more details. | ||||
* | * | ||||
* For a full copy of the license see the LGPL.txt file | |||||
* For a full copy of the license see the doc/LGPL.txt file. | |||||
*/ | */ | ||||
#ifndef DISTRHO_UI_STEREO_ENHANCER_HPP_INCLUDED | #ifndef DISTRHO_UI_STEREO_ENHANCER_HPP_INCLUDED | ||||
@@ -28,7 +28,7 @@ | |||||
START_NAMESPACE_DISTRHO | START_NAMESPACE_DISTRHO | ||||
// ------------------------------------------------- | |||||
// ----------------------------------------------------------------------- | |||||
class DistrhoUIStereoEnhancer : public OpenGLUI, | class DistrhoUIStereoEnhancer : public OpenGLUI, | ||||
public ImageButton::Callback, | public ImageButton::Callback, | ||||
@@ -39,26 +39,26 @@ public: | |||||
~DistrhoUIStereoEnhancer() override; | ~DistrhoUIStereoEnhancer() override; | ||||
protected: | protected: | ||||
// --------------------------------------------- | |||||
// ------------------------------------------------------------------- | |||||
// Information | // Information | ||||
unsigned int d_width() const override | |||||
unsigned int d_getWidth() const noexcept override | |||||
{ | { | ||||
return DistrhoArtworkStereoEnhancer::backgroundWidth; | return DistrhoArtworkStereoEnhancer::backgroundWidth; | ||||
} | } | ||||
unsigned int d_height() const override | |||||
unsigned int d_getHeight() const noexcept override | |||||
{ | { | ||||
return DistrhoArtworkStereoEnhancer::backgroundHeight; | return DistrhoArtworkStereoEnhancer::backgroundHeight; | ||||
} | } | ||||
// --------------------------------------------- | |||||
// ------------------------------------------------------------------- | |||||
// DSP Callbacks | // DSP Callbacks | ||||
void d_parameterChanged(uint32_t index, float value) override; | void d_parameterChanged(uint32_t index, float value) override; | ||||
void d_programChanged(uint32_t index) override; | void d_programChanged(uint32_t index) override; | ||||
// --------------------------------------------- | |||||
// ------------------------------------------------------------------- | |||||
// Widget Callbacks | // Widget Callbacks | ||||
void imageButtonClicked(ImageButton* button, int) override; | void imageButtonClicked(ImageButton* button, int) override; | ||||
@@ -78,6 +78,8 @@ private: | |||||
ImageButton* fButtonAbout; | ImageButton* fButtonAbout; | ||||
}; | }; | ||||
// ----------------------------------------------------------------------- | |||||
END_NAMESPACE_DISTRHO | END_NAMESPACE_DISTRHO | ||||
#endif // DISTRHO_UI_STEREO_ENHANCER_HPP_INCLUDED | #endif // DISTRHO_UI_STEREO_ENHANCER_HPP_INCLUDED |
@@ -12,7 +12,7 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU General Public License for more details. | * GNU General Public License for more details. | ||||
* | * | ||||
* For a full copy of the GNU General Public License see the GPL.txt file | |||||
* For a full copy of the GNU General Public License see the doc/GPL.txt file. | |||||
*/ | */ | ||||
#include "CarlaNative.hpp" | #include "CarlaNative.hpp" | ||||
@@ -109,7 +109,7 @@ private: | |||||
static double sTicksPerFrame; | static double sTicksPerFrame; | ||||
public: | public: | ||||
static PluginHandle _instantiate(const PluginDescriptor*, HostDescriptor* host) | |||||
static PluginHandle _instantiate(HostDescriptor* host) | |||||
{ | { | ||||
if (sInstanceCount == 0) | if (sInstanceCount == 0) | ||||
{ | { | ||||
@@ -160,7 +160,7 @@ double SunVoxFilePlugin::sTicksPerFrame = 0.0; | |||||
static const PluginDescriptor sunvoxfileDesc = { | static const PluginDescriptor sunvoxfileDesc = { | ||||
/* category */ PLUGIN_CATEGORY_UTILITY, | /* category */ PLUGIN_CATEGORY_UTILITY, | ||||
/* hints */ static_cast<PluginHints>(PLUGIN_HAS_GUI|PLUGIN_USES_GUI_AS_FILE), | |||||
/* hints */ static_cast<PluginHints>(PLUGIN_HAS_GUI), | |||||
/* supports */ static_cast<PluginSupports>(0x0), | /* supports */ static_cast<PluginSupports>(0x0), | ||||
/* audioIns */ 0, | /* audioIns */ 0, | ||||
/* audioOuts */ 2, | /* audioOuts */ 2, | ||||
@@ -12,7 +12,7 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU General Public License for more details. | * GNU General Public License for more details. | ||||
* | * | ||||
* For a full copy of the GNU General Public License see the GPL.txt file | |||||
* For a full copy of the GNU General Public License see the doc/GPL.txt file. | |||||
*/ | */ | ||||
// zynaddsubfx includes | // zynaddsubfx includes | ||||
@@ -12,7 +12,7 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU General Public License for more details. | * GNU General Public License for more details. | ||||
* | * | ||||
* For a full copy of the GNU General Public License see the GPL.txt file | |||||
* For a full copy of the GNU General Public License see the doc/GPL.txt file. | |||||
*/ | */ | ||||
#include "CarlaString.hpp" | #include "CarlaString.hpp" | ||||
@@ -12,7 +12,7 @@ | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
* GNU General Public License for more details. | * GNU General Public License for more details. | ||||
* | * | ||||
* For a full copy of the GNU General Public License see the GPL.txt file | |||||
* For a full copy of the GNU General Public License see the doc/GPL.txt file. | |||||
*/ | */ | ||||
// for UINT32_MAX | // for UINT32_MAX | ||||
@@ -275,7 +275,7 @@ public: | |||||
#ifdef WANT_ZYNADDSUBFX_UI | #ifdef WANT_ZYNADDSUBFX_UI | ||||
if (gPixmapPath.isEmpty()) | if (gPixmapPath.isEmpty()) | ||||
{ | { | ||||
gPixmapPath = host->resource_dir; | |||||
gPixmapPath = host->resourceDir; | |||||
gPixmapPath += PIXMAP_PATH; | gPixmapPath += PIXMAP_PATH; | ||||
gUiPixmapPath = gPixmapPath; | gUiPixmapPath = gPixmapPath; | ||||
} | } | ||||
@@ -475,7 +475,7 @@ protected: | |||||
{ | { | ||||
fUiClosed = 0; | fUiClosed = 0; | ||||
fUi = new MasterUI(fMaster, &fUiClosed); | fUi = new MasterUI(fMaster, &fUiClosed); | ||||
fUi->masterwindow->label(kHost->ui_name); | |||||
fUi->masterwindow->label(kHost->uiName); | |||||
fUi->showUI(); | fUi->showUI(); | ||||
} | } | ||||
} | } | ||||
@@ -559,17 +559,17 @@ private: | |||||
// ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
#define ZynPluginDescriptorClassEND(ClassName) \ | |||||
public: \ | |||||
static PluginHandle _instantiate(const PluginDescriptor*, HostDescriptor* host) \ | |||||
{ \ | |||||
sInstanceCount.addOne(host); \ | |||||
return new ClassName(host); \ | |||||
} \ | |||||
static void _cleanup(PluginHandle handle) \ | |||||
{ \ | |||||
delete (ClassName*)handle; \ | |||||
sInstanceCount.removeOne(); \ | |||||
#define ZynPluginDescriptorClassEND(ClassName) \ | |||||
public: \ | |||||
static PluginHandle _instantiate(HostDescriptor* host) \ | |||||
{ \ | |||||
sInstanceCount.addOne(host); \ | |||||
return new ClassName(host); \ | |||||
} \ | |||||
static void _cleanup(PluginHandle handle) \ | |||||
{ \ | |||||
delete (ClassName*)handle; \ | |||||
sInstanceCount.removeOne(); \ | |||||
} | } | ||||
// ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
@@ -703,7 +703,7 @@ protected: | |||||
// no break | // no break | ||||
} | } | ||||
case PLUGIN_OPCODE_SAMPLE_RATE_CHANGED: | case PLUGIN_OPCODE_SAMPLE_RATE_CHANGED: | ||||
sInstanceCount.maybeReinit(hostHandle()); | |||||
sInstanceCount.maybeReinit(getHostHandle()); | |||||
break; | break; | ||||
default: | default: | ||||
break; | break; | ||||
@@ -19,15 +19,20 @@ | |||||
#define CARLA_JUCE_HEADER_H_INCLUDED | #define CARLA_JUCE_HEADER_H_INCLUDED | ||||
#include "juce_core/AppConfig.h" | #include "juce_core/AppConfig.h" | ||||
#include "juce_audio_basics/AppConfig.h" | |||||
#include "juce_audio_formats/AppConfig.h" | |||||
#include "juce_audio_devices/AppConfig.h" | |||||
#include "juce_events/AppConfig.h" | |||||
#include "juce_core/juce_core.h" | #include "juce_core/juce_core.h" | ||||
#include "juce_audio_basics/juce_audio_basics.h" | |||||
#include "juce_audio_formats/juce_audio_formats.h" | |||||
#include "juce_audio_devices/juce_audio_devices.h" | |||||
#include "juce_events/juce_events.h" | |||||
//#include "modules/juce_audio_basics/juce_audio_basics.h" | |||||
//#include "modules/juce_audio_devices/juce_audio_devices.h" | |||||
//#include "modules/juce_audio_formats/juce_audio_formats.h" | |||||
//#include "modules/juce_audio_processors/juce_audio_processors.h" | //#include "modules/juce_audio_processors/juce_audio_processors.h" | ||||
//#include "modules/juce_audio_utils/juce_audio_utils.h" | //#include "modules/juce_audio_utils/juce_audio_utils.h" | ||||
//#include "modules/juce_data_structures/juce_data_structures.h" | //#include "modules/juce_data_structures/juce_data_structures.h" | ||||
//#include "modules/juce_events/juce_events.h" | |||||
//#include "modules/juce_graphics/juce_graphics.h" | //#include "modules/juce_graphics/juce_graphics.h" | ||||
//#include "modules/juce_gui_basics/juce_gui_basics.h" | //#include "modules/juce_gui_basics/juce_gui_basics.h" | ||||
//#include "modules/juce_gui_extra/juce_gui_extra.h" | //#include "modules/juce_gui_extra/juce_gui_extra.h" | ||||
@@ -21,7 +21,7 @@ | |||||
#include "dgl/Widget.hpp" | #include "dgl/Widget.hpp" | ||||
using DGL::Widget; | |||||
using namespace DGL; | |||||
START_NAMESPACE_DISTRHO | START_NAMESPACE_DISTRHO | ||||
@@ -227,12 +227,12 @@ public: | |||||
#if defined(DISTRHO_UI_EXTERNAL) | #if defined(DISTRHO_UI_EXTERNAL) | ||||
// not needed | // not needed | ||||
#elif defined(DISTRHO_UI_OPENGL) | #elif defined(DISTRHO_UI_OPENGL) | ||||
App& getApp() | |||||
DGL::App& getApp() | |||||
{ | { | ||||
return glApp; | return glApp; | ||||
} | } | ||||
Window& getWindow() | |||||
DGL::Window& getWindow() | |||||
{ | { | ||||
return glWindow; | return glWindow; | ||||
} | } | ||||
@@ -263,8 +263,8 @@ public: | |||||
#ifdef DISTRHO_UI_OPENGL | #ifdef DISTRHO_UI_OPENGL | ||||
private: | private: | ||||
App glApp; | |||||
Window glWindow; | |||||
DGL::App glApp; | |||||
DGL::Window glWindow; | |||||
#endif | #endif | ||||
protected: | protected: | ||||
@@ -27,11 +27,11 @@ START_NAMESPACE_DISTRHO | |||||
OpenGLUI::OpenGLUI() | OpenGLUI::OpenGLUI() | ||||
: UI(), | : UI(), | ||||
Widget(dgl_lastUiParent) | |||||
Widget(DGL::dgl_lastUiParent) | |||||
{ | { | ||||
assert(dgl_lastUiParent != nullptr); | |||||
assert(DGL::dgl_lastUiParent != nullptr); | |||||
dgl_lastUiParent = nullptr; | |||||
DGL::dgl_lastUiParent = nullptr; | |||||
} | } | ||||
OpenGLUI::~OpenGLUI() | OpenGLUI::~OpenGLUI() | ||||