diff --git a/lv2export/lv2plugin.cpp b/lv2export/lv2plugin.cpp index 1db214f..d4e42fb 100644 --- a/lv2export/lv2plugin.cpp +++ b/lv2export/lv2plugin.cpp @@ -33,7 +33,7 @@ bool cpuMeter = false; } Context::~Context() { } -static thread_local Context* threadContext = nullptr; +static thread_local Context* threadContext; Context* contextGet() { DISTRHO_SAFE_ASSERT(threadContext != nullptr); return threadContext; @@ -121,8 +121,8 @@ struct PluginLv2 { frameCount }; - const float* CV1_INPUT = (float*)ports[0]; - const float* CV2_INPUT = (float*)ports[1]; + // const float* CV1_INPUT = (float*)ports[0]; + // const float* CV2_INPUT = (float*)ports[1]; const float* IN1_INPUT = (float*)ports[2]; const float* IN2_INPUT = (float*)ports[3]; const float* MIX_CV_INPUT = (float*)ports[4]; @@ -141,8 +141,8 @@ struct PluginLv2 { for (uint32_t i=0; iinputs[0].setVoltage(CV1_INPUT[i]); - module->inputs[1].setVoltage(CV2_INPUT[i]); + // module->inputs[0].setVoltage(CV1_INPUT[i]); + // module->inputs[1].setVoltage(CV2_INPUT[i]); module->inputs[2].setVoltage(IN1_INPUT[i] * 10); module->inputs[3].setVoltage(IN2_INPUT[i] * 10); module->inputs[4].setVoltage(MIX_CV_INPUT[i]); diff --git a/lv2export/lv2plugin.ttl b/lv2export/lv2plugin.ttl index 80f2e3e..e8dfc60 100644 --- a/lv2export/lv2plugin.ttl +++ b/lv2export/lv2plugin.ttl @@ -17,8 +17,9 @@ a lv2:Plugin, doap:Project ; + # NOTE port 0 and 1 are actually CV ins, but we need some kind of optionally-connected stuff implemented first lv2:port [ - a lv2:InputPort, lv2:CVPort, mod:CVPort ; + a lv2:OutputPort, lv2:ControlPort ; lv2:index 0 ; lv2:symbol "lv2_audio_in_1" ; lv2:name "CV1_INPUT" ; @@ -26,7 +27,7 @@ lv2:minimum 0; lv2:maximum 10; ] , [ - a lv2:InputPort, lv2:CVPort, mod:CVPort ; + a lv2:OutputPort, lv2:ControlPort ; lv2:index 1 ; lv2:symbol "lv2_audio_in_2" ; lv2:name "CV2_INPUT" ; diff --git a/lv2export/test.cpp b/lv2export/test.cpp index 67f0552..fab3c48 100644 --- a/lv2export/test.cpp +++ b/lv2export/test.cpp @@ -28,7 +28,7 @@ Plugin* pluginInstance__Befaco; namespace rack { Context::~Context() { } -static thread_local Context* threadContext = nullptr; +static thread_local Context* threadContext; Context* contextGet() { DISTRHO_SAFE_ASSERT(threadContext != nullptr); return threadContext; diff --git a/plugins/Cardinal/src/glBars.cpp b/plugins/Cardinal/src/glBars.cpp index 7108036..676db0a 100644 --- a/plugins/Cardinal/src/glBars.cpp +++ b/plugins/Cardinal/src/glBars.cpp @@ -15,7 +15,11 @@ * For a full copy of the GNU General Public License see the LICENSE file. */ -#include "glBars.hpp" +#ifndef HEADLESS +# include "glBars.hpp" +#else +# include "plugin.hpp" +#endif #define SAMPLES_PER_DRAW 256 @@ -34,24 +38,29 @@ struct glBarsModule : Module { NUM_LIGHTS }; +#ifndef HEADLESS glBarsState state; float audioData[SAMPLES_PER_DRAW]; unsigned audioDataFill = 0; +#endif glBarsModule() { config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS); } void process(const ProcessArgs&) override { +#ifndef HEADLESS audioData[audioDataFill++] = inputs[IN1_INPUT].getVoltage(); if (audioDataFill == SAMPLES_PER_DRAW) { audioDataFill = 0; state.AudioData(audioData, SAMPLES_PER_DRAW); } +#endif } }; +#ifndef HEADLESS struct glBarsRendererWidget : OpenGlWidget { glBarsModule* const glBars; @@ -73,12 +82,17 @@ struct glBarsRendererWidget : OpenGlWidget { glBars->state.Render(); } }; +#endif struct glBarsWidget : ModuleWidget { +#ifndef HEADLESS glBarsRendererWidget* const glBarsRenderer; +#endif glBarsWidget(glBarsModule* const module) +#ifndef HEADLESS : glBarsRenderer(new glBarsRendererWidget(module)) +#endif { setModule(module); setPanel(APP->window->loadSvg(asset::plugin(pluginInstance, "res/glBars.svg"))); @@ -88,9 +102,11 @@ struct glBarsWidget : ModuleWidget { addChild(createWidget(Vec(RACK_GRID_WIDTH, 0))); addChild(createWidget(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); +#ifndef HEADLESS glBarsRenderer->box.pos = Vec(2 * RACK_GRID_WIDTH, 0); glBarsRenderer->box.size = Vec(box.size.x - 2 * RACK_GRID_WIDTH, box.size.y); addChild(glBarsRenderer); +#endif addInput(createInput(Vec(3, 54), module, glBarsModule::IN1_INPUT)); }