| @@ -24,7 +24,7 @@ | |||
| // Single, standalone engine | |||
| static CarlaBackend::CarlaEngine* carlaEngine = nullptr; | |||
| static CarlaBackend::CallbackFunc carlaFunc = nullptr; | |||
| static carla_string carlaStandaloneError; | |||
| static CarlaString carlaStandaloneError; | |||
| static const char* extendedLicenseText = nullptr; | |||
| static bool carlaEngineStarted = false; | |||
| @@ -109,7 +109,7 @@ const PluginInfo* get_internal_plugin_info(unsigned int plugin_id) | |||
| static PluginInfo info; | |||
| const PluginDescriptor* const nativePlugin = CarlaBackend::CarlaPlugin::getNativePlugin(plugin_id); | |||
| const PluginDescriptor* const nativePlugin = CarlaBackend::CarlaPlugin::getNativePluginDescriptor(plugin_id); | |||
| CARLA_ASSERT(nativePlugin); | |||
| @@ -194,8 +194,6 @@ bool engine_close() | |||
| get_midi_program_name(0, 0); | |||
| get_real_plugin_name(0); | |||
| carlaEngine->resetOptions(); | |||
| delete carlaEngine; | |||
| carlaEngine = nullptr; | |||
| @@ -1001,13 +999,12 @@ double get_current_parameter_value(unsigned short plugin_id, uint32_t parameter_ | |||
| double get_input_peak_value(unsigned short plugin_id, unsigned short port_id) | |||
| { | |||
| CARLA_ASSERT(carlaEngine); | |||
| CARLA_ASSERT(plugin_id < CarlaBackend::CarlaEngine::maxPluginNumber()); | |||
| CARLA_ASSERT(port_id == 1 || port_id == 2); | |||
| if (! carlaEngine) | |||
| return 0.0; | |||
| if (plugin_id >= CarlaBackend::CarlaEngine::maxPluginNumber()) | |||
| if (plugin_id >= carlaEngine->maxPluginNumber()) | |||
| { | |||
| qCritical("CarlaBackendStandalone::get_input_peak_value(%i, %i) - invalid plugin value", plugin_id, port_id); | |||
| return 0.0; | |||
| @@ -1023,13 +1020,12 @@ double get_input_peak_value(unsigned short plugin_id, unsigned short port_id) | |||
| double get_output_peak_value(unsigned short plugin_id, unsigned short port_id) | |||
| { | |||
| CARLA_ASSERT(carlaEngine); | |||
| CARLA_ASSERT(plugin_id < CarlaBackend::CarlaEngine::maxPluginNumber()); | |||
| CARLA_ASSERT(port_id == 1 || port_id == 2); | |||
| if (! carlaEngine) | |||
| return 0.0; | |||
| if (plugin_id >= CarlaBackend::CarlaEngine::maxPluginNumber()) | |||
| if (plugin_id >= carlaEngine->maxPluginNumber()) | |||
| { | |||
| qCritical("CarlaBackendStandalone::get_input_peak_value(%i, %i) - invalid plugin value", plugin_id, port_id); | |||
| return 0.0; | |||
| @@ -20,7 +20,7 @@ BUILD_CXX_FLAGS += -I. -I../carla-backend -I../carla-includes -I../carla-plugin | |||
| BUILD_CXX_FLAGS += $(shell pkg-config --cflags liblo QtCore) | |||
| ifeq ($(CARLA_PLUGIN_SUPPORT),true) | |||
| BUILD_CXX_FLAGS += -DWANT_LV2 | |||
| # BUILD_CXX_FLAGS += -DWANT_LV2 | |||
| endif | |||
| ifeq ($(HAVE_JACK),true) | |||
| @@ -64,6 +64,10 @@ CarlaEngineControlPort::CarlaEngineControlPort(const bool isInput, const Process | |||
| qDebug("CarlaEngineControlPort::CarlaEngineControlPort(%s, %s)", bool2str(isInput), ProcessMode2Str(processMode)); | |||
| } | |||
| CarlaEngineControlPort::~CarlaEngineControlPort() | |||
| { | |||
| } | |||
| void CarlaEngineControlPort::initBuffer(CarlaEngine* const engine) | |||
| { | |||
| CARLA_ASSERT(engine); | |||
| @@ -160,6 +164,10 @@ CarlaEngineMidiPort::CarlaEngineMidiPort(const bool isInput, const ProcessMode p | |||
| qDebug("CarlaEngineMidiPort::CarlaEngineMidiPort(%s, %s)", bool2str(isInput), ProcessMode2Str(processMode)); | |||
| } | |||
| CarlaEngineMidiPort::~CarlaEngineMidiPort() | |||
| { | |||
| } | |||
| void CarlaEngineMidiPort::initBuffer(CarlaEngine* const engine) | |||
| { | |||
| CARLA_ASSERT(engine); | |||
| @@ -647,6 +647,16 @@ public: | |||
| { | |||
| return options.processMode; | |||
| } | |||
| uint maxParameters() const | |||
| { | |||
| return options.maxParameters; | |||
| } | |||
| uint oscUiTimeout() const | |||
| { | |||
| return options.oscUiTimeout; | |||
| } | |||
| #endif | |||
| // ------------------------------------------------------------------- | |||
| @@ -24,23 +24,23 @@ BUILD_CXX_FLAGS += -I. -I../carla-backend -I../carla-engine -I../carla-includes | |||
| BUILD_CXX_FLAGS += $(shell pkg-config --cflags liblo QtCore QtGui) | |||
| ifeq ($(CARLA_PLUGIN_SUPPORT),true) | |||
| BUILD_CXX_FLAGS += -DWANT_LADSPA -DWANT_DSSI -DWANT_LV2 -DWANT_VST | |||
| # BUILD_CXX_FLAGS += -DWANT_LADSPA -DWANT_DSSI -DWANT_LV2 -DWANT_VST | |||
| endif | |||
| ifeq ($(HAVE_ZYN_DEPS),true) | |||
| BUILD_CXX_FLAGS += -DWANT_ZYNADDSUBFX | |||
| # BUILD_CXX_FLAGS += -DWANT_ZYNADDSUBFX | |||
| endif | |||
| ifeq ($(HAVE_SUIL),true) | |||
| BUILD_CXX_FLAGS += $(shell pkg-config --cflags suil-0) -DWANT_SUIL | |||
| # BUILD_CXX_FLAGS += $(shell pkg-config --cflags suil-0) -DWANT_SUIL | |||
| endif | |||
| ifeq ($(HAVE_FLUIDSYNTH),true) | |||
| BUILD_CXX_FLAGS += $(shell pkg-config --cflags fluidsynth) -DWANT_FLUIDSYNTH | |||
| # BUILD_CXX_FLAGS += $(shell pkg-config --cflags fluidsynth) -DWANT_FLUIDSYNTH | |||
| endif | |||
| ifeq ($(HAVE_LINUSAMPLER),true) | |||
| BUILD_CXX_FLAGS += $(shell pkg-config --cflags linuxsampler) -DWANT_LINUXSAMPLER | |||
| # BUILD_CXX_FLAGS += $(shell pkg-config --cflags linuxsampler) -DWANT_LINUXSAMPLER | |||
| endif | |||
| OBJS = \ | |||
| @@ -334,7 +334,7 @@ public: | |||
| } | |||
| // create new if needed | |||
| param.count = (pTotal < (int32_t)x_engine->options.maxParameters) ? pTotal : 0; | |||
| param.count = (pTotal < (int32_t)x_engine->maxParameters()) ? pTotal : 0; | |||
| if (param.count > 0) | |||
| { | |||
| @@ -1022,7 +1022,7 @@ CarlaPlugin* CarlaPlugin::newBridge(const initializer& init, BinaryType btype, P | |||
| short id = init.engine->getNewPluginId(); | |||
| if (id < 0 || id > CarlaEngine::maxPluginNumber()) | |||
| if (id < 0 || id > init.engine->maxPluginNumber()) | |||
| { | |||
| init.engine->setLastError("Maximum number of plugins reached"); | |||
| return nullptr; | |||
| @@ -40,7 +40,7 @@ CarlaPlugin::CarlaPlugin(CarlaEngine* const engine, const unsigned short id) | |||
| x_balanceRight(1.0) | |||
| { | |||
| CARLA_ASSERT(engine); | |||
| CARLA_ASSERT(id < CarlaEngine::maxPluginNumber()); | |||
| CARLA_ASSERT(id < x_engine->maxPluginNumber()); | |||
| qDebug("CarlaPlugin::CarlaPlugin(%p, %i)", engine, id); | |||
| m_type = PLUGIN_NONE; | |||
| @@ -55,7 +55,7 @@ CarlaPlugin::CarlaPlugin(CarlaEngine* const engine, const unsigned short id) | |||
| m_filename = nullptr; | |||
| #ifndef BUILD_BRIDGE | |||
| if (engine->processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||
| if (engine->processMode() == PROCESS_MODE_CONTINUOUS_RACK) | |||
| m_ctrlInChannel = m_id; | |||
| else | |||
| #endif | |||
| @@ -426,7 +426,7 @@ void CarlaPlugin::setId(const unsigned short id) | |||
| { | |||
| m_id = id; | |||
| if (x_engine->processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||
| if (x_engine->processMode() == PROCESS_MODE_CONTINUOUS_RACK) | |||
| m_ctrlInChannel = id; | |||
| } | |||
| #endif | |||
| @@ -950,7 +950,7 @@ void CarlaPlugin::registerToOscControl() | |||
| #ifdef BUILD_BRIDGE | |||
| uint32_t maxParameters = MAX_PARAMETERS; | |||
| #else | |||
| uint32_t maxParameters = x_engine->options.maxParameters; | |||
| uint32_t maxParameters = x_engine->maxParameters(); | |||
| #endif | |||
| if (param.count > 0 && param.count < maxParameters) | |||
| { | |||
| @@ -1098,7 +1098,7 @@ bool CarlaPlugin::showOscGui() | |||
| qWarning("CarlaPlugin::showOscGui()"); | |||
| // wait for UI 'update' call | |||
| for (uint i=0; i < x_engine->options.oscUiTimeout; i++) | |||
| for (uint i=0; i < x_engine->oscUiTimeout(); i++) | |||
| { | |||
| if (osc.data.target) | |||
| { | |||
| @@ -1652,7 +1652,7 @@ CarlaPlugin* CarlaPlugin::newDSSI(const initializer& init, const void* const ext | |||
| return plugin; | |||
| #else | |||
| setLastError("DSSI support not available"); | |||
| init.engine->setLastError("DSSI support not available"); | |||
| return nullptr; | |||
| #endif | |||
| } | |||
| @@ -1346,7 +1346,7 @@ CarlaPlugin* CarlaPlugin::newSF2(const initializer& init) | |||
| return plugin; | |||
| #else | |||
| setLastError("fluidsynth support not available"); | |||
| init.engine->setLastError("fluidsynth support not available"); | |||
| return nullptr; | |||
| #endif | |||
| } | |||
| @@ -1256,7 +1256,7 @@ CarlaPlugin* CarlaPlugin::newLADSPA(const initializer& init, const void* const e | |||
| return plugin; | |||
| #else | |||
| setLastError("LADSPA support not available"); | |||
| init.engine->setLastError("LADSPA support not available"); | |||
| return nullptr; | |||
| #endif | |||
| } | |||
| @@ -954,7 +954,7 @@ CarlaPlugin* CarlaPlugin::newGIG(const initializer& init) | |||
| #ifdef WANT_LINUXSAMPLER | |||
| return LinuxSamplerPlugin::newLinuxSampler(init, true); | |||
| #else | |||
| setLastError("linuxsampler support not available"); | |||
| init.engine->setLastError("linuxsampler support not available"); | |||
| return nullptr; | |||
| #endif | |||
| } | |||
| @@ -965,7 +965,7 @@ CarlaPlugin* CarlaPlugin::newSFZ(const initializer& init) | |||
| #ifdef WANT_LINUXSAMPLER | |||
| return LinuxSamplerPlugin::newLinuxSampler(init, false); | |||
| #else | |||
| setLastError("linuxsampler support not available"); | |||
| init.engine->setLastError("linuxsampler support not available"); | |||
| return nullptr; | |||
| #endif | |||
| } | |||
| @@ -4706,7 +4706,7 @@ CarlaPlugin* CarlaPlugin::newLV2(const initializer& init) | |||
| return plugin; | |||
| #else | |||
| setLastError("LV2 support not available"); | |||
| init.engine->setLastError("LV2 support not available"); | |||
| return nullptr; | |||
| #endif | |||
| } | |||
| @@ -878,7 +878,7 @@ public: | |||
| // Input VU | |||
| #ifndef BUILD_BRIDGE | |||
| if (aIn.count > 0 && CarlaEngine::processMode != PROCESS_MODE_CONTINUOUS_RACK) | |||
| if (aIn.count > 0 && x_engine->processMode() != PROCESS_MODE_CONTINUOUS_RACK) | |||
| #else | |||
| if (aIn.count > 0) | |||
| #endif | |||
| @@ -935,10 +935,10 @@ public: | |||
| // Control change | |||
| switch (cinEvent->type) | |||
| { | |||
| case CarlaEngineEventNull: | |||
| case CarlaEngineNullEvent: | |||
| break; | |||
| case CarlaEngineEventControlChange: | |||
| case CarlaEngineParameterChangeEvent: | |||
| { | |||
| double value; | |||
| @@ -1022,12 +1022,12 @@ public: | |||
| break; | |||
| } | |||
| case CarlaEngineEventMidiBankChange: | |||
| case CarlaEngineMidiBankChangeEvent: | |||
| if (cinEvent->channel == m_ctrlInChannel) | |||
| nextBankId = rint(cinEvent->value); | |||
| break; | |||
| case CarlaEngineEventMidiProgramChange: | |||
| case CarlaEngineMidiProgramChangeEvent: | |||
| if (cinEvent->channel == m_ctrlInChannel) | |||
| { | |||
| uint32_t nextProgramId = rint(cinEvent->value); | |||
| @@ -1044,7 +1044,7 @@ public: | |||
| } | |||
| break; | |||
| case CarlaEngineEventAllSoundOff: | |||
| case CarlaEngineAllSoundOffEvent: | |||
| if (cinEvent->channel == m_ctrlInChannel) | |||
| { | |||
| if (mIn.count > 0 && ! allNotesOffSent) | |||
| @@ -1069,7 +1069,7 @@ public: | |||
| } | |||
| break; | |||
| case CarlaEngineEventAllNotesOff: | |||
| case CarlaEngineAllNotesOffEvent: | |||
| if (cinEvent->channel == m_ctrlInChannel) | |||
| { | |||
| if (mIn.count > 0 && ! allNotesOffSent) | |||
| @@ -1327,7 +1327,7 @@ public: | |||
| // Output VU | |||
| #ifndef BUILD_BRIDGE | |||
| if (CarlaEngine::processMode != PROCESS_MODE_CONTINUOUS_RACK) | |||
| if (x_engine->processMode() != PROCESS_MODE_CONTINUOUS_RACK) | |||
| #endif | |||
| { | |||
| for (k=0; i < 2 && k < frames; k++) | |||
| @@ -1392,7 +1392,7 @@ public: | |||
| if (param.data[k].midiCC > 0) | |||
| { | |||
| valueControl = (value - param.ranges[k].min) / (param.ranges[k].max - param.ranges[k].min); | |||
| param.portCout->writeEvent(CarlaEngineEventControlChange, framesOffset, param.data[k].midiChannel, param.data[k].midiCC, valueControl); | |||
| param.portCout->writeEvent(CarlaEngineParameterChangeEvent, framesOffset, param.data[k].midiChannel, param.data[k].midiCC, valueControl); | |||
| } | |||
| } | |||
| } | |||
| @@ -1665,7 +1665,7 @@ CarlaPlugin* CarlaPlugin::newNative(const initializer& init) | |||
| short id = init.engine->getNewPluginId(); | |||
| if (id < 0 || id > CarlaEngine::maxPluginNumber()) | |||
| if (id < 0 || id > init.engine->maxPluginNumber()) | |||
| { | |||
| init.engine->setLastError("Maximum number of plugins reached"); | |||
| return nullptr; | |||
| @@ -1681,7 +1681,7 @@ CarlaPlugin* CarlaPlugin::newNative(const initializer& init) | |||
| plugin->reload(); | |||
| if (CarlaEngine::processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||
| if (init.engine->processMode() == PROCESS_MODE_CONTINUOUS_RACK) | |||
| { | |||
| if (! (plugin->hints() & PLUGIN_CAN_FORCE_STEREO)) | |||
| { | |||
| @@ -1703,7 +1703,7 @@ size_t CarlaPlugin::getNativePluginCount() | |||
| return NativePlugin::getPluginCount(); | |||
| } | |||
| const PluginDescriptor* CarlaPlugin::getNativePlugin(size_t index) | |||
| const PluginDescriptor* CarlaPlugin::getNativePluginDescriptor(size_t index) | |||
| { | |||
| return NativePlugin::getPlugin(index); | |||
| } | |||
| @@ -2417,7 +2417,7 @@ CarlaPlugin* CarlaPlugin::newVST(const initializer& init) | |||
| return plugin; | |||
| #else | |||
| setLastError("VST support not available"); | |||
| init.engine->setLastError("VST support not available"); | |||
| return nullptr; | |||
| #endif | |||
| } | |||