Browse Source

Start final rework and check of Carla C++ code

tags/v0.9.0
falkTX 13 years ago
parent
commit
03033365ec
18 changed files with 427 additions and 411 deletions
  1. +4
    -4
      c++/carla-backend/carla_backend_plugin.cpp
  2. +3
    -2
      c++/carla-backend/carla_backend_standalone.cpp
  3. +1
    -1
      c++/carla-backend/carla_bridge.cpp
  4. +182
    -23
      c++/carla-backend/carla_engine.cpp
  5. +61
    -0
      c++/carla-backend/carla_engine.h
  6. +9
    -9
      c++/carla-backend/carla_engine_jack.cpp
  7. +4
    -4
      c++/carla-backend/carla_engine_rtaudio.cpp
  8. +7
    -7
      c++/carla-backend/carla_native.cpp
  9. +4
    -4
      c++/carla-backend/carla_plugin.h
  10. +11
    -165
      c++/carla-backend/carla_shared.cpp
  11. +0
    -54
      c++/carla-backend/carla_shared.h
  12. +10
    -10
      c++/carla-backend/dssi.cpp
  13. +6
    -6
      c++/carla-backend/fluidsynth.cpp
  14. +7
    -7
      c++/carla-backend/ladspa.cpp
  15. +5
    -5
      c++/carla-backend/linuxsampler.cpp
  16. +27
    -27
      c++/carla-backend/lv2.cpp
  17. +18
    -18
      c++/carla-backend/vst.cpp
  18. +68
    -65
      c++/carla-includes/carla_includes.h

+ 4
- 4
c++/carla-backend/carla_backend_plugin.cpp View File

@@ -64,10 +64,10 @@ public:
memcpy(prevParamBuffers, paramBuffers, sizeof(float)*paramCount); memcpy(prevParamBuffers, paramBuffers, sizeof(float)*paramCount);


// set-up engine // set-up engine
carlaOptions.forceStereo = true;
carlaOptions.processMode = PROCESS_MODE_CONTINUOUS_RACK;
carlaOptions.preferPluginBridges = false;
carlaOptions.preferUiBridges = false;
processMode = PROCESS_MODE_CONTINUOUS_RACK;
options.forceStereo = true;
options.preferPluginBridges = false;
options.preferUiBridges = false;
init("Carla"); init("Carla");


// Force thread start so we get some OSC usage // Force thread start so we get some OSC usage


+ 3
- 2
c++/carla-backend/carla_backend_standalone.cpp View File

@@ -193,7 +193,7 @@ bool engine_close()
get_midi_program_name(0, 0); get_midi_program_name(0, 0);
get_real_plugin_name(0); get_real_plugin_name(0);


CarlaBackend::resetOptions();
carlaEngine->resetOptions();
CarlaBackend::setLastError(nullptr); CarlaBackend::setLastError(nullptr);


delete carlaEngine; delete carlaEngine;
@@ -1428,7 +1428,8 @@ void set_option(CarlaBackend::OptionsType option, int value, const char* value_s
{ {
qDebug("CarlaBackendStandalone::set_option(%s, %i, \"%s\")", CarlaBackend::OptionsType2str(option), value, value_str); qDebug("CarlaBackendStandalone::set_option(%s, %i, \"%s\")", CarlaBackend::OptionsType2str(option), value, value_str);


CarlaBackend::setOption(option, value, value_str);
if (carlaEngine)
carlaEngine->setOption(option, value, value_str);
} }


// ------------------------------------------------------------------------------------------------------------------- // -------------------------------------------------------------------------------------------------------------------


+ 1
- 1
c++/carla-backend/carla_bridge.cpp View File

@@ -313,7 +313,7 @@ public:
} }


// create new if needed // create new if needed
param.count = (pTotal < (int32_t)carlaOptions.maxParameters) ? pTotal : 0;
param.count = (pTotal < (int32_t)x_engine->options.maxParameters) ? pTotal : 0;


