@@ -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_CXX_FLAGS += $(BACKEND_FLAGS) | |||
@@ -12,7 +12,7 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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" | |||
@@ -12,7 +12,7 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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 | |||
@@ -12,7 +12,7 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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 | |||
@@ -12,7 +12,7 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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" | |||
@@ -12,7 +12,7 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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 | |||
@@ -12,7 +12,7 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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" | |||
@@ -12,7 +12,7 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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 | |||
@@ -12,7 +12,7 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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" | |||
@@ -12,7 +12,7 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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 | |||
@@ -12,7 +12,7 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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" | |||
@@ -25,7 +25,7 @@ CARLA_BACKEND_START_NAMESPACE | |||
// ----------------------------------------------------------------------- | |||
CarlaEngineThread::CarlaEngineThread(CarlaEngine* const engine) | |||
: kEngine(engine), | |||
: fEngine(engine), | |||
fStopNow(true) | |||
{ | |||
carla_debug("CarlaEngineThread::CarlaEngineThread(%p)", engine); | |||
@@ -12,20 +12,20 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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 <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 | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
DistrhoPlugin3BandEQ::DistrhoPlugin3BandEQ() | |||
: Plugin(paramCount, 1, 0) // 1 program, 0 states | |||
@@ -41,7 +41,7 @@ DistrhoPlugin3BandEQ::~DistrhoPlugin3BandEQ() | |||
{ | |||
} | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
// Init | |||
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"; | |||
} | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
// Internal data | |||
float DistrhoPlugin3BandEQ::d_parameterValue(uint32_t index) | |||
float DistrhoPlugin3BandEQ::d_getParameterValue(uint32_t index) const | |||
{ | |||
switch (index) | |||
{ | |||
@@ -144,38 +144,38 @@ float DistrhoPlugin3BandEQ::d_parameterValue(uint32_t index) | |||
void DistrhoPlugin3BandEQ::d_setParameterValue(uint32_t index, float value) | |||
{ | |||
if (d_sampleRate() <= 0.0) | |||
if (d_getSampleRate() <= 0.0) | |||
return; | |||
switch (index) | |||
{ | |||
case paramLow: | |||
fLow = value; | |||
lowVol = std::exp( (fLow/48.0f) * 48 / cfAMP_DB); | |||
lowVol = std::exp( (fLow/48.0f) * 48 / kAMP_DB); | |||
break; | |||
case paramMid: | |||
fMid = value; | |||
midVol = std::exp( (fMid/48.0f) * 48 / cfAMP_DB); | |||
midVol = std::exp( (fMid/48.0f) * 48 / kAMP_DB); | |||
break; | |||
case paramHigh: | |||
fHigh = value; | |||
highVol = std::exp( (fHigh/48.0f) * 48 / cfAMP_DB); | |||
highVol = std::exp( (fHigh/48.0f) * 48 / kAMP_DB); | |||
break; | |||
case paramMaster: | |||
fMaster = value; | |||
outVol = std::exp( (fMaster/48.0f) * 48 / cfAMP_DB); | |||
outVol = std::exp( (fMaster/48.0f) * 48 / kAMP_DB); | |||
break; | |||
case paramLowMidFreq: | |||
fLowMidFreq = std::fmin(value, fMidHighFreq); | |||
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; | |||
b1LP = -xLP; | |||
break; | |||
case paramMidHighFreq: | |||
fMidHighFreq = std::fmax(value, fLowMidFreq); | |||
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; | |||
b1HP = -xHP; | |||
break; | |||
@@ -204,16 +204,16 @@ void DistrhoPlugin3BandEQ::d_setProgram(uint32_t index) | |||
d_activate(); | |||
} | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
// Process | |||
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; | |||
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; | |||
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) | |||
{ | |||
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; | |||
out2[i] = (out2LP*lowVol + (in2[i] - out2LP - out2HP)*midVol + out2HP*highVol) * outVol; | |||
} | |||
} | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
Plugin* createPlugin() | |||
{ | |||
return new DistrhoPlugin3BandEQ(); | |||
} | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
END_NAMESPACE_DISTRHO |
@@ -12,7 +12,7 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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 | |||
@@ -22,6 +22,8 @@ | |||
START_NAMESPACE_DISTRHO | |||
// ----------------------------------------------------------------------- | |||
class DistrhoPlugin3BandEQ : public Plugin | |||
{ | |||
public: | |||
@@ -37,58 +39,58 @@ public: | |||
}; | |||
DistrhoPlugin3BandEQ(); | |||
~DistrhoPlugin3BandEQ(); | |||
~DistrhoPlugin3BandEQ() override; | |||
protected: | |||
// --------------------------------------------- | |||
// ------------------------------------------------------------------- | |||
// Information | |||
const char* d_label() const | |||
const char* d_getLabel() const noexcept override | |||
{ | |||
return "3BandEQ"; | |||
} | |||
const char* d_maker() const | |||
const char* d_getMaker() const noexcept override | |||
{ | |||
return "DISTRHO"; | |||
} | |||
const char* d_license() const | |||
const char* d_getLicense() const noexcept override | |||
{ | |||
return "LGPL"; | |||
} | |||
uint32_t d_version() const | |||
uint32_t d_getVersion() const noexcept override | |||
{ | |||
return 0x1000; | |||
} | |||
long d_uniqueId() const | |||
long d_getUniqueId() const noexcept override | |||
{ | |||
return d_cconst('D', '3', 'E', 'Q'); | |||
} | |||
// --------------------------------------------- | |||
// ------------------------------------------------------------------- | |||
// 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 | |||
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 | |||
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: | |||
float fLow, fMid, fHigh, fMaster, fLowMidFreq, fMidHighFreq; | |||
@@ -103,6 +105,8 @@ private: | |||
float tmp1LP, tmp2LP, tmp1HP, tmp2HP; | |||
}; | |||
// ----------------------------------------------------------------------- | |||
END_NAMESPACE_DISTRHO | |||
#endif // DISTRHO_PLUGIN_3BANDEQ_HPP_INCLUDED |
@@ -11,7 +11,7 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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 | |||
@@ -11,14 +11,14 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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" | |||
START_NAMESPACE_DISTRHO | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
DistrhoUI3BandEQ::DistrhoUI3BandEQ() | |||
: OpenGLUI(), | |||
@@ -103,7 +103,7 @@ DistrhoUI3BandEQ::~DistrhoUI3BandEQ() | |||
delete fButtonAbout; | |||
} | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
// DSP Callbacks | |||
void DistrhoUI3BandEQ::d_parameterChanged(uint32_t index, float value) | |||
@@ -145,7 +145,7 @@ void DistrhoUI3BandEQ::d_programChanged(uint32_t index) | |||
fKnobMidHigh->setValue(2000.0f); | |||
} | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
// Widget Callbacks | |||
void DistrhoUI3BandEQ::imageButtonClicked(ImageButton* button, int) | |||
@@ -221,13 +221,13 @@ void DistrhoUI3BandEQ::onDisplay() | |||
fImgBackground.draw(); | |||
} | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
UI* createUI() | |||
{ | |||
return new DistrhoUI3BandEQ(); | |||
} | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
END_NAMESPACE_DISTRHO |
@@ -11,7 +11,7 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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 | |||
@@ -29,7 +29,7 @@ | |||
START_NAMESPACE_DISTRHO | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
class DistrhoUI3BandEQ : public OpenGLUI, | |||
public ImageButton::Callback, | |||
@@ -41,26 +41,26 @@ public: | |||
~DistrhoUI3BandEQ() override; | |||
protected: | |||
// --------------------------------------------- | |||
// ------------------------------------------------------------------- | |||
// Information | |||
unsigned int d_width() const override | |||
unsigned int d_getWidth() const noexcept override | |||
{ | |||
return DistrhoArtwork3BandEQ::backgroundWidth; | |||
} | |||
unsigned int d_height() const override | |||
unsigned int d_getHeight() const noexcept override | |||
{ | |||
return DistrhoArtwork3BandEQ::backgroundHeight; | |||
} | |||
// --------------------------------------------- | |||
// ------------------------------------------------------------------- | |||
// DSP Callbacks | |||
void d_parameterChanged(uint32_t index, float value) override; | |||
void d_programChanged(uint32_t index) override; | |||
// --------------------------------------------- | |||
// ------------------------------------------------------------------- | |||
// Widget Callbacks | |||
void imageButtonClicked(ImageButton* button, int) override; | |||
@@ -86,7 +86,7 @@ private: | |||
ImageButton* fButtonAbout; | |||
}; | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
END_NAMESPACE_DISTRHO | |||
@@ -12,20 +12,20 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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 <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 | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
DistrhoPlugin3BandSplitter::DistrhoPlugin3BandSplitter() | |||
: Plugin(paramCount, 1, 0) // 1 program, 0 states | |||
@@ -41,7 +41,7 @@ DistrhoPlugin3BandSplitter::~DistrhoPlugin3BandSplitter() | |||
{ | |||
} | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
// Init | |||
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"; | |||
} | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
// Internal data | |||
float DistrhoPlugin3BandSplitter::d_parameterValue(uint32_t index) | |||
float DistrhoPlugin3BandSplitter::d_getParameterValue(uint32_t index) const | |||
{ | |||
switch (index) | |||
{ | |||
@@ -144,38 +144,38 @@ float DistrhoPlugin3BandSplitter::d_parameterValue(uint32_t index) | |||
void DistrhoPlugin3BandSplitter::d_setParameterValue(uint32_t index, float value) | |||
{ | |||
if (d_sampleRate() <= 0.0) | |||
if (d_getSampleRate() <= 0.0) | |||
return; | |||
switch (index) | |||
{ | |||
case paramLow: | |||
fLow = value; | |||
lowVol = std::exp( (fLow/48.0f) * 48 / cfAMP_DB); | |||
lowVol = std::exp( (fLow/48.0f) * 48 / kAMP_DB); | |||
break; | |||
case paramMid: | |||
fMid = value; | |||
midVol = std::exp( (fMid/48.0f) * 48 / cfAMP_DB); | |||
midVol = std::exp( (fMid/48.0f) * 48 / kAMP_DB); | |||
break; | |||
case paramHigh: | |||
fHigh = value; | |||
highVol = std::exp( (fHigh/48.0f) * 48 / cfAMP_DB); | |||
highVol = std::exp( (fHigh/48.0f) * 48 / kAMP_DB); | |||
break; | |||
case paramMaster: | |||
fMaster = value; | |||
outVol = std::exp( (fMaster/48.0f) * 48 / cfAMP_DB); | |||
outVol = std::exp( (fMaster/48.0f) * 48 / kAMP_DB); | |||
break; | |||
case paramLowMidFreq: | |||
fLowMidFreq = std::fmin(value, fMidHighFreq); | |||
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; | |||
b1LP = -xLP; | |||
break; | |||
case paramMidHighFreq: | |||
fMidHighFreq = std::fmax(value, fLowMidFreq); | |||
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; | |||
b1HP = -xHP; | |||
break; | |||
@@ -204,16 +204,16 @@ void DistrhoPlugin3BandSplitter::d_setProgram(uint32_t index) | |||
d_activate(); | |||
} | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
// Process | |||
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; | |||
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; | |||
b1HP = -xHP; | |||
} | |||
@@ -237,15 +237,15 @@ void DistrhoPlugin3BandSplitter::d_run(float** inputs, float** outputs, uint32_t | |||
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; | |||
out2[i] = out2LP*lowVol * outVol; | |||
@@ -256,13 +256,13 @@ void DistrhoPlugin3BandSplitter::d_run(float** inputs, float** outputs, uint32_t | |||
} | |||
} | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
Plugin* createPlugin() | |||
{ | |||
return new DistrhoPlugin3BandSplitter(); | |||
} | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
END_NAMESPACE_DISTRHO |
@@ -12,7 +12,7 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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 | |||
@@ -22,6 +22,8 @@ | |||
START_NAMESPACE_DISTRHO | |||
// ----------------------------------------------------------------------- | |||
class DistrhoPlugin3BandSplitter : public Plugin | |||
{ | |||
public: | |||
@@ -37,58 +39,58 @@ public: | |||
}; | |||
DistrhoPlugin3BandSplitter(); | |||
~DistrhoPlugin3BandSplitter(); | |||
~DistrhoPlugin3BandSplitter() override; | |||
protected: | |||
// --------------------------------------------- | |||
// ------------------------------------------------------------------- | |||
// Information | |||
const char* d_label() const | |||
const char* d_getLabel() const noexcept override | |||
{ | |||
return "3BandSplitter"; | |||
} | |||
const char* d_maker() const | |||
const char* d_getMaker() const noexcept override | |||
{ | |||
return "DISTRHO"; | |||
} | |||
const char* d_license() const | |||
const char* d_getLicense() const noexcept override | |||
{ | |||
return "LGPL"; | |||
} | |||
uint32_t d_version() const | |||
uint32_t d_getVersion() const noexcept override | |||
{ | |||
return 0x1000; | |||
} | |||
long d_uniqueId() const | |||
long d_getUniqueId() const noexcept override | |||
{ | |||
return d_cconst('D', '3', 'E', 'S'); | |||
} | |||
// --------------------------------------------- | |||
// ------------------------------------------------------------------- | |||
// 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 | |||
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 | |||
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: | |||
float fLow, fMid, fHigh, fMaster, fLowMidFreq, fMidHighFreq; | |||
@@ -103,6 +105,8 @@ private: | |||
float tmp1LP, tmp2LP, tmp1HP, tmp2HP; | |||
}; | |||
// ----------------------------------------------------------------------- | |||
END_NAMESPACE_DISTRHO | |||
#endif // DISTRHO_PLUGIN_3BANDSPLITTER_HPP_INCLUDED |
@@ -11,7 +11,7 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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 | |||
@@ -11,14 +11,14 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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" | |||
START_NAMESPACE_DISTRHO | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
DistrhoUI3BandSplitter::DistrhoUI3BandSplitter() | |||
: OpenGLUI(), | |||
@@ -103,7 +103,7 @@ DistrhoUI3BandSplitter::~DistrhoUI3BandSplitter() | |||
delete fButtonAbout; | |||
} | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
// DSP Callbacks | |||
void DistrhoUI3BandSplitter::d_parameterChanged(uint32_t index, float value) | |||
@@ -145,7 +145,7 @@ void DistrhoUI3BandSplitter::d_programChanged(uint32_t index) | |||
fKnobMidHigh->setValue(2000.0f); | |||
} | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
// Widget Callbacks | |||
void DistrhoUI3BandSplitter::imageButtonClicked(ImageButton* button, int) | |||
@@ -221,13 +221,13 @@ void DistrhoUI3BandSplitter::onDisplay() | |||
fImgBackground.draw(); | |||
} | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
UI* createUI() | |||
{ | |||
return new DistrhoUI3BandSplitter(); | |||
} | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
END_NAMESPACE_DISTRHO |
@@ -11,7 +11,7 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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 | |||
@@ -29,7 +29,7 @@ | |||
START_NAMESPACE_DISTRHO | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
class DistrhoUI3BandSplitter : public OpenGLUI, | |||
public ImageButton::Callback, | |||
@@ -41,26 +41,26 @@ public: | |||
~DistrhoUI3BandSplitter() override; | |||
protected: | |||
// --------------------------------------------- | |||
// ------------------------------------------------------------------- | |||
// Information | |||
unsigned int d_width() const override | |||
unsigned int d_getWidth() const noexcept override | |||
{ | |||
return DistrhoArtwork3BandSplitter::backgroundWidth; | |||
} | |||
unsigned int d_height() const override | |||
unsigned int d_getHeight() const noexcept override | |||
{ | |||
return DistrhoArtwork3BandSplitter::backgroundHeight; | |||
} | |||
// --------------------------------------------- | |||
// ------------------------------------------------------------------- | |||
// DSP Callbacks | |||
void d_parameterChanged(uint32_t index, float value) override; | |||
void d_programChanged(uint32_t index) override; | |||
// --------------------------------------------- | |||
// ------------------------------------------------------------------- | |||
// Widget Callbacks | |||
void imageButtonClicked(ImageButton* button, int) override; | |||
@@ -86,7 +86,7 @@ private: | |||
ImageButton* fButtonAbout; | |||
}; | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
END_NAMESPACE_DISTRHO | |||
@@ -6,10 +6,6 @@ | |||
include ../Makefile.mk | |||
# -------------------------------------------------------------- | |||
BUILD_CXX_FLAGS += -I. -I../../libs/distrho -I../../widgets | |||
ifeq ($(HAVE_QT4),true) | |||
BUILD_CXX_FLAGS += $(shell pkg-config --cflags QtCore QtGui) | |||
else | |||
@@ -19,30 +15,34 @@ endif | |||
# -------------------------------------------------------------- | |||
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) | |||
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 | |||
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 | |||
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 | |||
QT_CXX_FLAGS = $(BUILD_CXX_FLAGS) | |||
QT_CXX_FLAGS += -I../../modules/distrho -I../../modules/widgets | |||
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) | |||
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 | |||
@@ -56,8 +56,7 @@ OBJS = \ | |||
midi-split.c.o \ | |||
midi-through.c.o \ | |||
midi-transpose.c.o \ | |||
nekofilter.c.o \ | |||
sunvox-file.cpp.o | |||
nekofilter.c.o | |||
# AudioFile | |||
ifeq ($(HAVE_AF_DEPS),true) | |||
@@ -80,13 +79,13 @@ OBJS += \ | |||
distrho-3bandeq.cpp.o \ | |||
distrho-3bandsplitter.cpp.o \ | |||
distrho-nekobi.cpp.o \ | |||
distrho-pingpongpan.cpp.o | |||
# distrho-stereoenhancer.cpp.o | |||
distrho-pingpongpan.cpp.o \ | |||
distrho-stereoenhancer.cpp.o | |||
endif | |||
# DISTRHO plugins (Qt) | |||
# OBJS += \ | |||
# distrho-notes.cpp.o | |||
OBJS += \ | |||
distrho-notes.cpp.o | |||
ifeq ($(HAVE_ZYN_DEPS),true) | |||
# ZynAddSubFX | |||
@@ -142,9 +141,7 @@ TARGET = ../libcarla_native.a | |||
all: $(TARGET) | |||
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 | |||
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 $@ | |||
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) | |||
$(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) | |||
$(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 $@ | |||
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) $< -DMOC_PARSING -o $@ | |||
@@ -12,7 +12,7 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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 | |||
@@ -20,7 +20,7 @@ | |||
#include "CarlaMutex.hpp" | |||
#include <QtCore/QThread> | |||
#include "JuceHeader.h" | |||
extern "C" { | |||
#include "audio_decoder/ad.h" | |||
@@ -109,14 +109,13 @@ public: | |||
virtual uint32_t getLastFrame() const = 0; | |||
}; | |||
class AudioFileThread : public QThread | |||
class AudioFileThread : public juce::Thread | |||
{ | |||
public: | |||
AudioFileThread(AbstractAudioPlayer* const player, const double sampleRate) | |||
: QThread(nullptr), | |||
: juce::Thread("AudioFileThread"), | |||
kPlayer(player), | |||
fNeedsRead(false), | |||
fQuitNow(true), | |||
fFilePtr(nullptr) | |||
{ | |||
CARLA_ASSERT(kPlayer != nullptr); | |||
@@ -136,8 +135,7 @@ public: | |||
~AudioFileThread() override | |||
{ | |||
CARLA_ASSERT(fQuitNow); | |||
CARLA_ASSERT(! isRunning()); | |||
CARLA_ASSERT(! isThreadRunning()); | |||
if (fFilePtr != nullptr) | |||
ad_close(fFilePtr); | |||
@@ -148,17 +146,13 @@ public: | |||
void startNow() | |||
{ | |||
fNeedsRead = true; | |||
fQuitNow = false; | |||
start(IdlePriority); | |||
startThread(2); | |||
} | |||
void stopNow() | |||
{ | |||
fNeedsRead = false; | |||
fQuitNow = true; | |||
if (isRunning() && ! wait(1000)) | |||
terminate(); | |||
stopThread(1000); | |||
const CarlaMutex::ScopedLocker sl(fMutex); | |||
fPool.reset(); | |||
@@ -176,7 +170,7 @@ public: | |||
bool loadFilename(const char* const filename) | |||
{ | |||
CARLA_ASSERT(! isRunning()); | |||
CARLA_ASSERT(! isThreadRunning()); | |||
CARLA_ASSERT(filename != nullptr); | |||
fPool.startFrame = 0; | |||
@@ -362,7 +356,7 @@ public: | |||
protected: | |||
void run() override | |||
{ | |||
while (! fQuitNow) | |||
while (! threadShouldExit()) | |||
{ | |||
const uint32_t lastFrame(kPlayer->getLastFrame()); | |||
@@ -377,7 +371,6 @@ private: | |||
AbstractAudioPlayer* const kPlayer; | |||
bool fNeedsRead; | |||
bool fQuitNow; | |||
void* fFilePtr; | |||
ADInfo fFileNfo; | |||
@@ -12,7 +12,7 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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" | |||
@@ -245,7 +245,7 @@ private: | |||
static const PluginDescriptor audiofileDesc = { | |||
/* 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), | |||
/* audioIns */ 0, | |||
/* audioOuts */ 2, | |||
@@ -12,18 +12,17 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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" | |||
static PluginHandle bypass_instantiate(const PluginDescriptor* _this_, HostDescriptor* host) | |||
static PluginHandle bypass_instantiate(HostDescriptor* host) | |||
{ | |||
// dummy, return non-NULL | |||
return (PluginHandle)0x1; | |||
// unused | |||
(void)_this_; | |||
(void)host; | |||
} | |||
@@ -12,7 +12,7 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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" | |||
@@ -12,7 +12,7 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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" | |||
@@ -12,7 +12,7 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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" | |||
@@ -12,7 +12,7 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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" | |||
@@ -12,7 +12,7 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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" | |||
@@ -12,7 +12,7 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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" | |||
@@ -15,7 +15,6 @@ | |||
*/ | |||
#include "CarlaNative.hpp" | |||
#include "CarlaUtils.hpp" | |||
#include "DistrhoPluginMain.cpp" | |||
@@ -30,6 +29,8 @@ | |||
# include "DistrhoUIMain.cpp" | |||
#endif | |||
using juce::ScopedPointer; | |||
// ----------------------------------------------------------------------- | |||
START_NAMESPACE_DISTRHO | |||
@@ -60,12 +61,12 @@ public: | |||
setCentralWidget(qtUi); | |||
#endif | |||
setWindowIcon(QIcon(":/scalable/distrho.svg")); | |||
setWindowTitle(QString("%1 (GUI)").arg(fUi.name())); | |||
setWindowTitle(QString("%1 (GUI)").arg(fUi.getName())); | |||
#ifdef DISTRHO_UI_OPENGL | |||
fUi.fixSize(); | |||
fUi.fixWindowSize(); | |||
#endif | |||
uiResize(fUi.width(), fUi.height()); | |||
uiResize(fUi.getWidth(), fUi.getHeight()); | |||
{ | |||
QSettings settings; | |||
@@ -148,7 +149,7 @@ protected: | |||
fWidget.setFixedSize(width, height); | |||
setFixedSize(width, height); | |||
#else | |||
if (fUi.resizable()) | |||
if (fUi.isResizable()) | |||
resize(width, height); | |||
else | |||
setFixedSize(width, height); | |||
@@ -243,7 +244,7 @@ protected: | |||
uint32_t getParameterCount() override | |||
{ | |||
return fPlugin.parameterCount(); | |||
return fPlugin.getParameterCount(); | |||
} | |||
const ::Parameter* getParameterInfo(const uint32_t index) override | |||
@@ -259,7 +260,7 @@ protected: | |||
{ | |||
int nativeParamHints = ::PARAMETER_IS_ENABLED; | |||
const uint32_t paramHints = fPlugin.parameterHints(index); | |||
const uint32_t paramHints = fPlugin.getParameterHints(index); | |||
if (paramHints & PARAMETER_IS_AUTOMABLE) | |||
nativeParamHints |= ::PARAMETER_IS_AUTOMABLE; | |||
@@ -275,11 +276,11 @@ protected: | |||
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.min = ranges.min; | |||
@@ -296,7 +297,7 @@ protected: | |||
{ | |||
CARLA_ASSERT(index < getParameterCount()); | |||
return fPlugin.parameterValue(index); | |||
return fPlugin.getParameterValue(index); | |||
} | |||
// getParameterText unused | |||
@@ -307,21 +308,21 @@ protected: | |||
#if DISTRHO_PLUGIN_WANT_PROGRAMS | |||
uint32_t getMidiProgramCount() override | |||
{ | |||
return fPlugin.programCount(); | |||
return fPlugin.getProgramCount(); | |||
} | |||
const ::MidiProgram* getMidiProgramInfo(const uint32_t index) override | |||
{ | |||
CARLA_ASSERT(index < getMidiProgramCount()); | |||
if (index >= fPlugin.programCount()) | |||
if (index >= fPlugin.getProgramCount()) | |||
return nullptr; | |||
static ::MidiProgram midiProgram; | |||
midiProgram.bank = index / 128; | |||
midiProgram.program = index % 128; | |||
midiProgram.name = fPlugin.programName(index); | |||
midiProgram.name = fPlugin.getProgramName(index); | |||
return &midiProgram; | |||
} | |||
@@ -342,7 +343,7 @@ protected: | |||
{ | |||
const uint32_t realProgram(bank * 128 + program); | |||
if (realProgram >= fPlugin.programCount()) | |||
if (realProgram >= fPlugin.getProgramCount()) | |||
return; | |||
fPlugin.setProgram(realProgram); | |||
@@ -436,7 +437,7 @@ protected: | |||
const uint32_t realProgram(bank * 128 + program); | |||
if (realProgram >= fPlugin.programCount()) | |||
if (realProgram >= fPlugin.getProgramCount()) | |||
return; | |||
if (fUiPtr != nullptr) | |||
@@ -476,7 +477,7 @@ private: | |||
if (fUiPtr == nullptr) | |||
{ | |||
d_lastUiSampleRate = getSampleRate(); | |||
fUiPtr = new UICarla(hostHandle(), &fPlugin); | |||
fUiPtr = new UICarla(getHostHandle(), &fPlugin); | |||
if (! fUiGeometry.isNull()) | |||
fUiPtr->restoreGeometry(fUiGeometry); | |||
@@ -489,7 +490,7 @@ private: | |||
// ------------------------------------------------------------------- | |||
public: | |||
static PluginHandle _instantiate(const PluginDescriptor*, HostDescriptor* host) | |||
static PluginHandle _instantiate(HostDescriptor* host) | |||
{ | |||
d_lastBufferSize = host->get_buffer_size(host->handle); | |||
d_lastSampleRate = host->get_sample_rate(host->handle); | |||
@@ -43,7 +43,7 @@ typedef struct _LfoHandle { | |||
float value; | |||
} LfoHandle; | |||
static PluginHandle lfo_instantiate(const PluginDescriptor* _this_, HostDescriptor* host) | |||
static PluginHandle lfo_instantiate(HostDescriptor* host) | |||
{ | |||
LfoHandle* const handle = (LfoHandle*)malloc(sizeof(LfoHandle)); | |||
@@ -59,9 +59,6 @@ static PluginHandle lfo_instantiate(const PluginDescriptor* _this_, HostDescript | |||
handle->baseStart = 0.0f; | |||
handle->value = 0.0f; | |||
return handle; | |||
// unused | |||
(void)_this_; | |||
} | |||
#define handlePtr ((LfoHandle*)handle) | |||
@@ -12,7 +12,7 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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 | |||
@@ -83,7 +83,7 @@ public: | |||
void addChannelPressure(const uint32_t time, const uint8_t channel, const uint8_t pressure) | |||
{ | |||
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->size = 2; | |||
pressureEvent->time = time; | |||
@@ -12,7 +12,7 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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" | |||
@@ -220,7 +220,7 @@ private: | |||
static const PluginDescriptor midifileDesc = { | |||
/* 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), | |||
/* audioIns */ 0, | |||
/* audioOuts */ 0, | |||
@@ -12,7 +12,7 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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" | |||
@@ -12,7 +12,7 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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" | |||
@@ -24,7 +24,7 @@ typedef struct _MidiSplitHandle { | |||
HostDescriptor* host; | |||
} MidiSplitHandle; | |||
static PluginHandle midiSplit_instantiate(const PluginDescriptor* _this_, HostDescriptor* host) | |||
static PluginHandle midiSplit_instantiate(HostDescriptor* host) | |||
{ | |||
MidiSplitHandle* const handle = (MidiSplitHandle*)malloc(sizeof(MidiSplitHandle)); | |||
@@ -33,9 +33,6 @@ static PluginHandle midiSplit_instantiate(const PluginDescriptor* _this_, HostDe | |||
handle->host = host; | |||
return handle; | |||
// unused | |||
(void)_this_; | |||
} | |||
#define handlePtr ((MidiSplitHandle*)handle) | |||
@@ -12,7 +12,7 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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" | |||
@@ -24,7 +24,7 @@ typedef struct _MidiThroughHandle { | |||
HostDescriptor* host; | |||
} MidiThroughHandle; | |||
static PluginHandle midiThrough_instantiate(const PluginDescriptor* _this_, HostDescriptor* host) | |||
static PluginHandle midiThrough_instantiate(HostDescriptor* host) | |||
{ | |||
MidiThroughHandle* const handle = (MidiThroughHandle*)malloc(sizeof(MidiThroughHandle)); | |||
@@ -33,9 +33,6 @@ static PluginHandle midiThrough_instantiate(const PluginDescriptor* _this_, Host | |||
handle->host = host; | |||
return handle; | |||
// unused | |||
(void)_this_; | |||
} | |||
#define handlePtr ((MidiThroughHandle*)handle) | |||
@@ -12,7 +12,7 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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" | |||
@@ -25,7 +25,7 @@ typedef struct _MidiTransposeHandle { | |||
int octaves; | |||
} MidiTransposeHandle; | |||
static PluginHandle midiTranspose_instantiate(const PluginDescriptor* _this_, HostDescriptor* host) | |||
static PluginHandle midiTranspose_instantiate(HostDescriptor* host) | |||
{ | |||
MidiTransposeHandle* const handle = (MidiTransposeHandle*)malloc(sizeof(MidiTransposeHandle)); | |||
@@ -35,9 +35,6 @@ static PluginHandle midiTranspose_instantiate(const PluginDescriptor* _this_, Ho | |||
handle->host = host; | |||
handle->octaves = 0; | |||
return handle; | |||
// unused | |||
(void)_this_; | |||
} | |||
#define handlePtr ((MidiTransposeHandle*)handle) | |||
@@ -12,7 +12,7 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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 | |||
@@ -13,7 +13,7 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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" | |||
@@ -30,7 +30,8 @@ extern "C" { | |||
#include "nekobee-src/nekobee_voice_render.c" | |||
#include "nekobee-src/minblep_tables.c" | |||
/* ---- mutual exclusion ---- */ | |||
// ----------------------------------------------------------------------- | |||
// mutual exclusion | |||
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); | |||
} | |||
/* | |||
* nekobee_handle_raw_event | |||
*/ | |||
// ----------------------------------------------------------------------- | |||
// nekobee_handle_raw_event | |||
void nekobee_handle_raw_event(nekobee_synth_t* synth, uint8_t size, const uint8_t* data) | |||
{ | |||
if (size != 3) | |||
@@ -92,7 +93,7 @@ void nekobee_handle_raw_event(nekobee_synth_t* synth, uint8_t size, const uint8_ | |||
START_NAMESPACE_DISTRHO | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
DistrhoPluginNekobi::DistrhoPluginNekobi() | |||
: Plugin(paramCount, 0, 0) // 0 programs, 0 states | |||
@@ -102,8 +103,8 @@ DistrhoPluginNekobi::DistrhoPluginNekobi() | |||
// init synth | |||
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->note_id = 0; | |||
@@ -167,7 +168,7 @@ DistrhoPluginNekobi::~DistrhoPluginNekobi() | |||
delete fSynth; | |||
} | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
// Init | |||
void DistrhoPluginNekobi::d_initParameter(uint32_t index, Parameter& parameter) | |||
@@ -247,10 +248,10 @@ void DistrhoPluginNekobi::d_initParameter(uint32_t index, Parameter& parameter) | |||
} | |||
} | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
// Internal data | |||
float DistrhoPluginNekobi::d_parameterValue(uint32_t index) | |||
float DistrhoPluginNekobi::d_getParameterValue(uint32_t index) const | |||
{ | |||
switch (index) | |||
{ | |||
@@ -322,7 +323,7 @@ void DistrhoPluginNekobi::d_setParameterValue(uint32_t index, float value) | |||
} | |||
} | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
// Process | |||
void DistrhoPluginNekobi::d_activate() | |||
@@ -397,13 +398,13 @@ void DistrhoPluginNekobi::d_run(float**, float** outputs, uint32_t frames, uint3 | |||
dssp_voicelist_mutex_unlock(fSynth); | |||
} | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
Plugin* createPlugin() | |||
{ | |||
return new DistrhoPluginNekobi(); | |||
} | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
END_NAMESPACE_DISTRHO |
@@ -13,11 +13,11 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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" | |||
@@ -27,6 +27,8 @@ extern "C" { | |||
START_NAMESPACE_DISTRHO | |||
// ----------------------------------------------------------------------- | |||
class DistrhoPluginNekobi : public Plugin | |||
{ | |||
public: | |||
@@ -44,56 +46,56 @@ public: | |||
}; | |||
DistrhoPluginNekobi(); | |||
~DistrhoPluginNekobi(); | |||
~DistrhoPluginNekobi() override; | |||
protected: | |||
// --------------------------------------------- | |||
// ------------------------------------------------------------------- | |||
// Information | |||
const char* d_label() const | |||
const char* d_getLabel() const noexcept override | |||
{ | |||
return "Nekobi"; | |||
} | |||
const char* d_maker() const | |||
const char* d_getMaker() const noexcept override | |||
{ | |||
return "DISTRHO"; | |||
} | |||
const char* d_license() const | |||
const char* d_getLicense() const noexcept override | |||
{ | |||
return "GPL v2+"; | |||
} | |||
uint32_t d_version() const | |||
uint32_t d_getVersion() const noexcept override | |||
{ | |||
return 0x1000; | |||
} | |||
long d_uniqueId() const | |||
long d_getUniqueId() const noexcept override | |||
{ | |||
return d_cconst('D', 'N', 'e', 'k'); | |||
} | |||
// --------------------------------------------- | |||
// ------------------------------------------------------------------- | |||
// Init | |||
void d_initParameter(uint32_t index, Parameter& parameter); | |||
void d_initParameter(uint32_t index, Parameter& parameter) override; | |||
// --------------------------------------------- | |||
// ------------------------------------------------------------------- | |||
// 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 | |||
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: | |||
struct ParamValues { | |||
@@ -110,6 +112,8 @@ private: | |||
nekobee_synth_t* fSynth; | |||
}; | |||
// ----------------------------------------------------------------------- | |||
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 | |||
* 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" | |||
@@ -21,7 +21,7 @@ | |||
START_NAMESPACE_DISTRHO | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
DistrhoUINekobi::DistrhoUINekobi() | |||
: OpenGLUI(), | |||
@@ -127,7 +127,7 @@ DistrhoUINekobi::~DistrhoUINekobi() | |||
delete fButtonAbout; | |||
} | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
// DSP Callbacks | |||
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 | |||
void DistrhoUINekobi::d_uiIdle() | |||
@@ -178,7 +170,7 @@ void DistrhoUINekobi::d_uiIdle() | |||
repaint(); | |||
} | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
// Widget Callbacks | |||
void DistrhoUINekobi::imageButtonClicked(ImageButton* button, int) | |||
@@ -273,13 +265,13 @@ void DistrhoUINekobi::onDisplay() | |||
fNeko.draw(); | |||
} | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
UI* createUI() | |||
{ | |||
return new DistrhoUINekobi(); | |||
} | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
END_NAMESPACE_DISTRHO |
@@ -12,11 +12,11 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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" | |||
@@ -31,7 +31,7 @@ | |||
START_NAMESPACE_DISTRHO | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
class DistrhoUINekobi : public OpenGLUI, | |||
public ImageButton::Callback, | |||
@@ -43,31 +43,31 @@ public: | |||
~DistrhoUINekobi() override; | |||
protected: | |||
// --------------------------------------------- | |||
// ------------------------------------------------------------------- | |||
// Information | |||
unsigned int d_width() const override | |||
unsigned int d_getWidth() const noexcept override | |||
{ | |||
return DistrhoArtworkNekobi::backgroundWidth; | |||
} | |||
unsigned int d_height() const override | |||
unsigned int d_getHeight() const noexcept override | |||
{ | |||
return DistrhoArtworkNekobi::backgroundHeight; | |||
} | |||
// --------------------------------------------- | |||
// ------------------------------------------------------------------- | |||
// DSP Callbacks | |||
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 | |||
void d_uiIdle() override; | |||
// --------------------------------------------- | |||
// ------------------------------------------------------------------- | |||
// Widget Callbacks | |||
void imageButtonClicked(ImageButton* button, int) override; | |||
@@ -97,8 +97,8 @@ private: | |||
ImageAboutWindow fAboutWindow; | |||
}; | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
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> | |||
* | |||
* This program is free software; you can redistribute it and/or | |||
@@ -12,9 +12,12 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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/Widget.hpp" | |||
@@ -24,6 +27,8 @@ | |||
USE_NAMESPACE_DGL; | |||
// ----------------------------------------------------------------------- | |||
class NekoWidget | |||
{ | |||
public: | |||
@@ -159,6 +164,8 @@ public: | |||
fTimerSpeed = speed; | |||
} | |||
// ------------------------------------------------------------------- | |||
private: | |||
enum Action { | |||
kActionNone, // bounce tail | |||
@@ -189,3 +196,7 @@ private: | |||
Action fCurAction; | |||
Image* fCurImage; | |||
}; | |||
// ----------------------------------------------------------------------- | |||
#endif // NEKO_WIDGET_HPP_INCLUDED |
@@ -12,7 +12,7 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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" | |||
@@ -55,7 +55,6 @@ struct nekofilter | |||
PluginHandle | |||
nekofilter_instantiate( | |||
const struct _PluginDescriptor* _this_, | |||
HostDescriptor* host) | |||
{ | |||
struct nekofilter * nekofilter_ptr; | |||
@@ -66,7 +65,7 @@ nekofilter_instantiate( | |||
nekofilter_ptr = malloc(sizeof(struct nekofilter)); | |||
if (nekofilter_ptr == NULL) | |||
{ | |||
goto fail; | |||
return NULL; | |||
} | |||
nekofilter_ptr->host = host; | |||
@@ -74,9 +73,10 @@ nekofilter_instantiate( | |||
nekofilter_ptr->ui = NULL; | |||
#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; | |||
@@ -135,16 +135,6 @@ nekofilter_instantiate( | |||
} | |||
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) | |||
@@ -373,13 +373,13 @@ nekoui_instantiate( | |||
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 */ | |||
filename = malloc(strlen(host->resource_dir) + strlen(UI_EXECUTABLE) + 1); | |||
filename = malloc(strlen(host->resourceDir) + strlen(UI_EXECUTABLE) + 1); | |||
if (filename == NULL) | |||
{ | |||
goto fail_free_control; | |||
} | |||
strcpy(filename, host->resource_dir); | |||
strcpy(filename, host->resourceDir); | |||
strcat(filename, UI_EXECUTABLE); | |||
char sample_rate_str[12] = { 0 }; | |||
@@ -12,7 +12,7 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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 | |||
@@ -12,7 +12,7 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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" | |||
@@ -21,7 +21,7 @@ | |||
START_NAMESPACE_DISTRHO | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
DistrhoPluginNotes::DistrhoPluginNotes() | |||
: Plugin(1, 0, 103) // 1 parameter, 0 programs, 103 states | |||
@@ -33,7 +33,7 @@ DistrhoPluginNotes::~DistrhoPluginNotes() | |||
{ | |||
} | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
// Init | |||
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 | |||
float DistrhoPluginNotes::d_parameterValue(uint32_t index) | |||
float DistrhoPluginNotes::d_getParameterValue(uint32_t index) const | |||
{ | |||
if (index != 0) | |||
return 0.0f; | |||
@@ -95,7 +95,7 @@ void DistrhoPluginNotes::d_setState(const char*, const char*) | |||
// do nothing, used only for UI state | |||
} | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
// Process | |||
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); | |||
} | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
Plugin* createPlugin() | |||
{ | |||
return new DistrhoPluginNotes(); | |||
} | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
END_NAMESPACE_DISTRHO |
@@ -12,7 +12,7 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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 | |||
@@ -22,65 +22,69 @@ | |||
START_NAMESPACE_DISTRHO | |||
// ----------------------------------------------------------------------- | |||
class DistrhoPluginNotes : public Plugin | |||
{ | |||
public: | |||
DistrhoPluginNotes(); | |||
~DistrhoPluginNotes(); | |||
~DistrhoPluginNotes() override; | |||
protected: | |||
// --------------------------------------------- | |||
// ------------------------------------------------------------------- | |||
// Information | |||
const char* d_label() const | |||
const char* d_getLabel() const noexcept override | |||
{ | |||
return "Notes"; | |||
} | |||
const char* d_maker() const | |||
const char* d_getMaker() const noexcept override | |||
{ | |||
return "DISTRHO"; | |||
} | |||
const char* d_license() const | |||
const char* d_getLicense() const noexcept override | |||
{ | |||
return "GPL v2+"; | |||
} | |||
uint32_t d_version() const | |||
uint32_t d_getVersion() const noexcept override | |||
{ | |||
return 0x1000; | |||
} | |||
long d_uniqueId() const | |||
long d_getUniqueId() const noexcept override | |||
{ | |||
return d_cconst('D', 'N', 'o', 't'); | |||
} | |||
// --------------------------------------------- | |||
// ------------------------------------------------------------------- | |||
// 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 | |||
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 | |||
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: | |||
int fCurPage; | |||
}; | |||
// ----------------------------------------------------------------------- | |||
END_NAMESPACE_DISTRHO | |||
#endif // DISTRHO_PLUGIN_NOTES_HPP_INCLUDED |
@@ -12,7 +12,7 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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" | |||
@@ -23,7 +23,7 @@ START_NAMESPACE_DISTRHO | |||
#include "moc_DistrhoUINotes.cpp" | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
DistrhoUINotes::DistrhoUINotes() | |||
: QtUI(), | |||
@@ -80,7 +80,7 @@ void DistrhoUINotes::saveCurrentTextState() | |||
} | |||
} | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
// DSP Callbacks | |||
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 | |||
void DistrhoUINotes::d_uiIdle() | |||
@@ -174,7 +174,7 @@ void DistrhoUINotes::resizeEvent(QResizeEvent* event) | |||
QtUI::resizeEvent(event); | |||
} | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
void DistrhoUINotes::buttonClicked(bool click) | |||
{ | |||
@@ -210,13 +210,13 @@ void DistrhoUINotes::textChanged() | |||
fSaveTextNowChecker = 0; | |||
} | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
UI* createUI() | |||
{ | |||
return new DistrhoUINotes; | |||
return new DistrhoUINotes(); | |||
} | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
END_NAMESPACE_DISTRHO |
@@ -12,7 +12,7 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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 | |||
@@ -38,7 +38,7 @@ class QResizeEvent; | |||
START_NAMESPACE_DISTRHO | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
class DistrhoUINotes : public QtUI | |||
{ | |||
@@ -49,40 +49,42 @@ public: | |||
~DistrhoUINotes() override; | |||
protected: | |||
// --------------------------------------------- | |||
// ------------------------------------------------------------------- | |||
// Information | |||
bool d_resizable() const override | |||
bool d_isResizable() const noexcept override | |||
{ | |||
return true; | |||
} | |||
uint d_minimumWidth() const override | |||
uint d_getMinimumWidth() const noexcept override | |||
{ | |||
return 180; | |||
} | |||
uint d_minimumHeight() const override | |||
uint d_getMinimumHeight() const noexcept override | |||
{ | |||
return 150; | |||
} | |||
// --------------------------------------------- | |||
// ------------------------------------------------------------------- | |||
// DSP Callbacks | |||
void d_parameterChanged(uint32_t index, float value) override; | |||
void d_stateChanged(const char* key, const char* value) override; | |||
// --------------------------------------------- | |||
// ------------------------------------------------------------------- | |||
// UI Callbacks | |||
void d_uiIdle() override; | |||
// --------------------------------------------- | |||
// ------------------------------------------------------------------- | |||
// listen for resize events | |||
void resizeEvent(QResizeEvent*) override; | |||
// ------------------------------------------------------------------- | |||
private slots: | |||
void buttonClicked(bool click); | |||
void progressBarValueChanged(float value); | |||
@@ -104,6 +106,8 @@ private: | |||
void saveCurrentTextState(); | |||
}; | |||
// ----------------------------------------------------------------------- | |||
END_NAMESPACE_DISTRHO | |||
#endif // DISTRHO_UI_NOTES_HPP_INCLUDED |
@@ -11,7 +11,7 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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 | |||
@@ -12,18 +12,18 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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 <cmath> | |||
static const float cf2PI = 6.283185307f; | |||
static const float k2PI = 6.283185307f; | |||
START_NAMESPACE_DISTRHO | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
DistrhoPluginPingPongPan::DistrhoPluginPingPongPan() | |||
: Plugin(paramCount, 1, 0) // 1 program, 0 states | |||
@@ -39,7 +39,7 @@ DistrhoPluginPingPongPan::~DistrhoPluginPingPongPan() | |||
{ | |||
} | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
// Init | |||
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"; | |||
} | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
// Internal data | |||
float DistrhoPluginPingPongPan::d_parameterValue(uint32_t index) | |||
float DistrhoPluginPingPongPan::d_getParameterValue(uint32_t index) const | |||
{ | |||
switch (index) | |||
{ | |||
@@ -93,14 +93,14 @@ float DistrhoPluginPingPongPan::d_parameterValue(uint32_t index) | |||
void DistrhoPluginPingPongPan::d_setParameterValue(uint32_t index, float value) | |||
{ | |||
if (d_sampleRate() <= 0.0) | |||
if (d_getSampleRate() <= 0.0) | |||
return; | |||
switch (index) | |||
{ | |||
case paramFreq: | |||
fFreq = value; | |||
waveSpeed = (cf2PI * fFreq / 100.0f)/(float)d_sampleRate(); | |||
waveSpeed = (k2PI * fFreq / 100.0f)/(float)d_getSampleRate(); | |||
break; | |||
case paramWidth: | |||
fWidth = value; | |||
@@ -121,12 +121,12 @@ void DistrhoPluginPingPongPan::d_setProgram(uint32_t index) | |||
d_activate(); | |||
} | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
// Process | |||
void DistrhoPluginPingPongPan::d_activate() | |||
{ | |||
waveSpeed = (cf2PI * fFreq / 100.0f)/(float)d_sampleRate(); | |||
waveSpeed = (k2PI * fFreq / 100.0f)/(float)d_getSampleRate(); | |||
} | |||
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); | |||
if ((wavePos += waveSpeed) >= cf2PI) | |||
wavePos -= cf2PI; | |||
if ((wavePos += waveSpeed) >= k2PI) | |||
wavePos -= k2PI; | |||
out1[i] = in1[i] * (pan > 0.0f ? 1.0f-pan : 1.0f); | |||
out2[i] = in2[i] * (pan < 0.0f ? 1.0f+pan : 1.0f); | |||
} | |||
} | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
Plugin* createPlugin() | |||
{ | |||
return new DistrhoPluginPingPongPan(); | |||
} | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
END_NAMESPACE_DISTRHO |
@@ -12,7 +12,7 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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 | |||
@@ -22,6 +22,8 @@ | |||
START_NAMESPACE_DISTRHO | |||
// ----------------------------------------------------------------------- | |||
class DistrhoPluginPingPongPan : public Plugin | |||
{ | |||
public: | |||
@@ -33,58 +35,58 @@ public: | |||
}; | |||
DistrhoPluginPingPongPan(); | |||
~DistrhoPluginPingPongPan(); | |||
~DistrhoPluginPingPongPan() override; | |||
protected: | |||
// --------------------------------------------- | |||
// ------------------------------------------------------------------- | |||
// Information | |||
const char* d_label() const | |||
const char* d_getLabel() const noexcept override | |||
{ | |||
return "PingPongPan"; | |||
} | |||
const char* d_maker() const | |||
const char* d_getMaker() const noexcept override | |||
{ | |||
return "DISTRHO"; | |||
} | |||
const char* d_license() const | |||
const char* d_getLicense() const noexcept override | |||
{ | |||
return "LGPL"; | |||
} | |||
uint32_t d_version() const | |||
uint32_t d_getVersion() const noexcept override | |||
{ | |||
return 0x1000; | |||
} | |||
long d_uniqueId() const | |||
long d_getUniqueId() const noexcept override | |||
{ | |||
return d_cconst('D', 'P', 'P', 'P'); | |||
} | |||
// --------------------------------------------- | |||
// ------------------------------------------------------------------- | |||
// 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 | |||
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 | |||
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: | |||
float fFreq; | |||
@@ -94,6 +96,8 @@ private: | |||
float pan, wavePos; | |||
}; | |||
// ----------------------------------------------------------------------- | |||
END_NAMESPACE_DISTRHO | |||
#endif // DISTRHO_PLUGIN_PINGPONGPAN_HPP_INCLUDED |
@@ -11,7 +11,7 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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" | |||
@@ -20,7 +20,7 @@ | |||
START_NAMESPACE_DISTRHO | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
DistrhoUIPingPongPan::DistrhoUIPingPongPan() | |||
: OpenGLUI(), | |||
@@ -66,7 +66,7 @@ DistrhoUIPingPongPan::~DistrhoUIPingPongPan() | |||
delete fButtonAbout; | |||
} | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
// DSP Callbacks | |||
void DistrhoUIPingPongPan::d_parameterChanged(uint32_t index, float value) | |||
@@ -92,7 +92,7 @@ void DistrhoUIPingPongPan::d_programChanged(uint32_t index) | |||
fKnobWidth->setValue(75.0f); | |||
} | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
// Widget Callbacks | |||
void DistrhoUIPingPongPan::imageButtonClicked(ImageButton* button, int) | |||
@@ -133,13 +133,13 @@ void DistrhoUIPingPongPan::onDisplay() | |||
fImgBackground.draw(); | |||
} | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
UI* createUI() | |||
{ | |||
return new DistrhoUIPingPongPan(); | |||
} | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
END_NAMESPACE_DISTRHO |
@@ -11,7 +11,7 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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 | |||
@@ -28,7 +28,7 @@ | |||
START_NAMESPACE_DISTRHO | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
class DistrhoUIPingPongPan : public OpenGLUI, | |||
public ImageButton::Callback, | |||
@@ -39,27 +39,26 @@ public: | |||
~DistrhoUIPingPongPan() override; | |||
protected: | |||
// --------------------------------------------- | |||
// ------------------------------------------------------------------- | |||
// Information | |||
unsigned int d_width() const override | |||
unsigned int d_getWidth() const noexcept override | |||
{ | |||
return DistrhoArtworkPingPongPan::backgroundWidth; | |||
} | |||
unsigned int d_height() const override | |||
unsigned int d_getHeight() const noexcept override | |||
{ | |||
return DistrhoArtworkPingPongPan::backgroundHeight; | |||
} | |||
// --------------------------------------------- | |||
// ------------------------------------------------------------------- | |||
// DSP Callbacks | |||
void d_parameterChanged(uint32_t index, float value) override; | |||
void d_programChanged(uint32_t index) override; | |||
// --------------------------------------------- | |||
// ------------------------------------------------------------------- | |||
// Widget Callbacks | |||
void imageButtonClicked(ImageButton* button, int) override; | |||
@@ -78,6 +77,8 @@ private: | |||
ImageButton* fButtonAbout; | |||
}; | |||
// ----------------------------------------------------------------------- | |||
END_NAMESPACE_DISTRHO | |||
#endif // DISTRHO_UI_PINGPONGPAN_HPP_INCLUDED |
@@ -11,7 +11,7 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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 | |||
@@ -12,19 +12,19 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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 <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 | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
DistrhoPluginStereoEnhancer::DistrhoPluginStereoEnhancer() | |||
: Plugin(paramCount, 1, 0) // 1 program, 0 states | |||
@@ -40,7 +40,7 @@ DistrhoPluginStereoEnhancer::~DistrhoPluginStereoEnhancer() | |||
{ | |||
} | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
// Init | |||
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"; | |||
} | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
// Internal data | |||
float DistrhoPluginStereoEnhancer::d_parameterValue(uint32_t index) | |||
float DistrhoPluginStereoEnhancer::d_getParameterValue(uint32_t index) const | |||
{ | |||
switch (index) | |||
{ | |||
@@ -107,7 +107,7 @@ float DistrhoPluginStereoEnhancer::d_parameterValue(uint32_t index) | |||
void DistrhoPluginStereoEnhancer::d_setParameterValue(uint32_t index, float value) | |||
{ | |||
if (d_sampleRate() <= 0.0) | |||
if (d_getSampleRate() <= 0.0) | |||
return; | |||
switch (index) | |||
@@ -123,7 +123,7 @@ void DistrhoPluginStereoEnhancer::d_setParameterValue(uint32_t index, float valu | |||
case paramCrossover: | |||
freqHPFader = value; | |||
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; | |||
b1HP = -xHP; | |||
break; | |||
@@ -149,12 +149,12 @@ void DistrhoPluginStereoEnhancer::d_setProgram(uint32_t index) | |||
d_activate(); | |||
} | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
// Process | |||
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; | |||
b1HP = -xHP; | |||
} | |||
@@ -177,11 +177,11 @@ void DistrhoPluginStereoEnhancer::d_run(float** inputs, float** outputs, uint32_ | |||
out1HP = in1[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; | |||
stereoLP = in1[i] - in2[i]; | |||
@@ -190,6 +190,7 @@ void DistrhoPluginStereoEnhancer::d_run(float** inputs, float** outputs, uint32_ | |||
monoHP = (out1HP + out2HP) / 2.0f; | |||
stereoHP = out1HP - out2HP; | |||
out1HP = (monoHP + stereoHP * widthHP) / widthCoeffHP; | |||
out2HP = (monoHP - stereoHP * widthHP) / widthCoeffHP; | |||
@@ -198,13 +199,13 @@ void DistrhoPluginStereoEnhancer::d_run(float** inputs, float** outputs, uint32_ | |||
} | |||
} | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
Plugin* createPlugin() | |||
{ | |||
return new DistrhoPluginStereoEnhancer(); | |||
} | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
END_NAMESPACE_DISTRHO |
@@ -12,7 +12,7 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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 | |||
@@ -22,6 +22,8 @@ | |||
START_NAMESPACE_DISTRHO | |||
// ----------------------------------------------------------------------- | |||
class DistrhoPluginStereoEnhancer : public Plugin | |||
{ | |||
public: | |||
@@ -34,58 +36,58 @@ public: | |||
}; | |||
DistrhoPluginStereoEnhancer(); | |||
~DistrhoPluginStereoEnhancer(); | |||
~DistrhoPluginStereoEnhancer() override; | |||
protected: | |||
// --------------------------------------------- | |||
// ------------------------------------------------------------------- | |||
// Information | |||
const char* d_label() const | |||
const char* d_getLabel() const noexcept override | |||
{ | |||
return "StereoEnhancer"; | |||
} | |||
const char* d_maker() const | |||
const char* d_getMaker() const noexcept override | |||
{ | |||
return "DISTRHO"; | |||
} | |||
const char* d_license() const | |||
const char* d_getLicense() const noexcept override | |||
{ | |||
return "LGPL"; | |||
} | |||
uint32_t d_version() const | |||
uint32_t d_getVersion() const noexcept override | |||
{ | |||
return 0x1000; | |||
} | |||
long d_uniqueId() const | |||
long d_getUniqueId() const noexcept override | |||
{ | |||
return d_cconst('D', 'S', 't', 'E'); | |||
} | |||
// --------------------------------------------- | |||
// ------------------------------------------------------------------- | |||
// 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 | |||
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 | |||
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: | |||
float widthLP, widthCoeffLP; | |||
@@ -101,6 +103,8 @@ private: | |||
float monoLP, stereoLP; | |||
}; | |||
// ----------------------------------------------------------------------- | |||
END_NAMESPACE_DISTRHO | |||
#endif // DISTRHO_PLUGIN_STEREO_ENHANCER_HPP_INCLUDED |
@@ -11,7 +11,7 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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" | |||
@@ -20,7 +20,7 @@ | |||
START_NAMESPACE_DISTRHO | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
DistrhoUIStereoEnhancer::DistrhoUIStereoEnhancer() | |||
: OpenGLUI(), | |||
@@ -69,7 +69,7 @@ DistrhoUIStereoEnhancer::~DistrhoUIStereoEnhancer() | |||
delete fButtonAbout; | |||
} | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
// DSP Callbacks | |||
void DistrhoUIStereoEnhancer::d_parameterChanged(uint32_t index, float value) | |||
@@ -99,7 +99,7 @@ void DistrhoUIStereoEnhancer::d_programChanged(uint32_t index) | |||
fKnobCrossover->setValue(27.51604f); | |||
} | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
// Widget Callbacks | |||
void DistrhoUIStereoEnhancer::imageButtonClicked(ImageButton* button, int) | |||
@@ -145,13 +145,13 @@ void DistrhoUIStereoEnhancer::onDisplay() | |||
fImgBackground.draw(); | |||
} | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
UI* createUI() | |||
{ | |||
return new DistrhoUIStereoEnhancer(); | |||
} | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
END_NAMESPACE_DISTRHO |
@@ -11,7 +11,7 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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 | |||
@@ -28,7 +28,7 @@ | |||
START_NAMESPACE_DISTRHO | |||
// ------------------------------------------------- | |||
// ----------------------------------------------------------------------- | |||
class DistrhoUIStereoEnhancer : public OpenGLUI, | |||
public ImageButton::Callback, | |||
@@ -39,26 +39,26 @@ public: | |||
~DistrhoUIStereoEnhancer() override; | |||
protected: | |||
// --------------------------------------------- | |||
// ------------------------------------------------------------------- | |||
// Information | |||
unsigned int d_width() const override | |||
unsigned int d_getWidth() const noexcept override | |||
{ | |||
return DistrhoArtworkStereoEnhancer::backgroundWidth; | |||
} | |||
unsigned int d_height() const override | |||
unsigned int d_getHeight() const noexcept override | |||
{ | |||
return DistrhoArtworkStereoEnhancer::backgroundHeight; | |||
} | |||
// --------------------------------------------- | |||
// ------------------------------------------------------------------- | |||
// DSP Callbacks | |||
void d_parameterChanged(uint32_t index, float value) override; | |||
void d_programChanged(uint32_t index) override; | |||
// --------------------------------------------- | |||
// ------------------------------------------------------------------- | |||
// Widget Callbacks | |||
void imageButtonClicked(ImageButton* button, int) override; | |||
@@ -78,6 +78,8 @@ private: | |||
ImageButton* fButtonAbout; | |||
}; | |||
// ----------------------------------------------------------------------- | |||
END_NAMESPACE_DISTRHO | |||
#endif // DISTRHO_UI_STEREO_ENHANCER_HPP_INCLUDED |
@@ -12,7 +12,7 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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" | |||
@@ -109,7 +109,7 @@ private: | |||
static double sTicksPerFrame; | |||
public: | |||
static PluginHandle _instantiate(const PluginDescriptor*, HostDescriptor* host) | |||
static PluginHandle _instantiate(HostDescriptor* host) | |||
{ | |||
if (sInstanceCount == 0) | |||
{ | |||
@@ -160,7 +160,7 @@ double SunVoxFilePlugin::sTicksPerFrame = 0.0; | |||
static const PluginDescriptor sunvoxfileDesc = { | |||
/* 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), | |||
/* audioIns */ 0, | |||
/* audioOuts */ 2, | |||
@@ -12,7 +12,7 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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 | |||
@@ -12,7 +12,7 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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" | |||
@@ -12,7 +12,7 @@ | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* 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 | |||
@@ -275,7 +275,7 @@ public: | |||
#ifdef WANT_ZYNADDSUBFX_UI | |||
if (gPixmapPath.isEmpty()) | |||
{ | |||
gPixmapPath = host->resource_dir; | |||
gPixmapPath = host->resourceDir; | |||
gPixmapPath += PIXMAP_PATH; | |||
gUiPixmapPath = gPixmapPath; | |||
} | |||
@@ -475,7 +475,7 @@ protected: | |||
{ | |||
fUiClosed = 0; | |||
fUi = new MasterUI(fMaster, &fUiClosed); | |||
fUi->masterwindow->label(kHost->ui_name); | |||
fUi->masterwindow->label(kHost->uiName); | |||
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 | |||
} | |||
case PLUGIN_OPCODE_SAMPLE_RATE_CHANGED: | |||
sInstanceCount.maybeReinit(hostHandle()); | |||
sInstanceCount.maybeReinit(getHostHandle()); | |||
break; | |||
default: | |||
break; | |||
@@ -19,15 +19,20 @@ | |||
#define CARLA_JUCE_HEADER_H_INCLUDED | |||
#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_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_utils/juce_audio_utils.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_gui_basics/juce_gui_basics.h" | |||
//#include "modules/juce_gui_extra/juce_gui_extra.h" | |||
@@ -21,7 +21,7 @@ | |||
#include "dgl/Widget.hpp" | |||
using DGL::Widget; | |||
using namespace DGL; | |||
START_NAMESPACE_DISTRHO | |||
@@ -227,12 +227,12 @@ public: | |||
#if defined(DISTRHO_UI_EXTERNAL) | |||
// not needed | |||
#elif defined(DISTRHO_UI_OPENGL) | |||
App& getApp() | |||
DGL::App& getApp() | |||
{ | |||
return glApp; | |||
} | |||
Window& getWindow() | |||
DGL::Window& getWindow() | |||
{ | |||
return glWindow; | |||
} | |||
@@ -263,8 +263,8 @@ public: | |||
#ifdef DISTRHO_UI_OPENGL | |||
private: | |||
App glApp; | |||
Window glWindow; | |||
DGL::App glApp; | |||
DGL::Window glWindow; | |||
#endif | |||
protected: | |||
@@ -27,11 +27,11 @@ START_NAMESPACE_DISTRHO | |||
OpenGLUI::OpenGLUI() | |||
: 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() | |||