@@ -21,6 +21,7 @@ endif | |||
# ---------------------------------------------------------------------------------------------------------------------------- | |||
PREFIX := /usr/local | |||
LIBDIR := $(PREFIX)/lib | |||
DESTDIR := | |||
BINDIR := $(CURDIR)/bin | |||
@@ -47,11 +47,7 @@ CARLA_BACKEND_START_NAMESPACE | |||
class CarlaEngineAudioPort; | |||
class CarlaEngineCVPort; | |||
class CarlaEngineEventPort; | |||
/*! | |||
* Save state data. | |||
*/ | |||
struct StateSave; | |||
struct CarlaStateSave; | |||
// ----------------------------------------------------------------------- | |||
@@ -396,14 +392,14 @@ public: | |||
* | |||
* @see loadStateSave() | |||
*/ | |||
const StateSave& getStateSave(); | |||
const CarlaStateSave& getStateSave(); | |||
/*! | |||
* Get the plugin's save state. | |||
* | |||
* @see getStateSave() | |||
*/ | |||
void loadStateSave(const StateSave& stateSave); | |||
void loadStateSave(const CarlaStateSave& stateSave); | |||
/*! | |||
* Save the current plugin state to @a filename. | |||
@@ -1803,7 +1803,7 @@ bool CarlaEngine::loadProjectInternal(juce::XmlDocument& xmlDoc) | |||
if (isPreset || tagName.equalsIgnoreCase("plugin")) | |||
{ | |||
StateSave stateSave; | |||
CarlaStateSave stateSave; | |||
stateSave.fillFromXmlElement(isPreset ? xmlElement.get() : elem); | |||
callback(ENGINE_CALLBACK_IDLE, 0, 0, 0, 0.0f, nullptr); | |||
@@ -1058,7 +1058,7 @@ public: | |||
if (needsReinit) | |||
{ | |||
// reload plugin to recreate its ports | |||
const StateSave& saveState(plugin->getStateSave()); | |||
const CarlaStateSave& saveState(plugin->getStateSave()); | |||
plugin->reload(); | |||
plugin->loadStateSave(saveState); | |||
} | |||
@@ -388,12 +388,6 @@ int CarlaEngineOsc::handleMessage(const bool isTCP, const char* const path, cons | |||
if (std::strcmp(bmethod, "error") == 0) | |||
return CarlaPluginSetOscBridgeInfo(plugin, kPluginBridgeOscError, argc, argv, types); | |||
} | |||
// Plugin-specific methods | |||
if (std::strcmp(method, "lv2_atom_transfer") == 0) | |||
return handleMsgLv2AtomTransfer(plugin, argc, argv, types); | |||
if (std::strcmp(method, "lv2_urid_map") == 0) | |||
return handleMsgLv2UridMap(plugin, argc, argv, types); | |||
#endif | |||
carla_stderr("CarlaEngineOsc::handleMessage() - unsupported OSC method '%s'", method); | |||
@@ -108,6 +108,7 @@ private: | |||
int handleMessage(const bool isTCP, const char* const path, const int argc, const lo_arg* const* const argv, const char* const types, const lo_message msg); | |||
// Common OSC methods (all bridges) | |||
int handleMsgUpdate(CARLA_ENGINE_OSC_HANDLE_ARGS2, const lo_address source); | |||
int handleMsgExiting(CARLA_ENGINE_OSC_HANDLE_ARGS1); | |||
@@ -115,11 +116,13 @@ private: | |||
int handleMsgRegister(const bool isTCP, const int argc, const lo_arg* const* const argv, const char* const types, const lo_address source); | |||
int handleMsgUnregister(); | |||
// Common OSC methods (DSSI and bridge UIs) | |||
int handleMsgConfigure(CARLA_ENGINE_OSC_HANDLE_ARGS2); | |||
int handleMsgControl(CARLA_ENGINE_OSC_HANDLE_ARGS2); | |||
int handleMsgProgram(CARLA_ENGINE_OSC_HANDLE_ARGS2); | |||
int handleMsgMidi(CARLA_ENGINE_OSC_HANDLE_ARGS2); | |||
// Internal methods | |||
int handleMsgSetActive(CARLA_ENGINE_OSC_HANDLE_ARGS2); | |||
int handleMsgSetDryWet(CARLA_ENGINE_OSC_HANDLE_ARGS2); | |||
int handleMsgSetVolume(CARLA_ENGINE_OSC_HANDLE_ARGS2); | |||
@@ -133,9 +136,6 @@ private: | |||
int handleMsgSetMidiProgram(CARLA_ENGINE_OSC_HANDLE_ARGS2); | |||
int handleMsgNoteOn(CARLA_ENGINE_OSC_HANDLE_ARGS2); | |||
int handleMsgNoteOff(CARLA_ENGINE_OSC_HANDLE_ARGS2); | |||
int handleMsgLv2AtomTransfer(CARLA_ENGINE_OSC_HANDLE_ARGS2); | |||
int handleMsgLv2UridMap(CARLA_ENGINE_OSC_HANDLE_ARGS2); | |||
#endif | |||
// ----------------------------------------------------------------------- | |||
@@ -73,7 +73,7 @@ struct ParamSymbol { | |||
// Constructor and destructor | |||
CarlaPlugin::CarlaPlugin(CarlaEngine* const engine, const uint id) | |||
: pData(new ProtectedData(engine, id, this)) | |||
: pData(new ProtectedData(engine, id)) | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(engine != nullptr,); | |||
CARLA_SAFE_ASSERT(id < engine->getMaxPluginNumber()); | |||
@@ -471,7 +471,7 @@ void CarlaPlugin::randomizeParameters() noexcept | |||
} | |||
} | |||
const StateSave& CarlaPlugin::getStateSave() | |||
const CarlaStateSave& CarlaPlugin::getStateSave() | |||
{ | |||
pData->stateSave.clear(); | |||
prepareForSave(); | |||
@@ -558,7 +558,7 @@ const StateSave& CarlaPlugin::getStateSave() | |||
if ((paramData.hints & PARAMETER_IS_ENABLED) == 0) | |||
continue; | |||
StateParameter* const stateParameter(new StateParameter()); | |||
CarlaStateSave::Parameter* const stateParameter(new CarlaStateSave::Parameter()); | |||
stateParameter->isInput = (paramData.type == PARAMETER_INPUT); | |||
stateParameter->index = paramData.index; | |||
@@ -588,7 +588,7 @@ const StateSave& CarlaPlugin::getStateSave() | |||
{ | |||
const CustomData& cData(it.getValue()); | |||
StateCustomData* stateCustomData(new StateCustomData()); | |||
CarlaStateSave::CustomData* stateCustomData(new CarlaStateSave::CustomData()); | |||
stateCustomData->type = carla_strdup(cData.type); | |||
stateCustomData->key = carla_strdup(cData.key); | |||
@@ -600,7 +600,7 @@ const StateSave& CarlaPlugin::getStateSave() | |||
return pData->stateSave; | |||
} | |||
void CarlaPlugin::loadStateSave(const StateSave& stateSave) | |||
void CarlaPlugin::loadStateSave(const CarlaStateSave& stateSave) | |||
{ | |||
char strBuf[STR_MAX+1]; | |||
const bool usesMultiProgs(pData->extraHints & PLUGIN_EXTRA_HINT_USES_MULTI_PROGS); | |||
@@ -608,9 +608,9 @@ void CarlaPlugin::loadStateSave(const StateSave& stateSave) | |||
// --------------------------------------------------------------- | |||
// Part 1 - PRE-set custom data (only that which reload programs) | |||
for (LinkedList<StateCustomData*>::Itenerator it = stateSave.customData.begin(); it.valid(); it.next()) | |||
for (CarlaStateSave::CustomDataItenerator it = stateSave.customData.begin(); it.valid(); it.next()) | |||
{ | |||
const StateCustomData* const stateCustomData(it.getValue()); | |||
const CarlaStateSave::CustomData* const stateCustomData(it.getValue()); | |||
const char* const key(stateCustomData->key); | |||
bool wantData = false; | |||
@@ -688,9 +688,9 @@ void CarlaPlugin::loadStateSave(const StateSave& stateSave) | |||
const float sampleRate(static_cast<float>(pData->engine->getSampleRate())); | |||
for (LinkedList<StateParameter*>::Itenerator it = stateSave.parameters.begin(); it.valid(); it.next()) | |||
for (CarlaStateSave::ParameterItenerator it = stateSave.parameters.begin(); it.valid(); it.next()) | |||
{ | |||
StateParameter* const stateParameter(it.getValue()); | |||
CarlaStateSave::Parameter* const stateParameter(it.getValue()); | |||
int32_t index = -1; | |||
@@ -778,9 +778,9 @@ void CarlaPlugin::loadStateSave(const StateSave& stateSave) | |||
// --------------------------------------------------------------- | |||
// Part 5 - set custom data | |||
for (LinkedList<StateCustomData*>::Itenerator it = stateSave.customData.begin(); it.valid(); it.next()) | |||
for (CarlaStateSave::CustomDataItenerator it = stateSave.customData.begin(); it.valid(); it.next()) | |||
{ | |||
const StateCustomData* const stateCustomData(it.getValue()); | |||
const CarlaStateSave::CustomData* const stateCustomData(it.getValue()); | |||
const char* const key(stateCustomData->key); | |||
if (getType() == PLUGIN_DSSI && (std::strcmp(key, "reloadprograms") == 0 || std::strcmp(key, "load") == 0 || std::strncmp(key, "patches", 7) == 0)) | |||
@@ -1338,7 +1338,13 @@ void CarlaPlugin::idle() | |||
CarlaString uiTitle(pData->name); | |||
uiTitle += " (GUI)"; | |||
if (CarlaPluginUI::tryTransientWinIdMatch(pData->osc.data.target != nullptr ? pData->osc.thread.getPid() : 0, uiTitle, pData->engine->getOptions().frontendWinId, true)) | |||
uint32_t pid = 0; | |||
#ifndef BUILD_BRIDGE | |||
if (pData->oscData.target != nullptr && pData->childProcess != nullptr) | |||
pid = pData->childProcess->getPID(); | |||
#endif | |||
if (CarlaPluginUI::tryTransientWinIdMatch(pid, uiTitle, pData->engine->getOptions().frontendWinId, true)) | |||
pData->transientTryCounter = 0; | |||
} | |||
@@ -1572,14 +1578,14 @@ void CarlaPlugin::updateOscData(const lo_address& source, const char* const url) | |||
// FIXME - remove debug prints later | |||
carla_stdout("CarlaPlugin::updateOscData(%p, \"%s\")", source, url); | |||
pData->osc.data.clear(); | |||
pData->oscData.clear(); | |||
const int proto = lo_address_get_protocol(source); | |||
{ | |||
const char* host = lo_address_get_hostname(source); | |||
const char* port = lo_address_get_port(source); | |||
pData->osc.data.source = lo_address_new_with_proto(proto, host, port); | |||
pData->oscData.source = lo_address_new_with_proto(proto, host, port); | |||
carla_stdout("CarlaPlugin::updateOscData() - source: host \"%s\", port \"%s\"", host, port); | |||
} | |||
@@ -1587,9 +1593,9 @@ void CarlaPlugin::updateOscData(const lo_address& source, const char* const url) | |||
{ | |||
char* host = lo_url_get_hostname(url); | |||
char* port = lo_url_get_port(url); | |||
pData->osc.data.path = carla_strdup_free(lo_url_get_path(url)); | |||
pData->osc.data.target = lo_address_new_with_proto(proto, host, port); | |||
carla_stdout("CarlaPlugin::updateOscData() - target: host \"%s\", port \"%s\", path \"%s\"", host, port, pData->osc.data.path); | |||
pData->oscData.path = carla_strdup_free(lo_url_get_path(url)); | |||
pData->oscData.target = lo_address_new_with_proto(proto, host, port); | |||
carla_stdout("CarlaPlugin::updateOscData() - target: host \"%s\", port \"%s\", path \"%s\"", host, port, pData->oscData.path); | |||
std::free(host); | |||
std::free(port); | |||
@@ -1607,7 +1613,7 @@ void CarlaPlugin::updateOscData(const lo_address& source, const char* const url) | |||
if (updateOscDataExtra()) | |||
pData->engine->idleOsc(); | |||
osc_send_sample_rate(pData->osc.data, static_cast<float>(pData->engine->getSampleRate())); | |||
osc_send_sample_rate(pData->oscData, static_cast<float>(pData->engine->getSampleRate())); | |||
for (LinkedList<CustomData>::Itenerator it = pData->custom.begin(); it.valid(); it.next()) | |||
{ | |||
@@ -1618,24 +1624,24 @@ void CarlaPlugin::updateOscData(const lo_address& source, const char* const url) | |||
CARLA_SAFE_ASSERT_CONTINUE(cData.value != nullptr); | |||
if (std::strcmp(cData.type, CUSTOM_DATA_TYPE_STRING) == 0) | |||
osc_send_configure(pData->osc.data, cData.key, cData.value); | |||
osc_send_configure(pData->oscData, cData.key, cData.value); | |||
} | |||
if (pData->prog.current >= 0) | |||
osc_send_program(pData->osc.data, static_cast<uint32_t>(pData->prog.current)); | |||
osc_send_program(pData->oscData, static_cast<uint32_t>(pData->prog.current)); | |||
if (pData->midiprog.current >= 0) | |||
{ | |||
const MidiProgramData& curMidiProg(pData->midiprog.getCurrent()); | |||
if (getType() == PLUGIN_DSSI) | |||
osc_send_program(pData->osc.data, curMidiProg.bank, curMidiProg.program); | |||
osc_send_program(pData->oscData, curMidiProg.bank, curMidiProg.program); | |||
else | |||
osc_send_midi_program(pData->osc.data, curMidiProg.bank, curMidiProg.program); | |||
osc_send_midi_program(pData->oscData, curMidiProg.bank, curMidiProg.program); | |||
} | |||
for (uint32_t i=0; i < pData->param.count; ++i) | |||
osc_send_control(pData->osc.data, pData->param.data[i].rindex, getParameterValue(i)); | |||
osc_send_control(pData->oscData, pData->param.data[i].rindex, getParameterValue(i)); | |||
if ((pData->hints & PLUGIN_HAS_CUSTOM_UI) != 0 && pData->engine->getOptions().frontendWinId != 0) | |||
pData->transientTryCounter = 1; | |||
@@ -1652,7 +1658,7 @@ void CarlaPlugin::updateOscURL() | |||
{ | |||
const String newURL(String(pData->engine->getOscServerPathUDP()) + String("/") + String(pData->id)); | |||
osc_send_update_url(pData->osc.data, newURL.toRawUTF8()); | |||
osc_send_update_url(pData->oscData, newURL.toRawUTF8()); | |||
} | |||
bool CarlaPlugin::waitForOscGuiShow() | |||
@@ -1663,14 +1669,14 @@ bool CarlaPlugin::waitForOscGuiShow() | |||
// wait for UI 'update' call | |||
for (; i < oscUiTimeout/100; ++i) | |||
{ | |||
if (pData->osc.data.target != nullptr) | |||
if (pData->oscData.target != nullptr) | |||
{ | |||
carla_stdout("CarlaPlugin::waitForOscGuiShow() - got response, asking UI to show itself now"); | |||
osc_send_show(pData->osc.data); | |||
osc_send_show(pData->oscData); | |||
return true; | |||
} | |||
if (pData->osc.thread.isThreadRunning()) | |||
if (pData->childProcess != nullptr && pData->childProcess->isRunning()) | |||
carla_msleep(100); | |||
else | |||
return false; | |||
@@ -63,6 +63,7 @@ using juce::StringArray; | |||
CARLA_BACKEND_START_NAMESPACE | |||
#if 0 | |||
// ------------------------------------------------------------------------------------------------------------------- | |||
// call carla_shm_create with for a XXXXXX temp filename | |||
@@ -357,8 +358,6 @@ public: | |||
{ | |||
carla_debug("BridgePlugin::BridgePlugin(%p, %i, %s, %s)", engine, id, BinaryType2Str(btype), PluginType2Str(ptype)); | |||
pData->osc.thread.setMode(CarlaPluginThread::PLUGIN_THREAD_BRIDGE); | |||
pData->hints |= PLUGIN_IS_BRIDGE; | |||
} | |||
@@ -2219,6 +2218,7 @@ private: | |||
CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(BridgePlugin) | |||
}; | |||
#endif | |||
CARLA_BACKEND_END_NAMESPACE | |||
@@ -2232,7 +2232,7 @@ CarlaPlugin* CarlaPlugin::newBridge(const Initializer& init, BinaryType btype, P | |||
{ | |||
carla_debug("CarlaPlugin::newBridge({%p, \"%s\", \"%s\", \"%s\"}, %s, %s, \"%s\")", init.engine, init.filename, init.name, init.label, BinaryType2Str(btype), PluginType2Str(ptype), bridgeBinary); | |||
#ifndef BUILD_BRIDGE | |||
#if 0 //ndef BUILD_BRIDGE | |||
if (bridgeBinary == nullptr || bridgeBinary[0] == '\0') | |||
{ | |||
init.engine->setLastError("Bridge not possible, bridge-binary not found"); | |||
@@ -2283,7 +2283,7 @@ CarlaPlugin* CarlaPlugin::newBridge(const Initializer& init, BinaryType btype, P | |||
return nullptr; | |||
// unused | |||
(void)bridgeBinary; | |||
(void)bridgeBinary; (void)btype; (void)ptype; | |||
#endif | |||
} | |||
@@ -2296,11 +2296,12 @@ CarlaPlugin* CarlaPlugin::newBridge(const Initializer& init, BinaryType btype, P | |||
extern int CarlaPluginSetOscBridgeInfo(CarlaPlugin* const plugin, const PluginBridgeOscInfoType type, | |||
const int argc, const lo_arg* const* const argv, const char* const types); | |||
int CarlaPluginSetOscBridgeInfo(CarlaPlugin* const plugin, const PluginBridgeOscInfoType type, | |||
const int argc, const lo_arg* const* const argv, const char* const types) | |||
int CarlaPluginSetOscBridgeInfo(CarlaPlugin* const plugin, const PluginBridgeOscInfoType /*type*/, | |||
const int /*argc*/, const lo_arg* const* const /*argv*/, const char* const /*types*/) | |||
{ | |||
CARLA_SAFE_ASSERT(plugin != nullptr && (plugin->getHints() & PLUGIN_IS_BRIDGE) != 0); | |||
return bridgePlugin->setOscPluginBridgeInfo(type, argc, argv, types); | |||
return 0; | |||
//return bridgePlugin->setOscPluginBridgeInfo(type, argc, argv, types); | |||
} | |||
#undef bridgePlugin | |||
@@ -26,6 +26,7 @@ | |||
CARLA_BACKEND_START_NAMESPACE | |||
#if 0 | |||
// ----------------------------------------------------- | |||
class CarlaPluginDSSI : public CarlaPlugin | |||
@@ -2325,6 +2326,7 @@ private: | |||
}; | |||
LinkedList<const char*> CarlaPluginDSSI::sMultiSynthList; | |||
#endif | |||
// ------------------------------------------------------------------------------------------------------------------- | |||
@@ -2332,6 +2334,7 @@ CarlaPlugin* CarlaPlugin::newDSSI(const Initializer& init) | |||
{ | |||
carla_debug("CarlaPlugin::newDSSI({%p, \"%s\", \"%s\", \"%s\", " P_INT64 "})", init.engine, init.filename, init.name, init.label, init.uniqueId); | |||
#if 0 | |||
CarlaPluginDSSI* const plugin(new CarlaPluginDSSI(init.engine, init.id)); | |||
if (! plugin->init(init.filename, init.name, init.label)) | |||
@@ -2370,6 +2373,9 @@ CarlaPlugin* CarlaPlugin::newDSSI(const Initializer& init) | |||
} | |||
return plugin; | |||
#endif | |||
return nullptr; | |||
(void)init; | |||
} | |||
// ------------------------------------------------------------------------------------------------------------------- | |||
@@ -432,13 +432,7 @@ CarlaPlugin::ProtectedData::PostProc::PostProc() noexcept | |||
// ----------------------------------------------------------------------- | |||
CarlaPlugin::ProtectedData::OSC::OSC(CarlaEngine* const eng, CarlaPlugin* const plug) noexcept | |||
: data(), | |||
thread(eng, plug) {} | |||
// ----------------------------------------------------------------------- | |||
CarlaPlugin::ProtectedData::ProtectedData(CarlaEngine* const eng, const uint idx, CarlaPlugin* const plug) noexcept | |||
CarlaPlugin::ProtectedData::ProtectedData(CarlaEngine* const eng, const uint idx) noexcept | |||
: engine(eng), | |||
client(nullptr), | |||
id(idx), | |||
@@ -471,13 +465,17 @@ CarlaPlugin::ProtectedData::ProtectedData(CarlaEngine* const eng, const uint idx | |||
custom(), | |||
masterMutex(), | |||
singleMutex(), | |||
#ifndef BUILD_BRIDGE | |||
childProcess(), | |||
oscData(), | |||
#endif | |||
stateSave(), | |||
extNotes(), | |||
postRtEvents(), | |||
#ifndef BUILD_BRIDGE | |||
postProc(), | |||
#endif | |||
osc(eng, plug) {} | |||
leakDetector_ProtectedData() {} | |||
CarlaPlugin::ProtectedData::~ProtectedData() noexcept | |||
{ | |||
@@ -22,15 +22,19 @@ | |||
#include "CarlaPluginThread.hpp" | |||
#include "CarlaLibUtils.hpp" | |||
#include "CarlaMutex.hpp" | |||
#include "CarlaOscUtils.hpp" | |||
#include "CarlaStateUtils.hpp" | |||
#include "CarlaString.hpp" | |||
#include "CarlaMIDI.h" | |||
#include "RtLinkedList.hpp" | |||
#include "juce_audio_basics.h" | |||
using juce::ChildProcess; | |||
using juce::FloatVectorOperations; | |||
using juce::ScopedPointer; | |||
CARLA_BACKEND_START_NAMESPACE | |||
@@ -250,7 +254,12 @@ struct CarlaPlugin::ProtectedData { | |||
CarlaMutex masterMutex; // global master lock | |||
CarlaMutex singleMutex; // small lock used only in processSingle() | |||
StateSave stateSave; | |||
#ifndef BUILD_BRIDGE | |||
ScopedPointer<ChildProcess> childProcess; | |||
CarlaOscData oscData; | |||
#endif | |||
CarlaStateSave stateSave; | |||
struct ExternalNotes { | |||
CarlaMutex mutex; | |||
@@ -297,19 +306,7 @@ struct CarlaPlugin::ProtectedData { | |||
} postProc; | |||
#endif | |||
struct OSC { | |||
CarlaOscData data; | |||
CarlaPluginThread thread; | |||
OSC(CarlaEngine* const engine, CarlaPlugin* const plugin) noexcept; | |||
#ifdef CARLA_PROPER_CPP11_SUPPORT | |||
OSC() = delete; | |||
CARLA_DECLARE_NON_COPY_STRUCT(OSC) | |||
#endif | |||
} osc; | |||
ProtectedData(CarlaEngine* const engine, const uint idx, CarlaPlugin* const plugin) noexcept; | |||
ProtectedData(CarlaEngine* const engine, const uint idx) noexcept; | |||
~ProtectedData() noexcept; | |||
// ------------------------------------------------------------------- | |||
@@ -359,8 +356,9 @@ struct CarlaPlugin::ProtectedData { | |||
#ifdef CARLA_PROPER_CPP11_SUPPORT | |||
ProtectedData() = delete; | |||
CARLA_DECLARE_NON_COPY_STRUCT(ProtectedData) | |||
CARLA_DECLARE_NON_COPY_STRUCT(ProtectedData); | |||
#endif | |||
CARLA_LEAK_DETECTOR(ProtectedData); | |||
}; | |||
CARLA_BACKEND_END_NAMESPACE | |||
@@ -42,6 +42,7 @@ using juce::File; | |||
CARLA_BACKEND_START_NAMESPACE | |||
#if 0 | |||
// ----------------------------------------------------- | |||
// Maximum default buffer size | |||
@@ -5951,12 +5952,15 @@ int CarlaEngineOsc::handleMsgLv2UridMap(CARLA_ENGINE_OSC_HANDLE_ARGS2) | |||
#undef lv2PluginPtr | |||
#endif | |||
// ------------------------------------------------------------------------------------------------------------------- | |||
CarlaPlugin* CarlaPlugin::newLV2(const Initializer& init) | |||
{ | |||
carla_debug("CarlaPlugin::newLV2({%p, \"%s\", \"%s\", " P_INT64 "})", init.engine, init.name, init.label, init.uniqueId); | |||
#if 0 | |||
CarlaPluginLV2* const plugin(new CarlaPluginLV2(init.engine, init.id)); | |||
if (! plugin->init(init.name, init.label)) | |||
@@ -5995,6 +5999,9 @@ CarlaPlugin* CarlaPlugin::newLV2(const Initializer& init) | |||
} | |||
return plugin; | |||
#endif | |||
return nullptr; | |||
(void)init; | |||
} | |||
// ------------------------------------------------------------------------------------------------------------------- | |||
@@ -15,6 +15,8 @@ | |||
* For a full copy of the GNU General Public License see the doc/GPL.txt file. | |||
*/ | |||
#if 0 | |||
#include "CarlaPlugin.hpp" | |||
#include "CarlaPluginThread.hpp" | |||
#include "CarlaEngine.hpp" | |||
@@ -386,3 +388,5 @@ void CarlaPluginThread::run() | |||
// ----------------------------------------------------------------------- | |||
CARLA_BACKEND_END_NAMESPACE | |||
#endif |
@@ -15,6 +15,8 @@ | |||
* For a full copy of the GNU General Public License see the doc/GPL.txt file. | |||
*/ | |||
#if 0 | |||
#ifndef CARLA_PLUGIN_THREAD_HPP_INCLUDED | |||
#define CARLA_PLUGIN_THREAD_HPP_INCLUDED | |||
@@ -73,3 +75,5 @@ private: | |||
CARLA_BACKEND_END_NAMESPACE | |||
#endif // CARLA_PLUGIN_THREAD_HPP_INCLUDED | |||
#endif |
@@ -40,6 +40,7 @@ using juce::File; | |||
CARLA_BACKEND_START_NAMESPACE | |||
#if 0 | |||
// ----------------------------------------------------- | |||
const uint PLUGIN_CAN_PROCESS_REPLACING = 0x1000; | |||
@@ -2547,6 +2548,8 @@ private: | |||
CarlaPluginVST2* CarlaPluginVST2::sLastCarlaPluginVST2 = nullptr; | |||
#endif | |||
CARLA_BACKEND_END_NAMESPACE | |||
#endif // ! USE_JUCE_FOR_VST | |||
@@ -2561,7 +2564,7 @@ CarlaPlugin* CarlaPlugin::newVST2(const Initializer& init) | |||
#ifdef USE_JUCE_FOR_VST | |||
return newJuce(init, "VST"); | |||
#else | |||
#elif 0 //se | |||
CarlaPluginVST2* const plugin(new CarlaPluginVST2(init.engine, init.id)); | |||
if (! plugin->init(init.filename, init.name, init.uniqueId)) | |||
@@ -2580,6 +2583,9 @@ CarlaPlugin* CarlaPlugin::newVST2(const Initializer& init) | |||
} | |||
return plugin; | |||
#else | |||
return nullptr; | |||
(void)init; | |||
#endif | |||
} | |||
@@ -40,9 +40,7 @@ public: | |||
CARLA_SAFE_ASSERT(host != nullptr); | |||
} | |||
virtual ~NativePluginClass() | |||
{ | |||
} | |||
virtual ~NativePluginClass() {} | |||
protected: | |||
// ------------------------------------------------------------------- | |||
@@ -268,8 +266,7 @@ protected: | |||
return; | |||
// unused | |||
(void)bank; | |||
(void)program; | |||
(void)bank; (void)program; | |||
} | |||
virtual void setCustomData(const char* const key, const char* const value) | |||
@@ -281,13 +278,9 @@ protected: | |||
// ------------------------------------------------------------------- | |||
// Plugin process calls | |||
virtual void activate() | |||
{ | |||
} | |||
virtual void activate() {} | |||
virtual void deactivate() | |||
{ | |||
} | |||
virtual void deactivate() {} | |||
virtual void process(float** const inBuffer, float** const outBuffer, const uint32_t frames, const NativeMidiEvent* const midiEvents, const uint32_t midiEventCount) = 0; | |||
@@ -321,13 +314,12 @@ protected: | |||
return; | |||
// unused | |||
(void)bank; | |||
(void)program; | |||
(void)bank; (void)program; | |||
} | |||
virtual void uiSetCustomData(const char* const key, const char* const value) | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(key != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(key != nullptr && key[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(value != nullptr,); | |||
} | |||
@@ -58,7 +58,7 @@ protected: | |||
carla_stdout("Trying to start UI using \"%s\"", path.buffer()); | |||
CarlaExternalUI::setData(path, getSampleRate(), getUiName()); | |||
CarlaExternalUI::startPipeServer(); | |||
CarlaExternalUI::startPipeServer(true); | |||
} | |||
else | |||
{ | |||
@@ -108,7 +108,7 @@ static const char* xmlSafeStringCharDup(const String& string, const bool toXml) | |||
// ----------------------------------------------------------------------- | |||
// StateParameter | |||
StateParameter::StateParameter() noexcept | |||
CarlaStateSave::Parameter::Parameter() noexcept | |||
: isInput(true), | |||
index(-1), | |||
name(nullptr), | |||
@@ -121,7 +121,7 @@ StateParameter::StateParameter() noexcept | |||
value(0.0f) {} | |||
#endif | |||
StateParameter::~StateParameter() noexcept | |||
CarlaStateSave::Parameter::~Parameter() noexcept | |||
{ | |||
if (name != nullptr) | |||
{ | |||
@@ -138,12 +138,12 @@ StateParameter::~StateParameter() noexcept | |||
// ----------------------------------------------------------------------- | |||
// StateCustomData | |||
StateCustomData::StateCustomData() noexcept | |||
CarlaStateSave::CustomData::CustomData() noexcept | |||
: type(nullptr), | |||
key(nullptr), | |||
value(nullptr) {} | |||
StateCustomData::~StateCustomData() noexcept | |||
CarlaStateSave::CustomData::~CustomData() noexcept | |||
{ | |||
if (type != nullptr) | |||
{ | |||
@@ -165,7 +165,7 @@ StateCustomData::~StateCustomData() noexcept | |||
// ----------------------------------------------------------------------- | |||
// StateSave | |||
StateSave::StateSave() noexcept | |||
CarlaStateSave::CarlaStateSave() noexcept | |||
: type(nullptr), | |||
name(nullptr), | |||
label(nullptr), | |||
@@ -189,12 +189,12 @@ StateSave::StateSave() noexcept | |||
parameters(), | |||
customData() {} | |||
StateSave::~StateSave() noexcept | |||
CarlaStateSave::~CarlaStateSave() noexcept | |||
{ | |||
clear(); | |||
} | |||
void StateSave::clear() noexcept | |||
void CarlaStateSave::clear() noexcept | |||
{ | |||
if (type != nullptr) | |||
{ | |||
@@ -242,15 +242,15 @@ void StateSave::clear() noexcept | |||
currentMidiBank = -1; | |||
currentMidiProgram = -1; | |||
for (StateParameterItenerator it = parameters.begin(); it.valid(); it.next()) | |||
for (ParameterItenerator it = parameters.begin(); it.valid(); it.next()) | |||
{ | |||
StateParameter* const stateParameter(it.getValue()); | |||
Parameter* const stateParameter(it.getValue()); | |||
delete stateParameter; | |||
} | |||
for (StateCustomDataItenerator it = customData.begin(); it.valid(); it.next()) | |||
for (CustomDataItenerator it = customData.begin(); it.valid(); it.next()) | |||
{ | |||
StateCustomData* const stateCustomData(it.getValue()); | |||
CustomData* const stateCustomData(it.getValue()); | |||
delete stateCustomData; | |||
} | |||
@@ -261,7 +261,7 @@ void StateSave::clear() noexcept | |||
// ----------------------------------------------------------------------- | |||
// fillFromXmlElement | |||
bool StateSave::fillFromXmlElement(const XmlElement* const xmlElement) | |||
bool CarlaStateSave::fillFromXmlElement(const XmlElement* const xmlElement) | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(xmlElement != nullptr, false); | |||
@@ -386,7 +386,7 @@ bool StateSave::fillFromXmlElement(const XmlElement* const xmlElement) | |||
else if (tag.equalsIgnoreCase("parameter")) | |||
{ | |||
StateParameter* const stateParameter(new StateParameter()); | |||
Parameter* const stateParameter(new Parameter()); | |||
for (XmlElement* xmlSubData = xmlData->getFirstChildElement(); xmlSubData != nullptr; xmlSubData = xmlSubData->getNextElement()) | |||
{ | |||
@@ -436,7 +436,7 @@ bool StateSave::fillFromXmlElement(const XmlElement* const xmlElement) | |||
else if (tag.equalsIgnoreCase("customdata") || tag.equalsIgnoreCase("custom-data")) | |||
{ | |||
StateCustomData* const stateCustomData(new StateCustomData()); | |||
CustomData* const stateCustomData(new CustomData()); | |||
for (XmlElement* xmlSubData = xmlData->getFirstChildElement(); xmlSubData != nullptr; xmlSubData = xmlSubData->getNextElement()) | |||
{ | |||
@@ -472,7 +472,7 @@ bool StateSave::fillFromXmlElement(const XmlElement* const xmlElement) | |||
// ----------------------------------------------------------------------- | |||
// fillXmlStringFromStateSave | |||
String StateSave::toString() const | |||
String CarlaStateSave::toString() const | |||
{ | |||
String content; | |||
@@ -557,9 +557,9 @@ String StateSave::toString() const | |||
} | |||
#endif | |||
for (StateParameterItenerator it = parameters.begin(); it.valid(); it.next()) | |||
for (ParameterItenerator it = parameters.begin(); it.valid(); it.next()) | |||
{ | |||
StateParameter* const stateParameter(it.getValue()); | |||
Parameter* const stateParameter(it.getValue()); | |||
String parameterXml("\n"" <Parameter>\n"); | |||
@@ -607,9 +607,9 @@ String StateSave::toString() const | |||
content << midiProgramXml; | |||
} | |||
for (StateCustomDataItenerator it = customData.begin(); it.valid(); it.next()) | |||
for (CustomDataItenerator it = customData.begin(); it.valid(); it.next()) | |||
{ | |||
StateCustomData* const stateCustomData(it.getValue()); | |||
CustomData* const stateCustomData(it.getValue()); | |||
CARLA_SAFE_ASSERT_CONTINUE(stateCustomData->type != nullptr && stateCustomData->type[0] != '\0'); | |||
CARLA_SAFE_ASSERT_CONTINUE(stateCustomData->key != nullptr && stateCustomData->key[0] != '\0'); | |||
CARLA_SAFE_ASSERT_CONTINUE(stateCustomData->value != nullptr); | |||
@@ -27,41 +27,41 @@ CARLA_BACKEND_START_NAMESPACE | |||
// ----------------------------------------------------------------------- | |||
struct StateParameter { | |||
bool isInput; | |||
int32_t index; | |||
const char* name; | |||
const char* symbol; | |||
float value; | |||
struct CarlaStateSave { | |||
struct Parameter { | |||
bool isInput; | |||
int32_t index; | |||
const char* name; | |||
const char* symbol; | |||
float value; | |||
#ifndef BUILD_BRIDGE | |||
uint8_t midiChannel; | |||
int16_t midiCC; | |||
uint8_t midiChannel; | |||
int16_t midiCC; | |||
#endif | |||
StateParameter() noexcept; | |||
~StateParameter() noexcept; | |||
Parameter() noexcept; | |||
~Parameter() noexcept; | |||
CARLA_DECLARE_NON_COPY_STRUCT(StateParameter) | |||
}; | |||
CARLA_DECLARE_NON_COPY_STRUCT(Parameter) | |||
}; | |||
struct StateCustomData { | |||
const char* type; | |||
const char* key; | |||
const char* value; | |||
typedef LinkedList<Parameter*> ParameterList; | |||
typedef LinkedList<Parameter*>::Itenerator ParameterItenerator; | |||
StateCustomData() noexcept; | |||
~StateCustomData() noexcept; | |||
struct CustomData { | |||
const char* type; | |||
const char* key; | |||
const char* value; | |||
CARLA_DECLARE_NON_COPY_STRUCT(StateCustomData) | |||
}; | |||
CustomData() noexcept; | |||
~CustomData() noexcept; | |||
typedef LinkedList<StateParameter*> StateParameterList; | |||
typedef LinkedList<StateCustomData*> StateCustomDataList; | |||
CARLA_DECLARE_NON_COPY_STRUCT(CustomData) | |||
}; | |||
typedef LinkedList<StateParameter*>::Itenerator StateParameterItenerator; | |||
typedef LinkedList<StateCustomData*>::Itenerator StateCustomDataItenerator; | |||
typedef LinkedList<CustomData*> CustomDataList; | |||
typedef LinkedList<CustomData*>::Itenerator CustomDataItenerator; | |||
struct StateSave { | |||
const char* type; | |||
const char* name; | |||
const char* label; | |||
@@ -85,17 +85,17 @@ struct StateSave { | |||
int32_t currentMidiProgram; | |||
const char* chunk; | |||
StateParameterList parameters; | |||
StateCustomDataList customData; | |||
ParameterList parameters; | |||
CustomDataList customData; | |||
StateSave() noexcept; | |||
~StateSave() noexcept; | |||
CarlaStateSave() noexcept; | |||
~CarlaStateSave() noexcept; | |||
void clear() noexcept; | |||
bool fillFromXmlElement(const juce::XmlElement* const xmlElement); | |||
juce::String toString() const; | |||
CARLA_DECLARE_NON_COPY_STRUCT(StateSave) | |||
CARLA_DECLARE_NON_COPY_STRUCT(CarlaStateSave) | |||
}; | |||
static inline | |||