if (param.count > 0) if (param.count > 0)
{ {


+ 182
- 23
c++/carla-backend/carla_engine.cpp View File

@@ -84,7 +84,7 @@ int CarlaEngine::maxClientNameSize()
{ {
#ifdef CARLA_ENGINE_JACK #ifdef CARLA_ENGINE_JACK
# ifndef BUILD_BRIDGE # ifndef BUILD_BRIDGE
if (carlaOptions.processMode != PROCESS_MODE_CONTINUOUS_RACK)
if (processMode != PROCESS_MODE_CONTINUOUS_RACK)
# endif # endif
return jackbridge_client_name_size(); return jackbridge_client_name_size();
#endif #endif
@@ -95,7 +95,7 @@ int CarlaEngine::maxPortNameSize()
{ {
#ifdef CARLA_ENGINE_JACK #ifdef CARLA_ENGINE_JACK
# ifndef BUILD_BRIDGE # ifndef BUILD_BRIDGE
if (carlaOptions.processMode != PROCESS_MODE_CONTINUOUS_RACK)
if (processMode != PROCESS_MODE_CONTINUOUS_RACK)
# endif # endif
return jackbridge_port_name_size(); return jackbridge_port_name_size();
#endif #endif
@@ -225,6 +225,165 @@ CarlaEngine* CarlaEngine::newDriverByName(const char* driverName)
return nullptr; return nullptr;
} }


// -----------------------------------------------------------------------
// Global options

#ifndef BUILD_BRIDGE
ProcessModeType CarlaEngine::processMode = PROCESS_MODE_MULTIPLE_CLIENTS;

void CarlaEngine::setOption(const OptionsType option, const int value, const char* const valueStr)
{
qDebug("CarlaEngine::setOption(%s, %i, \"%s\")", OptionsType2str(option), value, valueStr);

switch (option)
{
case OPTION_PROCESS_NAME:
carla_setprocname(valueStr);
break;
case OPTION_PROCESS_MODE:
if (value < PROCESS_MODE_SINGLE_CLIENT || value > PROCESS_MODE_CONTINUOUS_RACK)
return qCritical("CarlaEngine::setOption(%s, %i, \"%s\") - invalid value", OptionsType2str(option), value, valueStr);
processMode = (ProcessModeType)value;
break;
case OPTION_PROCESS_HIGH_PRECISION:
options.processHighPrecision = value;
break;
case OPTION_MAX_PARAMETERS:
options.maxParameters = (value > 0) ? value : MAX_PARAMETERS;
break;
case OPTION_PREFERRED_BUFFER_SIZE:
options.preferredBufferSize = value;
break;
case OPTION_PREFERRED_SAMPLE_RATE:
options.preferredSampleRate = value;
break;
case OPTION_FORCE_STEREO:
options.forceStereo = value;
break;
case OPTION_USE_DSSI_VST_CHUNKS:
options.useDssiVstChunks = value;
break;
case OPTION_PREFER_PLUGIN_BRIDGES:
options.preferPluginBridges = value;
break;
case OPTION_PREFER_UI_BRIDGES:
options.preferUiBridges = value;
break;
case OPTION_OSC_UI_TIMEOUT:
options.oscUiTimeout = value/100;
break;
case OPTION_PATH_LADSPA:
carla_setenv("LADSPA_PATH", valueStr);
break;
case OPTION_PATH_DSSI:
carla_setenv("DSSI_PATH", valueStr);
break;
case OPTION_PATH_LV2:
carla_setenv("LV2_PATH", valueStr);
break;
case OPTION_PATH_VST:
carla_setenv("VST_PATH", valueStr);
break;
case OPTION_PATH_GIG:
carla_setenv("GIG_PATH", valueStr);
break;
case OPTION_PATH_SF2:
carla_setenv("SF2_PATH", valueStr);
break;
case OPTION_PATH_SFZ:
carla_setenv("SFZ_PATH", valueStr);
break;
case OPTION_PATH_BRIDGE_POSIX32:
options.bridge_posix32 = strdup(valueStr);
break;
case OPTION_PATH_BRIDGE_POSIX64:
options.bridge_posix64 = strdup(valueStr);
break;
case OPTION_PATH_BRIDGE_WIN32:
options.bridge_win32 = strdup(valueStr);
break;
case OPTION_PATH_BRIDGE_WIN64:
options.bridge_win64 = strdup(valueStr);
break;
case OPTION_PATH_BRIDGE_LV2_GTK2:
options.bridge_lv2gtk2 = strdup(valueStr);
break;
case OPTION_PATH_BRIDGE_LV2_GTK3:
options.bridge_lv2gtk3 = strdup(valueStr);
break;
case OPTION_PATH_BRIDGE_LV2_QT4:
options.bridge_lv2qt4 = strdup(valueStr);
break;
case OPTION_PATH_BRIDGE_LV2_X11:
options.bridge_lv2x11 = strdup(valueStr);
break;
case OPTION_PATH_BRIDGE_VST_HWND:
options.bridge_vsthwnd = strdup(valueStr);
break;
case OPTION_PATH_BRIDGE_VST_X11:
options.bridge_vstx11 = strdup(valueStr);
break;
}
}

void CarlaEngine::resetOptions()
{
qDebug("CarlaEngine::resetOptions()");

if (options.bridge_posix32)
free((void*)options.bridge_posix32);

if (options.bridge_posix64)
free((void*)options.bridge_posix64);

if (options.bridge_win32)
free((void*)options.bridge_win32);

if (options.bridge_win64)
free((void*)options.bridge_win64);

if (options.bridge_lv2gtk2)
free((void*)options.bridge_lv2gtk2);

if (options.bridge_lv2gtk3)
free((void*)options.bridge_lv2gtk3);

if (options.bridge_lv2qt4)
free((void*)options.bridge_lv2qt4);

if (options.bridge_lv2x11)
free((void*)options.bridge_lv2x11);

if (options.bridge_vsthwnd)
free((void*)options.bridge_vsthwnd);

if (options.bridge_vstx11)
free((void*)options.bridge_vstx11);

processMode = PROCESS_MODE_MULTIPLE_CLIENTS;
options.processHighPrecision = false;
options.maxParameters = MAX_PARAMETERS;
options.preferredBufferSize = 512;
options.preferredSampleRate = 44100;
options.forceStereo = false;
options.useDssiVstChunks = false;
options.preferPluginBridges = false;
options.preferUiBridges = true;
options.oscUiTimeout = 4000/100;

options.bridge_posix32 = nullptr;
options.bridge_posix64 = nullptr;
options.bridge_win32 = nullptr;
options.bridge_win64 = nullptr;
options.bridge_lv2gtk2 = nullptr;
options.bridge_lv2gtk3 = nullptr;
options.bridge_lv2qt4 = nullptr;
options.bridge_lv2x11 = nullptr;
options.bridge_vsthwnd = nullptr;
options.bridge_vstx11 = nullptr;
}
#endif

// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
// Virtual, per-engine type calls // Virtual, per-engine type calls


@@ -377,7 +536,7 @@ short CarlaEngine::addPlugin(const BinaryType btype, const PluginType ptype, con
#ifdef BUILD_BRIDGE #ifdef BUILD_BRIDGE
m_maxPluginNumber = MAX_PLUGINS; m_maxPluginNumber = MAX_PLUGINS;
#else #else
m_maxPluginNumber = (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK) ? 16 : MAX_PLUGINS;
m_maxPluginNumber = (processMode == PROCESS_MODE_CONTINUOUS_RACK) ? 16 : MAX_PLUGINS;
#endif #endif
} }


@@ -391,10 +550,10 @@ short CarlaEngine::addPlugin(const BinaryType btype, const PluginType ptype, con
CarlaPlugin* plugin = nullptr; CarlaPlugin* plugin = nullptr;


#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (btype != BINARY_NATIVE || (carlaOptions.preferPluginBridges && getBinaryBidgePath(btype) && type == CarlaEngineTypeJack))
if (btype != BINARY_NATIVE || (options.preferPluginBridges && getBinaryBidgePath(btype) && type == CarlaEngineTypeJack))
{ {
# ifdef CARLA_ENGINE_JACK # ifdef CARLA_ENGINE_JACK
if (carlaOptions.processMode != CarlaBackend::PROCESS_MODE_MULTIPLE_CLIENTS)
if (processMode != CarlaBackend::PROCESS_MODE_MULTIPLE_CLIENTS)
{ {
setLastError("Can only use bridged plugins in JACK Multi-Client mode"); setLastError("Can only use bridged plugins in JACK Multi-Client mode");
return -1; return -1;
@@ -489,7 +648,7 @@ bool CarlaEngine::removePlugin(const unsigned short id)
#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
osc_send_control_remove_plugin(id); osc_send_control_remove_plugin(id);


if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK)
if (processMode == PROCESS_MODE_CONTINUOUS_RACK)
{ {
// TODO - handle OSC server comm // TODO - handle OSC server comm


@@ -599,7 +758,7 @@ void CarlaEngine::processRack(float* inBuf[2], float* outBuf[2], uint32_t frames


plugin->initBuffers(); plugin->initBuffers();


if (carlaOptions.processHighPrecision)
if (options.processHighPrecision)
{ {
float* inBuf2[2]; float* inBuf2[2];
float* outBuf2[2]; float* outBuf2[2];
@@ -862,7 +1021,7 @@ CarlaEngineClient::~CarlaEngineClient()
CARLA_ASSERT(! m_active); CARLA_ASSERT(! m_active);


#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (carlaOptions.processMode == PROCESS_MODE_MULTIPLE_CLIENTS)
if (CarlaEngine::processMode == PROCESS_MODE_MULTIPLE_CLIENTS)
#endif #endif
{ {
#ifdef CARLA_ENGINE_JACK #ifdef CARLA_ENGINE_JACK
@@ -878,7 +1037,7 @@ void CarlaEngineClient::activate()
CARLA_ASSERT(! m_active); CARLA_ASSERT(! m_active);


#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (carlaOptions.processMode == PROCESS_MODE_MULTIPLE_CLIENTS)
if (CarlaEngine::processMode == PROCESS_MODE_MULTIPLE_CLIENTS)
#endif #endif
{ {
if (! m_active) if (! m_active)
@@ -899,7 +1058,7 @@ void CarlaEngineClient::deactivate()
CARLA_ASSERT(m_active); CARLA_ASSERT(m_active);


#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (carlaOptions.processMode == PROCESS_MODE_MULTIPLE_CLIENTS)
if (CarlaEngine::processMode == PROCESS_MODE_MULTIPLE_CLIENTS)
#endif #endif
{ {
if (m_active) if (m_active)
@@ -926,7 +1085,7 @@ bool CarlaEngineClient::isOk() const
qDebug("CarlaEngineClient::isOk()"); qDebug("CarlaEngineClient::isOk()");


#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (carlaOptions.processMode != PROCESS_MODE_CONTINUOUS_RACK)
if (CarlaEngine::processMode != PROCESS_MODE_CONTINUOUS_RACK)
#endif #endif
{ {
#ifdef CARLA_ENGINE_JACK #ifdef CARLA_ENGINE_JACK
@@ -948,7 +1107,7 @@ void CarlaEngineClient::setLatency(const uint32_t samples)
m_latency = samples; m_latency = samples;


#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (carlaOptions.processMode != PROCESS_MODE_CONTINUOUS_RACK)
if (CarlaEngine::processMode != PROCESS_MODE_CONTINUOUS_RACK)
#endif #endif
{ {
#ifdef CARLA_ENGINE_JACK #ifdef CARLA_ENGINE_JACK
@@ -968,7 +1127,7 @@ const CarlaEngineBasePort* CarlaEngineClient::addPort(const CarlaEnginePortType
#endif #endif


#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (carlaOptions.processMode != PROCESS_MODE_CONTINUOUS_RACK)
if (CarlaEngine::processMode != PROCESS_MODE_CONTINUOUS_RACK)
#endif #endif
{ {
#ifdef CARLA_ENGINE_JACK #ifdef CARLA_ENGINE_JACK
@@ -1019,7 +1178,7 @@ CarlaEngineBasePort::~CarlaEngineBasePort()
qDebug("CarlaEngineBasePort::~CarlaEngineBasePort()"); qDebug("CarlaEngineBasePort::~CarlaEngineBasePort()");


#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK)
if (CarlaEngine::processMode == PROCESS_MODE_CONTINUOUS_RACK)
return; return;
#endif #endif


@@ -1046,7 +1205,7 @@ void CarlaEngineAudioPort::initBuffer(CarlaEngine* const /*engine*/)
float* CarlaEngineAudioPort::getJackAudioBuffer(uint32_t nframes) float* CarlaEngineAudioPort::getJackAudioBuffer(uint32_t nframes)
{ {
# ifndef BUILD_BRIDGE # ifndef BUILD_BRIDGE
if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK)
if (CarlaEngine::processMode == PROCESS_MODE_CONTINUOUS_RACK)
return nullptr; return nullptr;
# endif # endif
CARLA_ASSERT(handle.jackPort); CARLA_ASSERT(handle.jackPort);
@@ -1068,7 +1227,7 @@ void CarlaEngineControlPort::initBuffer(CarlaEngine* const engine)
CARLA_ASSERT(engine); CARLA_ASSERT(engine);


#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK)
if (CarlaEngine::processMode == PROCESS_MODE_CONTINUOUS_RACK)
{ {
buffer = isInput ? engine->rackControlEventsIn : engine->rackControlEventsOut; buffer = isInput ? engine->rackControlEventsIn : engine->rackControlEventsOut;
return; return;
@@ -1094,7 +1253,7 @@ uint32_t CarlaEngineControlPort::getEventCount()
CARLA_ASSERT(buffer); CARLA_ASSERT(buffer);


#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK)
if (CarlaEngine::processMode == PROCESS_MODE_CONTINUOUS_RACK)
{ {
uint32_t count = 0; uint32_t count = 0;
const CarlaEngineControlEvent* const events = (CarlaEngineControlEvent*)buffer; const CarlaEngineControlEvent* const events = (CarlaEngineControlEvent*)buffer;
@@ -1129,7 +1288,7 @@ const CarlaEngineControlEvent* CarlaEngineControlPort::getEvent(uint32_t index)
#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
CARLA_ASSERT(index < CarlaEngine::MAX_ENGINE_CONTROL_EVENTS); CARLA_ASSERT(index < CarlaEngine::MAX_ENGINE_CONTROL_EVENTS);


if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK)
if (CarlaEngine::processMode == PROCESS_MODE_CONTINUOUS_RACK)
{ {
const CarlaEngineControlEvent* const events = (CarlaEngineControlEvent*)buffer; const CarlaEngineControlEvent* const events = (CarlaEngineControlEvent*)buffer;


@@ -1207,7 +1366,7 @@ void CarlaEngineControlPort::writeEvent(CarlaEngineControlEventType type, uint32
CARLA_ASSERT(type != CarlaEngineEventNull); CARLA_ASSERT(type != CarlaEngineEventNull);


#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK)
if (CarlaEngine::processMode == PROCESS_MODE_CONTINUOUS_RACK)
{ {
CarlaEngineControlEvent* const events = (CarlaEngineControlEvent*)buffer; CarlaEngineControlEvent* const events = (CarlaEngineControlEvent*)buffer;


@@ -1286,7 +1445,7 @@ void CarlaEngineMidiPort::initBuffer(CarlaEngine* const engine)
CARLA_ASSERT(engine); CARLA_ASSERT(engine);


#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK)
if (CarlaEngine::processMode == PROCESS_MODE_CONTINUOUS_RACK)
{ {
buffer = isInput ? engine->rackMidiEventsIn : engine->rackMidiEventsOut; buffer = isInput ? engine->rackMidiEventsIn : engine->rackMidiEventsOut;
return; return;
@@ -1312,7 +1471,7 @@ uint32_t CarlaEngineMidiPort::getEventCount()
CARLA_ASSERT(buffer); CARLA_ASSERT(buffer);


#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK)
if (CarlaEngine::processMode == PROCESS_MODE_CONTINUOUS_RACK)
{ {
uint32_t count = 0; uint32_t count = 0;
const CarlaEngineMidiEvent* const events = (CarlaEngineMidiEvent*)buffer; const CarlaEngineMidiEvent* const events = (CarlaEngineMidiEvent*)buffer;
@@ -1347,7 +1506,7 @@ const CarlaEngineMidiEvent* CarlaEngineMidiPort::getEvent(uint32_t index)
#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
CARLA_ASSERT(index < CarlaEngine::MAX_ENGINE_MIDI_EVENTS); CARLA_ASSERT(index < CarlaEngine::MAX_ENGINE_MIDI_EVENTS);


if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK)
if (CarlaEngine::processMode == PROCESS_MODE_CONTINUOUS_RACK)
{ {
const CarlaEngineMidiEvent* const events = (CarlaEngineMidiEvent*)buffer; const CarlaEngineMidiEvent* const events = (CarlaEngineMidiEvent*)buffer;


@@ -1387,7 +1546,7 @@ void CarlaEngineMidiPort::writeEvent(uint32_t time, const uint8_t* data, uint8_t
CARLA_ASSERT(size > 0); CARLA_ASSERT(size > 0);


#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK)
if (CarlaEngine::processMode == PROCESS_MODE_CONTINUOUS_RACK)
{ {
if (size > 4) if (size > 4)
return; return;


+ 61
- 0
c++/carla-backend/carla_engine.h View File

@@ -166,6 +166,56 @@ struct CarlaEnginePortNativeHandle {
} }
}; };


#ifndef BUILD_BRIDGE
// Global options
struct CarlaEngineOptions {
bool processHighPrecision;

uint maxParameters;
uint preferredBufferSize;
uint preferredSampleRate;

bool forceStereo;
bool useDssiVstChunks;

bool preferPluginBridges;
bool preferUiBridges;
uint oscUiTimeout;

const char* bridge_posix32;
const char* bridge_posix64;
const char* bridge_win32;
const char* bridge_win64;
const char* bridge_lv2gtk2;
const char* bridge_lv2gtk3;
const char* bridge_lv2qt4;
const char* bridge_lv2x11;
const char* bridge_vsthwnd;
const char* bridge_vstx11;

CarlaEngineOptions()
: processHighPrecision(false),
maxParameters(MAX_PARAMETERS),
preferredBufferSize(512),
preferredSampleRate(44100),
forceStereo(false),
useDssiVstChunks(false),
preferPluginBridges(false),
preferUiBridges(true),
oscUiTimeout(4000/100),
bridge_posix32(nullptr),
bridge_posix64(nullptr),
bridge_win32(nullptr),
bridge_win64(nullptr),
bridge_lv2gtk2(nullptr),
bridge_lv2gtk3(nullptr),
bridge_lv2qt4(nullptr),
bridge_lv2x11(nullptr),
bridge_vsthwnd(nullptr),
bridge_vstx11(nullptr) {}
};
#endif

// ----------------------------------------------------------------------- // -----------------------------------------------------------------------


class CarlaEngineClient; class CarlaEngineClient;
@@ -198,6 +248,17 @@ public:
static const char* getDriverName(unsigned int index); static const char* getDriverName(unsigned int index);
static CarlaEngine* newDriverByName(const char* driverName); static CarlaEngine* newDriverByName(const char* driverName);


#ifndef BUILD_BRIDGE
// -------------------------------------------------------------------
// Global options

CarlaEngineOptions options;
static ProcessModeType processMode;

void setOption(const OptionsType option, const int value, const char* const valueStr);
void resetOptions();
#endif

// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Virtual, per-engine type calls // Virtual, per-engine type calls




+ 9
- 9
c++/carla-backend/carla_engine_jack.cpp View File

@@ -82,7 +82,7 @@ public:
jackbridge_set_latency_callback(client, carla_jack_latency_callback, this); jackbridge_set_latency_callback(client, carla_jack_latency_callback, this);
jackbridge_on_shutdown(client, carla_jack_shutdown_callback, this); jackbridge_on_shutdown(client, carla_jack_shutdown_callback, this);


if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK)
if (processMode == PROCESS_MODE_CONTINUOUS_RACK)
{ {
rackJackPorts[rackPortAudioIn1] = jackbridge_port_register(client, "in1", JACK_DEFAULT_AUDIO_TYPE, JackPortIsInput, 0); rackJackPorts[rackPortAudioIn1] = jackbridge_port_register(client, "in1", JACK_DEFAULT_AUDIO_TYPE, JackPortIsInput, 0);
rackJackPorts[rackPortAudioIn2] = jackbridge_port_register(client, "in2", JACK_DEFAULT_AUDIO_TYPE, JackPortIsInput, 0); rackJackPorts[rackPortAudioIn2] = jackbridge_port_register(client, "in2", JACK_DEFAULT_AUDIO_TYPE, JackPortIsInput, 0);
@@ -134,7 +134,7 @@ public:
#else #else
if (jackbridge_deactivate(client) == 0) if (jackbridge_deactivate(client) == 0)
{ {
if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK)
if (processMode == PROCESS_MODE_CONTINUOUS_RACK)
{ {
jackbridge_port_unregister(client, rackJackPorts[rackPortAudioIn1]); jackbridge_port_unregister(client, rackJackPorts[rackPortAudioIn1]);
jackbridge_port_unregister(client, rackJackPorts[rackPortAudioIn2]); jackbridge_port_unregister(client, rackJackPorts[rackPortAudioIn2]);
@@ -190,11 +190,11 @@ public:
jackbridge_set_latency_callback(handle.jackClient, carla_jack_latency_callback, this); jackbridge_set_latency_callback(handle.jackClient, carla_jack_latency_callback, this);
jackbridge_on_shutdown(client, carla_jack_shutdown_callback, this); jackbridge_on_shutdown(client, carla_jack_shutdown_callback, this);
#else #else
if (carlaOptions.processMode == PROCESS_MODE_SINGLE_CLIENT)
if (processMode == PROCESS_MODE_SINGLE_CLIENT)
{ {
handle.jackClient = client; handle.jackClient = client;
} }
else if (carlaOptions.processMode == PROCESS_MODE_MULTIPLE_CLIENTS)
else if (processMode == PROCESS_MODE_MULTIPLE_CLIENTS)
{ {
handle.jackClient = jackbridge_client_open(plugin->name(), JackNullOption, nullptr); handle.jackClient = jackbridge_client_open(plugin->name(), JackNullOption, nullptr);
jackbridge_set_process_callback(handle.jackClient, carla_jack_process_callback_plugin, plugin); jackbridge_set_process_callback(handle.jackClient, carla_jack_process_callback_plugin, plugin);
@@ -216,7 +216,7 @@ protected:
void handleBufferSizeCallback(uint32_t newBufferSize) void handleBufferSizeCallback(uint32_t newBufferSize)
{ {
#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (carlaOptions.processHighPrecision)
if (options.processHighPrecision)
return; return;
#endif #endif


@@ -265,7 +265,7 @@ protected:
} }


#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (carlaOptions.processMode == PROCESS_MODE_SINGLE_CLIENT)
if (processMode == PROCESS_MODE_SINGLE_CLIENT)
{ {
for (unsigned short i=0, max=maxPluginNumber(); i < max; i++) for (unsigned short i=0, max=maxPluginNumber(); i < max; i++)
{ {
@@ -287,7 +287,7 @@ protected:
plugin->engineProcessUnlock(); plugin->engineProcessUnlock();
} }
} }
else if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK)
else if (processMode == PROCESS_MODE_CONTINUOUS_RACK)
{ {
// get buffers from jack // get buffers from jack
float* audioIn1 = (float*)jackbridge_port_get_buffer(rackJackPorts[rackPortAudioIn1], nframes); float* audioIn1 = (float*)jackbridge_port_get_buffer(rackJackPorts[rackPortAudioIn1], nframes);
@@ -477,7 +477,7 @@ protected:
void handleLatencyCallback(jack_latency_callback_mode_t mode) void handleLatencyCallback(jack_latency_callback_mode_t mode)
{ {
#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (carlaOptions.processMode != PROCESS_MODE_SINGLE_CLIENT)
if (processMode != PROCESS_MODE_SINGLE_CLIENT)
return; return;
#endif #endif


@@ -542,7 +542,7 @@ private:
outBuffer[i] = p->aOut.ports[i]->getJackAudioBuffer(nframes); outBuffer[i] = p->aOut.ports[i]->getJackAudioBuffer(nframes);


#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (carlaOptions.processHighPrecision)
if (/*options.processHighPrecision*/ 0)
{ {
float* inBuffer2[p->aIn.count]; float* inBuffer2[p->aIn.count];
float* outBuffer2[p->aOut.count]; float* outBuffer2[p->aOut.count];


+ 4
- 4
c++/carla-backend/carla_engine_rtaudio.cpp View File

@@ -39,8 +39,8 @@ public:
midiOut = nullptr; midiOut = nullptr;


// just to make sure // just to make sure
carlaOptions.forceStereo = true;
carlaOptions.processMode = PROCESS_MODE_CONTINUOUS_RACK;
options.forceStereo = true;
processMode = PROCESS_MODE_CONTINUOUS_RACK;
} }


~CarlaEngineRtAudio() ~CarlaEngineRtAudio()
@@ -60,8 +60,8 @@ public:
return false; return false;
} }


bufferSize = carlaOptions.preferredBufferSize;
sampleRate = carlaOptions.preferredSampleRate;
bufferSize = options.preferredBufferSize;
sampleRate = options.preferredSampleRate;


RtAudio::StreamParameters iParams, oParams; RtAudio::StreamParameters iParams, oParams;
//iParams.deviceId = 3; //iParams.deviceId = 3;


+ 7
- 7
c++/carla-backend/carla_native.cpp View File

@@ -506,7 +506,7 @@ public:
params += 1; params += 1;
} }


if (carlaOptions.forceStereo && (aIns == 1 || aOuts == 1) && mIns <= 1 && mOuts <= 1 && ! h2)
if (x_engine->options.forceStereo && (aIns == 1 || aOuts == 1) && mIns <= 1 && mOuts <= 1 && ! h2)
{ {
h2 = descriptor->instantiate((struct _PluginDescriptor*)descriptor, &host); h2 = descriptor->instantiate((struct _PluginDescriptor*)descriptor, &host);


@@ -565,7 +565,7 @@ public:


if (portType == PORT_TYPE_AUDIO || portType == PORT_TYPE_MIDI) if (portType == PORT_TYPE_AUDIO || portType == PORT_TYPE_MIDI)
{ {
if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS)
if (CarlaEngine::processMode != PROCESS_MODE_MULTIPLE_CLIENTS)
{ {
strcpy(portName, m_name); strcpy(portName, m_name);
strcat(portName, ":"); strcat(portName, ":");
@@ -727,7 +727,7 @@ public:


if (needsCtrlIn) if (needsCtrlIn)
{ {
if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS)
if (CarlaEngine::processMode != PROCESS_MODE_MULTIPLE_CLIENTS)
{ {
strcpy(portName, m_name); strcpy(portName, m_name);
strcat(portName, ":control-in"); strcat(portName, ":control-in");
@@ -740,7 +740,7 @@ public:


if (needsCtrlOut) if (needsCtrlOut)
{ {
if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS)
if (CarlaEngine::processMode != PROCESS_MODE_MULTIPLE_CLIENTS)
{ {
strcpy(portName, m_name); strcpy(portName, m_name);
strcat(portName, ":control-out"); strcat(portName, ":control-out");
@@ -896,7 +896,7 @@ public:
// Input VU // Input VU


#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (aIn.count > 0 && carlaOptions.processMode != PROCESS_MODE_CONTINUOUS_RACK)
if (aIn.count > 0 && CarlaEngine::processMode != PROCESS_MODE_CONTINUOUS_RACK)
#else #else
if (aIn.count > 0) if (aIn.count > 0)
#endif #endif
@@ -1349,7 +1349,7 @@ public:


// Output VU // Output VU
#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (carlaOptions.processMode != PROCESS_MODE_CONTINUOUS_RACK)
if (CarlaEngine::processMode != PROCESS_MODE_CONTINUOUS_RACK)
#endif #endif
{ {
for (k=0; i < 2 && k < frames; k++) for (k=0; i < 2 && k < frames; k++)
@@ -1703,7 +1703,7 @@ CarlaPlugin* CarlaPlugin::newNative(const initializer& init)


plugin->reload(); plugin->reload();


if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK)
if (CarlaEngine::processMode == PROCESS_MODE_CONTINUOUS_RACK)
{ {
if (! (plugin->hints() & PLUGIN_CAN_FORCE_STEREO)) if (! (plugin->hints() & PLUGIN_CAN_FORCE_STEREO))
{ {


+ 4
- 4
c++/carla-backend/carla_plugin.h View File

@@ -227,7 +227,7 @@ public:
m_filename = nullptr; m_filename = nullptr;


#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK)
if (engine->processMode == PROCESS_MODE_CONTINUOUS_RACK)
m_ctrlInChannel = m_id; m_ctrlInChannel = m_id;
else else
#endif #endif
@@ -769,7 +769,7 @@ public:
{ {
m_id = id; m_id = id;


if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK)
if (x_engine->processMode == PROCESS_MODE_CONTINUOUS_RACK)
m_ctrlInChannel = id; m_ctrlInChannel = id;
} }
#endif #endif
@@ -1452,7 +1452,7 @@ public:
#ifdef BUILD_BRIDGE #ifdef BUILD_BRIDGE
uint32_t maxParameters = MAX_PARAMETERS; uint32_t maxParameters = MAX_PARAMETERS;
#else #else
uint32_t maxParameters = carlaOptions.maxParameters;
uint32_t maxParameters = x_engine->options.maxParameters;
#endif #endif
if (param.count > 0 && param.count < maxParameters) if (param.count > 0 && param.count < maxParameters)
{ {
@@ -1611,7 +1611,7 @@ public:
qWarning("CarlaPlugin::showOscGui()"); qWarning("CarlaPlugin::showOscGui()");


// wait for UI 'update' call // wait for UI 'update' call
for (uint i=0; i < carlaOptions.oscUiTimeout; i++)
for (uint i=0; i < x_engine->options.oscUiTimeout; i++)
{ {
if (osc.data.target) if (osc.data.target)
{ {


+ 11
- 165
c++/carla-backend/carla_shared.cpp View File

@@ -16,6 +16,7 @@
*/ */


#include "carla_shared.h" #include "carla_shared.h"
#include "carla_engine.h"


#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
# include "plugins/carla_native.h" # include "plugins/carla_native.h"
@@ -27,11 +28,6 @@ CARLA_BACKEND_START_NAMESPACE


static const char* carlaLastError = nullptr; static const char* carlaLastError = nullptr;


#ifndef BUILD_BRIDGE
// Global options
carla_options_t carlaOptions;
#endif

// ------------------------------------------------------------------------------------------------------------------- // -------------------------------------------------------------------------------------------------------------------


const char* BinaryType2str(const BinaryType type) const char* BinaryType2str(const BinaryType type)
@@ -312,6 +308,8 @@ const char* CallbackType2str(const CallbackType type)
return "CALLBACK_NSM_OPEN2"; return "CALLBACK_NSM_OPEN2";
case CALLBACK_NSM_SAVE: case CALLBACK_NSM_SAVE:
return "CALLBACK_NSM_SAVE"; return "CALLBACK_NSM_SAVE";
case CALLBACK_ERROR:
return "CALLBACK_ERROR";
case CALLBACK_QUIT: case CALLBACK_QUIT:
return "CALLBACK_QUIT"; return "CALLBACK_QUIT";
} }
@@ -379,14 +377,14 @@ const char* getBinaryBidgePath(const BinaryType type)
switch (type) switch (type)
{ {
#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
case BINARY_POSIX32:
return carlaOptions.bridge_posix32;
case BINARY_POSIX64:
return carlaOptions.bridge_posix64;
case BINARY_WIN32:
return carlaOptions.bridge_win32;
case BINARY_WIN64:
return carlaOptions.bridge_win64;
// case BINARY_POSIX32:
// return CarlaEngine::options.bridge_posix32;
// case BINARY_POSIX64:
// return CarlaEngine::options.bridge_posix64;
// case BINARY_WIN32:
// return CarlaEngine::options.bridge_win32;
// case BINARY_WIN64:
// return CarlaEngine::options.bridge_win64;
#endif #endif
default: default:
return nullptr; return nullptr;
@@ -543,158 +541,6 @@ uint32_t getPluginHintsFromNative(const uint32_t nativeHints)


return realHints; return realHints;
} }

void setOption(const OptionsType option, const int value, const char* const valueStr)
{
qDebug("CarlaBackend::setOption(%s, %i, \"%s\")", OptionsType2str(option), value, valueStr);

switch (option)
{
case OPTION_PROCESS_NAME:
carla_setprocname(valueStr);
break;
case OPTION_PROCESS_MODE:
if (value < PROCESS_MODE_SINGLE_CLIENT || value > PROCESS_MODE_CONTINUOUS_RACK)
return qCritical("CarlaBackend::setOption(%s, %i, \"%s\") - invalid value", OptionsType2str(option), value, valueStr);
carlaOptions.processMode = (ProcessModeType)value;
break;
case OPTION_PROCESS_HIGH_PRECISION:
carlaOptions.processHighPrecision = value;
break;
case OPTION_MAX_PARAMETERS:
carlaOptions.maxParameters = (value > 0) ? value : MAX_PARAMETERS;
break;
case OPTION_PREFERRED_BUFFER_SIZE:
carlaOptions.preferredBufferSize = value;
break;
case OPTION_PREFERRED_SAMPLE_RATE:
carlaOptions.preferredSampleRate = value;
break;
case OPTION_FORCE_STEREO:
carlaOptions.forceStereo = value;
break;
case OPTION_USE_DSSI_VST_CHUNKS:
carlaOptions.useDssiVstChunks = value;
break;
case OPTION_PREFER_PLUGIN_BRIDGES:
carlaOptions.preferPluginBridges = value;
break;
case OPTION_PREFER_UI_BRIDGES:
carlaOptions.preferUiBridges = value;
break;
case OPTION_OSC_UI_TIMEOUT:
carlaOptions.oscUiTimeout = value/100;
break;
case OPTION_PATH_LADSPA:
carla_setenv("LADSPA_PATH", valueStr);
break;
case OPTION_PATH_DSSI:
carla_setenv("DSSI_PATH", valueStr);
break;
case OPTION_PATH_LV2:
carla_setenv("LV2_PATH", valueStr);
break;
case OPTION_PATH_VST:
carla_setenv("VST_PATH", valueStr);
break;
case OPTION_PATH_GIG:
carla_setenv("GIG_PATH", valueStr);
break;
case OPTION_PATH_SF2:
carla_setenv("SF2_PATH", valueStr);
break;
case OPTION_PATH_SFZ:
carla_setenv("SFZ_PATH", valueStr);
break;
case OPTION_PATH_BRIDGE_POSIX32:
carlaOptions.bridge_posix32 = strdup(valueStr);
break;
case OPTION_PATH_BRIDGE_POSIX64:
carlaOptions.bridge_posix64 = strdup(valueStr);
break;
case OPTION_PATH_BRIDGE_WIN32:
carlaOptions.bridge_win32 = strdup(valueStr);
break;
case OPTION_PATH_BRIDGE_WIN64:
carlaOptions.bridge_win64 = strdup(valueStr);
break;
case OPTION_PATH_BRIDGE_LV2_GTK2:
carlaOptions.bridge_lv2gtk2 = strdup(valueStr);
break;
case OPTION_PATH_BRIDGE_LV2_GTK3:
carlaOptions.bridge_lv2gtk3 = strdup(valueStr);
break;
case OPTION_PATH_BRIDGE_LV2_QT4:
carlaOptions.bridge_lv2qt4 = strdup(valueStr);
break;
case OPTION_PATH_BRIDGE_LV2_X11:
carlaOptions.bridge_lv2x11 = strdup(valueStr);
break;
case OPTION_PATH_BRIDGE_VST_HWND:
carlaOptions.bridge_vsthwnd = strdup(valueStr);
break;
case OPTION_PATH_BRIDGE_VST_X11:
carlaOptions.bridge_vstx11 = strdup(valueStr);
break;
}
}

void resetOptions()
{
qDebug("CarlaBackend::resetOptions()");

if (carlaOptions.bridge_posix32)
free((void*)carlaOptions.bridge_posix32);

if (carlaOptions.bridge_posix64)
free((void*)carlaOptions.bridge_posix64);

if (carlaOptions.bridge_win32)
free((void*)carlaOptions.bridge_win32);

if (carlaOptions.bridge_win64)
free((void*)carlaOptions.bridge_win64);

if (carlaOptions.bridge_lv2gtk2)
free((void*)carlaOptions.bridge_lv2gtk2);

if (carlaOptions.bridge_lv2gtk3)
free((void*)carlaOptions.bridge_lv2gtk3);

if (carlaOptions.bridge_lv2qt4)
free((void*)carlaOptions.bridge_lv2qt4);

if (carlaOptions.bridge_lv2x11)
free((void*)carlaOptions.bridge_lv2x11);

if (carlaOptions.bridge_vsthwnd)
free((void*)carlaOptions.bridge_vsthwnd);

if (carlaOptions.bridge_vstx11)
free((void*)carlaOptions.bridge_vstx11);

carlaOptions.processMode = PROCESS_MODE_MULTIPLE_CLIENTS;
carlaOptions.processHighPrecision = false;
carlaOptions.maxParameters = MAX_PARAMETERS;
carlaOptions.preferredBufferSize = 512;
carlaOptions.preferredSampleRate = 44100;
carlaOptions.forceStereo = false;
carlaOptions.useDssiVstChunks = false;
carlaOptions.preferPluginBridges = false;
carlaOptions.preferUiBridges = true;
carlaOptions.oscUiTimeout = 4000/100;

carlaOptions.bridge_posix32 = nullptr;
carlaOptions.bridge_posix64 = nullptr;
carlaOptions.bridge_win32 = nullptr;
carlaOptions.bridge_win64 = nullptr;
carlaOptions.bridge_lv2gtk2 = nullptr;
carlaOptions.bridge_lv2gtk3 = nullptr;
carlaOptions.bridge_lv2qt4 = nullptr;
carlaOptions.bridge_lv2x11 = nullptr;
carlaOptions.bridge_vsthwnd = nullptr;
carlaOptions.bridge_vstx11 = nullptr;
}
#endif // BUILD_BRIDGE #endif // BUILD_BRIDGE


CARLA_BACKEND_END_NAMESPACE CARLA_BACKEND_END_NAMESPACE

+ 0
- 54
c++/carla-backend/carla_shared.h View File

@@ -52,60 +52,6 @@ void setLastError(const char* const error);


#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
uint32_t getPluginHintsFromNative(const uint32_t nativeHints); uint32_t getPluginHintsFromNative(const uint32_t nativeHints);

void setOption(const OptionsType option, const int value, const char* const valueStr);
void resetOptions();

// Global options
struct carla_options_t {
ProcessModeType processMode;
bool processHighPrecision;

uint maxParameters;
uint preferredBufferSize;
uint preferredSampleRate;

bool forceStereo;
bool useDssiVstChunks;

bool preferPluginBridges;
bool preferUiBridges;
uint oscUiTimeout;

const char* bridge_posix32;
const char* bridge_posix64;
const char* bridge_win32;
const char* bridge_win64;
const char* bridge_lv2gtk2;
const char* bridge_lv2gtk3;
const char* bridge_lv2qt4;
const char* bridge_lv2x11;
const char* bridge_vsthwnd;
const char* bridge_vstx11;

carla_options_t()
: processMode(PROCESS_MODE_MULTIPLE_CLIENTS),
processHighPrecision(false),
maxParameters(MAX_PARAMETERS),
preferredBufferSize(512),
preferredSampleRate(44100),
forceStereo(false),
useDssiVstChunks(false),
preferPluginBridges(false),
preferUiBridges(true),
oscUiTimeout(4000/100),
bridge_posix32(nullptr),
bridge_posix64(nullptr),
bridge_win32(nullptr),
bridge_win64(nullptr),
bridge_lv2gtk2(nullptr),
bridge_lv2gtk3(nullptr),
bridge_lv2qt4(nullptr),
bridge_lv2x11(nullptr),
bridge_vsthwnd(nullptr),
bridge_vstx11(nullptr) {}
};
extern carla_options_t carlaOptions;
#endif #endif


/**@}*/ /**@}*/


+ 10
- 10
c++/carla-backend/dssi.cpp View File

@@ -63,7 +63,7 @@ public:
if (osc.thread) if (osc.thread)
{ {
// Wait a bit first, try safe quit, then force kill // Wait a bit first, try safe quit, then force kill
if (osc.thread->isRunning() && ! osc.thread->wait(carlaOptions.oscUiTimeout * 100))
if (osc.thread->isRunning() && ! osc.thread->wait(x_engine->options.oscUiTimeout * 100))
{ {
qWarning("Failed to properly stop DSSI GUI thread"); qWarning("Failed to properly stop DSSI GUI thread");
osc.thread->terminate(); osc.thread->terminate();
@@ -373,7 +373,7 @@ public:
} }


#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (carlaOptions.forceStereo && (aIns == 1 || aOuts == 1) && ! h2)
if (x_engine->options.forceStereo && (aIns == 1 || aOuts == 1) && ! h2)
{ {
h2 = ldescriptor->instantiate(ldescriptor, sampleRate); h2 = ldescriptor->instantiate(ldescriptor, sampleRate);


@@ -426,7 +426,7 @@ public:
if (LADSPA_IS_PORT_AUDIO(portType)) if (LADSPA_IS_PORT_AUDIO(portType))
{ {
#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS)
if (CarlaEngine::processMode != PROCESS_MODE_MULTIPLE_CLIENTS)
{ {
strcpy(portName, m_name); strcpy(portName, m_name);
strcat(portName, ":"); strcat(portName, ":");
@@ -624,7 +624,7 @@ public:
if (needsCtrlIn) if (needsCtrlIn)
{ {
#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS)
if (CarlaEngine::processMode != PROCESS_MODE_MULTIPLE_CLIENTS)
{ {
strcpy(portName, m_name); strcpy(portName, m_name);
strcat(portName, ":control-in"); strcat(portName, ":control-in");
@@ -639,7 +639,7 @@ public:
if (needsCtrlOut) if (needsCtrlOut)
{ {
#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS)
if (CarlaEngine::processMode != PROCESS_MODE_MULTIPLE_CLIENTS)
{ {
strcpy(portName, m_name); strcpy(portName, m_name);
strcat(portName, ":control-out"); strcat(portName, ":control-out");
@@ -654,7 +654,7 @@ public:
if (mIns == 1) if (mIns == 1)
{ {
#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS)
if (CarlaEngine::processMode != PROCESS_MODE_MULTIPLE_CLIENTS)
{ {
strcpy(portName, m_name); strcpy(portName, m_name);
strcat(portName, ":midi-in"); strcat(portName, ":midi-in");
@@ -677,7 +677,7 @@ public:
m_hints |= PLUGIN_IS_SYNTH; m_hints |= PLUGIN_IS_SYNTH;


#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (carlaOptions.useDssiVstChunks && QString(m_filename).endsWith("dssi-vst.so", Qt::CaseInsensitive))
if (x_engine->options.useDssiVstChunks && QString(m_filename).endsWith("dssi-vst.so", Qt::CaseInsensitive))
{ {
if (descriptor->get_custom_data && descriptor->set_custom_data) if (descriptor->get_custom_data && descriptor->set_custom_data)
m_hints |= PLUGIN_USES_CHUNKS; m_hints |= PLUGIN_USES_CHUNKS;
@@ -869,7 +869,7 @@ public:
// Input VU // Input VU


#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (aIn.count > 0 && carlaOptions.processMode != PROCESS_MODE_CONTINUOUS_RACK)
if (aIn.count > 0 && CarlaEngine::processMode != PROCESS_MODE_CONTINUOUS_RACK)
#else #else
if (aIn.count > 0) if (aIn.count > 0)
#endif #endif
@@ -1360,7 +1360,7 @@ public:


// Output VU // Output VU
#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (carlaOptions.processMode != PROCESS_MODE_CONTINUOUS_RACK)
if (CarlaEngine::processMode != PROCESS_MODE_CONTINUOUS_RACK)
#endif #endif
{ {
for (k=0; i < 2 && k < frames; k++) for (k=0; i < 2 && k < frames; k++)
@@ -1636,7 +1636,7 @@ CarlaPlugin* CarlaPlugin::newDSSI(const initializer& init, const void* const ext
plugin->reload(); plugin->reload();


# ifndef BUILD_BRIDGE # ifndef BUILD_BRIDGE
if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK)
if (CarlaEngine::processMode == PROCESS_MODE_CONTINUOUS_RACK)
{ {
if (! (plugin->hints() & PLUGIN_CAN_FORCE_STEREO)) if (! (plugin->hints() & PLUGIN_CAN_FORCE_STEREO))
{ {


+ 6
- 6
c++/carla-backend/fluidsynth.cpp View File

@@ -419,7 +419,7 @@ public:
// Audio Outputs // Audio Outputs


#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS)
if (CarlaEngine::processMode != PROCESS_MODE_MULTIPLE_CLIENTS)
{ {
strcpy(portName, m_name); strcpy(portName, m_name);
strcat(portName, ":out-left"); strcat(portName, ":out-left");
@@ -432,7 +432,7 @@ public:
aOut.rindexes[0] = 0; aOut.rindexes[0] = 0;


#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS)
if (CarlaEngine::processMode != PROCESS_MODE_MULTIPLE_CLIENTS)
{ {
strcpy(portName, m_name); strcpy(portName, m_name);
strcat(portName, ":out-right"); strcat(portName, ":out-right");
@@ -448,7 +448,7 @@ public:
// MIDI Input // MIDI Input


#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS)
if (CarlaEngine::processMode != PROCESS_MODE_MULTIPLE_CLIENTS)
{ {
strcpy(portName, m_name); strcpy(portName, m_name);
strcat(portName, ":midi-in"); strcat(portName, ":midi-in");
@@ -463,7 +463,7 @@ public:
// Parameters // Parameters


#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS)
if (CarlaEngine::processMode != PROCESS_MODE_MULTIPLE_CLIENTS)
{ {
strcpy(portName, m_name); strcpy(portName, m_name);
strcat(portName, ":control-in"); strcat(portName, ":control-in");
@@ -475,7 +475,7 @@ public:
param.portCin = (CarlaEngineControlPort*)x_client->addPort(CarlaEnginePortTypeControl, portName, true); param.portCin = (CarlaEngineControlPort*)x_client->addPort(CarlaEnginePortTypeControl, portName, true);


#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS)
if (CarlaEngine::processMode != PROCESS_MODE_MULTIPLE_CLIENTS)
{ {
strcpy(portName, m_name); strcpy(portName, m_name);
strcat(portName, ":control-out"); strcat(portName, ":control-out");
@@ -1183,7 +1183,7 @@ public:


// Output VU // Output VU
#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (carlaOptions.processMode != PROCESS_MODE_CONTINUOUS_RACK)
if (CarlaEngine::processMode != PROCESS_MODE_CONTINUOUS_RACK)
#endif #endif
{ {
for (k=0; i < 2 && k < frames; k++) for (k=0; i < 2 && k < frames; k++)


+ 7
- 7
c++/carla-backend/ladspa.cpp View File

@@ -375,7 +375,7 @@ public:
} }


#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (carlaOptions.forceStereo && (aIns == 1 || aOuts == 1) && ! h2)
if (x_engine->options.forceStereo && (aIns == 1 || aOuts == 1) && ! h2)
{ {
h2 = descriptor->instantiate(descriptor, sampleRate); h2 = descriptor->instantiate(descriptor, sampleRate);


@@ -426,7 +426,7 @@ public:
if (LADSPA_IS_PORT_AUDIO(portType)) if (LADSPA_IS_PORT_AUDIO(portType))
{ {
#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS)
if (CarlaEngine::processMode != PROCESS_MODE_MULTIPLE_CLIENTS)
{ {
strcpy(portName, m_name); strcpy(portName, m_name);
strcat(portName, ":"); strcat(portName, ":");
@@ -619,7 +619,7 @@ public:
if (needsCtrlIn) if (needsCtrlIn)
{ {
#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS)
if (CarlaEngine::processMode != PROCESS_MODE_MULTIPLE_CLIENTS)
{ {
strcpy(portName, m_name); strcpy(portName, m_name);
strcat(portName, ":control-in"); strcat(portName, ":control-in");
@@ -634,7 +634,7 @@ public:
if (needsCtrlOut) if (needsCtrlOut)
{ {
#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS)
if (CarlaEngine::processMode != PROCESS_MODE_MULTIPLE_CLIENTS)
{ {
strcpy(portName, m_name); strcpy(portName, m_name);
strcat(portName, ":control-out"); strcat(portName, ":control-out");
@@ -739,7 +739,7 @@ public:
// Input VU // Input VU


#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (aIn.count > 0 && carlaOptions.processMode != PROCESS_MODE_CONTINUOUS_RACK)
if (aIn.count > 0 && CarlaEngine::processMode != PROCESS_MODE_CONTINUOUS_RACK)
#else #else
if (aIn.count > 0) if (aIn.count > 0)
#endif #endif
@@ -1036,7 +1036,7 @@ public:


// Output VU // Output VU
#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (carlaOptions.processMode != PROCESS_MODE_CONTINUOUS_RACK)
if (CarlaEngine::processMode != PROCESS_MODE_CONTINUOUS_RACK)
#endif #endif
{ {
for (k=0; i < 2 && k < frames; k++) for (k=0; i < 2 && k < frames; k++)
@@ -1241,7 +1241,7 @@ CarlaPlugin* CarlaPlugin::newLADSPA(const initializer& init, const void* const e
plugin->reload(); plugin->reload();


# ifndef BUILD_BRIDGE # ifndef BUILD_BRIDGE
if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK)
if (CarlaEngine::processMode == PROCESS_MODE_CONTINUOUS_RACK)
{ {
if (! (plugin->hints() & PLUGIN_CAN_FORCE_STEREO)) if (! (plugin->hints() & PLUGIN_CAN_FORCE_STEREO))
{ {


+ 5
- 5
c++/carla-backend/linuxsampler.cpp View File

@@ -156,7 +156,7 @@ public:
// --------------------------------------- // ---------------------------------------
// Audio Outputs // Audio Outputs


if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS)
if (CarlaEngine::processMode != PROCESS_MODE_MULTIPLE_CLIENTS)
{ {
strcpy(portName, m_name); strcpy(portName, m_name);
strcat(portName, ":out-left"); strcat(portName, ":out-left");
@@ -167,7 +167,7 @@ public:
aOut.ports[0] = (CarlaEngineAudioPort*)x_client->addPort(CarlaEnginePortTypeAudio, portName, false); aOut.ports[0] = (CarlaEngineAudioPort*)x_client->addPort(CarlaEnginePortTypeAudio, portName, false);
aOut.rindexes[0] = 0; aOut.rindexes[0] = 0;


if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS)
if (CarlaEngine::processMode != PROCESS_MODE_MULTIPLE_CLIENTS)
{ {
strcpy(portName, m_name); strcpy(portName, m_name);
strcat(portName, ":out-right"); strcat(portName, ":out-right");
@@ -181,7 +181,7 @@ public:
// --------------------------------------- // ---------------------------------------
// Control Input // Control Input


if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS)
if (CarlaEngine::processMode != PROCESS_MODE_MULTIPLE_CLIENTS)
{ {
strcpy(portName, m_name); strcpy(portName, m_name);
strcat(portName, ":control-in"); strcat(portName, ":control-in");
@@ -194,7 +194,7 @@ public:
// --------------------------------------- // ---------------------------------------
// MIDI Input // MIDI Input


if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS)
if (CarlaEngine::processMode != PROCESS_MODE_MULTIPLE_CLIENTS)
{ {
strcpy(portName, m_name); strcpy(portName, m_name);
strcat(portName, ":midi-in"); strcat(portName, ":midi-in");
@@ -647,7 +647,7 @@ public:


// Output VU // Output VU
#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (carlaOptions.processMode != PROCESS_MODE_CONTINUOUS_RACK)
if (CarlaEngine::processMode != PROCESS_MODE_CONTINUOUS_RACK)
#endif #endif
{ {
for (k=0; i < 2 && k < frames; k++) for (k=0; i < 2 && k < frames; k++)


+ 27
- 27
c++/carla-backend/lv2.cpp View File

@@ -191,18 +191,18 @@ const char* lv2bridge2str(const LV2_Property type)
switch (type) switch (type)
{ {
#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
case LV2_UI_GTK2:
return carlaOptions.bridge_lv2gtk2;
case LV2_UI_GTK3:
return carlaOptions.bridge_lv2gtk3;
case LV2_UI_QT4:
return carlaOptions.bridge_lv2qt4;
case LV2_UI_COCOA:
return nullptr; //carlaOptions.bridge_lv2cocoa;
case LV2_UI_WINDOWS:
return nullptr; //carlaOptions.bridge_lv2hwnd;
case LV2_UI_X11:
return carlaOptions.bridge_lv2x11;
// case LV2_UI_GTK2:
// return x_engine->options.bridge_lv2gtk2;
// case LV2_UI_GTK3:
// return x_engine->options.bridge_lv2gtk3;
// case LV2_UI_QT4:
// return x_engine->options.bridge_lv2qt4;
// case LV2_UI_COCOA:
// return nullptr; //x_engine->options.bridge_lv2cocoa;
// case LV2_UI_WINDOWS:
// return nullptr; //x_engine->options.bridge_lv2hwnd;
// case LV2_UI_X11:
// return x_engine->options.bridge_lv2x11;
#endif #endif
default: default:
return nullptr; return nullptr;
@@ -368,7 +368,7 @@ public:
if (osc.thread) if (osc.thread)
{ {
// Wait a bit first, try safe quit, then force kill // Wait a bit first, try safe quit, then force kill
if (osc.thread->isRunning() && ! osc.thread->wait(carlaOptions.oscUiTimeout * 100))
if (osc.thread->isRunning() && ! osc.thread->wait(x_engine->options.oscUiTimeout * 100))
{ {
qWarning("Failed to properly stop LV2 OSC GUI thread"); qWarning("Failed to properly stop LV2 OSC GUI thread");
osc.thread->terminate(); osc.thread->terminate();
@@ -456,7 +456,7 @@ public:
delete (LV2_Worker_Schedule*)features[lv2_feature_id_worker]->data; delete (LV2_Worker_Schedule*)features[lv2_feature_id_worker]->data;


#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (! carlaOptions.processHighPrecision)
if (! x_engine->options.processHighPrecision)
#endif #endif
{ {
features[lv2_feature_id_bufsize_fixed] = nullptr; features[lv2_feature_id_bufsize_fixed] = nullptr;
@@ -1220,7 +1220,7 @@ public:
} }


#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (carlaOptions.forceStereo && (aIns == 1 || aOuts == 1) && ! (h2 || ext.state || ext.worker))
if (x_engine->options.forceStereo && (aIns == 1 || aOuts == 1) && ! (h2 || ext.state || ext.worker))
{ {
h2 = descriptor->instantiate(descriptor, sampleRate, rdf_descriptor->Bundle, features); h2 = descriptor->instantiate(descriptor, sampleRate, rdf_descriptor->Bundle, features);


@@ -1337,7 +1337,7 @@ public:
if (LV2_IS_PORT_AUDIO(portType) || LV2_IS_PORT_ATOM_SEQUENCE(portType) || LV2_IS_PORT_CV(portType) || LV2_IS_PORT_EVENT(portType) || LV2_IS_PORT_MIDI_LL(portType)) if (LV2_IS_PORT_AUDIO(portType) || LV2_IS_PORT_ATOM_SEQUENCE(portType) || LV2_IS_PORT_CV(portType) || LV2_IS_PORT_EVENT(portType) || LV2_IS_PORT_MIDI_LL(portType))
{ {
#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS)
if (CarlaEngine::processMode != PROCESS_MODE_MULTIPLE_CLIENTS)
{ {
strcpy(portName, m_name); strcpy(portName, m_name);
strcat(portName, ":"); strcat(portName, ":");
@@ -1719,7 +1719,7 @@ public:
if (needsCtrlIn) if (needsCtrlIn)
{ {
#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS)
if (CarlaEngine::processMode != PROCESS_MODE_MULTIPLE_CLIENTS)
{ {
strcpy(portName, m_name); strcpy(portName, m_name);
strcat(portName, ":control-in"); strcat(portName, ":control-in");
@@ -1734,7 +1734,7 @@ public:
if (needsCtrlOut) if (needsCtrlOut)
{ {
#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS)
if (CarlaEngine::processMode != PROCESS_MODE_MULTIPLE_CLIENTS)
{ {
strcpy(portName, m_name); strcpy(portName, m_name);
strcat(portName, ":control-out"); strcat(portName, ":control-out");
@@ -2000,7 +2000,7 @@ public:
// Input VU // Input VU


#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (aIn.count > 0 && carlaOptions.processMode != PROCESS_MODE_CONTINUOUS_RACK)
if (aIn.count > 0 && CarlaEngine::processMode != PROCESS_MODE_CONTINUOUS_RACK)
#else #else
if (aIn.count > 0) if (aIn.count > 0)
#endif #endif
@@ -2692,7 +2692,7 @@ public:


// Output VU // Output VU
#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (carlaOptions.processMode != PROCESS_MODE_CONTINUOUS_RACK)
if (CarlaEngine::processMode != PROCESS_MODE_CONTINUOUS_RACK)
#endif #endif
{ {
for (k=0; i < 2 && k < frames; k++) for (k=0; i < 2 && k < frames; k++)
@@ -3981,7 +3981,7 @@ public:
features[lv2_feature_id_bufsize_bounded]->data = nullptr; features[lv2_feature_id_bufsize_bounded]->data = nullptr;


#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (carlaOptions.processHighPrecision)
if (x_engine->options.processHighPrecision)
{ {
features[lv2_feature_id_bufsize_fixed] = new LV2_Feature; features[lv2_feature_id_bufsize_fixed] = new LV2_Feature;
features[lv2_feature_id_bufsize_fixed]->URI = LV2_BUF_SIZE__fixedBlockLength; features[lv2_feature_id_bufsize_fixed]->URI = LV2_BUF_SIZE__fixedBlockLength;
@@ -4218,7 +4218,7 @@ public:
{ {
case LV2_UI_QT4: case LV2_UI_QT4:
#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (isUiBridgeable(i) && carlaOptions.preferUiBridges)
if (isUiBridgeable(i) && x_engine->options.preferUiBridges)
eQt4 = i; eQt4 = i;
#endif #endif
iQt4 = i; iQt4 = i;
@@ -4226,7 +4226,7 @@ public:


case LV2_UI_COCOA: case LV2_UI_COCOA:
#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (isUiBridgeable(i) && carlaOptions.preferUiBridges)
if (isUiBridgeable(i) && x_engine->options.preferUiBridges)
eCocoa = i; eCocoa = i;
#endif #endif
iCocoa = i; iCocoa = i;
@@ -4234,7 +4234,7 @@ public:


case LV2_UI_WINDOWS: case LV2_UI_WINDOWS:
#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (isUiBridgeable(i) && carlaOptions.preferUiBridges)
if (isUiBridgeable(i) && x_engine->options.preferUiBridges)
eHWND = i; eHWND = i;
#endif #endif
iHWND = i; iHWND = i;
@@ -4242,7 +4242,7 @@ public:


case LV2_UI_X11: case LV2_UI_X11:
#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (isUiBridgeable(i) && carlaOptions.preferUiBridges)
if (isUiBridgeable(i) && x_engine->options.preferUiBridges)
eX11 = i; eX11 = i;
#endif #endif
iX11 = i; iX11 = i;
@@ -4253,7 +4253,7 @@ public:
if (false) if (false)
#else #else
# ifdef HAVE_SUIL # ifdef HAVE_SUIL
if (isUiBridgeable(i) && carlaOptions.preferUiBridges)
if (isUiBridgeable(i) && x_engine->options.preferUiBridges)
# else # else
if (isUiBridgeable(i)) if (isUiBridgeable(i))
# endif # endif
@@ -4688,7 +4688,7 @@ CarlaPlugin* CarlaPlugin::newLV2(const initializer& init)
plugin->reload(); plugin->reload();


# ifndef BUILD_BRIDGE # ifndef BUILD_BRIDGE
if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK)
if (CarlaEngine::processMode == PROCESS_MODE_CONTINUOUS_RACK)
{ {
if (! (plugin->hints() & PLUGIN_CAN_FORCE_STEREO)) if (! (plugin->hints() & PLUGIN_CAN_FORCE_STEREO))
{ {


+ 18
- 18
c++/carla-backend/vst.cpp View File

@@ -98,7 +98,7 @@ public:
if (osc.thread) if (osc.thread)
{ {
// Wait a bit first, try safe quit, then force kill // Wait a bit first, try safe quit, then force kill
if (osc.thread->isRunning() && ! osc.thread->wait(carlaOptions.oscUiTimeout * 100))
if (osc.thread->isRunning() && ! osc.thread->wait(x_engine->options.oscUiTimeout * 100))
{ {
qWarning("Failed to properly stop VST OSC GUI thread"); qWarning("Failed to properly stop VST OSC GUI thread");
osc.thread->terminate(); osc.thread->terminate();
@@ -523,7 +523,7 @@ public:
for (j=0; j < aIns; j++) for (j=0; j < aIns; j++)
{ {
#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS)
if (CarlaEngine::processMode != PROCESS_MODE_MULTIPLE_CLIENTS)
sprintf(portName, "%s:input_%02i", m_name, j+1); sprintf(portName, "%s:input_%02i", m_name, j+1);
else else
#endif #endif
@@ -536,7 +536,7 @@ public:
for (j=0; j < aOuts; j++) for (j=0; j < aOuts; j++)
{ {
#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS)
if (CarlaEngine::processMode != PROCESS_MODE_MULTIPLE_CLIENTS)
sprintf(portName, "%s:output_%02i", m_name, j+1); sprintf(portName, "%s:output_%02i", m_name, j+1);
else else
#endif #endif
@@ -664,7 +664,7 @@ public:
if (needsCtrlIn) if (needsCtrlIn)
{ {
#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS)
if (CarlaEngine::processMode != PROCESS_MODE_MULTIPLE_CLIENTS)
{ {
strcpy(portName, m_name); strcpy(portName, m_name);
strcat(portName, ":control-in"); strcat(portName, ":control-in");
@@ -679,7 +679,7 @@ public:
if (mIns == 1) if (mIns == 1)
{ {
#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS)
if (CarlaEngine::processMode != PROCESS_MODE_MULTIPLE_CLIENTS)
{ {
strcpy(portName, m_name); strcpy(portName, m_name);
strcat(portName, ":midi-in"); strcat(portName, ":midi-in");
@@ -694,7 +694,7 @@ public:
if (mOuts == 1) if (mOuts == 1)
{ {
#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS)
if (CarlaEngine::processMode != PROCESS_MODE_MULTIPLE_CLIENTS)
{ {
strcpy(portName, m_name); strcpy(portName, m_name);
strcat(portName, ":midi-out"); strcat(portName, ":midi-out");
@@ -893,7 +893,7 @@ public:
// Input VU // Input VU


#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (aIn.count > 0 && carlaOptions.processMode != PROCESS_MODE_CONTINUOUS_RACK)
if (aIn.count > 0 && CarlaEngine::processMode != PROCESS_MODE_CONTINUOUS_RACK)
#else #else
if (aIn.count > 0) if (aIn.count > 0)
#endif #endif
@@ -1347,7 +1347,7 @@ public:


// Output VU // Output VU
#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (carlaOptions.processMode != PROCESS_MODE_CONTINUOUS_RACK)
if (CarlaEngine::processMode != PROCESS_MODE_CONTINUOUS_RACK)
#endif #endif
{ {
for (k=0; i < 2 && k < frames; k++) for (k=0; i < 2 && k < frames; k++)
@@ -1603,7 +1603,7 @@ public:
return 1; return 1;


#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK)
if (CarlaEngine::processMode == PROCESS_MODE_CONTINUOUS_RACK)
{ {
qCritical("VstPlugin::handleAudioMasterIOChanged() - plugin asked IO change, but it's not supported in rack mode"); qCritical("VstPlugin::handleAudioMasterIOChanged() - plugin asked IO change, but it's not supported in rack mode");
return 0; return 0;
@@ -1744,7 +1744,7 @@ public:
if (strcmp(feature, "acceptIOChanges") == 0) if (strcmp(feature, "acceptIOChanges") == 0)
{ {
#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK)
if (CarlaEngine::processMode == PROCESS_MODE_CONTINUOUS_RACK)
return -1; return -1;
#endif #endif
return 1; return 1;
@@ -1955,7 +1955,7 @@ public:
#ifdef BUILD_BRIDGE #ifdef BUILD_BRIDGE
ret = MAX_PARAMETERS; ret = MAX_PARAMETERS;
#else #else
ret = carlaOptions.maxParameters;
ret = 0; //x_engine->options.maxParameters;
#endif #endif
if (effect && ret > effect->numParams) if (effect && ret > effect->numParams)
ret = effect->numParams; ret = effect->numParams;
@@ -2014,11 +2014,11 @@ public:
else else
qWarning("VstPlugin::hostCallback::audioMasterGetBlockSize called without valid object"); qWarning("VstPlugin::hostCallback::audioMasterGetBlockSize called without valid object");
if (ret == 0) if (ret == 0)
#ifndef BUILD_BRIDGE
ret = carlaOptions.processHighPrecision ? 8 : 512;
#else
//#ifndef BUILD_BRIDGE
// ret = CarlaEngine::processHighPrecision ? 8 : 512;
//#else
ret = 512; ret = 512;
#endif
//#endif
break; break;


case audioMasterGetInputLatency: case audioMasterGetInputLatency:
@@ -2312,10 +2312,10 @@ public:
m_hints |= PLUGIN_HAS_GUI; m_hints |= PLUGIN_HAS_GUI;


#if defined(Q_OS_LINUX) && ! defined(BUILD_BRIDGE) #if defined(Q_OS_LINUX) && ! defined(BUILD_BRIDGE)
if (carlaOptions.bridge_vstx11 && carlaOptions.preferUiBridges && ! (effect->flags & effFlagsProgramChunks))
if (x_engine->options.bridge_vstx11 && x_engine->options.preferUiBridges && ! (effect->flags & effFlagsProgramChunks))
{ {
osc.thread = new CarlaPluginThread(x_engine, this, CarlaPluginThread::PLUGIN_THREAD_VST_GUI); osc.thread = new CarlaPluginThread(x_engine, this, CarlaPluginThread::PLUGIN_THREAD_VST_GUI);
osc.thread->setOscData(carlaOptions.bridge_vstx11, label);
osc.thread->setOscData(x_engine->options.bridge_vstx11, label);
gui.type = GUI_EXTERNAL_OSC; gui.type = GUI_EXTERNAL_OSC;
} }
else else
@@ -2402,7 +2402,7 @@ CarlaPlugin* CarlaPlugin::newVST(const initializer& init)
plugin->reload(); plugin->reload();


# ifndef BUILD_BRIDGE # ifndef BUILD_BRIDGE
if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK)
if (CarlaEngine::processMode == PROCESS_MODE_CONTINUOUS_RACK)
{ {
if (! (plugin->hints() & PLUGIN_CAN_FORCE_STEREO)) if (! (plugin->hints() & PLUGIN_CAN_FORCE_STEREO))
{ {


+ 68
- 65
c++/carla-includes/carla_includes.h View File

@@ -19,101 +19,104 @@
#define CARLA_INCLUDES_H #define CARLA_INCLUDES_H


#ifdef __WINE__ #ifdef __WINE__
# define Q_CORE_EXPORT
# define Q_GUI_EXPORT
# define QT_NO_STL
# define Q_CORE_EXPORT
# define Q_GUI_EXPORT
# define QT_NO_STL
#endif #endif


#include <QtCore/Qt> #include <QtCore/Qt>


// TESTING - remove later
// TESTING - remove later (QtCreator doesn't fully support this)
#ifdef QTCREATOR_TEST #ifdef QTCREATOR_TEST
# undef Q_COMPILER_INITIALIZER_LISTS
# undef Q_COMPILER_INITIALIZER_LISTS
#endif #endif


// If the compiler can't do C++11 lambdas, it most likely doesn't know about nullptr either
#ifndef Q_COMPILER_LAMBDA #ifndef Q_COMPILER_LAMBDA
# define nullptr (0)
# define nullptr (0)
#endif #endif


// Common includes and macros
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
# include <winsock2.h>
# include <windows.h>
# define uintptr_t size_t // FIXME
# define carla_sleep(t) Sleep(t * 1000)
# define carla_msleep(t) Sleep(t)
# define carla_usleep(t) Sleep(t / 1000)
# define carla_setenv(key, value) SetEnvironmentVariableA(key, value)
# include <winsock2.h>
# include <windows.h>
//# define uintptr_t size_t // FIXME
# define carla_sleep(t) Sleep(t * 1000)
# define carla_msleep(t) Sleep(t)
# define carla_usleep(t) Sleep(t / 1000)
# define carla_setenv(key, value) SetEnvironmentVariableA(key, value)
#else #else
# include <dlfcn.h>
# include <unistd.h>
# define carla_sleep(t) sleep(t)
# define carla_msleep(t) usleep(t * 1000)
# define carla_usleep(t) usleep(t)
# define carla_setenv(key, value) setenv(key, value, 1)
# ifndef __cdecl
# define __cdecl
# endif
# include <dlfcn.h>
# include <unistd.h>
# define carla_sleep(t) sleep(t)
# define carla_msleep(t) usleep(t * 1000)
# define carla_usleep(t) usleep(t)
# define carla_setenv(key, value) setenv(key, value, 1)
# ifndef __cdecl
# define __cdecl
# endif
#endif #endif


// needed for qDebug/Warning/Critical sections
// ..., needed for qDebug/Warning/Critical sections
#if defined(Q_OS_WIN64) && ! defined(__WINE__) #if defined(Q_OS_WIN64) && ! defined(__WINE__)
# define P_INT64 "%I64i"
# define P_INTPTR "%I64i"
# define P_UINTPTR "%I64x"
# define P_SIZE "%I64u"
# define P_INT64 "%I64i"
# define P_INTPTR "%I64i"
# define P_UINTPTR "%I64x"
# define P_SIZE "%I64u"
#elif __WORDSIZE == 64 #elif __WORDSIZE == 64
# define P_INT64 "%li"
# define P_INTPTR "%li"
# define P_UINTPTR "%lx"
# define P_SIZE "%lu"
# define P_INT64 "%li"
# define P_INTPTR "%li"
# define P_UINTPTR "%lx"
# define P_SIZE "%lu"
#else #else
# define P_INT64 "%lli"
# define P_INTPTR "%i"
# define P_UINTPTR "%x"
# define P_SIZE "%u"
# define P_INT64 "%lli"
# define P_INTPTR "%i"
# define P_UINTPTR "%x"
# define P_SIZE "%u"
#endif #endif


// set native binary type
// Define BINARY_NATIVE
#if defined(Q_OS_HAIKU) || defined(Q_OS_UNIX) #if defined(Q_OS_HAIKU) || defined(Q_OS_UNIX)
# ifdef __LP64__
# define BINARY_NATIVE BINARY_POSIX64
# else
# define BINARY_NATIVE BINARY_POSIX32
# endif
# ifdef __LP64__
# define BINARY_NATIVE BINARY_POSIX64
# else
# define BINARY_NATIVE BINARY_POSIX32
# endif
#elif defined(Q_OS_WIN) #elif defined(Q_OS_WIN)
# ifdef Q_OS_WIN64
# define BINARY_NATIVE BINARY_WIN64
# else
# define BINARY_NATIVE BINARY_WIN32
# endif
# ifdef Q_OS_WIN64
# define BINARY_NATIVE BINARY_WIN64
# else
# define BINARY_NATIVE BINARY_WIN32
# endif
#else #else
# warning Unknown binary type
# define BINARY_NATIVE BINARY_OTHER
# warning Unknown binary type
# define BINARY_NATIVE BINARY_OTHER
#endif #endif


// export symbols if needed
#ifdef BUILD_BRIDGE
# define CARLA_EXPORT extern "C"
// Define CARLA_ASSERT*
#ifdef NDEBUG
# define CARLA_ASSERT(cond) ((!(cond)) ? carla_assert(#cond, __FILE__, __LINE__) : pass())
# define CARLA_ASSERT_INT(cond, value) ((!(cond)) ? carla_assert_int(#cond, __FILE__, __LINE__, value) : pass())
#else #else
# if defined(Q_OS_WIN) && ! defined(__WINE__)
# define CARLA_EXPORT extern "C" __declspec (dllexport)
# else
# define CARLA_EXPORT extern "C" __attribute__ ((visibility("default")))
# endif
# define CARLA_ASSERT Q_ASSERT
# define CARLA_ASSERT_INT(cond, value) Q_ASSERT(cond)
#endif #endif


#ifdef NDEBUG
# define CARLA_ASSERT(cond) ((!(cond)) ? carla_assert(#cond, __FILE__, __LINE__) : pass())
# define CARLA_ASSERT_INT(cond, value) ((!(cond)) ? carla_assert_int(#cond, __FILE__, __LINE__, value) : pass())
// Export symbols if needed
#ifdef BUILD_BRIDGE
# define CARLA_EXPORT extern "C"
#else #else
# define CARLA_ASSERT Q_ASSERT
# define CARLA_ASSERT_INT(cond, value) Q_ASSERT(cond)
# if defined(Q_OS_WIN) && ! defined(__WINE__)
# define CARLA_EXPORT extern "C" __declspec (dllexport)
# else
# define CARLA_EXPORT extern "C" __attribute__ ((visibility("default")))
# endif
#endif #endif


// carla_setprocname
// Inline functions
#ifdef Q_OS_LINUX #ifdef Q_OS_LINUX
# include <sys/prctl.h>
# include <linux/prctl.h>
# include <sys/prctl.h>
# include <linux/prctl.h>
static inline static inline
void carla_setprocname(const char* const name) void carla_setprocname(const char* const name)
{ {
@@ -121,7 +124,7 @@ void carla_setprocname(const char* const name)
} }
#else #else
static inline static inline
void carla_setprocname(const char* const /*name*/)
void carla_setprocname(const char* const)
{ {
} }
#endif #endif


Loading…
Cancel
Save