| @@ -64,10 +64,10 @@ public: | |||
| memcpy(prevParamBuffers, paramBuffers, sizeof(float)*paramCount); | |||
| // 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"); | |||
| // Force thread start so we get some OSC usage | |||
| @@ -193,7 +193,7 @@ bool engine_close() | |||
| get_midi_program_name(0, 0); | |||
| get_real_plugin_name(0); | |||
| CarlaBackend::resetOptions(); | |||
| carlaEngine->resetOptions(); | |||
| CarlaBackend::setLastError(nullptr); | |||
| 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); | |||
| CarlaBackend::setOption(option, value, value_str); | |||
| if (carlaEngine) | |||
| carlaEngine->setOption(option, value, value_str); | |||
| } | |||
| // ------------------------------------------------------------------------------------------------------------------- | |||
| @@ -313,7 +313,7 @@ public: | |||
| } | |||
| // 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) | |||
| { | |||
| @@ -84,7 +84,7 @@ int CarlaEngine::maxClientNameSize() | |||
| { | |||
| #ifdef CARLA_ENGINE_JACK | |||
| # ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processMode != PROCESS_MODE_CONTINUOUS_RACK) | |||
| if (processMode != PROCESS_MODE_CONTINUOUS_RACK) | |||
| # endif | |||
| return jackbridge_client_name_size(); | |||
| #endif | |||
| @@ -95,7 +95,7 @@ int CarlaEngine::maxPortNameSize() | |||
| { | |||
| #ifdef CARLA_ENGINE_JACK | |||
| # ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processMode != PROCESS_MODE_CONTINUOUS_RACK) | |||
| if (processMode != PROCESS_MODE_CONTINUOUS_RACK) | |||
| # endif | |||
| return jackbridge_port_name_size(); | |||
| #endif | |||
| @@ -225,6 +225,165 @@ CarlaEngine* CarlaEngine::newDriverByName(const char* driverName) | |||
| 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 | |||
| @@ -377,7 +536,7 @@ short CarlaEngine::addPlugin(const BinaryType btype, const PluginType ptype, con | |||
| #ifdef BUILD_BRIDGE | |||
| m_maxPluginNumber = MAX_PLUGINS; | |||
| #else | |||
| m_maxPluginNumber = (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK) ? 16 : MAX_PLUGINS; | |||
| m_maxPluginNumber = (processMode == PROCESS_MODE_CONTINUOUS_RACK) ? 16 : MAX_PLUGINS; | |||
| #endif | |||
| } | |||
| @@ -391,10 +550,10 @@ short CarlaEngine::addPlugin(const BinaryType btype, const PluginType ptype, con | |||
| CarlaPlugin* plugin = nullptr; | |||
| #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 | |||
| 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"); | |||
| return -1; | |||
| @@ -489,7 +648,7 @@ bool CarlaEngine::removePlugin(const unsigned short id) | |||
| #ifndef BUILD_BRIDGE | |||
| osc_send_control_remove_plugin(id); | |||
| if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||
| if (processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||
| { | |||
| // TODO - handle OSC server comm | |||
| @@ -599,7 +758,7 @@ void CarlaEngine::processRack(float* inBuf[2], float* outBuf[2], uint32_t frames | |||
| plugin->initBuffers(); | |||
| if (carlaOptions.processHighPrecision) | |||
| if (options.processHighPrecision) | |||
| { | |||
| float* inBuf2[2]; | |||
| float* outBuf2[2]; | |||
| @@ -862,7 +1021,7 @@ CarlaEngineClient::~CarlaEngineClient() | |||
| CARLA_ASSERT(! m_active); | |||
| #ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processMode == PROCESS_MODE_MULTIPLE_CLIENTS) | |||
| if (CarlaEngine::processMode == PROCESS_MODE_MULTIPLE_CLIENTS) | |||
| #endif | |||
| { | |||
| #ifdef CARLA_ENGINE_JACK | |||
| @@ -878,7 +1037,7 @@ void CarlaEngineClient::activate() | |||
| CARLA_ASSERT(! m_active); | |||
| #ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processMode == PROCESS_MODE_MULTIPLE_CLIENTS) | |||
| if (CarlaEngine::processMode == PROCESS_MODE_MULTIPLE_CLIENTS) | |||
| #endif | |||
| { | |||
| if (! m_active) | |||
| @@ -899,7 +1058,7 @@ void CarlaEngineClient::deactivate() | |||
| CARLA_ASSERT(m_active); | |||
| #ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processMode == PROCESS_MODE_MULTIPLE_CLIENTS) | |||
| if (CarlaEngine::processMode == PROCESS_MODE_MULTIPLE_CLIENTS) | |||
| #endif | |||
| { | |||
| if (m_active) | |||
| @@ -926,7 +1085,7 @@ bool CarlaEngineClient::isOk() const | |||
| qDebug("CarlaEngineClient::isOk()"); | |||
| #ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processMode != PROCESS_MODE_CONTINUOUS_RACK) | |||
| if (CarlaEngine::processMode != PROCESS_MODE_CONTINUOUS_RACK) | |||
| #endif | |||
| { | |||
| #ifdef CARLA_ENGINE_JACK | |||
| @@ -948,7 +1107,7 @@ void CarlaEngineClient::setLatency(const uint32_t samples) | |||
| m_latency = samples; | |||
| #ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processMode != PROCESS_MODE_CONTINUOUS_RACK) | |||
| if (CarlaEngine::processMode != PROCESS_MODE_CONTINUOUS_RACK) | |||
| #endif | |||
| { | |||
| #ifdef CARLA_ENGINE_JACK | |||
| @@ -968,7 +1127,7 @@ const CarlaEngineBasePort* CarlaEngineClient::addPort(const CarlaEnginePortType | |||
| #endif | |||
| #ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processMode != PROCESS_MODE_CONTINUOUS_RACK) | |||
| if (CarlaEngine::processMode != PROCESS_MODE_CONTINUOUS_RACK) | |||
| #endif | |||
| { | |||
| #ifdef CARLA_ENGINE_JACK | |||
| @@ -1019,7 +1178,7 @@ CarlaEngineBasePort::~CarlaEngineBasePort() | |||
| qDebug("CarlaEngineBasePort::~CarlaEngineBasePort()"); | |||
| #ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||
| if (CarlaEngine::processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||
| return; | |||
| #endif | |||
| @@ -1046,7 +1205,7 @@ void CarlaEngineAudioPort::initBuffer(CarlaEngine* const /*engine*/) | |||
| float* CarlaEngineAudioPort::getJackAudioBuffer(uint32_t nframes) | |||
| { | |||
| # ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||
| if (CarlaEngine::processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||
| return nullptr; | |||
| # endif | |||
| CARLA_ASSERT(handle.jackPort); | |||
| @@ -1068,7 +1227,7 @@ void CarlaEngineControlPort::initBuffer(CarlaEngine* const engine) | |||
| CARLA_ASSERT(engine); | |||
| #ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||
| if (CarlaEngine::processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||
| { | |||
| buffer = isInput ? engine->rackControlEventsIn : engine->rackControlEventsOut; | |||
| return; | |||
| @@ -1094,7 +1253,7 @@ uint32_t CarlaEngineControlPort::getEventCount() | |||
| CARLA_ASSERT(buffer); | |||
| #ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||
| if (CarlaEngine::processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||
| { | |||
| uint32_t count = 0; | |||
| const CarlaEngineControlEvent* const events = (CarlaEngineControlEvent*)buffer; | |||
| @@ -1129,7 +1288,7 @@ const CarlaEngineControlEvent* CarlaEngineControlPort::getEvent(uint32_t index) | |||
| #ifndef BUILD_BRIDGE | |||
| 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; | |||
| @@ -1207,7 +1366,7 @@ void CarlaEngineControlPort::writeEvent(CarlaEngineControlEventType type, uint32 | |||
| CARLA_ASSERT(type != CarlaEngineEventNull); | |||
| #ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||
| if (CarlaEngine::processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||
| { | |||
| CarlaEngineControlEvent* const events = (CarlaEngineControlEvent*)buffer; | |||
| @@ -1286,7 +1445,7 @@ void CarlaEngineMidiPort::initBuffer(CarlaEngine* const engine) | |||
| CARLA_ASSERT(engine); | |||
| #ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||
| if (CarlaEngine::processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||
| { | |||
| buffer = isInput ? engine->rackMidiEventsIn : engine->rackMidiEventsOut; | |||
| return; | |||
| @@ -1312,7 +1471,7 @@ uint32_t CarlaEngineMidiPort::getEventCount() | |||
| CARLA_ASSERT(buffer); | |||
| #ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||
| if (CarlaEngine::processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||
| { | |||
| uint32_t count = 0; | |||
| const CarlaEngineMidiEvent* const events = (CarlaEngineMidiEvent*)buffer; | |||
| @@ -1347,7 +1506,7 @@ const CarlaEngineMidiEvent* CarlaEngineMidiPort::getEvent(uint32_t index) | |||
| #ifndef BUILD_BRIDGE | |||
| 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; | |||
| @@ -1387,7 +1546,7 @@ void CarlaEngineMidiPort::writeEvent(uint32_t time, const uint8_t* data, uint8_t | |||
| CARLA_ASSERT(size > 0); | |||
| #ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||
| if (CarlaEngine::processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||
| { | |||
| if (size > 4) | |||
| return; | |||
| @@ -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; | |||
| @@ -198,6 +248,17 @@ public: | |||
| static const char* getDriverName(unsigned int index); | |||
| 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 | |||
| @@ -82,7 +82,7 @@ public: | |||
| jackbridge_set_latency_callback(client, carla_jack_latency_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[rackPortAudioIn2] = jackbridge_port_register(client, "in2", JACK_DEFAULT_AUDIO_TYPE, JackPortIsInput, 0); | |||
| @@ -134,7 +134,7 @@ public: | |||
| #else | |||
| 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[rackPortAudioIn2]); | |||
| @@ -190,11 +190,11 @@ public: | |||
| jackbridge_set_latency_callback(handle.jackClient, carla_jack_latency_callback, this); | |||
| jackbridge_on_shutdown(client, carla_jack_shutdown_callback, this); | |||
| #else | |||
| if (carlaOptions.processMode == PROCESS_MODE_SINGLE_CLIENT) | |||
| if (processMode == PROCESS_MODE_SINGLE_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); | |||
| jackbridge_set_process_callback(handle.jackClient, carla_jack_process_callback_plugin, plugin); | |||
| @@ -216,7 +216,7 @@ protected: | |||
| void handleBufferSizeCallback(uint32_t newBufferSize) | |||
| { | |||
| #ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processHighPrecision) | |||
| if (options.processHighPrecision) | |||
| return; | |||
| #endif | |||
| @@ -265,7 +265,7 @@ protected: | |||
| } | |||
| #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++) | |||
| { | |||
| @@ -287,7 +287,7 @@ protected: | |||
| plugin->engineProcessUnlock(); | |||
| } | |||
| } | |||
| else if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||
| else if (processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||
| { | |||
| // get buffers from jack | |||
| float* audioIn1 = (float*)jackbridge_port_get_buffer(rackJackPorts[rackPortAudioIn1], nframes); | |||
| @@ -477,7 +477,7 @@ protected: | |||
| void handleLatencyCallback(jack_latency_callback_mode_t mode) | |||
| { | |||
| #ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processMode != PROCESS_MODE_SINGLE_CLIENT) | |||
| if (processMode != PROCESS_MODE_SINGLE_CLIENT) | |||
| return; | |||
| #endif | |||
| @@ -542,7 +542,7 @@ private: | |||
| outBuffer[i] = p->aOut.ports[i]->getJackAudioBuffer(nframes); | |||
| #ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processHighPrecision) | |||
| if (/*options.processHighPrecision*/ 0) | |||
| { | |||
| float* inBuffer2[p->aIn.count]; | |||
| float* outBuffer2[p->aOut.count]; | |||
| @@ -39,8 +39,8 @@ public: | |||
| midiOut = nullptr; | |||
| // just to make sure | |||
| carlaOptions.forceStereo = true; | |||
| carlaOptions.processMode = PROCESS_MODE_CONTINUOUS_RACK; | |||
| options.forceStereo = true; | |||
| processMode = PROCESS_MODE_CONTINUOUS_RACK; | |||
| } | |||
| ~CarlaEngineRtAudio() | |||
| @@ -60,8 +60,8 @@ public: | |||
| return false; | |||
| } | |||
| bufferSize = carlaOptions.preferredBufferSize; | |||
| sampleRate = carlaOptions.preferredSampleRate; | |||
| bufferSize = options.preferredBufferSize; | |||
| sampleRate = options.preferredSampleRate; | |||
| RtAudio::StreamParameters iParams, oParams; | |||
| //iParams.deviceId = 3; | |||
| @@ -506,7 +506,7 @@ public: | |||
| 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); | |||
| @@ -565,7 +565,7 @@ public: | |||
| 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); | |||
| strcat(portName, ":"); | |||
| @@ -727,7 +727,7 @@ public: | |||
| if (needsCtrlIn) | |||
| { | |||
| if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||
| if (CarlaEngine::processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||
| { | |||
| strcpy(portName, m_name); | |||
| strcat(portName, ":control-in"); | |||
| @@ -740,7 +740,7 @@ public: | |||
| if (needsCtrlOut) | |||
| { | |||
| if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||
| if (CarlaEngine::processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||
| { | |||
| strcpy(portName, m_name); | |||
| strcat(portName, ":control-out"); | |||
| @@ -896,7 +896,7 @@ public: | |||
| // Input VU | |||
| #ifndef BUILD_BRIDGE | |||
| if (aIn.count > 0 && carlaOptions.processMode != PROCESS_MODE_CONTINUOUS_RACK) | |||
| if (aIn.count > 0 && CarlaEngine::processMode != PROCESS_MODE_CONTINUOUS_RACK) | |||
| #else | |||
| if (aIn.count > 0) | |||
| #endif | |||
| @@ -1349,7 +1349,7 @@ public: | |||
| // Output VU | |||
| #ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processMode != PROCESS_MODE_CONTINUOUS_RACK) | |||
| if (CarlaEngine::processMode != PROCESS_MODE_CONTINUOUS_RACK) | |||
| #endif | |||
| { | |||
| for (k=0; i < 2 && k < frames; k++) | |||
| @@ -1703,7 +1703,7 @@ CarlaPlugin* CarlaPlugin::newNative(const initializer& init) | |||
| plugin->reload(); | |||
| if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||
| if (CarlaEngine::processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||
| { | |||
| if (! (plugin->hints() & PLUGIN_CAN_FORCE_STEREO)) | |||
| { | |||
| @@ -227,7 +227,7 @@ public: | |||
| m_filename = nullptr; | |||
| #ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||
| if (engine->processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||
| m_ctrlInChannel = m_id; | |||
| else | |||
| #endif | |||
| @@ -769,7 +769,7 @@ public: | |||
| { | |||
| m_id = id; | |||
| if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||
| if (x_engine->processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||
| m_ctrlInChannel = id; | |||
| } | |||
| #endif | |||
| @@ -1452,7 +1452,7 @@ public: | |||
| #ifdef BUILD_BRIDGE | |||
| uint32_t maxParameters = MAX_PARAMETERS; | |||
| #else | |||
| uint32_t maxParameters = carlaOptions.maxParameters; | |||
| uint32_t maxParameters = x_engine->options.maxParameters; | |||
| #endif | |||
| if (param.count > 0 && param.count < maxParameters) | |||
| { | |||
| @@ -1611,7 +1611,7 @@ public: | |||
| qWarning("CarlaPlugin::showOscGui()"); | |||
| // 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) | |||
| { | |||
| @@ -16,6 +16,7 @@ | |||
| */ | |||
| #include "carla_shared.h" | |||
| #include "carla_engine.h" | |||
| #ifndef BUILD_BRIDGE | |||
| # include "plugins/carla_native.h" | |||
| @@ -27,11 +28,6 @@ CARLA_BACKEND_START_NAMESPACE | |||
| static const char* carlaLastError = nullptr; | |||
| #ifndef BUILD_BRIDGE | |||
| // Global options | |||
| carla_options_t carlaOptions; | |||
| #endif | |||
| // ------------------------------------------------------------------------------------------------------------------- | |||
| const char* BinaryType2str(const BinaryType type) | |||
| @@ -312,6 +308,8 @@ const char* CallbackType2str(const CallbackType type) | |||
| return "CALLBACK_NSM_OPEN2"; | |||
| case CALLBACK_NSM_SAVE: | |||
| return "CALLBACK_NSM_SAVE"; | |||
| case CALLBACK_ERROR: | |||
| return "CALLBACK_ERROR"; | |||
| case CALLBACK_QUIT: | |||
| return "CALLBACK_QUIT"; | |||
| } | |||
| @@ -379,14 +377,14 @@ const char* getBinaryBidgePath(const BinaryType type) | |||
| switch (type) | |||
| { | |||
| #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 | |||
| default: | |||
| return nullptr; | |||
| @@ -543,158 +541,6 @@ uint32_t getPluginHintsFromNative(const uint32_t nativeHints) | |||
| 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 | |||
| CARLA_BACKEND_END_NAMESPACE | |||
| @@ -52,60 +52,6 @@ void setLastError(const char* const error); | |||
| #ifndef BUILD_BRIDGE | |||
| 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 | |||
| /**@}*/ | |||
| @@ -63,7 +63,7 @@ public: | |||
| if (osc.thread) | |||
| { | |||
| // 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"); | |||
| osc.thread->terminate(); | |||
| @@ -373,7 +373,7 @@ public: | |||
| } | |||
| #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); | |||
| @@ -426,7 +426,7 @@ public: | |||
| if (LADSPA_IS_PORT_AUDIO(portType)) | |||
| { | |||
| #ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||
| if (CarlaEngine::processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||
| { | |||
| strcpy(portName, m_name); | |||
| strcat(portName, ":"); | |||
| @@ -624,7 +624,7 @@ public: | |||
| if (needsCtrlIn) | |||
| { | |||
| #ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||
| if (CarlaEngine::processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||
| { | |||
| strcpy(portName, m_name); | |||
| strcat(portName, ":control-in"); | |||
| @@ -639,7 +639,7 @@ public: | |||
| if (needsCtrlOut) | |||
| { | |||
| #ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||
| if (CarlaEngine::processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||
| { | |||
| strcpy(portName, m_name); | |||
| strcat(portName, ":control-out"); | |||
| @@ -654,7 +654,7 @@ public: | |||
| if (mIns == 1) | |||
| { | |||
| #ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||
| if (CarlaEngine::processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||
| { | |||
| strcpy(portName, m_name); | |||
| strcat(portName, ":midi-in"); | |||
| @@ -677,7 +677,7 @@ public: | |||
| m_hints |= PLUGIN_IS_SYNTH; | |||
| #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) | |||
| m_hints |= PLUGIN_USES_CHUNKS; | |||
| @@ -869,7 +869,7 @@ public: | |||
| // Input VU | |||
| #ifndef BUILD_BRIDGE | |||
| if (aIn.count > 0 && carlaOptions.processMode != PROCESS_MODE_CONTINUOUS_RACK) | |||
| if (aIn.count > 0 && CarlaEngine::processMode != PROCESS_MODE_CONTINUOUS_RACK) | |||
| #else | |||
| if (aIn.count > 0) | |||
| #endif | |||
| @@ -1360,7 +1360,7 @@ public: | |||
| // Output VU | |||
| #ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processMode != PROCESS_MODE_CONTINUOUS_RACK) | |||
| if (CarlaEngine::processMode != PROCESS_MODE_CONTINUOUS_RACK) | |||
| #endif | |||
| { | |||
| for (k=0; i < 2 && k < frames; k++) | |||
| @@ -1636,7 +1636,7 @@ CarlaPlugin* CarlaPlugin::newDSSI(const initializer& init, const void* const ext | |||
| plugin->reload(); | |||
| # ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||
| if (CarlaEngine::processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||
| { | |||
| if (! (plugin->hints() & PLUGIN_CAN_FORCE_STEREO)) | |||
| { | |||
| @@ -419,7 +419,7 @@ public: | |||
| // Audio Outputs | |||
| #ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||
| if (CarlaEngine::processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||
| { | |||
| strcpy(portName, m_name); | |||
| strcat(portName, ":out-left"); | |||
| @@ -432,7 +432,7 @@ public: | |||
| aOut.rindexes[0] = 0; | |||
| #ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||
| if (CarlaEngine::processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||
| { | |||
| strcpy(portName, m_name); | |||
| strcat(portName, ":out-right"); | |||
| @@ -448,7 +448,7 @@ public: | |||
| // MIDI Input | |||
| #ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||
| if (CarlaEngine::processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||
| { | |||
| strcpy(portName, m_name); | |||
| strcat(portName, ":midi-in"); | |||
| @@ -463,7 +463,7 @@ public: | |||
| // Parameters | |||
| #ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||
| if (CarlaEngine::processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||
| { | |||
| strcpy(portName, m_name); | |||
| strcat(portName, ":control-in"); | |||
| @@ -475,7 +475,7 @@ public: | |||
| param.portCin = (CarlaEngineControlPort*)x_client->addPort(CarlaEnginePortTypeControl, portName, true); | |||
| #ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||
| if (CarlaEngine::processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||
| { | |||
| strcpy(portName, m_name); | |||
| strcat(portName, ":control-out"); | |||
| @@ -1183,7 +1183,7 @@ public: | |||
| // Output VU | |||
| #ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processMode != PROCESS_MODE_CONTINUOUS_RACK) | |||
| if (CarlaEngine::processMode != PROCESS_MODE_CONTINUOUS_RACK) | |||
| #endif | |||
| { | |||
| for (k=0; i < 2 && k < frames; k++) | |||
| @@ -375,7 +375,7 @@ public: | |||
| } | |||
| #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); | |||
| @@ -426,7 +426,7 @@ public: | |||
| if (LADSPA_IS_PORT_AUDIO(portType)) | |||
| { | |||
| #ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||
| if (CarlaEngine::processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||
| { | |||
| strcpy(portName, m_name); | |||
| strcat(portName, ":"); | |||
| @@ -619,7 +619,7 @@ public: | |||
| if (needsCtrlIn) | |||
| { | |||
| #ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||
| if (CarlaEngine::processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||
| { | |||
| strcpy(portName, m_name); | |||
| strcat(portName, ":control-in"); | |||
| @@ -634,7 +634,7 @@ public: | |||
| if (needsCtrlOut) | |||
| { | |||
| #ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||
| if (CarlaEngine::processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||
| { | |||
| strcpy(portName, m_name); | |||
| strcat(portName, ":control-out"); | |||
| @@ -739,7 +739,7 @@ public: | |||
| // Input VU | |||
| #ifndef BUILD_BRIDGE | |||
| if (aIn.count > 0 && carlaOptions.processMode != PROCESS_MODE_CONTINUOUS_RACK) | |||
| if (aIn.count > 0 && CarlaEngine::processMode != PROCESS_MODE_CONTINUOUS_RACK) | |||
| #else | |||
| if (aIn.count > 0) | |||
| #endif | |||
| @@ -1036,7 +1036,7 @@ public: | |||
| // Output VU | |||
| #ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processMode != PROCESS_MODE_CONTINUOUS_RACK) | |||
| if (CarlaEngine::processMode != PROCESS_MODE_CONTINUOUS_RACK) | |||
| #endif | |||
| { | |||
| for (k=0; i < 2 && k < frames; k++) | |||
| @@ -1241,7 +1241,7 @@ CarlaPlugin* CarlaPlugin::newLADSPA(const initializer& init, const void* const e | |||
| plugin->reload(); | |||
| # ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||
| if (CarlaEngine::processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||
| { | |||
| if (! (plugin->hints() & PLUGIN_CAN_FORCE_STEREO)) | |||
| { | |||
| @@ -156,7 +156,7 @@ public: | |||
| // --------------------------------------- | |||
| // Audio Outputs | |||
| if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||
| if (CarlaEngine::processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||
| { | |||
| strcpy(portName, m_name); | |||
| strcat(portName, ":out-left"); | |||
| @@ -167,7 +167,7 @@ public: | |||
| aOut.ports[0] = (CarlaEngineAudioPort*)x_client->addPort(CarlaEnginePortTypeAudio, portName, false); | |||
| aOut.rindexes[0] = 0; | |||
| if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||
| if (CarlaEngine::processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||
| { | |||
| strcpy(portName, m_name); | |||
| strcat(portName, ":out-right"); | |||
| @@ -181,7 +181,7 @@ public: | |||
| // --------------------------------------- | |||
| // Control Input | |||
| if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||
| if (CarlaEngine::processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||
| { | |||
| strcpy(portName, m_name); | |||
| strcat(portName, ":control-in"); | |||
| @@ -194,7 +194,7 @@ public: | |||
| // --------------------------------------- | |||
| // MIDI Input | |||
| if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||
| if (CarlaEngine::processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||
| { | |||
| strcpy(portName, m_name); | |||
| strcat(portName, ":midi-in"); | |||
| @@ -647,7 +647,7 @@ public: | |||
| // Output VU | |||
| #ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processMode != PROCESS_MODE_CONTINUOUS_RACK) | |||
| if (CarlaEngine::processMode != PROCESS_MODE_CONTINUOUS_RACK) | |||
| #endif | |||
| { | |||
| for (k=0; i < 2 && k < frames; k++) | |||
| @@ -191,18 +191,18 @@ const char* lv2bridge2str(const LV2_Property type) | |||
| switch (type) | |||
| { | |||
| #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 | |||
| default: | |||
| return nullptr; | |||
| @@ -368,7 +368,7 @@ public: | |||
| if (osc.thread) | |||
| { | |||
| // 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"); | |||
| osc.thread->terminate(); | |||
| @@ -456,7 +456,7 @@ public: | |||
| delete (LV2_Worker_Schedule*)features[lv2_feature_id_worker]->data; | |||
| #ifndef BUILD_BRIDGE | |||
| if (! carlaOptions.processHighPrecision) | |||
| if (! x_engine->options.processHighPrecision) | |||
| #endif | |||
| { | |||
| features[lv2_feature_id_bufsize_fixed] = nullptr; | |||
| @@ -1220,7 +1220,7 @@ public: | |||
| } | |||
| #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); | |||
| @@ -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)) | |||
| { | |||
| #ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||
| if (CarlaEngine::processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||
| { | |||
| strcpy(portName, m_name); | |||
| strcat(portName, ":"); | |||
| @@ -1719,7 +1719,7 @@ public: | |||
| if (needsCtrlIn) | |||
| { | |||
| #ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||
| if (CarlaEngine::processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||
| { | |||
| strcpy(portName, m_name); | |||
| strcat(portName, ":control-in"); | |||
| @@ -1734,7 +1734,7 @@ public: | |||
| if (needsCtrlOut) | |||
| { | |||
| #ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||
| if (CarlaEngine::processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||
| { | |||
| strcpy(portName, m_name); | |||
| strcat(portName, ":control-out"); | |||
| @@ -2000,7 +2000,7 @@ public: | |||
| // Input VU | |||
| #ifndef BUILD_BRIDGE | |||
| if (aIn.count > 0 && carlaOptions.processMode != PROCESS_MODE_CONTINUOUS_RACK) | |||
| if (aIn.count > 0 && CarlaEngine::processMode != PROCESS_MODE_CONTINUOUS_RACK) | |||
| #else | |||
| if (aIn.count > 0) | |||
| #endif | |||
| @@ -2692,7 +2692,7 @@ public: | |||
| // Output VU | |||
| #ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processMode != PROCESS_MODE_CONTINUOUS_RACK) | |||
| if (CarlaEngine::processMode != PROCESS_MODE_CONTINUOUS_RACK) | |||
| #endif | |||
| { | |||
| for (k=0; i < 2 && k < frames; k++) | |||
| @@ -3981,7 +3981,7 @@ public: | |||
| features[lv2_feature_id_bufsize_bounded]->data = nullptr; | |||
| #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]->URI = LV2_BUF_SIZE__fixedBlockLength; | |||
| @@ -4218,7 +4218,7 @@ public: | |||
| { | |||
| case LV2_UI_QT4: | |||
| #ifndef BUILD_BRIDGE | |||
| if (isUiBridgeable(i) && carlaOptions.preferUiBridges) | |||
| if (isUiBridgeable(i) && x_engine->options.preferUiBridges) | |||
| eQt4 = i; | |||
| #endif | |||
| iQt4 = i; | |||
| @@ -4226,7 +4226,7 @@ public: | |||
| case LV2_UI_COCOA: | |||
| #ifndef BUILD_BRIDGE | |||
| if (isUiBridgeable(i) && carlaOptions.preferUiBridges) | |||
| if (isUiBridgeable(i) && x_engine->options.preferUiBridges) | |||
| eCocoa = i; | |||
| #endif | |||
| iCocoa = i; | |||
| @@ -4234,7 +4234,7 @@ public: | |||
| case LV2_UI_WINDOWS: | |||
| #ifndef BUILD_BRIDGE | |||
| if (isUiBridgeable(i) && carlaOptions.preferUiBridges) | |||
| if (isUiBridgeable(i) && x_engine->options.preferUiBridges) | |||
| eHWND = i; | |||
| #endif | |||
| iHWND = i; | |||
| @@ -4242,7 +4242,7 @@ public: | |||
| case LV2_UI_X11: | |||
| #ifndef BUILD_BRIDGE | |||
| if (isUiBridgeable(i) && carlaOptions.preferUiBridges) | |||
| if (isUiBridgeable(i) && x_engine->options.preferUiBridges) | |||
| eX11 = i; | |||
| #endif | |||
| iX11 = i; | |||
| @@ -4253,7 +4253,7 @@ public: | |||
| if (false) | |||
| #else | |||
| # ifdef HAVE_SUIL | |||
| if (isUiBridgeable(i) && carlaOptions.preferUiBridges) | |||
| if (isUiBridgeable(i) && x_engine->options.preferUiBridges) | |||
| # else | |||
| if (isUiBridgeable(i)) | |||
| # endif | |||
| @@ -4688,7 +4688,7 @@ CarlaPlugin* CarlaPlugin::newLV2(const initializer& init) | |||
| plugin->reload(); | |||
| # ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||
| if (CarlaEngine::processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||
| { | |||
| if (! (plugin->hints() & PLUGIN_CAN_FORCE_STEREO)) | |||
| { | |||
| @@ -98,7 +98,7 @@ public: | |||
| if (osc.thread) | |||
| { | |||
| // 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"); | |||
| osc.thread->terminate(); | |||
| @@ -523,7 +523,7 @@ public: | |||
| for (j=0; j < aIns; j++) | |||
| { | |||
| #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); | |||
| else | |||
| #endif | |||
| @@ -536,7 +536,7 @@ public: | |||
| for (j=0; j < aOuts; j++) | |||
| { | |||
| #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); | |||
| else | |||
| #endif | |||
| @@ -664,7 +664,7 @@ public: | |||
| if (needsCtrlIn) | |||
| { | |||
| #ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||
| if (CarlaEngine::processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||
| { | |||
| strcpy(portName, m_name); | |||
| strcat(portName, ":control-in"); | |||
| @@ -679,7 +679,7 @@ public: | |||
| if (mIns == 1) | |||
| { | |||
| #ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||
| if (CarlaEngine::processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||
| { | |||
| strcpy(portName, m_name); | |||
| strcat(portName, ":midi-in"); | |||
| @@ -694,7 +694,7 @@ public: | |||
| if (mOuts == 1) | |||
| { | |||
| #ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||
| if (CarlaEngine::processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||
| { | |||
| strcpy(portName, m_name); | |||
| strcat(portName, ":midi-out"); | |||
| @@ -893,7 +893,7 @@ public: | |||
| // Input VU | |||
| #ifndef BUILD_BRIDGE | |||
| if (aIn.count > 0 && carlaOptions.processMode != PROCESS_MODE_CONTINUOUS_RACK) | |||
| if (aIn.count > 0 && CarlaEngine::processMode != PROCESS_MODE_CONTINUOUS_RACK) | |||
| #else | |||
| if (aIn.count > 0) | |||
| #endif | |||
| @@ -1347,7 +1347,7 @@ public: | |||
| // Output VU | |||
| #ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processMode != PROCESS_MODE_CONTINUOUS_RACK) | |||
| if (CarlaEngine::processMode != PROCESS_MODE_CONTINUOUS_RACK) | |||
| #endif | |||
| { | |||
| for (k=0; i < 2 && k < frames; k++) | |||
| @@ -1603,7 +1603,7 @@ public: | |||
| return 1; | |||
| #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"); | |||
| return 0; | |||
| @@ -1744,7 +1744,7 @@ public: | |||
| if (strcmp(feature, "acceptIOChanges") == 0) | |||
| { | |||
| #ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||
| if (CarlaEngine::processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||
| return -1; | |||
| #endif | |||
| return 1; | |||
| @@ -1955,7 +1955,7 @@ public: | |||
| #ifdef BUILD_BRIDGE | |||
| ret = MAX_PARAMETERS; | |||
| #else | |||
| ret = carlaOptions.maxParameters; | |||
| ret = 0; //x_engine->options.maxParameters; | |||
| #endif | |||
| if (effect && ret > effect->numParams) | |||
| ret = effect->numParams; | |||
| @@ -2014,11 +2014,11 @@ public: | |||
| else | |||
| qWarning("VstPlugin::hostCallback::audioMasterGetBlockSize called without valid object"); | |||
| if (ret == 0) | |||
| #ifndef BUILD_BRIDGE | |||
| ret = carlaOptions.processHighPrecision ? 8 : 512; | |||
| #else | |||
| //#ifndef BUILD_BRIDGE | |||
| // ret = CarlaEngine::processHighPrecision ? 8 : 512; | |||
| //#else | |||
| ret = 512; | |||
| #endif | |||
| //#endif | |||
| break; | |||
| case audioMasterGetInputLatency: | |||
| @@ -2312,10 +2312,10 @@ public: | |||
| m_hints |= PLUGIN_HAS_GUI; | |||
| #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->setOscData(carlaOptions.bridge_vstx11, label); | |||
| osc.thread->setOscData(x_engine->options.bridge_vstx11, label); | |||
| gui.type = GUI_EXTERNAL_OSC; | |||
| } | |||
| else | |||
| @@ -2402,7 +2402,7 @@ CarlaPlugin* CarlaPlugin::newVST(const initializer& init) | |||
| plugin->reload(); | |||
| # ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||
| if (CarlaEngine::processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||
| { | |||
| if (! (plugin->hints() & PLUGIN_CAN_FORCE_STEREO)) | |||
| { | |||
| @@ -19,101 +19,104 @@ | |||
| #define CARLA_INCLUDES_H | |||
| #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 | |||
| #include <QtCore/Qt> | |||
| // TESTING - remove later | |||
| // TESTING - remove later (QtCreator doesn't fully support this) | |||
| #ifdef QTCREATOR_TEST | |||
| # undef Q_COMPILER_INITIALIZER_LISTS | |||
| # undef Q_COMPILER_INITIALIZER_LISTS | |||
| #endif | |||
| // If the compiler can't do C++11 lambdas, it most likely doesn't know about nullptr either | |||
| #ifndef Q_COMPILER_LAMBDA | |||
| # define nullptr (0) | |||
| # define nullptr (0) | |||
| #endif | |||
| // Common includes and macros | |||
| #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 | |||
| # 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 | |||
| // needed for qDebug/Warning/Critical sections | |||
| // ..., needed for qDebug/Warning/Critical sections | |||
| #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 | |||
| # 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 | |||
| # 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 | |||
| // set native binary type | |||
| // Define BINARY_NATIVE | |||
| #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) | |||
| # 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 | |||
| # warning Unknown binary type | |||
| # define BINARY_NATIVE BINARY_OTHER | |||
| # warning Unknown binary type | |||
| # define BINARY_NATIVE BINARY_OTHER | |||
| #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 | |||
| # 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 | |||
| #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 | |||
| # 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 | |||
| // carla_setprocname | |||
| // Inline functions | |||
| #ifdef Q_OS_LINUX | |||
| # include <sys/prctl.h> | |||
| # include <linux/prctl.h> | |||
| # include <sys/prctl.h> | |||
| # include <linux/prctl.h> | |||
| static inline | |||
| void carla_setprocname(const char* const name) | |||
| { | |||
| @@ -121,7 +124,7 @@ void carla_setprocname(const char* const name) | |||
| } | |||
| #else | |||
| static inline | |||
| void carla_setprocname(const char* const /*name*/) | |||
| void carla_setprocname(const char* const) | |||
| { | |||
| } | |||
| #endif | |||