diff --git a/dpf b/dpf index a8be008..03ddba5 160000 --- a/dpf +++ b/dpf @@ -1 +1 @@ -Subproject commit a8be0083a2b0c308a15f29d39929d5125ca623fc +Subproject commit 03ddba518eebedc08710123e3e3a83b18662da15 diff --git a/plugins/Makefile.mk b/plugins/Makefile.mk index 0c1eb29..1bcd85a 100644 --- a/plugins/Makefile.mk +++ b/plugins/Makefile.mk @@ -62,7 +62,7 @@ all: %.c.o: %.c $(CC) $< $(BUILD_C_FLAGS) -c -o $@ -%.cpp.o: %.cpp +%.cpp.o: %.cpp ../../dpf/distrho/* $(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@ clean: diff --git a/plugins/ProM/DistrhoPluginProM.cpp b/plugins/ProM/DistrhoPluginProM.cpp index 2e9b4c6..5784e8c 100644 --- a/plugins/ProM/DistrhoPluginProM.cpp +++ b/plugins/ProM/DistrhoPluginProM.cpp @@ -60,7 +60,7 @@ void DistrhoPluginProM::d_run(const float** inputs, float** outputs, uint32_t fr const float* in = inputs[0]; float* out = outputs[0]; - if (in != out) + if (out != in) std::memcpy(out, in, sizeof(float)*frames); const MutexLocker csm(fMutex); @@ -68,7 +68,7 @@ void DistrhoPluginProM::d_run(const float** inputs, float** outputs, uint32_t fr if (fPM == nullptr) return; - if (PCM* const pcm = const_cast(fPM->pcm())) + if (PCM* const pcm = fPM->pcm()) pcm->addPCMfloat(in, frames); } diff --git a/plugins/ProM/DistrhoPluginProM.hpp b/plugins/ProM/DistrhoPluginProM.hpp index d3ae1da..377afcb 100644 --- a/plugins/ProM/DistrhoPluginProM.hpp +++ b/plugins/ProM/DistrhoPluginProM.hpp @@ -58,7 +58,7 @@ protected: return 0x1000; } - long d_getUniqueId() const noexcept override + int64_t d_getUniqueId() const noexcept override { return d_cconst('D', 'P', 'r', 'M'); } diff --git a/plugins/ProM/DistrhoUIProM.cpp b/plugins/ProM/DistrhoUIProM.cpp index cfffaea..7408257 100644 --- a/plugins/ProM/DistrhoUIProM.cpp +++ b/plugins/ProM/DistrhoUIProM.cpp @@ -23,6 +23,7 @@ START_NAMESPACE_DISTRHO // ----------------------------------------------------------------------- +#if 0 static const projectM::Settings kSettings = { /* meshX */ 32, /* meshY */ 24, @@ -41,12 +42,14 @@ static const projectM::Settings kSettings = { /* shuffleEnabled */ true, /* softCutRatingsEnabled */ false }; +#endif // ----------------------------------------------------------------------- DistrhoUIProM::DistrhoUIProM() : UI() { + setSize(512, 512); } DistrhoUIProM::~DistrhoUIProM() @@ -85,7 +88,7 @@ void DistrhoUIProM::d_uiIdle() } } -void DistrhoUIProM::d_uiReshape(int width, int height) +void DistrhoUIProM::d_uiReshape(uint width, uint height) { glEnable(GL_BLEND); glEnable(GL_LINE_SMOOTH); @@ -112,7 +115,8 @@ void DistrhoUIProM::d_uiReshape(int width, int height) glLineStipple(2, 0xAAAA); if (fPM == nullptr) - fPM = new projectM(kSettings); // std::string("/usr/share/projectM/config.inp")); + //fPM = new projectM(kSettings); + fPM = new projectM("/usr/share/projectM/config.inp"); fPM->projectM_resetGL(width, height); } @@ -133,6 +137,31 @@ bool DistrhoUIProM::onKeyboard(const KeyboardEvent& ev) if (fPM == nullptr) return false; + if (ev.press && (ev.key == '1' || ev.key == '+' || ev.key == '-')) + { + if (ev.key == '1') + { + if (getWidth() != 512 || getHeight() != 512) + setSize(512, 512); + } + else if (ev.key == '+') + { + /**/ if (getWidth() < 1100 && getHeight() < 1100) + setSize(getWidth()+100, getHeight()+100); + else if (getWidth() != 1100 || getHeight() != 1100) + setSize(1100, 1100); + } + else if (ev.key == '-') + { + /**/ if (getWidth() >= 200 && getHeight() >= 200) + setSize(getWidth()-100, getHeight()-100); + else if (getWidth() != 100 || getHeight() != 100) + setSize(100, 100); + } + + return true; + } + projectMKeycode pmKey = PROJECTM_K_NONE; projectMModifier pmMod = PROJECTM_KMOD_LSHIFT; diff --git a/plugins/ProM/DistrhoUIProM.hpp b/plugins/ProM/DistrhoUIProM.hpp index 4b907d5..32a09bc 100644 --- a/plugins/ProM/DistrhoUIProM.hpp +++ b/plugins/ProM/DistrhoUIProM.hpp @@ -32,19 +32,6 @@ public: ~DistrhoUIProM() override; protected: - // ------------------------------------------------------------------- - // Information - - uint d_getWidth() const noexcept override - { - return 512; - } - - uint d_getHeight() const noexcept override - { - return 512; - } - // ------------------------------------------------------------------- // DSP Callbacks @@ -54,7 +41,7 @@ protected: // UI Callbacks void d_uiIdle() override; - void d_uiReshape(int width, int height) override; + void d_uiReshape(uint width, uint height) override; // ------------------------------------------------------------------- // Widget Callbacks