| @@ -164,134 +164,144 @@ enum OptionsType { | |||||
| */ | */ | ||||
| OPTION_PROCESS_MODE = 1, | OPTION_PROCESS_MODE = 1, | ||||
| /*! | |||||
| * High-Precision processing mode.\n | |||||
| * When enabled, audio will be processed by blocks of 8 samples at a time, indenpendently of the buffer size.\n | |||||
| * Default is off.\n | |||||
| * EXPERIMENTAL! | |||||
| */ | |||||
| OPTION_PROCESS_HIGH_PRECISION = 2, | |||||
| /*! | /*! | ||||
| * Maximum number of parameters allowed.\n | * Maximum number of parameters allowed.\n | ||||
| * Default is MAX_PARAMETERS. | * Default is MAX_PARAMETERS. | ||||
| */ | */ | ||||
| OPTION_MAX_PARAMETERS = 2, | |||||
| OPTION_MAX_PARAMETERS = 3, | |||||
| /*! | /*! | ||||
| * Use OSC-UI bridges whenever possible, otherwise UIs will be handled in the main thread.\n | |||||
| * Default is yes. | |||||
| * Prefered buffer size. | |||||
| */ | |||||
| OPTION_PREFERRED_BUFFER_SIZE = 4, | |||||
| /*! | |||||
| * Prefered sample rate. | |||||
| */ | */ | ||||
| OPTION_PREFER_UI_BRIDGES = 3, | |||||
| OPTION_PREFERRED_SAMPLE_RATE = 5, | |||||
| /*! | /*! | ||||
| * Force mono plugins as stereo, by running 2 instances at the same time.\n | * Force mono plugins as stereo, by running 2 instances at the same time.\n | ||||
| * Not supported in VST plugins. | * Not supported in VST plugins. | ||||
| */ | */ | ||||
| OPTION_FORCE_STEREO = 4, | |||||
| OPTION_FORCE_STEREO = 6, | |||||
| /*! | /*! | ||||
| * High-Precision processing mode.\n | |||||
| * When enabled, audio will be processed by blocks of 8 samples at a time, indenpendently of the buffer size.\n | |||||
| * Default is off.\n | |||||
| * Use (unofficial) dssi-vst chunks feature.\n | |||||
| * Default is no. | |||||
| * EXPERIMENTAL! | * EXPERIMENTAL! | ||||
| */ | */ | ||||
| OPTION_PROCESS_HIGH_PRECISION = 5, | |||||
| OPTION_USE_DSSI_VST_CHUNKS = 7, | |||||
| /*! | /*! | ||||
| * Timeout value in ms for how much to wait for OSC-GUIs to respond.\n | |||||
| * Default is 4000 ms (4 secs). | |||||
| * Use OSC-UI bridges whenever possible, otherwise UIs will be handled in the main thread.\n | |||||
| * Default is yes. | |||||
| */ | */ | ||||
| OPTION_OSC_GUI_TIMEOUT = 6, | |||||
| OPTION_PREFER_UI_BRIDGES = 8, | |||||
| /*! | /*! | ||||
| * Use (unofficial) dssi-vst chunks feature.\n | |||||
| * Default is no. | |||||
| * EXPERIMENTAL! | |||||
| * Timeout value in ms for how much to wait for OSC-UIs to respond.\n | |||||
| * Default is 4000 ms (4 secs). | |||||
| */ | */ | ||||
| OPTION_USE_DSSI_CHUNKS = 7, | |||||
| OPTION_OSC_UI_TIMEOUT = 9, | |||||
| /*! | /*! | ||||
| * Set LADSPA_PATH environment variable.\n | * Set LADSPA_PATH environment variable.\n | ||||
| * Default undefined. | * Default undefined. | ||||
| */ | */ | ||||
| OPTION_PATH_LADSPA = 8, | |||||
| OPTION_PATH_LADSPA = 10, | |||||
| /*! | /*! | ||||
| * Set DSSI_PATH environment variable.\n | * Set DSSI_PATH environment variable.\n | ||||
| * Default undefined. | * Default undefined. | ||||
| */ | */ | ||||
| OPTION_PATH_DSSI = 9, | |||||
| OPTION_PATH_DSSI = 11, | |||||
| /*! | /*! | ||||
| * Set LV2_PATH environment variable.\n | * Set LV2_PATH environment variable.\n | ||||
| * Default undefined. | * Default undefined. | ||||
| */ | */ | ||||
| OPTION_PATH_LV2 = 10, | |||||
| OPTION_PATH_LV2 = 12, | |||||
| /*! | /*! | ||||
| * Set VST_PATH environment variable.\n | * Set VST_PATH environment variable.\n | ||||
| * Default undefined. | * Default undefined. | ||||
| */ | */ | ||||
| OPTION_PATH_VST = 11, | |||||
| OPTION_PATH_VST = 13, | |||||
| /*! | /*! | ||||
| * Set GIG_PATH environment variable.\n | * Set GIG_PATH environment variable.\n | ||||
| * Default undefined. | * Default undefined. | ||||
| */ | */ | ||||
| OPTION_PATH_GIG = 12, | |||||
| OPTION_PATH_GIG = 14, | |||||
| /*! | /*! | ||||
| * Set SF2_PATH environment variable.\n | * Set SF2_PATH environment variable.\n | ||||
| * Default undefined. | * Default undefined. | ||||
| */ | */ | ||||
| OPTION_PATH_SF2 = 13, | |||||
| OPTION_PATH_SF2 = 15, | |||||
| /*! | /*! | ||||
| * Set SFZ_PATH environment variable.\n | * Set SFZ_PATH environment variable.\n | ||||
| * Default undefined. | * Default undefined. | ||||
| */ | */ | ||||
| OPTION_PATH_SFZ = 14, | |||||
| OPTION_PATH_SFZ = 16, | |||||
| /*! | /*! | ||||
| * Set path to the Unix 32bit plugin bridge executable.\n | * Set path to the Unix 32bit plugin bridge executable.\n | ||||
| * Default unset. | * Default unset. | ||||
| */ | */ | ||||
| OPTION_PATH_BRIDGE_UNIX32 = 15, | |||||
| OPTION_PATH_BRIDGE_UNIX32 = 17, | |||||
| /*! | /*! | ||||
| * Set path to the Unix 64bit plugin bridge executable.\n | * Set path to the Unix 64bit plugin bridge executable.\n | ||||
| * Default unset. | * Default unset. | ||||
| */ | */ | ||||
| OPTION_PATH_BRIDGE_UNIX64 = 16, | |||||
| OPTION_PATH_BRIDGE_UNIX64 = 18, | |||||
| /*! | /*! | ||||
| * Set path to the Windows 32bit plugin bridge executable.\n | * Set path to the Windows 32bit plugin bridge executable.\n | ||||
| * Default unset. | * Default unset. | ||||
| */ | */ | ||||
| OPTION_PATH_BRIDGE_WIN32 = 17, | |||||
| OPTION_PATH_BRIDGE_WIN32 = 19, | |||||
| /*! | /*! | ||||
| * Set path to the Windows 64bit plugin bridge executable.\n | * Set path to the Windows 64bit plugin bridge executable.\n | ||||
| * Default unset. | * Default unset. | ||||
| */ | */ | ||||
| OPTION_PATH_BRIDGE_WIN64 = 18, | |||||
| OPTION_PATH_BRIDGE_WIN64 = 20, | |||||
| /*! | /*! | ||||
| * Set path to the LV2 Gtk2 UI bridge executable.\n | * Set path to the LV2 Gtk2 UI bridge executable.\n | ||||
| * Default unset. | * Default unset. | ||||
| */ | */ | ||||
| OPTION_PATH_BRIDGE_LV2_GTK2 = 19, | |||||
| OPTION_PATH_BRIDGE_LV2_GTK2 = 21, | |||||
| /*! | /*! | ||||
| * Set path to the LV2 Qt4 UI bridge executable.\n | * Set path to the LV2 Qt4 UI bridge executable.\n | ||||
| * Default unset. | * Default unset. | ||||
| */ | */ | ||||
| OPTION_PATH_BRIDGE_LV2_QT4 = 20, | |||||
| OPTION_PATH_BRIDGE_LV2_QT4 = 22, | |||||
| /*! | /*! | ||||
| * Set path to the LV2 X11 UI bridge executable.\n | * Set path to the LV2 X11 UI bridge executable.\n | ||||
| * Default unset. | * Default unset. | ||||
| */ | */ | ||||
| OPTION_PATH_BRIDGE_LV2_X11 = 21, | |||||
| OPTION_PATH_BRIDGE_LV2_X11 = 23, | |||||
| /*! | /*! | ||||
| * Set path to the VST X11 UI bridge executable.\n | * Set path to the VST X11 UI bridge executable.\n | ||||
| * Default unset. | * Default unset. | ||||
| */ | */ | ||||
| OPTION_PATH_BRIDGE_VST_X11 = 22 | |||||
| OPTION_PATH_BRIDGE_VST_X11 = 24 | |||||
| }; | }; | ||||
| /*! | /*! | ||||
| @@ -240,6 +240,9 @@ const PluginInfo* get_plugin_info(unsigned short plugin_id) | |||||
| info.copyright = nullptr; | info.copyright = nullptr; | ||||
| } | } | ||||
| if (! carlaEngine->isRunning()) | |||||
| return nullptr; | |||||
| CarlaBackend::CarlaPlugin* const plugin = carlaEngine->getPlugin(plugin_id); | CarlaBackend::CarlaPlugin* const plugin = carlaEngine->getPlugin(plugin_id); | ||||
| if (plugin) | if (plugin) | ||||
| @@ -265,9 +268,7 @@ const PluginInfo* get_plugin_info(unsigned short plugin_id) | |||||
| return &info; | return &info; | ||||
| } | } | ||||
| if (carlaEngine->isRunning()) | |||||
| qCritical("CarlaBackendStandalone::get_plugin_info(%i) - could not find plugin", plugin_id); | |||||
| qCritical("CarlaBackendStandalone::get_plugin_info(%i) - could not find plugin", plugin_id); | |||||
| return &info; | return &info; | ||||
| } | } | ||||
| @@ -255,7 +255,7 @@ public: | |||||
| } | } | ||||
| // create new if needed | // create new if needed | ||||
| param.count = (pTotal < (int)carlaOptions.max_parameters) ? pTotal : 0; | |||||
| param.count = (pTotal < (int)carlaOptions.maxParameters) ? pTotal : 0; | |||||
| if (param.count > 0) | if (param.count > 0) | ||||
| { | { | ||||
| @@ -721,7 +721,7 @@ CarlaPlugin* CarlaPlugin::newBridge(const initializer& init, BinaryType btype, P | |||||
| plugin->reload(); | plugin->reload(); | ||||
| if (carlaOptions.process_mode == PROCESS_MODE_CONTINUOUS_RACK) | |||||
| if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||||
| { | { | ||||
| if (/* inputs */ ((plugin->audioInCount() != 0 && plugin->audioInCount() != 2)) || /* outputs */ ((plugin->audioOutCount() != 0 && plugin->audioOutCount() != 2))) | if (/* inputs */ ((plugin->audioInCount() != 0 && plugin->audioInCount() != 2)) || /* outputs */ ((plugin->audioOutCount() != 0 && plugin->audioOutCount() != 2))) | ||||
| { | { | ||||
| @@ -78,7 +78,7 @@ int CarlaEngine::maxClientNameSize() | |||||
| { | { | ||||
| #ifdef CARLA_ENGINE_JACK | #ifdef CARLA_ENGINE_JACK | ||||
| # ifndef BUILD_BRIDGE | # ifndef BUILD_BRIDGE | ||||
| if (carlaOptions.process_mode != PROCESS_MODE_CONTINUOUS_RACK) | |||||
| if (carlaOptions.processMode != PROCESS_MODE_CONTINUOUS_RACK) | |||||
| # endif | # endif | ||||
| return jack_client_name_size(); | return jack_client_name_size(); | ||||
| #endif | #endif | ||||
| @@ -89,7 +89,7 @@ int CarlaEngine::maxPortNameSize() | |||||
| { | { | ||||
| #ifdef CARLA_ENGINE_JACK | #ifdef CARLA_ENGINE_JACK | ||||
| # ifndef BUILD_BRIDGE | # ifndef BUILD_BRIDGE | ||||
| if (carlaOptions.process_mode != PROCESS_MODE_CONTINUOUS_RACK) | |||||
| if (carlaOptions.processMode != PROCESS_MODE_CONTINUOUS_RACK) | |||||
| # endif | # endif | ||||
| return jack_port_name_size(); | return jack_port_name_size(); | ||||
| #endif | #endif | ||||
| @@ -103,8 +103,6 @@ bool CarlaEngine::init(const char* const clientName) | |||||
| m_osc.init(clientName); | m_osc.init(clientName); | ||||
| m_oscData = m_osc.getControllerData(); | m_oscData = m_osc.getControllerData(); | ||||
| m_checkThread.start(QThread::HighPriority); | |||||
| return true; | return true; | ||||
| } | } | ||||
| @@ -127,13 +125,6 @@ short CarlaEngine::getNewPluginId() const | |||||
| { | { | ||||
| qDebug("CarlaEngine::getNewPluginId()"); | qDebug("CarlaEngine::getNewPluginId()"); | ||||
| if (maxPluginNumber == 0) | |||||
| #ifdef BUILD_BRIDGE | |||||
| maxPluginNumber = MAX_PLUGINS; | |||||
| #else | |||||
| maxPluginNumber = (carlaOptions.process_mode == PROCESS_MODE_CONTINUOUS_RACK) ? 16 : MAX_PLUGINS; | |||||
| #endif | |||||
| for (unsigned short i=0; i < maxPluginNumber; i++) | for (unsigned short i=0; i < maxPluginNumber; i++) | ||||
| { | { | ||||
| if (! m_carlaPlugins[i]) | if (! m_carlaPlugins[i]) | ||||
| @@ -157,7 +148,7 @@ CarlaPlugin* CarlaEngine::getPlugin(const unsigned short id) const | |||||
| CarlaPlugin* CarlaEngine::getPluginUnchecked(const unsigned short id) const | CarlaPlugin* CarlaEngine::getPluginUnchecked(const unsigned short id) const | ||||
| { | { | ||||
| Q_ASSERT(maxPluginNumber != 0); | |||||
| //Q_ASSERT(maxPluginNumber != 0); | |||||
| Q_ASSERT(id < maxPluginNumber); | Q_ASSERT(id < maxPluginNumber); | ||||
| return m_carlaPlugins[id]; | return m_carlaPlugins[id]; | ||||
| @@ -233,12 +224,18 @@ short CarlaEngine::addPlugin(const PluginType ptype, const char* const filename, | |||||
| short CarlaEngine::addPlugin(const BinaryType btype, const PluginType ptype, const char* const filename, const char* const name, const char* const label, void* const extra) | short CarlaEngine::addPlugin(const BinaryType btype, const PluginType ptype, const char* const filename, const char* const name, const char* const label, void* const extra) | ||||
| { | { | ||||
| qDebug("CarlaEngine::addPlugin(%s, %s, \"%s\", \"%s\", \"%s\", %p)", BinaryType2str(btype), PluginType2str(ptype), filename, name, label, extra); | qDebug("CarlaEngine::addPlugin(%s, %s, \"%s\", \"%s\", \"%s\", %p)", BinaryType2str(btype), PluginType2str(ptype), filename, name, label, extra); | ||||
| Q_ASSERT(maxPluginNumber != 0); | |||||
| Q_ASSERT(btype != BINARY_NONE); | Q_ASSERT(btype != BINARY_NONE); | ||||
| Q_ASSERT(ptype != PLUGIN_NONE); | Q_ASSERT(ptype != PLUGIN_NONE); | ||||
| Q_ASSERT(filename); | Q_ASSERT(filename); | ||||
| Q_ASSERT(label); | Q_ASSERT(label); | ||||
| if (maxPluginNumber == 0) | |||||
| #ifdef BUILD_BRIDGE | |||||
| maxPluginNumber = MAX_PLUGINS; | |||||
| #else | |||||
| maxPluginNumber = (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK) ? 16 : MAX_PLUGINS; | |||||
| #endif | |||||
| CarlaPlugin::initializer init = { | CarlaPlugin::initializer init = { | ||||
| this, | this, | ||||
| filename, | filename, | ||||
| @@ -252,7 +249,7 @@ short CarlaEngine::addPlugin(const BinaryType btype, const PluginType ptype, con | |||||
| if (btype != BINARY_NATIVE) | if (btype != BINARY_NATIVE) | ||||
| { | { | ||||
| # ifdef CARLA_ENGINE_JACK | # ifdef CARLA_ENGINE_JACK | ||||
| if (carlaOptions.process_mode != CarlaBackend::PROCESS_MODE_MULTIPLE_CLIENTS) | |||||
| if (carlaOptions.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; | ||||
| @@ -306,6 +303,9 @@ short CarlaEngine::addPlugin(const BinaryType btype, const PluginType ptype, con | |||||
| m_carlaPlugins[id] = plugin; | m_carlaPlugins[id] = plugin; | ||||
| m_uniqueNames[id] = plugin->name(); | m_uniqueNames[id] = plugin->name(); | ||||
| if (! m_checkThread.isRunning()) | |||||
| m_checkThread.start(QThread::HighPriority); | |||||
| return id; | return id; | ||||
| } | } | ||||
| @@ -321,7 +321,7 @@ bool CarlaEngine::removePlugin(const unsigned short id) | |||||
| { | { | ||||
| Q_ASSERT(plugin->id() == id); | Q_ASSERT(plugin->id() == id); | ||||
| const CarlaCheckThread::ScopedLocker m(&m_checkThread); | |||||
| m_checkThread.stopNow(); | |||||
| processLock(); | processLock(); | ||||
| plugin->setEnabled(false); | plugin->setEnabled(false); | ||||
| @@ -331,7 +331,7 @@ bool CarlaEngine::removePlugin(const unsigned short id) | |||||
| m_carlaPlugins[id] = nullptr; | m_carlaPlugins[id] = nullptr; | ||||
| m_uniqueNames[id] = nullptr; | m_uniqueNames[id] = nullptr; | ||||
| if (carlaOptions.process_mode == PROCESS_MODE_CONTINUOUS_RACK) | |||||
| if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||||
| { | { | ||||
| for (unsigned short i=id; i < maxPluginNumber-1; i++) | for (unsigned short i=id; i < maxPluginNumber-1; i++) | ||||
| { | { | ||||
| @@ -343,6 +343,9 @@ bool CarlaEngine::removePlugin(const unsigned short id) | |||||
| } | } | ||||
| } | } | ||||
| if (isRunning()) | |||||
| m_checkThread.start(QThread::HighPriority); | |||||
| return true; | return true; | ||||
| } | } | ||||
| @@ -356,7 +359,7 @@ void CarlaEngine::removeAllPlugins() | |||||
| qDebug("CarlaEngine::removeAllPlugins()"); | qDebug("CarlaEngine::removeAllPlugins()"); | ||||
| Q_ASSERT(maxPluginNumber != 0); | Q_ASSERT(maxPluginNumber != 0); | ||||
| const CarlaCheckThread::ScopedLocker m(&m_checkThread); | |||||
| m_checkThread.stopNow(); | |||||
| for (unsigned short i=0; i < maxPluginNumber; i++) | for (unsigned short i=0; i < maxPluginNumber; i++) | ||||
| { | { | ||||
| @@ -546,7 +549,7 @@ CarlaEngineClient::~CarlaEngineClient() | |||||
| Q_ASSERT(! m_active); | Q_ASSERT(! m_active); | ||||
| #ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
| if (carlaOptions.process_mode == PROCESS_MODE_MULTIPLE_CLIENTS) | |||||
| if (carlaOptions.processMode == PROCESS_MODE_MULTIPLE_CLIENTS) | |||||
| #endif | #endif | ||||
| { | { | ||||
| #ifdef CARLA_ENGINE_JACK | #ifdef CARLA_ENGINE_JACK | ||||
| @@ -566,7 +569,7 @@ void CarlaEngineClient::activate() | |||||
| Q_ASSERT(! m_active); | Q_ASSERT(! m_active); | ||||
| #ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
| if (carlaOptions.process_mode == PROCESS_MODE_MULTIPLE_CLIENTS) | |||||
| if (carlaOptions.processMode == PROCESS_MODE_MULTIPLE_CLIENTS) | |||||
| #endif | #endif | ||||
| { | { | ||||
| if (! m_active) | if (! m_active) | ||||
| @@ -591,7 +594,7 @@ void CarlaEngineClient::deactivate() | |||||
| Q_ASSERT(m_active); | Q_ASSERT(m_active); | ||||
| #ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
| if (carlaOptions.process_mode == PROCESS_MODE_MULTIPLE_CLIENTS) | |||||
| if (carlaOptions.processMode == PROCESS_MODE_MULTIPLE_CLIENTS) | |||||
| #endif | #endif | ||||
| { | { | ||||
| if (m_active) | if (m_active) | ||||
| @@ -622,7 +625,7 @@ bool CarlaEngineClient::isOk() const | |||||
| qDebug("CarlaEngineClient::isOk()"); | qDebug("CarlaEngineClient::isOk()"); | ||||
| #ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
| if (carlaOptions.process_mode != PROCESS_MODE_CONTINUOUS_RACK) | |||||
| if (carlaOptions.processMode != PROCESS_MODE_CONTINUOUS_RACK) | |||||
| #endif | #endif | ||||
| { | { | ||||
| #ifdef CARLA_ENGINE_JACK | #ifdef CARLA_ENGINE_JACK | ||||
| @@ -645,7 +648,7 @@ const CarlaEngineBasePort* CarlaEngineClient::addPort(const CarlaEnginePortType | |||||
| #ifdef CARLA_ENGINE_JACK | #ifdef CARLA_ENGINE_JACK | ||||
| # ifndef BUILD_BRIDGE | # ifndef BUILD_BRIDGE | ||||
| if (carlaOptions.process_mode != PROCESS_MODE_CONTINUOUS_RACK) | |||||
| if (carlaOptions.processMode != PROCESS_MODE_CONTINUOUS_RACK) | |||||
| # endif | # endif | ||||
| { | { | ||||
| switch (type) | switch (type) | ||||
| @@ -694,7 +697,7 @@ CarlaEngineBasePort::~CarlaEngineBasePort() | |||||
| #ifdef CARLA_ENGINE_JACK | #ifdef CARLA_ENGINE_JACK | ||||
| # ifndef BUILD_BRIDGE | # ifndef BUILD_BRIDGE | ||||
| if (carlaOptions.process_mode != PROCESS_MODE_CONTINUOUS_RACK) | |||||
| if (carlaOptions.processMode != PROCESS_MODE_CONTINUOUS_RACK) | |||||
| # endif | # endif | ||||
| { | { | ||||
| if (handle.jackClient && handle.jackPort) | if (handle.jackClient && handle.jackPort) | ||||
| @@ -720,7 +723,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.process_mode == PROCESS_MODE_CONTINUOUS_RACK) | |||||
| if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||||
| return nullptr; | return nullptr; | ||||
| # endif | # endif | ||||
| Q_ASSERT(handle.jackPort); | Q_ASSERT(handle.jackPort); | ||||
| @@ -742,7 +745,7 @@ void CarlaEngineControlPort::initBuffer(CarlaEngine* const engine) | |||||
| Q_ASSERT(engine); | Q_ASSERT(engine); | ||||
| #ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
| if (carlaOptions.process_mode == PROCESS_MODE_CONTINUOUS_RACK) | |||||
| if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||||
| { | { | ||||
| buffer = isInput ? engine->rackControlEventsIn : engine->rackControlEventsOut; | buffer = isInput ? engine->rackControlEventsIn : engine->rackControlEventsOut; | ||||
| return; | return; | ||||
| @@ -768,7 +771,7 @@ uint32_t CarlaEngineControlPort::getEventCount() | |||||
| Q_ASSERT(buffer); | Q_ASSERT(buffer); | ||||
| #ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
| if (carlaOptions.process_mode == PROCESS_MODE_CONTINUOUS_RACK) | |||||
| if (carlaOptions.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; | ||||
| @@ -801,7 +804,7 @@ const CarlaEngineControlEvent* CarlaEngineControlPort::getEvent(uint32_t index) | |||||
| Q_ASSERT(index < CarlaEngine::MAX_ENGINE_CONTROL_EVENTS); | Q_ASSERT(index < CarlaEngine::MAX_ENGINE_CONTROL_EVENTS); | ||||
| #ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
| if (carlaOptions.process_mode == PROCESS_MODE_CONTINUOUS_RACK) | |||||
| if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||||
| { | { | ||||
| const CarlaEngineControlEvent* const events = (CarlaEngineControlEvent*)buffer; | const CarlaEngineControlEvent* const events = (CarlaEngineControlEvent*)buffer; | ||||
| @@ -876,7 +879,7 @@ void CarlaEngineControlPort::writeEvent(CarlaEngineControlEventType type, uint32 | |||||
| Q_ASSERT(type != CarlaEngineEventNull); | Q_ASSERT(type != CarlaEngineEventNull); | ||||
| #ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
| if (carlaOptions.process_mode == PROCESS_MODE_CONTINUOUS_RACK) | |||||
| if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||||
| { | { | ||||
| CarlaEngineControlEvent* const events = (CarlaEngineControlEvent*)buffer; | CarlaEngineControlEvent* const events = (CarlaEngineControlEvent*)buffer; | ||||
| @@ -952,7 +955,7 @@ void CarlaEngineMidiPort::initBuffer(CarlaEngine* const engine) | |||||
| Q_ASSERT(engine); | Q_ASSERT(engine); | ||||
| #ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
| if (carlaOptions.process_mode == PROCESS_MODE_CONTINUOUS_RACK) | |||||
| if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||||
| { | { | ||||
| buffer = isInput ? engine->rackMidiEventsIn : engine->rackMidiEventsOut; | buffer = isInput ? engine->rackMidiEventsIn : engine->rackMidiEventsOut; | ||||
| return; | return; | ||||
| @@ -978,7 +981,7 @@ uint32_t CarlaEngineMidiPort::getEventCount() | |||||
| Q_ASSERT(buffer); | Q_ASSERT(buffer); | ||||
| #ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
| if (carlaOptions.process_mode == PROCESS_MODE_CONTINUOUS_RACK) | |||||
| if (carlaOptions.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; | ||||
| @@ -1011,7 +1014,7 @@ const CarlaEngineMidiEvent* CarlaEngineMidiPort::getEvent(uint32_t index) | |||||
| Q_ASSERT(index < CarlaEngine::MAX_ENGINE_MIDI_EVENTS); | Q_ASSERT(index < CarlaEngine::MAX_ENGINE_MIDI_EVENTS); | ||||
| #ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
| if (carlaOptions.process_mode == PROCESS_MODE_CONTINUOUS_RACK) | |||||
| if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||||
| { | { | ||||
| const CarlaEngineMidiEvent* const events = (CarlaEngineMidiEvent*)buffer; | const CarlaEngineMidiEvent* const events = (CarlaEngineMidiEvent*)buffer; | ||||
| @@ -1048,7 +1051,7 @@ void CarlaEngineMidiPort::writeEvent(uint32_t time, uint8_t* data, uint8_t size) | |||||
| Q_ASSERT(size > 0); | Q_ASSERT(size > 0); | ||||
| #ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
| if (carlaOptions.process_mode == PROCESS_MODE_CONTINUOUS_RACK) | |||||
| if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||||
| { | { | ||||
| if (size > 4) | if (size > 4) | ||||
| return; | return; | ||||
| @@ -129,7 +129,7 @@ bool CarlaEngineJack::init(const char* const clientName) | |||||
| jack_on_shutdown(client, carla_jack_shutdown_callback, this); | jack_on_shutdown(client, carla_jack_shutdown_callback, this); | ||||
| #ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
| if (carlaOptions.process_mode == PROCESS_MODE_CONTINUOUS_RACK) | |||||
| if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||||
| { | { | ||||
| rackJackPorts[rackPortAudioIn1] = jack_port_register(client, "in1", JACK_DEFAULT_AUDIO_TYPE, JackPortIsInput, 0); | rackJackPorts[rackPortAudioIn1] = jack_port_register(client, "in1", JACK_DEFAULT_AUDIO_TYPE, JackPortIsInput, 0); | ||||
| rackJackPorts[rackPortAudioIn2] = jack_port_register(client, "in2", JACK_DEFAULT_AUDIO_TYPE, JackPortIsInput, 0); | rackJackPorts[rackPortAudioIn2] = jack_port_register(client, "in2", JACK_DEFAULT_AUDIO_TYPE, JackPortIsInput, 0); | ||||
| @@ -186,7 +186,7 @@ bool CarlaEngineJack::close() | |||||
| if (jack_deactivate(client) == 0) | if (jack_deactivate(client) == 0) | ||||
| { | { | ||||
| #ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
| if (carlaOptions.process_mode == PROCESS_MODE_CONTINUOUS_RACK) | |||||
| if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||||
| { | { | ||||
| jack_port_unregister(client, rackJackPorts[rackPortAudioIn1]); | jack_port_unregister(client, rackJackPorts[rackPortAudioIn1]); | ||||
| jack_port_unregister(client, rackJackPorts[rackPortAudioIn2]); | jack_port_unregister(client, rackJackPorts[rackPortAudioIn2]); | ||||
| @@ -234,11 +234,11 @@ CarlaEngineClient* CarlaEngineJack::addClient(CarlaPlugin* const plugin) | |||||
| CarlaEngineClientNativeHandle handle; | CarlaEngineClientNativeHandle handle; | ||||
| #ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
| if (carlaOptions.process_mode == PROCESS_MODE_SINGLE_CLIENT) | |||||
| if (carlaOptions.processMode == PROCESS_MODE_SINGLE_CLIENT) | |||||
| { | { | ||||
| handle.jackClient = client; | handle.jackClient = client; | ||||
| } | } | ||||
| else if (carlaOptions.process_mode == PROCESS_MODE_MULTIPLE_CLIENTS) | |||||
| else if (carlaOptions.processMode == PROCESS_MODE_MULTIPLE_CLIENTS) | |||||
| #endif | #endif | ||||
| { | { | ||||
| handle.jackClient = jack_client_open(plugin->name(), JackNullOption, nullptr); | handle.jackClient = jack_client_open(plugin->name(), JackNullOption, nullptr); | ||||
| @@ -261,7 +261,7 @@ void CarlaEngineJack::handleSampleRateCallback(double newSampleRate) | |||||
| void CarlaEngineJack::handleBufferSizeCallback(uint32_t newBufferSize) | void CarlaEngineJack::handleBufferSizeCallback(uint32_t newBufferSize) | ||||
| { | { | ||||
| #ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
| if (carlaOptions.proccess_hp) | |||||
| if (carlaOptions.processHighPrecision) | |||||
| return; | return; | ||||
| #endif | #endif | ||||
| @@ -309,7 +309,7 @@ void CarlaEngineJack::handleProcessCallback(uint32_t nframes) | |||||
| } | } | ||||
| #ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
| if (carlaOptions.process_mode == PROCESS_MODE_SINGLE_CLIENT) | |||||
| if (carlaOptions.processMode == PROCESS_MODE_SINGLE_CLIENT) | |||||
| { | { | ||||
| for (unsigned short i=0; i < MAX_PLUGINS; i++) | for (unsigned short i=0; i < MAX_PLUGINS; i++) | ||||
| { | { | ||||
| @@ -324,7 +324,7 @@ void CarlaEngineJack::handleProcessCallback(uint32_t nframes) | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| else if (carlaOptions.process_mode == PROCESS_MODE_CONTINUOUS_RACK) | |||||
| else if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||||
| { | { | ||||
| // get buffers from jack | // get buffers from jack | ||||
| float* audioIn1 = (float*)jack_port_get_buffer(rackJackPorts[rackPortAudioIn1], nframes); | float* audioIn1 = (float*)jack_port_get_buffer(rackJackPorts[rackPortAudioIn1], nframes); | ||||
| @@ -469,7 +469,7 @@ void CarlaEngineJack::handleProcessCallback(uint32_t nframes) | |||||
| plugin->initBuffers(); | plugin->initBuffers(); | ||||
| if (carlaOptions.proccess_hp) | |||||
| if (carlaOptions.processHighPrecision) | |||||
| { | { | ||||
| float* ains_buffer2[2]; | float* ains_buffer2[2]; | ||||
| float* aouts_buffer2[2]; | float* aouts_buffer2[2]; | ||||
| @@ -254,7 +254,7 @@ void CarlaEngineRtAudio::handleProcessCallback(void* outputBuffer, void* inputBu | |||||
| plugin->initBuffers(); | plugin->initBuffers(); | ||||
| if (carlaOptions.proccess_hp) | |||||
| if (carlaOptions.processHighPrecision) | |||||
| { | { | ||||
| float* ains_buffer2[2]; | float* ains_buffer2[2]; | ||||
| float* aouts_buffer2[2]; | float* aouts_buffer2[2]; | ||||
| @@ -217,7 +217,7 @@ public: | |||||
| m_filename = nullptr; | m_filename = nullptr; | ||||
| #ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
| if (carlaOptions.process_mode == PROCESS_MODE_CONTINUOUS_RACK) | |||||
| if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||||
| cin_channel = m_id; | cin_channel = m_id; | ||||
| else | else | ||||
| #endif | #endif | ||||
| @@ -741,7 +741,7 @@ public: | |||||
| { | { | ||||
| m_id = id; | m_id = id; | ||||
| if (carlaOptions.process_mode == PROCESS_MODE_CONTINUOUS_RACK) | |||||
| if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||||
| cin_channel = id; | cin_channel = id; | ||||
| } | } | ||||
| @@ -1330,7 +1330,7 @@ public: | |||||
| outBuffer[i] = aout.ports[i]->getJackAudioBuffer(nframes); | outBuffer[i] = aout.ports[i]->getJackAudioBuffer(nframes); | ||||
| #ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
| if (carlaOptions.proccess_hp) | |||||
| if (carlaOptions.processHighPrecision) | |||||
| { | { | ||||
| float* inBuffer2[ain.count]; | float* inBuffer2[ain.count]; | ||||
| float* outBuffer2[aout.count]; | float* outBuffer2[aout.count]; | ||||
| @@ -1419,7 +1419,7 @@ public: | |||||
| } | } | ||||
| // Plugin Parameters | // Plugin Parameters | ||||
| if (param.count > 0 && param.count < carlaOptions.max_parameters) | |||||
| if (param.count > 0 && param.count < carlaOptions.maxParameters) | |||||
| { | { | ||||
| char bufName[STR_MAX], bufUnit[STR_MAX]; | char bufName[STR_MAX], bufUnit[STR_MAX]; | ||||
| @@ -1556,7 +1556,7 @@ public: | |||||
| bool showOscGui() | bool showOscGui() | ||||
| { | { | ||||
| // wait for UI 'update' call | // wait for UI 'update' call | ||||
| for (int i=0; i < carlaOptions.osc_gui_timeout; i++) | |||||
| for (uint i=0; i < carlaOptions.oscUiTimeout; i++) | |||||
| { | { | ||||
| if (osc.data.target) | if (osc.data.target) | ||||
| { | { | ||||
| @@ -200,18 +200,22 @@ const char* OptionsType2str(const OptionsType type) | |||||
| { | { | ||||
| case OPTION_PROCESS_MODE: | case OPTION_PROCESS_MODE: | ||||
| return "OPTION_PROCESS_MODE"; | return "OPTION_PROCESS_MODE"; | ||||
| case OPTION_PROCESS_HIGH_PRECISION: | |||||
| return "OPTION_PROCESS_HIGH_PRECISION"; | |||||
| case OPTION_MAX_PARAMETERS: | case OPTION_MAX_PARAMETERS: | ||||
| return "OPTION_MAX_PARAMETERS"; | return "OPTION_MAX_PARAMETERS"; | ||||
| case OPTION_PREFER_UI_BRIDGES: | |||||
| return "OPTION_PREFER_UI_BRIDGES"; | |||||
| case OPTION_PREFERRED_BUFFER_SIZE: | |||||
| return "OPTION_PREFERRED_BUFFER_SIZE"; | |||||
| case OPTION_PREFERRED_SAMPLE_RATE: | |||||
| return "OPTION_PREFERRED_SAMPLE_RATE"; | |||||
| case OPTION_FORCE_STEREO: | case OPTION_FORCE_STEREO: | ||||
| return "OPTION_FORCE_STEREO"; | return "OPTION_FORCE_STEREO"; | ||||
| case OPTION_PROCESS_HIGH_PRECISION: | |||||
| return "OPTION_PROCESS_HIGH_PRECISION"; | |||||
| case OPTION_OSC_GUI_TIMEOUT: | |||||
| return "OPTION_OSC_GUI_TIMEOUT"; | |||||
| case OPTION_USE_DSSI_CHUNKS: | |||||
| return "OPTION_USE_DSSI_CHUNKS"; | |||||
| case OPTION_USE_DSSI_VST_CHUNKS: | |||||
| return "OPTION_USE_DSSI_VST_CHUNKS"; | |||||
| case OPTION_PREFER_UI_BRIDGES: | |||||
| return "OPTION_PREFER_UI_BRIDGES"; | |||||
| case OPTION_OSC_UI_TIMEOUT: | |||||
| return "OPTION_OSC_UI_TIMEOUT"; | |||||
| case OPTION_PATH_LADSPA: | case OPTION_PATH_LADSPA: | ||||
| return "OPTION_PATH_LADSPA"; | return "OPTION_PATH_LADSPA"; | ||||
| case OPTION_PATH_DSSI: | case OPTION_PATH_DSSI: | ||||
| @@ -480,25 +484,31 @@ void setOption(const OptionsType option, const int value, const char* const valu | |||||
| case OPTION_PROCESS_MODE: | case OPTION_PROCESS_MODE: | ||||
| if (value < PROCESS_MODE_SINGLE_CLIENT || value > PROCESS_MODE_CONTINUOUS_RACK) | if (value < PROCESS_MODE_SINGLE_CLIENT || value > PROCESS_MODE_CONTINUOUS_RACK) | ||||
| return qCritical("CarlaBackend::setOption(%s, %i, \"%s\") - invalid value", OptionsType2str(option), value, valueStr); | return qCritical("CarlaBackend::setOption(%s, %i, \"%s\") - invalid value", OptionsType2str(option), value, valueStr); | ||||
| carlaOptions.process_mode = (ProcessModeType)value; | |||||
| carlaOptions.processMode = (ProcessModeType)value; | |||||
| break; | |||||
| case OPTION_PROCESS_HIGH_PRECISION: | |||||
| carlaOptions.processHighPrecision = value; | |||||
| break; | break; | ||||
| case OPTION_MAX_PARAMETERS: | case OPTION_MAX_PARAMETERS: | ||||
| carlaOptions.max_parameters = (value > 0) ? value : MAX_PARAMETERS; | |||||
| carlaOptions.maxParameters = (value > 0) ? value : MAX_PARAMETERS; | |||||
| break; | break; | ||||
| case OPTION_PREFER_UI_BRIDGES: | |||||
| carlaOptions.prefer_ui_bridges = value; | |||||
| case OPTION_PREFERRED_BUFFER_SIZE: | |||||
| carlaOptions.preferredBufferSize = value; | |||||
| break; | |||||
| case OPTION_PREFERRED_SAMPLE_RATE: | |||||
| carlaOptions.preferredSampleRate = value; | |||||
| break; | break; | ||||
| case OPTION_FORCE_STEREO: | case OPTION_FORCE_STEREO: | ||||
| carlaOptions.force_stereo = value; | |||||
| carlaOptions.forceStereo = value; | |||||
| break; | break; | ||||
| case OPTION_PROCESS_HIGH_PRECISION: | |||||
| carlaOptions.proccess_hp = value; | |||||
| case OPTION_USE_DSSI_VST_CHUNKS: | |||||
| carlaOptions.useDssiVstChunks = value; | |||||
| break; | break; | ||||
| case OPTION_OSC_GUI_TIMEOUT: | |||||
| carlaOptions.osc_gui_timeout = value/100; | |||||
| case OPTION_PREFER_UI_BRIDGES: | |||||
| carlaOptions.preferUiBridges = value; | |||||
| break; | break; | ||||
| case OPTION_USE_DSSI_CHUNKS: | |||||
| carlaOptions.use_dssi_chunks = value; | |||||
| case OPTION_OSC_UI_TIMEOUT: | |||||
| carlaOptions.oscUiTimeout = value/100; | |||||
| break; | break; | ||||
| case OPTION_PATH_LADSPA: | case OPTION_PATH_LADSPA: | ||||
| carla_setenv("LADSPA_PATH", valueStr); | carla_setenv("LADSPA_PATH", valueStr); | ||||
| @@ -576,20 +586,24 @@ void resetOptions() | |||||
| if (carlaOptions.bridge_vstx11) | if (carlaOptions.bridge_vstx11) | ||||
| free((void*)carlaOptions.bridge_vstx11); | free((void*)carlaOptions.bridge_vstx11); | ||||
| carlaOptions.process_mode = PROCESS_MODE_MULTIPLE_CLIENTS; | |||||
| carlaOptions.max_parameters = MAX_PARAMETERS; | |||||
| carlaOptions.prefer_ui_bridges = true; | |||||
| carlaOptions.proccess_hp = false; | |||||
| carlaOptions.osc_gui_timeout = 4000/100; | |||||
| carlaOptions.use_dssi_chunks = false; | |||||
| carlaOptions.bridge_unix32 = nullptr; | |||||
| carlaOptions.bridge_unix64 = nullptr; | |||||
| carlaOptions.bridge_win32 = nullptr; | |||||
| carlaOptions.bridge_win64 = nullptr; | |||||
| carlaOptions.bridge_lv2gtk2 = nullptr; | |||||
| carlaOptions.bridge_lv2qt4 = nullptr; | |||||
| carlaOptions.bridge_lv2x11 = nullptr; | |||||
| carlaOptions.bridge_vstx11 = nullptr; | |||||
| 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.preferUiBridges = true; | |||||
| carlaOptions.oscUiTimeout = 4000/100; | |||||
| carlaOptions.bridge_unix32 = nullptr; | |||||
| carlaOptions.bridge_unix64 = nullptr; | |||||
| carlaOptions.bridge_win32 = nullptr; | |||||
| carlaOptions.bridge_win64 = nullptr; | |||||
| carlaOptions.bridge_lv2gtk2 = nullptr; | |||||
| carlaOptions.bridge_lv2qt4 = nullptr; | |||||
| carlaOptions.bridge_lv2x11 = nullptr; | |||||
| carlaOptions.bridge_vstx11 = nullptr; | |||||
| } | } | ||||
| #endif // BUILD_BRIDGE | #endif // BUILD_BRIDGE | ||||
| @@ -55,13 +55,19 @@ void resetOptions(); | |||||
| // Global options | // Global options | ||||
| struct carla_options_t { | struct carla_options_t { | ||||
| ProcessModeType process_mode; | |||||
| uint max_parameters; | |||||
| bool prefer_ui_bridges; | |||||
| bool force_stereo; | |||||
| bool proccess_hp; | |||||
| int osc_gui_timeout; | |||||
| bool use_dssi_chunks; | |||||
| ProcessModeType processMode; | |||||
| bool processHighPrecision; | |||||
| uint maxParameters; | |||||
| uint preferredBufferSize; | |||||
| uint preferredSampleRate; | |||||
| bool forceStereo; | |||||
| bool useDssiVstChunks; | |||||
| bool preferUiBridges; | |||||
| uint oscUiTimeout; | |||||
| const char* bridge_unix32; | const char* bridge_unix32; | ||||
| const char* bridge_unix64; | const char* bridge_unix64; | ||||
| const char* bridge_win32; | const char* bridge_win32; | ||||
| @@ -72,13 +78,15 @@ struct carla_options_t { | |||||
| const char* bridge_vstx11; | const char* bridge_vstx11; | ||||
| carla_options_t() | carla_options_t() | ||||
| : process_mode(PROCESS_MODE_MULTIPLE_CLIENTS), | |||||
| max_parameters(MAX_PARAMETERS), | |||||
| prefer_ui_bridges(true), | |||||
| force_stereo(false), | |||||
| proccess_hp(false), | |||||
| osc_gui_timeout(4000/100), | |||||
| use_dssi_chunks(false), | |||||
| : processMode(PROCESS_MODE_MULTIPLE_CLIENTS), | |||||
| processHighPrecision(false), | |||||
| maxParameters(MAX_PARAMETERS), | |||||
| preferredBufferSize(512), | |||||
| preferredSampleRate(44100), | |||||
| forceStereo(false), | |||||
| useDssiVstChunks(false), | |||||
| preferUiBridges(true), | |||||
| oscUiTimeout(4000/100), | |||||
| bridge_unix32(nullptr), | bridge_unix32(nullptr), | ||||
| bridge_unix64(nullptr), | bridge_unix64(nullptr), | ||||
| bridge_win32(nullptr), | bridge_win32(nullptr), | ||||
| @@ -34,6 +34,16 @@ public: | |||||
| void stopNow(); | void stopNow(); | ||||
| protected: | |||||
| void run(); | |||||
| private: | |||||
| CarlaBackend::CarlaEngine* const engine; | |||||
| QMutex mutex; | |||||
| bool m_stopNow; | |||||
| // ---------------------------------------------- | |||||
| class ScopedLocker | class ScopedLocker | ||||
| { | { | ||||
| public: | public: | ||||
| @@ -51,14 +61,6 @@ public: | |||||
| private: | private: | ||||
| CarlaCheckThread* const m_thread; | CarlaCheckThread* const m_thread; | ||||
| }; | }; | ||||
| protected: | |||||
| void run(); | |||||
| private: | |||||
| CarlaBackend::CarlaEngine* const engine; | |||||
| QMutex mutex; | |||||
| bool m_stopNow; | |||||
| }; | }; | ||||
| // -------------------------------------------------------------------------------------------------------- | // -------------------------------------------------------------------------------------------------------- | ||||
| @@ -345,7 +345,7 @@ public: | |||||
| params += 1; | params += 1; | ||||
| } | } | ||||
| if (carlaOptions.force_stereo && (ains == 1 || aouts == 1) && ! h2) | |||||
| if (carlaOptions.forceStereo && (ains == 1 || aouts == 1) && ! h2) | |||||
| h2 = ldescriptor->instantiate(ldescriptor, sampleRate); | h2 = ldescriptor->instantiate(ldescriptor, sampleRate); | ||||
| if (descriptor->run_synth || descriptor->run_multiple_synths) | if (descriptor->run_synth || descriptor->run_multiple_synths) | ||||
| @@ -383,7 +383,7 @@ public: | |||||
| if (LADSPA_IS_PORT_AUDIO(PortType)) | if (LADSPA_IS_PORT_AUDIO(PortType)) | ||||
| { | { | ||||
| #ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
| if (carlaOptions.process_mode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||||
| if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||||
| { | { | ||||
| strcpy(portName, m_name); | strcpy(portName, m_name); | ||||
| strcat(portName, ":"); | strcat(portName, ":"); | ||||
| @@ -612,7 +612,7 @@ public: | |||||
| if (needsCin) | if (needsCin) | ||||
| { | { | ||||
| #ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
| if (carlaOptions.process_mode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||||
| if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||||
| { | { | ||||
| strcpy(portName, m_name); | strcpy(portName, m_name); | ||||
| strcat(portName, ":control-in"); | strcat(portName, ":control-in"); | ||||
| @@ -627,7 +627,7 @@ public: | |||||
| if (needsCout) | if (needsCout) | ||||
| { | { | ||||
| #ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
| if (carlaOptions.process_mode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||||
| if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||||
| { | { | ||||
| strcpy(portName, m_name); | strcpy(portName, m_name); | ||||
| strcat(portName, ":control-out"); | strcat(portName, ":control-out"); | ||||
| @@ -642,7 +642,7 @@ public: | |||||
| if (mins > 0) | if (mins > 0) | ||||
| { | { | ||||
| #ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
| if (carlaOptions.process_mode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||||
| if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||||
| { | { | ||||
| strcpy(portName, m_name); | strcpy(portName, m_name); | ||||
| strcat(portName, ":midi-in"); | strcat(portName, ":midi-in"); | ||||
| @@ -665,7 +665,7 @@ public: | |||||
| m_hints |= PLUGIN_IS_SYNTH; | m_hints |= PLUGIN_IS_SYNTH; | ||||
| #ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
| if (carlaOptions.use_dssi_chunks && QString(m_filename).endsWith("dssi-vst.so", Qt::CaseInsensitive)) | |||||
| if (carlaOptions.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; | ||||
| @@ -1508,7 +1508,7 @@ CarlaPlugin* CarlaPlugin::newDSSI(const initializer& init, const void* const ext | |||||
| plugin->reload(); | plugin->reload(); | ||||
| #ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
| if (carlaOptions.process_mode == PROCESS_MODE_CONTINUOUS_RACK) | |||||
| if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||||
| { | { | ||||
| const uint32_t ins = plugin->audioInCount(); | const uint32_t ins = plugin->audioInCount(); | ||||
| const uint32_t outs = plugin->audioOutCount(); | const uint32_t outs = plugin->audioOutCount(); | ||||
| @@ -415,7 +415,7 @@ public: | |||||
| // Audio Outputs | // Audio Outputs | ||||
| #ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
| if (carlaOptions.process_mode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||||
| if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||||
| { | { | ||||
| strcpy(portName, m_name); | strcpy(portName, m_name); | ||||
| strcat(portName, ":out-left"); | strcat(portName, ":out-left"); | ||||
| @@ -428,7 +428,7 @@ public: | |||||
| aout.rindexes[0] = 0; | aout.rindexes[0] = 0; | ||||
| #ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
| if (carlaOptions.process_mode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||||
| if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||||
| { | { | ||||
| strcpy(portName, m_name); | strcpy(portName, m_name); | ||||
| strcat(portName, ":out-right"); | strcat(portName, ":out-right"); | ||||
| @@ -444,7 +444,7 @@ public: | |||||
| // MIDI Input | // MIDI Input | ||||
| #ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
| if (carlaOptions.process_mode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||||
| if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||||
| { | { | ||||
| strcpy(portName, m_name); | strcpy(portName, m_name); | ||||
| strcat(portName, ":midi-in"); | strcat(portName, ":midi-in"); | ||||
| @@ -459,7 +459,7 @@ public: | |||||
| // Parameters | // Parameters | ||||
| #ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
| if (carlaOptions.process_mode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||||
| if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||||
| { | { | ||||
| strcpy(portName, m_name); | strcpy(portName, m_name); | ||||
| strcat(portName, ":control-in"); | strcat(portName, ":control-in"); | ||||
| @@ -471,7 +471,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.process_mode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||||
| if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||||
| { | { | ||||
| strcpy(portName, m_name); | strcpy(portName, m_name); | ||||
| strcat(portName, ":control-out"); | strcat(portName, ":control-out"); | ||||
| @@ -331,7 +331,7 @@ public: | |||||
| params += 1; | params += 1; | ||||
| } | } | ||||
| if (carlaOptions.force_stereo && (ains == 1 || aouts == 1) && ! h2) | |||||
| if (carlaOptions.forceStereo && (ains == 1 || aouts == 1) && ! h2) | |||||
| h2 = descriptor->instantiate(descriptor, sampleRate); | h2 = descriptor->instantiate(descriptor, sampleRate); | ||||
| if (ains > 0) | if (ains > 0) | ||||
| @@ -367,7 +367,7 @@ public: | |||||
| if (LADSPA_IS_PORT_AUDIO(PortType)) | if (LADSPA_IS_PORT_AUDIO(PortType)) | ||||
| { | { | ||||
| #ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
| if (carlaOptions.process_mode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||||
| if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||||
| { | { | ||||
| strcpy(portName, m_name); | strcpy(portName, m_name); | ||||
| strcat(portName, ":"); | strcat(portName, ":"); | ||||
| @@ -591,7 +591,7 @@ public: | |||||
| if (needsCin) | if (needsCin) | ||||
| { | { | ||||
| #ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
| if (carlaOptions.process_mode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||||
| if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||||
| { | { | ||||
| strcpy(portName, m_name); | strcpy(portName, m_name); | ||||
| strcat(portName, ":control-in"); | strcat(portName, ":control-in"); | ||||
| @@ -606,7 +606,7 @@ public: | |||||
| if (needsCout) | if (needsCout) | ||||
| { | { | ||||
| #ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
| if (carlaOptions.process_mode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||||
| if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||||
| { | { | ||||
| strcpy(portName, m_name); | strcpy(portName, m_name); | ||||
| strcat(portName, ":control-out"); | strcat(portName, ":control-out"); | ||||
| @@ -1114,7 +1114,7 @@ CarlaPlugin* CarlaPlugin::newLADSPA(const initializer& init, const void* const e | |||||
| plugin->reload(); | plugin->reload(); | ||||
| #ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
| if (carlaOptions.process_mode == PROCESS_MODE_CONTINUOUS_RACK) | |||||
| if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||||
| { | { | ||||
| const uint32_t ins = plugin->audioInCount(); | const uint32_t ins = plugin->audioInCount(); | ||||
| const uint32_t outs = plugin->audioOutCount(); | const uint32_t outs = plugin->audioOutCount(); | ||||
| @@ -159,7 +159,7 @@ public: | |||||
| // Audio Outputs | // Audio Outputs | ||||
| #ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
| if (carlaOptions.process_mode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||||
| if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||||
| { | { | ||||
| strcpy(portName, m_name); | strcpy(portName, m_name); | ||||
| strcat(portName, ":out-left"); | strcat(portName, ":out-left"); | ||||
| @@ -172,7 +172,7 @@ public: | |||||
| aout.rindexes[0] = 0; | aout.rindexes[0] = 0; | ||||
| #ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
| if (carlaOptions.process_mode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||||
| if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||||
| { | { | ||||
| strcpy(portName, m_name); | strcpy(portName, m_name); | ||||
| strcat(portName, ":out-right"); | strcat(portName, ":out-right"); | ||||
| @@ -188,7 +188,7 @@ public: | |||||
| // MIDI Input | // MIDI Input | ||||
| #ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
| if (carlaOptions.process_mode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||||
| if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||||
| { | { | ||||
| strcpy(portName, m_name); | strcpy(portName, m_name); | ||||
| strcat(portName, ":midi-in"); | strcat(portName, ":midi-in"); | ||||
| @@ -984,7 +984,7 @@ public: | |||||
| bool forcedStereoIn, forcedStereoOut; | bool forcedStereoIn, forcedStereoOut; | ||||
| forcedStereoIn = forcedStereoOut = true; | forcedStereoIn = forcedStereoOut = true; | ||||
| if (carlaOptions.force_stereo && (ains == 1 || aouts == 1) && ! h2) | |||||
| if (carlaOptions.forceStereo && (ains == 1 || aouts == 1) && ! h2) | |||||
| { | { | ||||
| h2 = descriptor->instantiate(descriptor, sampleRate, rdf_descriptor->Bundle, features); | h2 = descriptor->instantiate(descriptor, sampleRate, rdf_descriptor->Bundle, features); | ||||
| @@ -1100,7 +1100,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.process_mode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||||
| if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||||
| { | { | ||||
| strcpy(portName, m_name); | strcpy(portName, m_name); | ||||
| strcat(portName, ":"); | strcat(portName, ":"); | ||||
| @@ -1434,7 +1434,7 @@ public: | |||||
| if (needsCin) | if (needsCin) | ||||
| { | { | ||||
| #ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
| if (carlaOptions.process_mode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||||
| if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||||
| { | { | ||||
| strcpy(portName, m_name); | strcpy(portName, m_name); | ||||
| strcat(portName, ":control-in"); | strcat(portName, ":control-in"); | ||||
| @@ -1449,7 +1449,7 @@ public: | |||||
| if (needsCout) | if (needsCout) | ||||
| { | { | ||||
| #ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
| if (carlaOptions.process_mode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||||
| if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||||
| { | { | ||||
| strcpy(portName, m_name); | strcpy(portName, m_name); | ||||
| strcat(portName, ":control-out"); | strcat(portName, ":control-out"); | ||||
| @@ -3446,7 +3446,7 @@ public: | |||||
| { | { | ||||
| case LV2_UI_QT4: | case LV2_UI_QT4: | ||||
| #ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
| if (isUiBridgeable(i) && carlaOptions.prefer_ui_bridges) | |||||
| if (isUiBridgeable(i) && carlaOptions.preferUiBridges) | |||||
| eQt4 = i; | eQt4 = i; | ||||
| #endif | #endif | ||||
| iQt4 = i; | iQt4 = i; | ||||
| @@ -3454,7 +3454,7 @@ public: | |||||
| case LV2_UI_WINDOWS: | case LV2_UI_WINDOWS: | ||||
| #ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
| if (isUiBridgeable(i) && carlaOptions.prefer_ui_bridges) | |||||
| if (isUiBridgeable(i) && carlaOptions.preferUiBridges) | |||||
| eHWND = i; | eHWND = i; | ||||
| #endif | #endif | ||||
| iHWND = i; | iHWND = i; | ||||
| @@ -3462,7 +3462,7 @@ public: | |||||
| case LV2_UI_X11: | case LV2_UI_X11: | ||||
| #ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
| if (isUiBridgeable(i) && carlaOptions.prefer_ui_bridges) | |||||
| if (isUiBridgeable(i) && carlaOptions.preferUiBridges) | |||||
| eX11 = i; | eX11 = i; | ||||
| #endif | #endif | ||||
| iX11 = i; | iX11 = i; | ||||
| @@ -3473,7 +3473,7 @@ public: | |||||
| if (false) | if (false) | ||||
| #else | #else | ||||
| # ifdef HAVE_SUIL | # ifdef HAVE_SUIL | ||||
| if (isUiBridgeable(i) && carlaOptions.prefer_ui_bridges) | |||||
| if (isUiBridgeable(i) && carlaOptions.preferUiBridges) | |||||
| # else | # else | ||||
| if (isUiBridgeable(i)) | if (isUiBridgeable(i)) | ||||
| # endif | # endif | ||||
| @@ -3825,7 +3825,7 @@ CarlaPlugin* CarlaPlugin::newLV2(const initializer& init) | |||||
| plugin->reload(); | plugin->reload(); | ||||
| #ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
| if (carlaOptions.process_mode == PROCESS_MODE_CONTINUOUS_RACK) | |||||
| if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||||
| { | { | ||||
| const uint32_t ins = plugin->audioInCount(); | const uint32_t ins = plugin->audioInCount(); | ||||
| const uint32_t outs = plugin->audioOutCount(); | const uint32_t outs = plugin->audioOutCount(); | ||||
| @@ -371,7 +371,7 @@ public: | |||||
| for (j=0; j<ains; j++) | for (j=0; j<ains; j++) | ||||
| { | { | ||||
| #ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
| if (carlaOptions.process_mode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||||
| if (carlaOptions.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 | ||||
| @@ -384,7 +384,7 @@ public: | |||||
| for (j=0; j<aouts; j++) | for (j=0; j<aouts; j++) | ||||
| { | { | ||||
| #ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
| if (carlaOptions.process_mode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||||
| if (carlaOptions.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 | ||||
| @@ -512,7 +512,7 @@ public: | |||||
| if (needsCin) | if (needsCin) | ||||
| { | { | ||||
| #ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
| if (carlaOptions.process_mode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||||
| if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||||
| { | { | ||||
| strcpy(portName, m_name); | strcpy(portName, m_name); | ||||
| strcat(portName, ":control-in"); | strcat(portName, ":control-in"); | ||||
| @@ -527,7 +527,7 @@ public: | |||||
| if (mins == 1) | if (mins == 1) | ||||
| { | { | ||||
| #ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
| if (carlaOptions.process_mode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||||
| if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||||
| { | { | ||||
| strcpy(portName, m_name); | strcpy(portName, m_name); | ||||
| strcat(portName, ":midi-in"); | strcat(portName, ":midi-in"); | ||||
| @@ -542,7 +542,7 @@ public: | |||||
| if (mouts == 1) | if (mouts == 1) | ||||
| { | { | ||||
| #ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
| if (carlaOptions.process_mode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||||
| if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||||
| { | { | ||||
| strcpy(portName, m_name); | strcpy(portName, m_name); | ||||
| strcat(portName, ":midi-out"); | strcat(portName, ":midi-out"); | ||||
| @@ -1391,7 +1391,7 @@ public: | |||||
| #ifdef BUILD_BRIDGE | #ifdef BUILD_BRIDGE | ||||
| return MAX_PARAMETERS; | return MAX_PARAMETERS; | ||||
| #else | #else | ||||
| return carlaOptions.max_parameters; | |||||
| return carlaOptions.maxParameters; | |||||
| #endif | #endif | ||||
| case audioMasterGetParameterQuantization: | case audioMasterGetParameterQuantization: | ||||
| @@ -1807,7 +1807,7 @@ CarlaPlugin* CarlaPlugin::newVST(const initializer& init) | |||||
| plugin->reload(); | plugin->reload(); | ||||
| #ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
| if (carlaOptions.process_mode == PROCESS_MODE_CONTINUOUS_RACK) | |||||
| if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||||
| { | { | ||||
| const uint32_t ins = plugin->audioInCount(); | const uint32_t ins = plugin->audioInCount(); | ||||
| const uint32_t outs = plugin->audioOutCount(); | const uint32_t outs = plugin->audioOutCount(); | ||||
| @@ -1060,6 +1060,7 @@ class CarlaMainW(QMainWindow, ui_carla.Ui_CarlaMainW): | |||||
| self.m_engine_started = False | self.m_engine_started = False | ||||
| self.m_project_filename = None | self.m_project_filename = None | ||||
| self.m_pluginCount = 0 | |||||
| self.m_plugin_list = [] | self.m_plugin_list = [] | ||||
| for x in range(MAX_PLUGINS): | for x in range(MAX_PLUGINS): | ||||
| @@ -1068,6 +1069,8 @@ class CarlaMainW(QMainWindow, ui_carla.Ui_CarlaMainW): | |||||
| # ------------------------------------------------------------- | # ------------------------------------------------------------- | ||||
| # Set-up GUI stuff | # Set-up GUI stuff | ||||
| self.act_engine_start.setEnabled(False) | |||||
| self.act_engine_stop.setEnabled(False) | |||||
| self.act_plugin_remove_all.setEnabled(False) | self.act_plugin_remove_all.setEnabled(False) | ||||
| self.resize(self.width(), 0) | self.resize(self.width(), 0) | ||||
| @@ -1079,6 +1082,9 @@ class CarlaMainW(QMainWindow, ui_carla.Ui_CarlaMainW): | |||||
| self.connect(self.act_file_save, SIGNAL("triggered()"), SLOT("slot_file_save()")) | self.connect(self.act_file_save, SIGNAL("triggered()"), SLOT("slot_file_save()")) | ||||
| self.connect(self.act_file_save_as, SIGNAL("triggered()"), SLOT("slot_file_save_as()")) | self.connect(self.act_file_save_as, SIGNAL("triggered()"), SLOT("slot_file_save_as()")) | ||||
| self.connect(self.act_engine_start, SIGNAL("triggered()"), SLOT("slot_engine_start()")) | |||||
| self.connect(self.act_engine_stop, SIGNAL("triggered()"), SLOT("slot_engine_stop()")) | |||||
| self.connect(self.act_plugin_add, SIGNAL("triggered()"), SLOT("slot_plugin_add()")) | self.connect(self.act_plugin_add, SIGNAL("triggered()"), SLOT("slot_plugin_add()")) | ||||
| self.connect(self.act_plugin_remove_all, SIGNAL("triggered()"), SLOT("slot_remove_all()")) | self.connect(self.act_plugin_remove_all, SIGNAL("triggered()"), SLOT("slot_remove_all()")) | ||||
| @@ -1105,6 +1111,132 @@ class CarlaMainW(QMainWindow, ui_carla.Ui_CarlaMainW): | |||||
| self.TIMER_GUI_STUFF = self.startTimer(self.m_savedSettings["Main/RefreshInterval"]) # Peaks | self.TIMER_GUI_STUFF = self.startTimer(self.m_savedSettings["Main/RefreshInterval"]) # Peaks | ||||
| self.TIMER_GUI_STUFF2 = self.startTimer(self.m_savedSettings["Main/RefreshInterval"] * 2) # LEDs and edit dialog | self.TIMER_GUI_STUFF2 = self.startTimer(self.m_savedSettings["Main/RefreshInterval"] * 2) # LEDs and edit dialog | ||||
| QTimer.singleShot(0, self, SLOT("slot_engine_start()")) | |||||
| def loadProjectLater(self): | |||||
| QTimer.singleShot(0, self.load_project) | |||||
| def startEngine(self): | |||||
| # --------------------------------------------- | |||||
| # engine | |||||
| Carla.processMode = self.settings.value("Engine/ProcessMode", PROCESS_MODE_MULTIPLE_CLIENTS, type=int) | |||||
| Carla.maxParameters = self.settings.value("Engine/MaxParameters", MAX_PARAMETERS, type=int) | |||||
| processHighPrecision = self.settings.value("Engine/ProcessHighPrecision", False, type=bool) | |||||
| preferredBufferSize = self.settings.value("Engine/PreferredBufferSize", 512, type=int) | |||||
| preferredSampleRate = self.settings.value("Engine/PreferredSampleRate", 44100, type=int) | |||||
| forceStereo = self.settings.value("Engine/ForceStereo", False, type=bool) | |||||
| useDssiVstChunks = self.settings.value("Engine/UseDssiVstChunks", False, type=bool) | |||||
| preferUiBridges = self.settings.value("Engine/PreferUiBridges", True, type=bool) | |||||
| oscUiTimeout = self.settings.value("Engine/OscUiTimeout", 40, type=int) | |||||
| disableChecks = self.settings.value("Engine/DisableChecks", bool(not WINDOWS), type=bool) | |||||
| if Carla.processMode == PROCESS_MODE_CONTINUOUS_RACK: | |||||
| forceStereo = True | |||||
| elif Carla.processMode == PROCESS_MODE_MULTIPLE_CLIENTS and os.getenv("LADISH_APP_NAME"): | |||||
| print("LADISH detected but using multiple clients (not allowed), forcing single client now") | |||||
| Carla.processMode = PROCESS_MODE_SINGLE_CLIENT | |||||
| if disableChecks: | |||||
| os.environ["CARLA_DISCOVERY_NO_PROCESSING_CHECKS"] = "true" | |||||
| Carla.Host.set_option(OPTION_PROCESS_MODE, Carla.processMode, "") | |||||
| Carla.Host.set_option(OPTION_PROCESS_HIGH_PRECISION, processHighPrecision, "") | |||||
| Carla.Host.set_option(OPTION_MAX_PARAMETERS, Carla.maxParameters, "") | |||||
| Carla.Host.set_option(OPTION_PREFERRED_BUFFER_SIZE, preferredBufferSize, "") | |||||
| Carla.Host.set_option(OPTION_PREFERRED_SAMPLE_RATE, preferredSampleRate, "") | |||||
| Carla.Host.set_option(OPTION_FORCE_STEREO, forceStereo, "") | |||||
| Carla.Host.set_option(OPTION_USE_DSSI_VST_CHUNKS, useDssiVstChunks, "") | |||||
| Carla.Host.set_option(OPTION_PREFER_UI_BRIDGES, preferUiBridges, "") | |||||
| Carla.Host.set_option(OPTION_OSC_UI_TIMEOUT, oscUiTimeout, "") | |||||
| # --------------------------------------------- | |||||
| # plugin paths | |||||
| global LADSPA_PATH, DSSI_PATH, LV2_PATH, VST_PATH, GIG_PATH, SF2_PATH, SFZ_PATH | |||||
| LADSPA_PATH = toList(self.settings.value("Paths/LADSPA", LADSPA_PATH)) | |||||
| DSSI_PATH = toList(self.settings.value("Paths/DSSI", DSSI_PATH)) | |||||
| LV2_PATH = toList(self.settings.value("Paths/LV2", LV2_PATH)) | |||||
| VST_PATH = toList(self.settings.value("Paths/VST", VST_PATH)) | |||||
| GIG_PATH = toList(self.settings.value("Paths/GIG", GIG_PATH)) | |||||
| SF2_PATH = toList(self.settings.value("Paths/SF2", SF2_PATH)) | |||||
| SFZ_PATH = toList(self.settings.value("Paths/SFZ", SFZ_PATH)) | |||||
| Carla.Host.set_option(OPTION_PATH_LADSPA, 0, splitter.join(LADSPA_PATH)) | |||||
| Carla.Host.set_option(OPTION_PATH_DSSI, 0, splitter.join(DSSI_PATH)) | |||||
| Carla.Host.set_option(OPTION_PATH_LV2, 0, splitter.join(LV2_PATH)) | |||||
| Carla.Host.set_option(OPTION_PATH_VST, 0, splitter.join(VST_PATH)) | |||||
| Carla.Host.set_option(OPTION_PATH_GIG, 0, splitter.join(GIG_PATH)) | |||||
| Carla.Host.set_option(OPTION_PATH_SF2, 0, splitter.join(SF2_PATH)) | |||||
| Carla.Host.set_option(OPTION_PATH_SFZ, 0, splitter.join(SFZ_PATH)) | |||||
| # --------------------------------------------- | |||||
| # bridge paths | |||||
| if carla_bridge_unix32: | |||||
| Carla.Host.set_option(OPTION_PATH_BRIDGE_UNIX32, 0, carla_bridge_unix32) | |||||
| if carla_bridge_unix64: | |||||
| Carla.Host.set_option(OPTION_PATH_BRIDGE_UNIX64, 0, carla_bridge_unix64) | |||||
| if carla_bridge_win32: | |||||
| Carla.Host.set_option(OPTION_PATH_BRIDGE_WIN32, 0, carla_bridge_win32) | |||||
| if carla_bridge_win64: | |||||
| Carla.Host.set_option(OPTION_PATH_BRIDGE_WIN64, 0, carla_bridge_win64) | |||||
| if carla_bridge_lv2_gtk2: | |||||
| Carla.Host.set_option(OPTION_PATH_BRIDGE_LV2_GTK2, 0, carla_bridge_lv2_gtk2) | |||||
| if carla_bridge_lv2_qt4: | |||||
| Carla.Host.set_option(OPTION_PATH_BRIDGE_LV2_QT4, 0, carla_bridge_lv2_qt4) | |||||
| if carla_bridge_lv2_x11: | |||||
| Carla.Host.set_option(OPTION_PATH_BRIDGE_LV2_X11, 0, carla_bridge_lv2_x11) | |||||
| if carla_bridge_vst_x11: | |||||
| Carla.Host.set_option(OPTION_PATH_BRIDGE_VST_X11, 0, carla_bridge_vst_x11) | |||||
| # --------------------------------------------- | |||||
| # start | |||||
| audioDriver = self.settings.value("Engine/AudioDriver", "JACK", type=str) | |||||
| if not Carla.Host.engine_init(audioDriver, "Carla"): | |||||
| self.act_engine_start.setEnabled(True) | |||||
| self.act_engine_stop.setEnabled(False) | |||||
| QMessageBox.critical(self, self.tr("Error"), self.tr("Could not connect to Audio backend '%s', possible reasons: %s" % (audioDriver, cString(Carla.Host.get_last_error())))) | |||||
| return | |||||
| self.m_engine_started = True | |||||
| def stopEngine(self): | |||||
| if Carla.Host.is_engine_running() and not Carla.Host.engine_close(): | |||||
| print(cString(Carla.Host.get_last_error())) | |||||
| self.m_engine_started = False | |||||
| @pyqtSlot() | |||||
| def slot_engine_start(self): | |||||
| self.startEngine() | |||||
| check = Carla.Host.is_engine_running() | |||||
| self.act_engine_start.setEnabled(not check) | |||||
| self.act_engine_stop.setEnabled(check) | |||||
| @pyqtSlot() | |||||
| def slot_engine_stop(self): | |||||
| self.stopEngine() | |||||
| check = Carla.Host.is_engine_running() | |||||
| self.act_engine_start.setEnabled(not check) | |||||
| self.act_engine_stop.setEnabled(check) | |||||
| @pyqtSlot() | @pyqtSlot() | ||||
| def slot_handleSIGUSR1(self): | def slot_handleSIGUSR1(self): | ||||
| print("Got SIGUSR1 -> Saving project now") | print("Got SIGUSR1 -> Saving project now") | ||||
| @@ -1216,11 +1348,16 @@ class CarlaMainW(QMainWindow, ui_carla.Ui_CarlaMainW): | |||||
| self.tr("You may want to save your session now..."), QMessageBox.Ok, QMessageBox.Ok) | self.tr("You may want to save your session now..."), QMessageBox.Ok, QMessageBox.Ok) | ||||
| def add_plugin(self, btype, ptype, filename, name, label, extra_stuff, activate): | def add_plugin(self, btype, ptype, filename, name, label, extra_stuff, activate): | ||||
| if not self.m_engine_started: | |||||
| if activate: | |||||
| QMessageBox.warning(self, self.tr("Warning"), self.tr("Cannot add new plugins while engine is stopped")) | |||||
| return -1 | |||||
| new_plugin_id = Carla.Host.add_plugin(btype, ptype, filename, name, label, extra_stuff) | new_plugin_id = Carla.Host.add_plugin(btype, ptype, filename, name, label, extra_stuff) | ||||
| if (new_plugin_id < 0): | |||||
| CustomMessageBox(self, QMessageBox.Critical, self.tr("Error"), self.tr("Failed to load plugin"), | |||||
| cString(Carla.Host.get_last_error()), QMessageBox.Ok, QMessageBox.Ok) | |||||
| if new_plugin_id < 0: | |||||
| CustomMessageBox(self, QMessageBox.Critical, self.tr("Error"), self.tr("Failed to load plugin"), cString(Carla.Host.get_last_error()), QMessageBox.Ok, QMessageBox.Ok) | |||||
| return -1 | |||||
| else: | else: | ||||
| pwidget = PluginWidget(self, new_plugin_id) | pwidget = PluginWidget(self, new_plugin_id) | ||||
| self.w_plugins.layout().addWidget(pwidget) | self.w_plugins.layout().addWidget(pwidget) | ||||
| @@ -1233,6 +1370,7 @@ class CarlaMainW(QMainWindow, ui_carla.Ui_CarlaMainW): | |||||
| if activate: | if activate: | ||||
| pwidget.set_active(True, True, True) | pwidget.set_active(True, True, True) | ||||
| self.m_pluginCount += 1 | |||||
| return new_plugin_id | return new_plugin_id | ||||
| def remove_plugin(self, plugin_id, showError): | def remove_plugin(self, plugin_id, showError): | ||||
| @@ -1247,6 +1385,7 @@ class CarlaMainW(QMainWindow, ui_carla.Ui_CarlaMainW): | |||||
| pwidget.deleteLater() | pwidget.deleteLater() | ||||
| self.w_plugins.layout().removeWidget(pwidget) | self.w_plugins.layout().removeWidget(pwidget) | ||||
| self.m_plugin_list[plugin_id] = None | self.m_plugin_list[plugin_id] = None | ||||
| self.m_pluginCount -= 1 | |||||
| elif showError: | elif showError: | ||||
| CustomMessageBox(self, QMessageBox.Critical, self.tr("Error"), self.tr("Failed to remove plugin"), cString(Carla.Host.get_last_error()), QMessageBox.Ok, QMessageBox.Ok) | CustomMessageBox(self, QMessageBox.Critical, self.tr("Error"), self.tr("Failed to remove plugin"), cString(Carla.Host.get_last_error()), QMessageBox.Ok, QMessageBox.Ok) | ||||
| @@ -1664,28 +1803,11 @@ class CarlaMainW(QMainWindow, ui_carla.Ui_CarlaMainW): | |||||
| "Main/RefreshInterval": self.settings.value("Main/RefreshInterval", 120, type=int) | "Main/RefreshInterval": self.settings.value("Main/RefreshInterval", 120, type=int) | ||||
| } | } | ||||
| global LADSPA_PATH, DSSI_PATH, LV2_PATH, VST_PATH, GIG_PATH, SF2_PATH, SFZ_PATH | |||||
| LADSPA_PATH = toList(self.settings.value("Paths/LADSPA", LADSPA_PATH)) | |||||
| DSSI_PATH = toList(self.settings.value("Paths/DSSI", DSSI_PATH)) | |||||
| LV2_PATH = toList(self.settings.value("Paths/LV2", LV2_PATH)) | |||||
| VST_PATH = toList(self.settings.value("Paths/VST", VST_PATH)) | |||||
| GIG_PATH = toList(self.settings.value("Paths/GIG", GIG_PATH)) | |||||
| SF2_PATH = toList(self.settings.value("Paths/SF2", SF2_PATH)) | |||||
| SFZ_PATH = toList(self.settings.value("Paths/SFZ", SFZ_PATH)) | |||||
| Carla.Host.set_option(OPTION_PATH_LADSPA, 0, splitter.join(LADSPA_PATH)) | |||||
| Carla.Host.set_option(OPTION_PATH_DSSI, 0, splitter.join(DSSI_PATH)) | |||||
| Carla.Host.set_option(OPTION_PATH_LV2, 0, splitter.join(LV2_PATH)) | |||||
| Carla.Host.set_option(OPTION_PATH_VST, 0, splitter.join(VST_PATH)) | |||||
| Carla.Host.set_option(OPTION_PATH_GIG, 0, splitter.join(GIG_PATH)) | |||||
| Carla.Host.set_option(OPTION_PATH_SF2, 0, splitter.join(SF2_PATH)) | |||||
| Carla.Host.set_option(OPTION_PATH_SFZ, 0, splitter.join(SFZ_PATH)) | |||||
| def timerEvent(self, event): | def timerEvent(self, event): | ||||
| if event.timerId() == self.TIMER_GUI_STUFF: | if event.timerId() == self.TIMER_GUI_STUFF: | ||||
| for pwidget in self.m_plugin_list: | for pwidget in self.m_plugin_list: | ||||
| if pwidget: pwidget.check_gui_stuff() | if pwidget: pwidget.check_gui_stuff() | ||||
| if self.m_engine_started: | |||||
| if self.m_engine_started and self.m_pluginCount > 0: | |||||
| Carla.Host.idle_guis() | Carla.Host.idle_guis() | ||||
| elif event.timerId() == self.TIMER_GUI_STUFF2: | elif event.timerId() == self.TIMER_GUI_STUFF2: | ||||
| for pwidget in self.m_plugin_list: | for pwidget in self.m_plugin_list: | ||||
| @@ -1699,37 +1821,37 @@ class CarlaMainW(QMainWindow, ui_carla.Ui_CarlaMainW): | |||||
| # ------------------------------------------------------------------------------------------------ | # ------------------------------------------------------------------------------------------------ | ||||
| def callback_function(ptr, action, plugin_id, value1, value2, value3): | |||||
| if plugin_id < 0 or plugin_id >= MAX_PLUGINS: | |||||
| def callback_function(ptr, action, pluginId, value1, value2, value3): | |||||
| if pluginId< 0 or pluginId >= MAX_PLUGINS or not Carla.gui: | |||||
| return | return | ||||
| if action == CALLBACK_DEBUG: | if action == CALLBACK_DEBUG: | ||||
| Carla.gui.emit(SIGNAL("DebugCallback(int, int, int, double)"), plugin_id, value1, value2, value3) | |||||
| Carla.gui.emit(SIGNAL("DebugCallback(int, int, int, double)"), pluginId, value1, value2, value3) | |||||
| elif action == CALLBACK_PARAMETER_VALUE_CHANGED: | elif action == CALLBACK_PARAMETER_VALUE_CHANGED: | ||||
| Carla.gui.emit(SIGNAL("ParameterCallback(int, int, double)"), plugin_id, value1, value3) | |||||
| Carla.gui.emit(SIGNAL("ParameterCallback(int, int, double)"), pluginId, value1, value3) | |||||
| # TODO param midi callbacks | # TODO param midi callbacks | ||||
| elif action == CALLBACK_PROGRAM_CHANGED: | elif action == CALLBACK_PROGRAM_CHANGED: | ||||
| Carla.gui.emit(SIGNAL("ProgramCallback(int, int)"), plugin_id, value1) | |||||
| Carla.gui.emit(SIGNAL("ProgramCallback(int, int)"), pluginId, value1) | |||||
| elif action == CALLBACK_MIDI_PROGRAM_CHANGED: | elif action == CALLBACK_MIDI_PROGRAM_CHANGED: | ||||
| Carla.gui.emit(SIGNAL("MidiProgramCallback(int, int)"), plugin_id, value1) | |||||
| Carla.gui.emit(SIGNAL("MidiProgramCallback(int, int)"), pluginId, value1) | |||||
| elif action == CALLBACK_NOTE_ON: | elif action == CALLBACK_NOTE_ON: | ||||
| Carla.gui.emit(SIGNAL("NoteOnCallback(int, int, int, int)"), plugin_id, value1, value2, value3) | |||||
| Carla.gui.emit(SIGNAL("NoteOnCallback(int, int, int, int)"), pluginId, value1, value2, value3) | |||||
| elif action == CALLBACK_NOTE_OFF: | elif action == CALLBACK_NOTE_OFF: | ||||
| Carla.gui.emit(SIGNAL("NoteOffCallback(int, int, int)"), plugin_id, value1, value2) | |||||
| Carla.gui.emit(SIGNAL("NoteOffCallback(int, int, int)"), pluginId, value1, value2) | |||||
| elif action == CALLBACK_SHOW_GUI: | elif action == CALLBACK_SHOW_GUI: | ||||
| Carla.gui.emit(SIGNAL("ShowGuiCallback(int, int)"), plugin_id, value1) | |||||
| Carla.gui.emit(SIGNAL("ShowGuiCallback(int, int)"), pluginId, value1) | |||||
| elif action == CALLBACK_RESIZE_GUI: | elif action == CALLBACK_RESIZE_GUI: | ||||
| Carla.gui.emit(SIGNAL("ResizeGuiCallback(int, int, int)"), plugin_id, value1, value2) | |||||
| Carla.gui.emit(SIGNAL("ResizeGuiCallback(int, int, int)"), pluginId, value1, value2) | |||||
| elif action == CALLBACK_UPDATE: | elif action == CALLBACK_UPDATE: | ||||
| Carla.gui.emit(SIGNAL("UpdateCallback(int)"), plugin_id) | |||||
| Carla.gui.emit(SIGNAL("UpdateCallback(int)"), pluginId) | |||||
| elif action == CALLBACK_RELOAD_INFO: | elif action == CALLBACK_RELOAD_INFO: | ||||
| Carla.gui.emit(SIGNAL("ReloadInfoCallback(int)"), plugin_id) | |||||
| Carla.gui.emit(SIGNAL("ReloadInfoCallback(int)"), pluginId) | |||||
| elif action == CALLBACK_RELOAD_PARAMETERS: | elif action == CALLBACK_RELOAD_PARAMETERS: | ||||
| Carla.gui.emit(SIGNAL("ReloadParametersCallback(int)"), plugin_id) | |||||
| Carla.gui.emit(SIGNAL("ReloadParametersCallback(int)"), pluginId) | |||||
| elif action == CALLBACK_RELOAD_PROGRAMS: | elif action == CALLBACK_RELOAD_PROGRAMS: | ||||
| Carla.gui.emit(SIGNAL("ReloadProgramsCallback(int)"), plugin_id) | |||||
| Carla.gui.emit(SIGNAL("ReloadProgramsCallback(int)"), pluginId) | |||||
| elif action == CALLBACK_RELOAD_ALL: | elif action == CALLBACK_RELOAD_ALL: | ||||
| Carla.gui.emit(SIGNAL("ReloadAllCallback(int)"), plugin_id) | |||||
| Carla.gui.emit(SIGNAL("ReloadAllCallback(int)"), pluginId) | |||||
| elif action == CALLBACK_QUIT: | elif action == CALLBACK_QUIT: | ||||
| Carla.gui.emit(SIGNAL("QuitCallback()")) | Carla.gui.emit(SIGNAL("QuitCallback()")) | ||||
| @@ -1742,114 +1864,50 @@ if __name__ == '__main__': | |||||
| app.setOrganizationName("Cadence") | app.setOrganizationName("Cadence") | ||||
| app.setWindowIcon(QIcon(":/scalable/carla.svg")) | app.setWindowIcon(QIcon(":/scalable/carla.svg")) | ||||
| lib_prefix = None | |||||
| project_filename = None | |||||
| libPrefix = None | |||||
| projectFilename = None | |||||
| for i in range(len(app.arguments())): | for i in range(len(app.arguments())): | ||||
| if i == 0: continue | if i == 0: continue | ||||
| argument = app.arguments()[i] | argument = app.arguments()[i] | ||||
| if argument.startswith("--with-libprefix="): | if argument.startswith("--with-libprefix="): | ||||
| lib_prefix = argument.replace("--with-libprefix=", "") | |||||
| libPrefix = argument.replace("--with-libprefix=", "") | |||||
| elif os.path.exists(argument): | elif os.path.exists(argument): | ||||
| project_filename = argument | |||||
| #style = app.style().metaObject().className() | |||||
| #force_parameters_style = (style in ("Bespin::Style",)) | |||||
| Carla.Host = Host(lib_prefix) | |||||
| # Create GUI and read settings | |||||
| Carla.gui = CarlaMainW() | |||||
| # Init backend | |||||
| Carla.processMode = Carla.gui.settings.value("Engine/ProcessMode", PROCESS_MODE_MULTIPLE_CLIENTS, type=int) | |||||
| Carla.maxParameters = Carla.gui.settings.value("Engine/MaxParameters", MAX_PARAMETERS, type=int) | |||||
| prefer_ui_bridges = Carla.gui.settings.value("Engine/PreferUIBridges", True, type=bool) | |||||
| osc_gui_timeout = Carla.gui.settings.value("Engine/OscGuiTimeout", 40, type=int) | |||||
| disable_checks = Carla.gui.settings.value("Engine/DisableChecks", bool(not WINDOWS), type=bool) | |||||
| use_dssi_chunks = Carla.gui.settings.value("Engine/UseDSSIChunks", False, type=bool) | |||||
| force_stereo = Carla.gui.settings.value("Engine/ForceStereo", False, type=bool) | |||||
| proccess_hp = Carla.gui.settings.value("Engine/ProcessHP", False, type=bool) | |||||
| if Carla.processMode == PROCESS_MODE_CONTINUOUS_RACK: | |||||
| force_stereo = True | |||||
| elif Carla.processMode == PROCESS_MODE_MULTIPLE_CLIENTS and os.getenv("LADISH_APP_NAME"): | |||||
| print("LADISH detected but using multiple clients (not allowed), forcing single client now") | |||||
| Carla.processMode = PROCESS_MODE_SINGLE_CLIENT | |||||
| if disable_checks: | |||||
| os.environ["CARLA_DISCOVERY_NO_PROCESSING_CHECKS"] = "true" | |||||
| projectFilename = argument | |||||
| Carla.Host = Host(libPrefix) | |||||
| Carla.Host.set_callback_function(callback_function) | Carla.Host.set_callback_function(callback_function) | ||||
| Carla.Host.set_option(OPTION_PROCESS_MODE, Carla.processMode, "") | |||||
| Carla.Host.set_option(OPTION_MAX_PARAMETERS, Carla.maxParameters, "") | |||||
| Carla.Host.set_option(OPTION_OSC_GUI_TIMEOUT, osc_gui_timeout, "") | |||||
| Carla.Host.set_option(OPTION_PREFER_UI_BRIDGES, prefer_ui_bridges, "") | |||||
| # Set available drivers | |||||
| driverCount = Carla.Host.get_engine_driver_count() | |||||
| driverList = [] | |||||
| for i in range(driverCount): | |||||
| driver = cString(Carla.Host.get_engine_driver_name(i)) | |||||
| if driver: | |||||
| driverList.append(driver) | |||||
| setAvailableEngineDrivers(driverList) | |||||
| Carla.Host.set_option(OPTION_USE_DSSI_CHUNKS, use_dssi_chunks, "") | |||||
| Carla.Host.set_option(OPTION_FORCE_STEREO, force_stereo, "") | |||||
| Carla.Host.set_option(OPTION_PROCESS_HIGH_PRECISION, proccess_hp, "") | |||||
| if carla_bridge_unix32: | |||||
| Carla.Host.set_option(OPTION_PATH_BRIDGE_UNIX32, 0, carla_bridge_unix32) | |||||
| if carla_bridge_unix64: | |||||
| Carla.Host.set_option(OPTION_PATH_BRIDGE_UNIX64, 0, carla_bridge_unix64) | |||||
| if carla_bridge_win32: | |||||
| Carla.Host.set_option(OPTION_PATH_BRIDGE_WIN32, 0, carla_bridge_win32) | |||||
| if carla_bridge_win64: | |||||
| Carla.Host.set_option(OPTION_PATH_BRIDGE_WIN64, 0, carla_bridge_win64) | |||||
| if carla_bridge_lv2_gtk2: | |||||
| Carla.Host.set_option(OPTION_PATH_BRIDGE_LV2_GTK2, 0, carla_bridge_lv2_gtk2) | |||||
| if carla_bridge_lv2_qt4: | |||||
| Carla.Host.set_option(OPTION_PATH_BRIDGE_LV2_QT4, 0, carla_bridge_lv2_qt4) | |||||
| if carla_bridge_lv2_x11: | |||||
| Carla.Host.set_option(OPTION_PATH_BRIDGE_LV2_X11, 0, carla_bridge_lv2_x11) | |||||
| if carla_bridge_vst_x11: | |||||
| Carla.Host.set_option(OPTION_PATH_BRIDGE_VST_X11, 0, carla_bridge_vst_x11) | |||||
| # TEST | |||||
| count = Carla.Host.get_engine_driver_count() | |||||
| print(count) | |||||
| for i in range(0, count): | |||||
| dname = cString(Carla.Host.get_engine_driver_name(i)) | |||||
| print("%i - %s" % (i, dname)) | |||||
| if not Carla.Host.engine_init("JACK", "Carla"): | |||||
| #if not Carla.Host.engine_init("PulseAudio", "Carla"): | |||||
| CustomMessageBox(None, QMessageBox.Critical, "Error", "Could not connect to Audio backend, possible reasons:", | |||||
| cString(Carla.Host.get_last_error()), QMessageBox.Ok, QMessageBox.Ok) | |||||
| sys.exit(1) | |||||
| # Create GUI and start engine | |||||
| Carla.gui = CarlaMainW() | |||||
| # Set-up custom signal handling | # Set-up custom signal handling | ||||
| setUpSignals(Carla.gui) | setUpSignals(Carla.gui) | ||||
| # Show GUI | # Show GUI | ||||
| Carla.gui.m_engine_started = True | |||||
| Carla.gui.show() | Carla.gui.show() | ||||
| if project_filename: | |||||
| Carla.gui.m_project_filename = project_filename | |||||
| Carla.gui.load_project() | |||||
| Carla.gui.setWindowTitle("Carla - %s" % os.path.basename(project_filename)) | |||||
| if projectFilename: | |||||
| Carla.gui.m_project_filename = projectFilename | |||||
| Carla.gui.loadProjectLater() | |||||
| Carla.gui.setWindowTitle("Carla - %s" % os.path.basename(projectFilename)) # FIXME - put in loadProject | |||||
| # App-Loop | # App-Loop | ||||
| ret = app.exec_() | ret = app.exec_() | ||||
| # Close Host | # Close Host | ||||
| if Carla.Host.is_engine_running() and not Carla.Host.engine_close(): | |||||
| print(cString(Carla.Host.get_last_error())) | |||||
| Carla.gui.stopEngine() | |||||
| # Exit properly | # Exit properly | ||||
| sys.exit(ret) | sys.exit(ret) | ||||
| @@ -135,27 +135,29 @@ GUI_EXTERNAL_OSC = 7 | |||||
| # enum OptionsType | # enum OptionsType | ||||
| OPTION_PROCESS_MODE = 1 | OPTION_PROCESS_MODE = 1 | ||||
| OPTION_MAX_PARAMETERS = 2 | |||||
| OPTION_PREFER_UI_BRIDGES = 3 | |||||
| OPTION_FORCE_STEREO = 4 | |||||
| OPTION_PROCESS_HIGH_PRECISION = 5 | |||||
| OPTION_OSC_GUI_TIMEOUT = 6 | |||||
| OPTION_USE_DSSI_CHUNKS = 7 | |||||
| OPTION_PATH_LADSPA = 8 | |||||
| OPTION_PATH_DSSI = 9 | |||||
| OPTION_PATH_LV2 = 10 | |||||
| OPTION_PATH_VST = 11 | |||||
| OPTION_PATH_GIG = 12 | |||||
| OPTION_PATH_SF2 = 13 | |||||
| OPTION_PATH_SFZ = 14 | |||||
| OPTION_PATH_BRIDGE_UNIX32 = 15 | |||||
| OPTION_PATH_BRIDGE_UNIX64 = 16 | |||||
| OPTION_PATH_BRIDGE_WIN32 = 17 | |||||
| OPTION_PATH_BRIDGE_WIN64 = 18 | |||||
| OPTION_PATH_BRIDGE_LV2_GTK2 = 19 | |||||
| OPTION_PATH_BRIDGE_LV2_QT4 = 20 | |||||
| OPTION_PATH_BRIDGE_LV2_X11 = 21 | |||||
| OPTION_PATH_BRIDGE_VST_X11 = 22 | |||||
| OPTION_PROCESS_HIGH_PRECISION = 2 | |||||
| OPTION_MAX_PARAMETERS = 3 | |||||
| OPTION_PREFERRED_BUFFER_SIZE = 4 | |||||
| OPTION_PREFERRED_SAMPLE_RATE = 5 | |||||
| OPTION_FORCE_STEREO = 6 | |||||
| OPTION_USE_DSSI_VST_CHUNKS = 7 | |||||
| OPTION_PREFER_UI_BRIDGES = 8 | |||||
| OPTION_OSC_UI_TIMEOUT = 9 | |||||
| OPTION_PATH_LADSPA = 10 | |||||
| OPTION_PATH_DSSI = 11 | |||||
| OPTION_PATH_LV2 = 12 | |||||
| OPTION_PATH_VST = 13 | |||||
| OPTION_PATH_GIG = 14 | |||||
| OPTION_PATH_SF2 = 15 | |||||
| OPTION_PATH_SFZ = 16 | |||||
| OPTION_PATH_BRIDGE_UNIX32 = 17 | |||||
| OPTION_PATH_BRIDGE_UNIX64 = 18 | |||||
| OPTION_PATH_BRIDGE_WIN32 = 19 | |||||
| OPTION_PATH_BRIDGE_WIN64 = 20 | |||||
| OPTION_PATH_BRIDGE_LV2_GTK2 = 21 | |||||
| OPTION_PATH_BRIDGE_LV2_QT4 = 22 | |||||
| OPTION_PATH_BRIDGE_LV2_X11 = 23 | |||||
| OPTION_PATH_BRIDGE_VST_X11 = 24 | |||||
| # enum CallbackType | # enum CallbackType | ||||
| CALLBACK_DEBUG = 0 | CALLBACK_DEBUG = 0 | ||||
| @@ -56,8 +56,10 @@ LADISH_CONF_KEY_DAEMON_JS_SAVE_DELAY_DEFAULT = 0 | |||||
| # Internal defines | # Internal defines | ||||
| global SETTINGS_DEFAULT_PROJECT_FOLDER | global SETTINGS_DEFAULT_PROJECT_FOLDER | ||||
| global SETTINGS_DEFAULT_PLUGINS_PATHS | global SETTINGS_DEFAULT_PLUGINS_PATHS | ||||
| SETTINGS_DEFAULT_PROJECT_FOLDER = HOME | |||||
| SETTINGS_DEFAULT_PLUGINS_PATHS = [[], [], [], [], [], [], []] | |||||
| global SETTINGS_AVAILABLE_ENGINE_DRIVERS | |||||
| SETTINGS_DEFAULT_PROJECT_FOLDER = HOME | |||||
| SETTINGS_DEFAULT_PLUGINS_PATHS = [[], [], [], [], [], [], []] | |||||
| SETTINGS_AVAILABLE_ENGINE_DRIVERS = ["JACK"] | |||||
| def setDefaultProjectFolder(folder): | def setDefaultProjectFolder(folder): | ||||
| global SETTINGS_DEFAULT_PROJECT_FOLDER | global SETTINGS_DEFAULT_PROJECT_FOLDER | ||||
| @@ -65,7 +67,11 @@ def setDefaultProjectFolder(folder): | |||||
| def setDefaultPluginsPaths(ladspas, dssis, lv2s, vsts, gigs, sf2s, sfzs): | def setDefaultPluginsPaths(ladspas, dssis, lv2s, vsts, gigs, sf2s, sfzs): | ||||
| global SETTINGS_DEFAULT_PLUGINS_PATHS | global SETTINGS_DEFAULT_PLUGINS_PATHS | ||||
| SETTINGS_DEFAULT_PLUGINS_PATHS = [ladspas, dssis, lv2s, vsts, gigs, sf2s, sfzs] | |||||
| SETTINGS_DEFAULT_PLUGINS_PATHS = [ladspas, dssis, lv2s, vsts, gigs, sf2s, sfzs] | |||||
| def setAvailableEngineDrivers(drivers): | |||||
| global SETTINGS_AVAILABLE_ENGINE_DRIVERS | |||||
| SETTINGS_AVAILABLE_ENGINE_DRIVERS = drivers | |||||
| # Settings Dialog | # Settings Dialog | ||||
| class SettingsW(QDialog, ui_settings_app.Ui_SettingsW): | class SettingsW(QDialog, ui_settings_app.Ui_SettingsW): | ||||
| @@ -119,6 +125,10 @@ class SettingsW(QDialog, ui_settings_app.Ui_SettingsW): | |||||
| self.lw_page.hideRow(2) | self.lw_page.hideRow(2) | ||||
| self.lw_page.setCurrentCell(0, 0) | self.lw_page.setCurrentCell(0, 0) | ||||
| global SETTINGS_AVAILABLE_ENGINE_DRIVERS | |||||
| for driver in SETTINGS_AVAILABLE_ENGINE_DRIVERS: | |||||
| self.cb_engine_audio_driver.addItem(driver) | |||||
| else: | else: | ||||
| self.lw_page.hideRow(0) | self.lw_page.hideRow(0) | ||||
| self.lw_page.hideRow(1) | self.lw_page.hideRow(1) | ||||
| @@ -200,7 +210,13 @@ class SettingsW(QDialog, ui_settings_app.Ui_SettingsW): | |||||
| # -------------------------------------------- | # -------------------------------------------- | ||||
| if not self.lw_page.isRowHidden(TAB_INDEX_CARLA_ENGINE): | if not self.lw_page.isRowHidden(TAB_INDEX_CARLA_ENGINE): | ||||
| #self.cb_engine_audio_driver.setCurrentIndex(self.settings.value("Engine/AudioDriver", "JACK", type=str)) | |||||
| audioDriver = self.settings.value("Engine/AudioDriver", "JACK", type=str) | |||||
| for i in range(self.cb_engine_audio_driver.count()): | |||||
| if self.cb_engine_audio_driver.itemText(i) == audioDriver: | |||||
| self.cb_engine_audio_driver.setCurrentIndex(i) | |||||
| break | |||||
| else: | |||||
| self.cb_engine_audio_driver.setCurrentIndex(-1) | |||||
| self.cb_engine_process_mode.setCurrentIndex(self.settings.value("Engine/ProcessMode", PROCESS_MODE_MULTIPLE_CLIENTS, type=int)) | self.cb_engine_process_mode.setCurrentIndex(self.settings.value("Engine/ProcessMode", PROCESS_MODE_MULTIPLE_CLIENTS, type=int)) | ||||
| self.sb_engine_max_params.setValue(self.settings.value("Engine/MaxParameters", 200, type=int)) | self.sb_engine_max_params.setValue(self.settings.value("Engine/MaxParameters", 200, type=int)) | ||||
| self.ch_engine_prefer_bridges.setChecked(self.settings.value("Engine/PreferUIBridges", True, type=bool)) | self.ch_engine_prefer_bridges.setChecked(self.settings.value("Engine/PreferUIBridges", True, type=bool)) | ||||
| @@ -398,12 +414,12 @@ class SettingsW(QDialog, ui_settings_app.Ui_SettingsW): | |||||
| self.settings.setValue("Engine/AudioDriver", self.cb_engine_audio_driver.currentText()) | self.settings.setValue("Engine/AudioDriver", self.cb_engine_audio_driver.currentText()) | ||||
| self.settings.setValue("Engine/ProcessMode", self.cb_engine_process_mode.currentIndex()) | self.settings.setValue("Engine/ProcessMode", self.cb_engine_process_mode.currentIndex()) | ||||
| self.settings.setValue("Engine/MaxParameters", self.sb_engine_max_params.value()) | self.settings.setValue("Engine/MaxParameters", self.sb_engine_max_params.value()) | ||||
| self.settings.setValue("Engine/PreferUIBridges", self.ch_engine_prefer_bridges.isChecked()) | |||||
| self.settings.setValue("Engine/OscGuiTimeout", self.sb_engine_oscgui_timeout.value()) | |||||
| self.settings.setValue("Engine/PreferUiBridges", self.ch_engine_prefer_bridges.isChecked()) | |||||
| self.settings.setValue("Engine/OscUiTimeout", self.sb_engine_oscgui_timeout.value()) | |||||
| self.settings.setValue("Engine/DisableChecks", self.ch_engine_disable_checks.isChecked()) | self.settings.setValue("Engine/DisableChecks", self.ch_engine_disable_checks.isChecked()) | ||||
| self.settings.setValue("Engine/UseDSSIChunks", self.ch_engine_dssi_chunks.isChecked()) | |||||
| self.settings.setValue("Engine/UseDssiVstChunks", self.ch_engine_dssi_chunks.isChecked()) | |||||
| self.settings.setValue("Engine/ForceStereo", self.ch_engine_force_stereo.isChecked()) | self.settings.setValue("Engine/ForceStereo", self.ch_engine_force_stereo.isChecked()) | ||||
| self.settings.setValue("Engine/ProcessHP", self.ch_engine_process_hp.isChecked()) | |||||
| self.settings.setValue("Engine/ProcessHighPrecision", self.ch_engine_process_hp.isChecked()) | |||||
| # -------------------------------------------- | # -------------------------------------------- | ||||
| @@ -470,6 +486,7 @@ class SettingsW(QDialog, ui_settings_app.Ui_SettingsW): | |||||
| self.le_ladish_terminal.setText(LADISH_CONF_KEY_DAEMON_TERMINAL_DEFAULT) | self.le_ladish_terminal.setText(LADISH_CONF_KEY_DAEMON_TERMINAL_DEFAULT) | ||||
| elif self.lw_page.currentRow() == TAB_INDEX_CARLA_ENGINE: | elif self.lw_page.currentRow() == TAB_INDEX_CARLA_ENGINE: | ||||
| self.cb_engine_audio_driver.setCurrentIndex(0) | |||||
| self.cb_engine_process_mode.setCurrentIndex(PROCESS_MODE_MULTIPLE_CLIENTS) | self.cb_engine_process_mode.setCurrentIndex(PROCESS_MODE_MULTIPLE_CLIENTS) | ||||
| self.sb_engine_max_params.setValue(200) | self.sb_engine_max_params.setValue(200) | ||||
| self.ch_engine_prefer_bridges.setChecked(True) | self.ch_engine_prefer_bridges.setChecked(True) | ||||
| @@ -51,7 +51,7 @@ | |||||
| <x>0</x> | <x>0</x> | ||||
| <y>0</y> | <y>0</y> | ||||
| <width>710</width> | <width>710</width> | ||||
| <height>19</height> | |||||
| <height>22</height> | |||||
| </rect> | </rect> | ||||
| </property> | </property> | ||||
| <widget class="QMenu" name="menu_File"> | <widget class="QMenu" name="menu_File"> | ||||
| @@ -88,7 +88,17 @@ | |||||
| <addaction name="separator"/> | <addaction name="separator"/> | ||||
| <addaction name="act_settings_configure"/> | <addaction name="act_settings_configure"/> | ||||
| </widget> | </widget> | ||||
| <widget class="QMenu" name="menu_Engine"> | |||||
| <property name="title"> | |||||
| <string>&Engine</string> | |||||
| </property> | |||||
| <addaction name="act_engine_start"/> | |||||
| <addaction name="act_engine_stop"/> | |||||
| <addaction name="separator"/> | |||||
| <addaction name="act_engine_configure"/> | |||||
| </widget> | |||||
| <addaction name="menu_File"/> | <addaction name="menu_File"/> | ||||
| <addaction name="menu_Engine"/> | |||||
| <addaction name="menu_Plugin"/> | <addaction name="menu_Plugin"/> | ||||
| <addaction name="menu_Settings"/> | <addaction name="menu_Settings"/> | ||||
| <addaction name="menu_Help"/> | <addaction name="menu_Help"/> | ||||
| @@ -118,6 +128,10 @@ | |||||
| <addaction name="act_file_save"/> | <addaction name="act_file_save"/> | ||||
| <addaction name="act_file_save_as"/> | <addaction name="act_file_save_as"/> | ||||
| <addaction name="separator"/> | <addaction name="separator"/> | ||||
| <addaction name="act_engine_start"/> | |||||
| <addaction name="act_engine_stop"/> | |||||
| <addaction name="act_engine_configure"/> | |||||
| <addaction name="separator"/> | |||||
| <addaction name="act_plugin_add"/> | <addaction name="act_plugin_add"/> | ||||
| <addaction name="act_plugin_remove_all"/> | <addaction name="act_plugin_remove_all"/> | ||||
| </widget> | </widget> | ||||
| @@ -211,6 +225,36 @@ | |||||
| <string>Configure Carla</string> | <string>Configure Carla</string> | ||||
| </property> | </property> | ||||
| </action> | </action> | ||||
| <action name="act_engine_start"> | |||||
| <property name="icon"> | |||||
| <iconset resource="../../resources/resources.qrc"> | |||||
| <normaloff>:/16x16/media-playback-start.png</normaloff>:/16x16/media-playback-start.png</iconset> | |||||
| </property> | |||||
| <property name="text"> | |||||
| <string>&Start</string> | |||||
| </property> | |||||
| </action> | |||||
| <action name="act_engine_stop"> | |||||
| <property name="icon"> | |||||
| <iconset resource="../../resources/resources.qrc"> | |||||
| <normaloff>:/16x16/media-playback-stop.png</normaloff>:/16x16/media-playback-stop.png</iconset> | |||||
| </property> | |||||
| <property name="text"> | |||||
| <string>St&op</string> | |||||
| </property> | |||||
| </action> | |||||
| <action name="act_engine_configure"> | |||||
| <property name="enabled"> | |||||
| <bool>false</bool> | |||||
| </property> | |||||
| <property name="icon"> | |||||
| <iconset resource="../../resources/resources.qrc"> | |||||
| <normaloff>:/16x16/configure.png</normaloff>:/16x16/configure.png</iconset> | |||||
| </property> | |||||
| <property name="text"> | |||||
| <string>Configure Driver</string> | |||||
| </property> | |||||
| </action> | |||||
| </widget> | </widget> | ||||
| <resources> | <resources> | ||||
| <include location="../../resources/resources.qrc"/> | <include location="../../resources/resources.qrc"/> | ||||
| @@ -7,7 +7,7 @@ | |||||
| <x>0</x> | <x>0</x> | ||||
| <y>0</y> | <y>0</y> | ||||
| <width>600</width> | <width>600</width> | ||||
| <height>449</height> | |||||
| <height>465</height> | |||||
| </rect> | </rect> | ||||
| </property> | </property> | ||||
| <property name="minimumSize"> | <property name="minimumSize"> | ||||
| @@ -203,7 +203,7 @@ | |||||
| <number>0</number> | <number>0</number> | ||||
| </property> | </property> | ||||
| <property name="currentIndex"> | <property name="currentIndex"> | ||||
| <number>0</number> | |||||
| <number>3</number> | |||||
| </property> | </property> | ||||
| <widget class="QWidget" name="page_main"> | <widget class="QWidget" name="page_main"> | ||||
| <layout class="QVBoxLayout" name="verticalLayout_5"> | <layout class="QVBoxLayout" name="verticalLayout_5"> | ||||
| @@ -309,7 +309,7 @@ | |||||
| <item row="0" column="0"> | <item row="0" column="0"> | ||||
| <widget class="QCheckBox" name="cb_tray_enable"> | <widget class="QCheckBox" name="cb_tray_enable"> | ||||
| <property name="text"> | <property name="text"> | ||||
| <string>Use System Tray (App-Indicator and KDE support)</string> | |||||
| <string>Use System Tray (App-Indicator support)</string> | |||||
| </property> | </property> | ||||
| </widget> | </widget> | ||||
| </item> | </item> | ||||
| @@ -799,13 +799,7 @@ | |||||
| </widget> | </widget> | ||||
| </item> | </item> | ||||
| <item row="0" column="1"> | <item row="0" column="1"> | ||||
| <widget class="QComboBox" name="cb_engine_audio_driver"> | |||||
| <item> | |||||
| <property name="text"> | |||||
| <string>JACK</string> | |||||
| </property> | |||||
| </item> | |||||
| </widget> | |||||
| <widget class="QComboBox" name="cb_engine_audio_driver"/> | |||||
| </item> | </item> | ||||
| <item row="1" column="0"> | <item row="1" column="0"> | ||||
| <widget class="QLabel" name="label_20"> | <widget class="QLabel" name="label_20"> | ||||
| @@ -900,7 +894,7 @@ | |||||
| <string>How much time to wait for OSC GUIs to ping back the host</string> | <string>How much time to wait for OSC GUIs to ping back the host</string> | ||||
| </property> | </property> | ||||
| <property name="text"> | <property name="text"> | ||||
| <string>OSC GUI Timeout:</string> | |||||
| <string>OSC UI Timeout:</string> | |||||
| </property> | </property> | ||||
| <property name="alignment"> | <property name="alignment"> | ||||
| <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> | <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> | ||||