| @@ -155,7 +155,7 @@ const PluginInfo* get_internal_plugin_info(unsigned int plugin_id) | |||
| const PluginDescriptor* const nativePlugin = CarlaBackend::CarlaPlugin::getNativePlugin(plugin_id); | |||
| Q_ASSERT(nativePlugin); | |||
| CARLA_ASSERT(nativePlugin); | |||
| if (! nativePlugin) | |||
| return nullptr; | |||
| @@ -169,7 +169,7 @@ public: | |||
| int32_t chunkData(void** const dataPtr) | |||
| { | |||
| Q_ASSERT(dataPtr); | |||
| CARLA_ASSERT(dataPtr); | |||
| if (! info.chunk.isEmpty()) | |||
| { | |||
| @@ -185,7 +185,7 @@ public: | |||
| double getParameterValue(const uint32_t parameterId) | |||
| { | |||
| Q_ASSERT(parameterId < param.count); | |||
| CARLA_ASSERT(parameterId < param.count); | |||
| return params[parameterId].value; | |||
| } | |||
| @@ -224,14 +224,14 @@ public: | |||
| void getParameterName(const uint32_t parameterId, char* const strBuf) | |||
| { | |||
| Q_ASSERT(parameterId < param.count); | |||
| CARLA_ASSERT(parameterId < param.count); | |||
| strncpy(strBuf, params[parameterId].name.toUtf8().constData(), STR_MAX); | |||
| } | |||
| void getParameterUnit(const uint32_t parameterId, char* const strBuf) | |||
| { | |||
| Q_ASSERT(parameterId < param.count); | |||
| CARLA_ASSERT(parameterId < param.count); | |||
| strncpy(strBuf, params[parameterId].unit.toUtf8().constData(), STR_MAX); | |||
| } | |||
| @@ -262,9 +262,9 @@ public: | |||
| const int32_t aOuts = argv[1]->i; | |||
| const int32_t aTotal = argv[2]->i; | |||
| Q_ASSERT(aIns >= 0); | |||
| Q_ASSERT(aOuts >= 0); | |||
| Q_ASSERT(aIns + aOuts == aTotal); | |||
| CARLA_ASSERT(aIns >= 0); | |||
| CARLA_ASSERT(aOuts >= 0); | |||
| CARLA_ASSERT(aIns + aOuts == aTotal); | |||
| info.aIns = aIns; | |||
| info.aOuts = aOuts; | |||
| @@ -281,9 +281,9 @@ public: | |||
| const int32_t mOuts = argv[1]->i; | |||
| const int32_t mTotal = argv[2]->i; | |||
| Q_ASSERT(mIns >= 0); | |||
| Q_ASSERT(mOuts >= 0); | |||
| Q_ASSERT(mIns + mOuts == mTotal); | |||
| CARLA_ASSERT(mIns >= 0); | |||
| CARLA_ASSERT(mOuts >= 0); | |||
| CARLA_ASSERT(mIns + mOuts == mTotal); | |||
| info.mIns = mIns; | |||
| info.mOuts = mOuts; | |||
| @@ -300,9 +300,9 @@ public: | |||
| const int32_t pOuts = argv[1]->i; | |||
| const int32_t pTotal = argv[2]->i; | |||
| Q_ASSERT(pIns >= 0); | |||
| Q_ASSERT(pOuts >= 0); | |||
| Q_ASSERT(pIns + pOuts <= pTotal); | |||
| CARLA_ASSERT(pIns >= 0); | |||
| CARLA_ASSERT(pOuts >= 0); | |||
| CARLA_ASSERT(pIns + pOuts <= pTotal); | |||
| // delete old data | |||
| if (param.count > 0) | |||
| @@ -339,7 +339,7 @@ public: | |||
| const int32_t count = argv[0]->i; | |||
| Q_ASSERT(count >= 0); | |||
| CARLA_ASSERT(count >= 0); | |||
| // delete old programs | |||
| if (prog.count > 0) | |||
| @@ -410,12 +410,12 @@ public: | |||
| const char* const copyright = (const char*)&argv[5]->s; | |||
| const int64_t uniqueId = argv[6]->h; | |||
| Q_ASSERT(category >= 0); | |||
| Q_ASSERT(hints >= 0); | |||
| Q_ASSERT(name); | |||
| Q_ASSERT(label); | |||
| Q_ASSERT(maker); | |||
| Q_ASSERT(copyright); | |||
| CARLA_ASSERT(category >= 0); | |||
| CARLA_ASSERT(hints >= 0); | |||
| CARLA_ASSERT(name); | |||
| CARLA_ASSERT(label); | |||
| CARLA_ASSERT(maker); | |||
| CARLA_ASSERT(copyright); | |||
| m_hints = hints | PLUGIN_IS_BRIDGE; | |||
| info.category = (PluginCategory)category; | |||
| @@ -440,9 +440,9 @@ public: | |||
| const char* const name = (const char*)&argv[1]->s; | |||
| const char* const unit = (const char*)&argv[2]->s; | |||
| Q_ASSERT(index >= 0 && index < (int32_t)param.count); | |||
| Q_ASSERT(name); | |||
| Q_ASSERT(unit); | |||
| CARLA_ASSERT(index >= 0 && index < (int32_t)param.count); | |||
| CARLA_ASSERT(name); | |||
| CARLA_ASSERT(unit); | |||
| if (index >= 0 && index < (int32_t)param.count) | |||
| { | |||
| @@ -464,12 +464,12 @@ public: | |||
| const int32_t channel = argv[4]->i; | |||
| const int32_t cc = argv[5]->i; | |||
| Q_ASSERT(index >= 0 && index < (int32_t)param.count); | |||
| Q_ASSERT(type >= 0); | |||
| Q_ASSERT(rindex >= 0); | |||
| Q_ASSERT(hints >= 0); | |||
| Q_ASSERT(channel >= 0 && channel < 16); | |||
| Q_ASSERT(cc >= -1); | |||
| CARLA_ASSERT(index >= 0 && index < (int32_t)param.count); | |||
| CARLA_ASSERT(type >= 0); | |||
| CARLA_ASSERT(rindex >= 0); | |||
| CARLA_ASSERT(hints >= 0); | |||
| CARLA_ASSERT(channel >= 0 && channel < 16); | |||
| CARLA_ASSERT(cc >= -1); | |||
| if (index >= 0 && index < (int32_t)param.count) | |||
| { | |||
| @@ -496,10 +496,10 @@ public: | |||
| const double stepSmall = argv[5]->d; | |||
| const double stepLarge = argv[6]->d; | |||
| Q_ASSERT(index >= 0 && index < (int32_t)param.count); | |||
| Q_ASSERT(min < max); | |||
| Q_ASSERT(def >= min); | |||
| Q_ASSERT(def <= max); | |||
| CARLA_ASSERT(index >= 0 && index < (int32_t)param.count); | |||
| CARLA_ASSERT(min < max); | |||
| CARLA_ASSERT(def >= min); | |||
| CARLA_ASSERT(def <= max); | |||
| if (index >= 0 && index < (int32_t)param.count) | |||
| { | |||
| @@ -522,8 +522,8 @@ public: | |||
| const int32_t index = argv[0]->i; | |||
| const char* const name = (const char*)&argv[1]->s; | |||
| Q_ASSERT(index >= 0 && index < (int32_t)prog.count); | |||
| Q_ASSERT(name); | |||
| CARLA_ASSERT(index >= 0 && index < (int32_t)prog.count); | |||
| CARLA_ASSERT(name); | |||
| if (index >= 0 && index < (int32_t)prog.count) | |||
| { | |||
| @@ -545,10 +545,10 @@ public: | |||
| const int32_t program = argv[2]->i; | |||
| const char* const name = (const char*)&argv[3]->s; | |||
| Q_ASSERT(index >= 0 && index < (int32_t)midiprog.count); | |||
| Q_ASSERT(bank >= 0); | |||
| Q_ASSERT(program >= 0 && program < 128); | |||
| Q_ASSERT(name); | |||
| CARLA_ASSERT(index >= 0 && index < (int32_t)midiprog.count); | |||
| CARLA_ASSERT(bank >= 0); | |||
| CARLA_ASSERT(program >= 0 && program < 128); | |||
| CARLA_ASSERT(name); | |||
| if (index >= 0 && index < (int32_t)midiprog.count) | |||
| { | |||
| @@ -570,8 +570,8 @@ public: | |||
| const char* const key = (const char*)&argv[0]->s; | |||
| const char* const value = (const char*)&argv[1]->s; | |||
| Q_ASSERT(key); | |||
| Q_ASSERT(value); | |||
| CARLA_ASSERT(key); | |||
| CARLA_ASSERT(value); | |||
| if (! (key && value)) | |||
| { | |||
| @@ -597,7 +597,7 @@ public: | |||
| const int32_t index = argv[0]->i; | |||
| const double value = argv[1]->d; | |||
| Q_ASSERT(index != PARAMETER_NULL); | |||
| CARLA_ASSERT(index != PARAMETER_NULL); | |||
| setParameterValueByRIndex(index, value, false, true, true); | |||
| @@ -611,7 +611,7 @@ public: | |||
| const int32_t index = argv[0]->i; | |||
| const double value = argv[1]->d; | |||
| Q_ASSERT(index >= 0 && index < (int32_t)param.count); | |||
| CARLA_ASSERT(index >= 0 && index < (int32_t)param.count); | |||
| if (index >= 0 && index < (int32_t)param.count) | |||
| param.ranges[index].def = value; | |||
| @@ -625,7 +625,7 @@ public: | |||
| const int32_t index = argv[0]->i; | |||
| Q_ASSERT(index < (int32_t)prog.count); | |||
| CARLA_ASSERT(index < (int32_t)prog.count); | |||
| setProgram(index, false, true, true, true); | |||
| @@ -638,7 +638,7 @@ public: | |||
| const int32_t index = argv[0]->i; | |||
| Q_ASSERT(index < (int32_t)midiprog.count); | |||
| CARLA_ASSERT(index < (int32_t)midiprog.count); | |||
| setMidiProgram(index, false, true, true, true); | |||
| @@ -653,9 +653,9 @@ public: | |||
| const char* const key = (const char*)&argv[1]->s; | |||
| const char* const value = (const char*)&argv[2]->s; | |||
| Q_ASSERT(stype); | |||
| Q_ASSERT(key); | |||
| Q_ASSERT(value); | |||
| CARLA_ASSERT(stype); | |||
| CARLA_ASSERT(key); | |||
| CARLA_ASSERT(value); | |||
| setCustomData(getCustomDataStringType(stype), key, value, false); | |||
| @@ -668,7 +668,7 @@ public: | |||
| const char* const chunkFileChar = (const char*)&argv[0]->s; | |||
| Q_ASSERT(chunkFileChar); | |||
| CARLA_ASSERT(chunkFileChar); | |||
| QString chunkFileStr(chunkFileChar); | |||
| @@ -725,7 +725,7 @@ public: | |||
| const char* const error = (const char*)&argv[0]->s; | |||
| Q_ASSERT(error); | |||
| CARLA_ASSERT(error); | |||
| m_initiated = true; | |||
| m_initError = true; | |||
| @@ -744,7 +744,7 @@ public: | |||
| void setParameterValue(const uint32_t parameterId, double value, const bool sendGui, const bool sendOsc, const bool sendCallback) | |||
| { | |||
| Q_ASSERT(parameterId < param.count); | |||
| CARLA_ASSERT(parameterId < param.count); | |||
| params[parameterId].value = fixParameterValue(value, param.ranges[parameterId]); | |||
| @@ -753,9 +753,9 @@ public: | |||
| void setCustomData(const CustomDataType type, const char* const key, const char* const value, const bool sendGui) | |||
| { | |||
| Q_ASSERT(type != CUSTOM_DATA_INVALID); | |||
| Q_ASSERT(key); | |||
| Q_ASSERT(value); | |||
| CARLA_ASSERT(type != CUSTOM_DATA_INVALID); | |||
| CARLA_ASSERT(key); | |||
| CARLA_ASSERT(value); | |||
| if (sendGui) | |||
| { | |||
| @@ -774,8 +774,8 @@ public: | |||
| void setChunkData(const char* const stringData) | |||
| { | |||
| Q_ASSERT(m_hints & PLUGIN_USES_CHUNKS); | |||
| Q_ASSERT(stringData); | |||
| CARLA_ASSERT(m_hints & PLUGIN_USES_CHUNKS); | |||
| CARLA_ASSERT(stringData); | |||
| QString filePath; | |||
| filePath = QDir::tempPath(); | |||
| @@ -840,7 +840,7 @@ public: | |||
| void uiParameterChange(const uint32_t index, const double value) | |||
| { | |||
| Q_ASSERT(index < param.count); | |||
| CARLA_ASSERT(index < param.count); | |||
| if (index >= param.count) | |||
| return; | |||
| @@ -852,7 +852,7 @@ public: | |||
| void uiProgramChange(const uint32_t index) | |||
| { | |||
| Q_ASSERT(index < prog.count); | |||
| CARLA_ASSERT(index < prog.count); | |||
| if (index >= prog.count) | |||
| return; | |||
| @@ -864,7 +864,7 @@ public: | |||
| void uiMidiProgramChange(const uint32_t index) | |||
| { | |||
| Q_ASSERT(index < midiprog.count); | |||
| CARLA_ASSERT(index < midiprog.count); | |||
| if (index >= midiprog.count) | |||
| return; | |||
| @@ -876,9 +876,9 @@ public: | |||
| void uiNoteOn(const uint8_t channel, const uint8_t note, const uint8_t velo) | |||
| { | |||
| Q_ASSERT(channel < 16); | |||
| Q_ASSERT(note < 128); | |||
| Q_ASSERT(velo > 0 && velo < 128); | |||
| CARLA_ASSERT(channel < 16); | |||
| CARLA_ASSERT(note < 128); | |||
| CARLA_ASSERT(velo > 0 && velo < 128); | |||
| if (! osc.data.target) | |||
| return; | |||
| @@ -892,8 +892,8 @@ public: | |||
| void uiNoteOff(const uint8_t channel, const uint8_t note) | |||
| { | |||
| Q_ASSERT(channel < 16); | |||
| Q_ASSERT(note < 128); | |||
| CARLA_ASSERT(channel < 16); | |||
| CARLA_ASSERT(note < 128); | |||
| if (! osc.data.target) | |||
| return; | |||
| @@ -152,8 +152,8 @@ short CarlaEngine::getNewPluginId() const | |||
| CarlaPlugin* CarlaEngine::getPlugin(const unsigned short id) const | |||
| { | |||
| qDebug("CarlaEngine::getPlugin(%i/%i)", id, m_maxPluginNumber); | |||
| Q_ASSERT(m_maxPluginNumber != 0); | |||
| Q_ASSERT(id < m_maxPluginNumber); | |||
| CARLA_ASSERT(m_maxPluginNumber != 0); | |||
| CARLA_ASSERT(id < m_maxPluginNumber); | |||
| if (id < m_maxPluginNumber) | |||
| return m_carlaPlugins[id]; | |||
| @@ -163,8 +163,8 @@ CarlaPlugin* CarlaEngine::getPlugin(const unsigned short id) const | |||
| CarlaPlugin* CarlaEngine::getPluginUnchecked(const unsigned short id) const | |||
| { | |||
| Q_ASSERT(m_maxPluginNumber != 0); | |||
| Q_ASSERT(id < m_maxPluginNumber); | |||
| CARLA_ASSERT(m_maxPluginNumber != 0); | |||
| CARLA_ASSERT(id < m_maxPluginNumber); | |||
| return m_carlaPlugins[id]; | |||
| } | |||
| @@ -239,10 +239,10 @@ 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) | |||
| { | |||
| qDebug("CarlaEngine::addPlugin(%s, %s, \"%s\", \"%s\", \"%s\", %p)", BinaryType2str(btype), PluginType2str(ptype), filename, name, label, extra); | |||
| Q_ASSERT(btype != BINARY_NONE); | |||
| Q_ASSERT(ptype != PLUGIN_NONE); | |||
| Q_ASSERT(filename); | |||
| Q_ASSERT(label); | |||
| CARLA_ASSERT(btype != BINARY_NONE); | |||
| CARLA_ASSERT(ptype != PLUGIN_NONE); | |||
| CARLA_ASSERT(filename); | |||
| CARLA_ASSERT(label); | |||
| if (m_maxPluginNumber == 0) | |||
| #ifdef BUILD_BRIDGE | |||
| @@ -339,14 +339,14 @@ short CarlaEngine::addPlugin(const BinaryType btype, const PluginType ptype, con | |||
| bool CarlaEngine::removePlugin(const unsigned short id) | |||
| { | |||
| qDebug("CarlaEngine::removePlugin(%i)", id); | |||
| Q_ASSERT(m_maxPluginNumber != 0); | |||
| Q_ASSERT(id < m_maxPluginNumber); | |||
| CARLA_ASSERT(m_maxPluginNumber != 0); | |||
| CARLA_ASSERT(id < m_maxPluginNumber); | |||
| CarlaPlugin* const plugin = m_carlaPlugins[id]; | |||
| if (plugin /*&& plugin->id() == id*/) | |||
| { | |||
| Q_ASSERT(plugin->id() == id); | |||
| CARLA_ASSERT(plugin->id() == id); | |||
| m_checkThread.stopNow(); | |||
| @@ -414,7 +414,7 @@ void CarlaEngine::removeAllPlugins() | |||
| void CarlaEngine::idlePluginGuis() | |||
| { | |||
| Q_ASSERT(m_maxPluginNumber != 0); | |||
| CARLA_ASSERT(m_maxPluginNumber != 0); | |||
| for (unsigned short i=0; i < m_maxPluginNumber; i++) | |||
| { | |||
| @@ -435,21 +435,21 @@ CarlaEngineType CarlaEngine::getType() const | |||
| const char* CarlaEngine::getName() const | |||
| { | |||
| Q_ASSERT(name); | |||
| CARLA_ASSERT(name); | |||
| return name; | |||
| } | |||
| double CarlaEngine::getSampleRate() const | |||
| { | |||
| //Q_ASSERT(sampleRate != 0.0); | |||
| //CARLA_ASSERT(sampleRate != 0.0); | |||
| return sampleRate; | |||
| } | |||
| uint32_t CarlaEngine::getBufferSize() const | |||
| { | |||
| //Q_ASSERT(bufferSize != 0); | |||
| //CARLA_ASSERT(bufferSize != 0); | |||
| return bufferSize; | |||
| } | |||
| @@ -464,32 +464,32 @@ const CarlaTimeInfo* CarlaEngine::getTimeInfo() const | |||
| double CarlaEngine::getInputPeak(const unsigned short pluginId, const unsigned short id) const | |||
| { | |||
| Q_ASSERT(pluginId < m_maxPluginNumber); | |||
| Q_ASSERT(id < MAX_PEAKS); | |||
| CARLA_ASSERT(pluginId < m_maxPluginNumber); | |||
| CARLA_ASSERT(id < MAX_PEAKS); | |||
| return m_insPeak[pluginId*MAX_PEAKS + id]; | |||
| } | |||
| double CarlaEngine::getOutputPeak(const unsigned short pluginId, const unsigned short id) const | |||
| { | |||
| Q_ASSERT(pluginId < m_maxPluginNumber); | |||
| Q_ASSERT(id < MAX_PEAKS); | |||
| CARLA_ASSERT(pluginId < m_maxPluginNumber); | |||
| CARLA_ASSERT(id < MAX_PEAKS); | |||
| return m_outsPeak[pluginId*MAX_PEAKS + id]; | |||
| } | |||
| void CarlaEngine::setInputPeak(const unsigned short pluginId, const unsigned short id, double value) | |||
| { | |||
| Q_ASSERT(pluginId < m_maxPluginNumber); | |||
| Q_ASSERT(id < MAX_PEAKS); | |||
| CARLA_ASSERT(pluginId < m_maxPluginNumber); | |||
| CARLA_ASSERT(id < MAX_PEAKS); | |||
| m_insPeak[pluginId*MAX_PEAKS + id] = value; | |||
| } | |||
| void CarlaEngine::setOutputPeak(const unsigned short pluginId, const unsigned short id, double value) | |||
| { | |||
| Q_ASSERT(pluginId < m_maxPluginNumber); | |||
| Q_ASSERT(id < MAX_PEAKS); | |||
| CARLA_ASSERT(pluginId < m_maxPluginNumber); | |||
| CARLA_ASSERT(id < MAX_PEAKS); | |||
| m_outsPeak[pluginId*MAX_PEAKS + id] = value; | |||
| } | |||
| @@ -589,7 +589,7 @@ CarlaEngineClient::CarlaEngineClient(const CarlaEngineType& type_, const CarlaEn | |||
| handle(handle_) | |||
| { | |||
| qDebug("CarlaEngineClient::CarlaEngineClient()"); | |||
| Q_ASSERT(type != CarlaEngineTypeNull); | |||
| CARLA_ASSERT(type != CarlaEngineTypeNull); | |||
| m_active = false; | |||
| } | |||
| @@ -597,7 +597,7 @@ CarlaEngineClient::CarlaEngineClient(const CarlaEngineType& type_, const CarlaEn | |||
| CarlaEngineClient::~CarlaEngineClient() | |||
| { | |||
| qDebug("CarlaEngineClient::~CarlaEngineClient()"); | |||
| Q_ASSERT(! m_active); | |||
| CARLA_ASSERT(! m_active); | |||
| #ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processMode == PROCESS_MODE_MULTIPLE_CLIENTS) | |||
| @@ -617,7 +617,7 @@ CarlaEngineClient::~CarlaEngineClient() | |||
| void CarlaEngineClient::activate() | |||
| { | |||
| qDebug("CarlaEngineClient::activate()"); | |||
| Q_ASSERT(! m_active); | |||
| CARLA_ASSERT(! m_active); | |||
| #ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processMode == PROCESS_MODE_MULTIPLE_CLIENTS) | |||
| @@ -642,7 +642,7 @@ void CarlaEngineClient::activate() | |||
| void CarlaEngineClient::deactivate() | |||
| { | |||
| qDebug("CarlaEngineClient::deactivate()"); | |||
| Q_ASSERT(m_active); | |||
| CARLA_ASSERT(m_active); | |||
| #ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processMode == PROCESS_MODE_MULTIPLE_CLIENTS) | |||
| @@ -794,7 +794,7 @@ float* CarlaEngineAudioPort::getJackAudioBuffer(uint32_t nframes) | |||
| if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||
| return nullptr; | |||
| # endif | |||
| Q_ASSERT(handle.jackPort); | |||
| CARLA_ASSERT(handle.jackPort); | |||
| return (float*)jackbridge_port_get_buffer(handle.jackPort, nframes); | |||
| } | |||
| #endif | |||
| @@ -810,7 +810,7 @@ CarlaEngineControlPort::CarlaEngineControlPort(const CarlaEnginePortNativeHandle | |||
| void CarlaEngineControlPort::initBuffer(CarlaEngine* const engine) | |||
| { | |||
| Q_ASSERT(engine); | |||
| CARLA_ASSERT(engine); | |||
| #ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||
| @@ -840,7 +840,7 @@ uint32_t CarlaEngineControlPort::getEventCount() | |||
| if (! isInput) | |||
| return 0; | |||
| Q_ASSERT(buffer); | |||
| CARLA_ASSERT(buffer); | |||
| #ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||
| @@ -877,10 +877,10 @@ const CarlaEngineControlEvent* CarlaEngineControlPort::getEvent(uint32_t index) | |||
| if (! isInput) | |||
| return nullptr; | |||
| Q_ASSERT(buffer); | |||
| CARLA_ASSERT(buffer); | |||
| #ifndef BUILD_BRIDGE | |||
| Q_ASSERT(index < CarlaEngine::MAX_ENGINE_CONTROL_EVENTS); | |||
| CARLA_ASSERT(index < CarlaEngine::MAX_ENGINE_CONTROL_EVENTS); | |||
| if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||
| { | |||
| @@ -960,8 +960,8 @@ void CarlaEngineControlPort::writeEvent(CarlaEngineControlEventType type, uint32 | |||
| if (isInput) | |||
| return; | |||
| Q_ASSERT(buffer); | |||
| Q_ASSERT(type != CarlaEngineEventNull); | |||
| CARLA_ASSERT(buffer); | |||
| CARLA_ASSERT(type != CarlaEngineEventNull); | |||
| #ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||
| @@ -1044,7 +1044,7 @@ CarlaEngineMidiPort::CarlaEngineMidiPort(const CarlaEnginePortNativeHandle& hand | |||
| void CarlaEngineMidiPort::initBuffer(CarlaEngine* const engine) | |||
| { | |||
| Q_ASSERT(engine); | |||
| CARLA_ASSERT(engine); | |||
| #ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||
| @@ -1074,7 +1074,7 @@ uint32_t CarlaEngineMidiPort::getEventCount() | |||
| if (! isInput) | |||
| return 0; | |||
| Q_ASSERT(buffer); | |||
| CARLA_ASSERT(buffer); | |||
| #ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||
| @@ -1111,10 +1111,10 @@ const CarlaEngineMidiEvent* CarlaEngineMidiPort::getEvent(uint32_t index) | |||
| if (! isInput) | |||
| return nullptr; | |||
| Q_ASSERT(buffer); | |||
| CARLA_ASSERT(buffer); | |||
| #ifndef BUILD_BRIDGE | |||
| Q_ASSERT(index < CarlaEngine::MAX_ENGINE_MIDI_EVENTS); | |||
| CARLA_ASSERT(index < CarlaEngine::MAX_ENGINE_MIDI_EVENTS); | |||
| if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||
| { | |||
| @@ -1155,9 +1155,9 @@ void CarlaEngineMidiPort::writeEvent(uint32_t time, const uint8_t* data, uint8_t | |||
| if (isInput) | |||
| return; | |||
| Q_ASSERT(buffer); | |||
| Q_ASSERT(data); | |||
| Q_ASSERT(size > 0); | |||
| CARLA_ASSERT(buffer); | |||
| CARLA_ASSERT(data); | |||
| CARLA_ASSERT(size > 0); | |||
| #ifndef BUILD_BRIDGE | |||
| if (carlaOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||
| @@ -1199,9 +1199,9 @@ void CarlaEngineMidiPort::writeEvent(uint32_t time, const uint8_t* data, uint8_t | |||
| void CarlaEngine::osc_send_control_add_plugin_start(const int32_t pluginId, const char* const pluginName) | |||
| { | |||
| qDebug("CarlaEngine::osc_send_control_add_plugin_start(%i, \"%s\")", pluginId, pluginName); | |||
| Q_ASSERT(m_oscData); | |||
| Q_ASSERT(pluginId >= 0 && pluginId < m_maxPluginNumber); | |||
| Q_ASSERT(pluginName); | |||
| CARLA_ASSERT(m_oscData); | |||
| CARLA_ASSERT(pluginId >= 0 && pluginId < m_maxPluginNumber); | |||
| CARLA_ASSERT(pluginName); | |||
| if (m_oscData && m_oscData->target) | |||
| { | |||
| @@ -1215,8 +1215,8 @@ void CarlaEngine::osc_send_control_add_plugin_start(const int32_t pluginId, cons | |||
| void CarlaEngine::osc_send_control_add_plugin_end(const int32_t pluginId) | |||
| { | |||
| qDebug("CarlaEngine::osc_send_control_add_plugin_end(%i)", pluginId); | |||
| Q_ASSERT(m_oscData); | |||
| Q_ASSERT(pluginId >= 0 && pluginId < m_maxPluginNumber); | |||
| CARLA_ASSERT(m_oscData); | |||
| CARLA_ASSERT(pluginId >= 0 && pluginId < m_maxPluginNumber); | |||
| if (m_oscData && m_oscData->target) | |||
| { | |||
| @@ -1230,8 +1230,8 @@ void CarlaEngine::osc_send_control_add_plugin_end(const int32_t pluginId) | |||
| void CarlaEngine::osc_send_control_remove_plugin(const int32_t pluginId) | |||
| { | |||
| qDebug("CarlaEngine::osc_send_control_remove_plugin(%i)", pluginId); | |||
| Q_ASSERT(m_oscData); | |||
| Q_ASSERT(pluginId >= 0 && pluginId < m_maxPluginNumber); | |||
| CARLA_ASSERT(m_oscData); | |||
| CARLA_ASSERT(pluginId >= 0 && pluginId < m_maxPluginNumber); | |||
| if (m_oscData && m_oscData->target) | |||
| { | |||
| @@ -1245,9 +1245,9 @@ void CarlaEngine::osc_send_control_remove_plugin(const int32_t pluginId) | |||
| void CarlaEngine::osc_send_control_set_plugin_data(const int32_t pluginId, const int32_t type, const int32_t category, const int32_t hints, const char* const realName, const char* const label, const char* const maker, const char* const copyright, const int64_t uniqueId) | |||
| { | |||
| qDebug("CarlaEngine::osc_send_control_set_plugin_data(%i, %i, %i, %i, \"%s\", \"%s\", \"%s\", \"%s\", " P_INT64 ")", pluginId, type, category, hints, realName, label, maker, copyright, uniqueId); | |||
| Q_ASSERT(m_oscData); | |||
| Q_ASSERT(pluginId >= 0 && pluginId < m_maxPluginNumber); | |||
| Q_ASSERT(type != PLUGIN_NONE); | |||
| CARLA_ASSERT(m_oscData); | |||
| CARLA_ASSERT(pluginId >= 0 && pluginId < m_maxPluginNumber); | |||
| CARLA_ASSERT(type != PLUGIN_NONE); | |||
| if (m_oscData && m_oscData->target) | |||
| { | |||
| @@ -1261,8 +1261,8 @@ void CarlaEngine::osc_send_control_set_plugin_data(const int32_t pluginId, const | |||
| void CarlaEngine::osc_send_control_set_plugin_ports(const int32_t pluginId, const int32_t audioIns, const int32_t audioOuts, const int32_t midiIns, const int32_t midiOuts, const int32_t cIns, const int32_t cOuts, const int32_t cTotals) | |||
| { | |||
| qDebug("CarlaEngine::osc_send_control_set_plugin_ports(%i, %i, %i, %i, %i, %i, %i, %i)", pluginId, audioIns, audioOuts, midiIns, midiOuts, cIns, cOuts, cTotals); | |||
| Q_ASSERT(m_oscData); | |||
| Q_ASSERT(pluginId >= 0 && pluginId < m_maxPluginNumber); | |||
| CARLA_ASSERT(m_oscData); | |||
| CARLA_ASSERT(pluginId >= 0 && pluginId < m_maxPluginNumber); | |||
| if (m_oscData && m_oscData->target) | |||
| { | |||
| @@ -1276,10 +1276,10 @@ void CarlaEngine::osc_send_control_set_plugin_ports(const int32_t pluginId, cons | |||
| void CarlaEngine::osc_send_control_set_parameter_data(const int32_t pluginId, const int32_t index, const int32_t type, const int32_t hints, const char* const name, const char* const label, const double current) | |||
| { | |||
| qDebug("CarlaEngine::osc_send_control_set_parameter_data(%i, %i, %i, %i, \"%s\", \"%s\", %g)", pluginId, index, type, hints, name, label, current); | |||
| Q_ASSERT(m_oscData); | |||
| Q_ASSERT(pluginId >= 0 && pluginId < m_maxPluginNumber); | |||
| Q_ASSERT(index >= 0); | |||
| Q_ASSERT(type != PARAMETER_UNKNOWN); | |||
| CARLA_ASSERT(m_oscData); | |||
| CARLA_ASSERT(pluginId >= 0 && pluginId < m_maxPluginNumber); | |||
| CARLA_ASSERT(index >= 0); | |||
| CARLA_ASSERT(type != PARAMETER_UNKNOWN); | |||
| if (m_oscData && m_oscData->target) | |||
| { | |||
| @@ -1293,10 +1293,10 @@ void CarlaEngine::osc_send_control_set_parameter_data(const int32_t pluginId, co | |||
| void CarlaEngine::osc_send_control_set_parameter_ranges(const int32_t pluginId, const int32_t index, const double min, const double max, const double def, const double step, const double stepSmall, const double stepLarge) | |||
| { | |||
| qDebug("CarlaEngine::osc_send_control_set_parameter_ranges(%i, %i, %g, %g, %g, %g, %g, %g)", pluginId, index, min, max, def, step, stepSmall, stepLarge); | |||
| Q_ASSERT(m_oscData); | |||
| Q_ASSERT(pluginId >= 0 && pluginId < m_maxPluginNumber); | |||
| Q_ASSERT(index >= 0); | |||
| Q_ASSERT(min < max); | |||
| CARLA_ASSERT(m_oscData); | |||
| CARLA_ASSERT(pluginId >= 0 && pluginId < m_maxPluginNumber); | |||
| CARLA_ASSERT(index >= 0); | |||
| CARLA_ASSERT(min < max); | |||
| if (m_oscData && m_oscData->target) | |||
| { | |||
| @@ -1310,9 +1310,9 @@ void CarlaEngine::osc_send_control_set_parameter_ranges(const int32_t pluginId, | |||
| void CarlaEngine::osc_send_control_set_parameter_midi_cc(const int32_t pluginId, const int32_t index, const int32_t cc) | |||
| { | |||
| qDebug("CarlaEngine::osc_send_control_set_parameter_midi_cc(%i, %i, %i)", pluginId, index, cc); | |||
| Q_ASSERT(m_oscData); | |||
| Q_ASSERT(pluginId >= 0 && pluginId < m_maxPluginNumber); | |||
| Q_ASSERT(index >= 0); | |||
| CARLA_ASSERT(m_oscData); | |||
| CARLA_ASSERT(pluginId >= 0 && pluginId < m_maxPluginNumber); | |||
| CARLA_ASSERT(index >= 0); | |||
| if (m_oscData && m_oscData->target) | |||
| { | |||
| @@ -1326,10 +1326,10 @@ void CarlaEngine::osc_send_control_set_parameter_midi_cc(const int32_t pluginId, | |||
| void CarlaEngine::osc_send_control_set_parameter_midi_channel(const int32_t pluginId, const int32_t index, const int32_t channel) | |||
| { | |||
| qDebug("CarlaEngine::osc_send_control_set_parameter_midi_channel(%i, %i, %i)", pluginId, index, channel); | |||
| Q_ASSERT(m_oscData); | |||
| Q_ASSERT(pluginId >= 0 && pluginId < m_maxPluginNumber); | |||
| Q_ASSERT(index >= 0); | |||
| Q_ASSERT(channel >= 0 && channel < 16); | |||
| CARLA_ASSERT(m_oscData); | |||
| CARLA_ASSERT(pluginId >= 0 && pluginId < m_maxPluginNumber); | |||
| CARLA_ASSERT(index >= 0); | |||
| CARLA_ASSERT(channel >= 0 && channel < 16); | |||
| if (m_oscData && m_oscData->target) | |||
| { | |||
| @@ -1348,8 +1348,8 @@ void CarlaEngine::osc_send_control_set_parameter_value(const int32_t pluginId, c | |||
| else | |||
| qDebug("CarlaEngine::osc_send_control_set_parameter_value(%i, %i, %g)", pluginId, index, value); | |||
| #endif | |||
| Q_ASSERT(m_oscData); | |||
| Q_ASSERT(pluginId >= 0 && pluginId < m_maxPluginNumber); | |||
| CARLA_ASSERT(m_oscData); | |||
| CARLA_ASSERT(pluginId >= 0 && pluginId < m_maxPluginNumber); | |||
| if (m_oscData && m_oscData->target) | |||
| { | |||
| @@ -1363,9 +1363,9 @@ void CarlaEngine::osc_send_control_set_parameter_value(const int32_t pluginId, c | |||
| void CarlaEngine::osc_send_control_set_default_value(const int32_t pluginId, const int32_t index, const double value) | |||
| { | |||
| qDebug("CarlaEngine::osc_send_control_set_default_value(%i, %i, %g)", pluginId, index, value); | |||
| Q_ASSERT(m_oscData); | |||
| Q_ASSERT(pluginId >= 0 && pluginId < m_maxPluginNumber); | |||
| Q_ASSERT(index >= 0); | |||
| CARLA_ASSERT(m_oscData); | |||
| CARLA_ASSERT(pluginId >= 0 && pluginId < m_maxPluginNumber); | |||
| CARLA_ASSERT(index >= 0); | |||
| if (m_oscData && m_oscData->target) | |||
| { | |||
| @@ -1379,8 +1379,8 @@ void CarlaEngine::osc_send_control_set_default_value(const int32_t pluginId, con | |||
| void CarlaEngine::osc_send_control_set_program(const int32_t pluginId, const int32_t index) | |||
| { | |||
| qDebug("CarlaEngine::osc_send_control_set_program(%i, %i)", pluginId, index); | |||
| Q_ASSERT(m_oscData); | |||
| Q_ASSERT(pluginId >= 0 && pluginId < m_maxPluginNumber); | |||
| CARLA_ASSERT(m_oscData); | |||
| CARLA_ASSERT(pluginId >= 0 && pluginId < m_maxPluginNumber); | |||
| if (m_oscData && m_oscData->target) | |||
| { | |||
| @@ -1394,9 +1394,9 @@ void CarlaEngine::osc_send_control_set_program(const int32_t pluginId, const int | |||
| void CarlaEngine::osc_send_control_set_program_count(const int32_t pluginId, const int32_t count) | |||
| { | |||
| qDebug("CarlaEngine::osc_send_control_set_program_count(%i, %i)", pluginId, count); | |||
| Q_ASSERT(m_oscData); | |||
| Q_ASSERT(pluginId >= 0 && pluginId < m_maxPluginNumber); | |||
| Q_ASSERT(count >= 0); | |||
| CARLA_ASSERT(m_oscData); | |||
| CARLA_ASSERT(pluginId >= 0 && pluginId < m_maxPluginNumber); | |||
| CARLA_ASSERT(count >= 0); | |||
| if (m_oscData && m_oscData->target) | |||
| { | |||
| @@ -1410,10 +1410,10 @@ void CarlaEngine::osc_send_control_set_program_count(const int32_t pluginId, con | |||
| void CarlaEngine::osc_send_control_set_program_name(const int32_t pluginId, const int32_t index, const char* const name) | |||
| { | |||
| qDebug("CarlaEngine::osc_send_control_set_program_name(%i, %i, \"%s\")", pluginId, index, name); | |||
| Q_ASSERT(m_oscData); | |||
| Q_ASSERT(pluginId >= 0 && pluginId < m_maxPluginNumber); | |||
| Q_ASSERT(index >= 0); | |||
| Q_ASSERT(name); | |||
| CARLA_ASSERT(m_oscData); | |||
| CARLA_ASSERT(pluginId >= 0 && pluginId < m_maxPluginNumber); | |||
| CARLA_ASSERT(index >= 0); | |||
| CARLA_ASSERT(name); | |||
| if (m_oscData && m_oscData->target) | |||
| { | |||
| @@ -1427,8 +1427,8 @@ void CarlaEngine::osc_send_control_set_program_name(const int32_t pluginId, cons | |||
| void CarlaEngine::osc_send_control_set_midi_program(const int32_t pluginId, const int32_t index) | |||
| { | |||
| qDebug("CarlaEngine::osc_send_control_set_midi_program(%i, %i)", pluginId, index); | |||
| Q_ASSERT(m_oscData); | |||
| Q_ASSERT(pluginId >= 0 && pluginId < m_maxPluginNumber); | |||
| CARLA_ASSERT(m_oscData); | |||
| CARLA_ASSERT(pluginId >= 0 && pluginId < m_maxPluginNumber); | |||
| if (m_oscData && m_oscData->target) | |||
| { | |||
| @@ -1442,9 +1442,9 @@ void CarlaEngine::osc_send_control_set_midi_program(const int32_t pluginId, cons | |||
| void CarlaEngine::osc_send_control_set_midi_program_count(const int32_t pluginId, const int32_t count) | |||
| { | |||
| qDebug("CarlaEngine::osc_send_control_set_midi_program_count(%i, %i)", pluginId, count); | |||
| Q_ASSERT(m_oscData); | |||
| Q_ASSERT(pluginId >= 0 && pluginId < m_maxPluginNumber); | |||
| Q_ASSERT(count >= 0); | |||
| CARLA_ASSERT(m_oscData); | |||
| CARLA_ASSERT(pluginId >= 0 && pluginId < m_maxPluginNumber); | |||
| CARLA_ASSERT(count >= 0); | |||
| if (m_oscData && m_oscData->target) | |||
| { | |||
| @@ -1458,12 +1458,12 @@ void CarlaEngine::osc_send_control_set_midi_program_count(const int32_t pluginId | |||
| void CarlaEngine::osc_send_control_set_midi_program_data(const int32_t pluginId, const int32_t index, const int32_t bank, const int32_t program, const char* const name) | |||
| { | |||
| qDebug("CarlaEngine::osc_send_control_set_midi_program_data(%i, %i, %i, %i, \"%s\")", pluginId, index, bank, program, name); | |||
| Q_ASSERT(m_oscData); | |||
| Q_ASSERT(pluginId >= 0 && pluginId < m_maxPluginNumber); | |||
| Q_ASSERT(index >= 0); | |||
| Q_ASSERT(bank >= 0); | |||
| Q_ASSERT(program >= 0); | |||
| Q_ASSERT(name); | |||
| CARLA_ASSERT(m_oscData); | |||
| CARLA_ASSERT(pluginId >= 0 && pluginId < m_maxPluginNumber); | |||
| CARLA_ASSERT(index >= 0); | |||
| CARLA_ASSERT(bank >= 0); | |||
| CARLA_ASSERT(program >= 0); | |||
| CARLA_ASSERT(name); | |||
| if (m_oscData && m_oscData->target) | |||
| { | |||
| @@ -1477,11 +1477,11 @@ void CarlaEngine::osc_send_control_set_midi_program_data(const int32_t pluginId, | |||
| void CarlaEngine::osc_send_control_note_on(const int32_t pluginId, const int32_t channel, const int32_t note, const int32_t velo) | |||
| { | |||
| qDebug("CarlaEngine::osc_send_control_note_on(%i, %i, %i, %i)", pluginId, channel, note, velo); | |||
| Q_ASSERT(m_oscData); | |||
| Q_ASSERT(pluginId >= 0 && pluginId < m_maxPluginNumber); | |||
| Q_ASSERT(channel >= 0 && channel < 16); | |||
| Q_ASSERT(note >= 0 && note < 128); | |||
| Q_ASSERT(velo > 0 && velo < 128); | |||
| CARLA_ASSERT(m_oscData); | |||
| CARLA_ASSERT(pluginId >= 0 && pluginId < m_maxPluginNumber); | |||
| CARLA_ASSERT(channel >= 0 && channel < 16); | |||
| CARLA_ASSERT(note >= 0 && note < 128); | |||
| CARLA_ASSERT(velo > 0 && velo < 128); | |||
| if (m_oscData && m_oscData->target) | |||
| { | |||
| @@ -1495,10 +1495,10 @@ void CarlaEngine::osc_send_control_note_on(const int32_t pluginId, const int32_t | |||
| void CarlaEngine::osc_send_control_note_off(const int32_t pluginId, const int32_t channel, const int32_t note) | |||
| { | |||
| qDebug("CarlaEngine::osc_send_control_note_off(%i, %i, %i)", pluginId, channel, note); | |||
| Q_ASSERT(m_oscData); | |||
| Q_ASSERT(pluginId >= 0 && pluginId < m_maxPluginNumber); | |||
| Q_ASSERT(channel >= 0 && channel < 16); | |||
| Q_ASSERT(note >= 0 && note < 128); | |||
| CARLA_ASSERT(m_oscData); | |||
| CARLA_ASSERT(pluginId >= 0 && pluginId < m_maxPluginNumber); | |||
| CARLA_ASSERT(channel >= 0 && channel < 16); | |||
| CARLA_ASSERT(note >= 0 && note < 128); | |||
| if (m_oscData && m_oscData->target) | |||
| { | |||
| @@ -1512,9 +1512,9 @@ void CarlaEngine::osc_send_control_note_off(const int32_t pluginId, const int32_ | |||
| void CarlaEngine::osc_send_control_set_input_peak_value(const int32_t pluginId, const int32_t portId, const double value) | |||
| { | |||
| //qDebug("CarlaEngine::osc_send_control_set_input_peak_value(%i, %i, %g)", pluginId, portId, value); | |||
| Q_ASSERT(m_oscData); | |||
| Q_ASSERT(pluginId >= 0 && pluginId < m_maxPluginNumber); | |||
| Q_ASSERT(portId == 1 || portId == 2); | |||
| CARLA_ASSERT(m_oscData); | |||
| CARLA_ASSERT(pluginId >= 0 && pluginId < m_maxPluginNumber); | |||
| CARLA_ASSERT(portId == 1 || portId == 2); | |||
| if (m_oscData && m_oscData->target) | |||
| { | |||
| @@ -1528,9 +1528,9 @@ void CarlaEngine::osc_send_control_set_input_peak_value(const int32_t pluginId, | |||
| void CarlaEngine::osc_send_control_set_output_peak_value(const int32_t pluginId, const int32_t portId, const double value) | |||
| { | |||
| //qDebug("CarlaEngine::osc_send_control_set_output_peak_value(%i, %i, %g)", pluginId, portId, value); | |||
| Q_ASSERT(m_oscData); | |||
| Q_ASSERT(pluginId >= 0 && pluginId < m_maxPluginNumber); | |||
| Q_ASSERT(portId == 1 || portId == 2); | |||
| CARLA_ASSERT(m_oscData); | |||
| CARLA_ASSERT(pluginId >= 0 && pluginId < m_maxPluginNumber); | |||
| CARLA_ASSERT(portId == 1 || portId == 2); | |||
| if (m_oscData && m_oscData->target) | |||
| { | |||
| @@ -1544,7 +1544,7 @@ void CarlaEngine::osc_send_control_set_output_peak_value(const int32_t pluginId, | |||
| void CarlaEngine::osc_send_control_exit() | |||
| { | |||
| qDebug("CarlaEngine::osc_send_control_exit()"); | |||
| Q_ASSERT(m_oscData); | |||
| CARLA_ASSERT(m_oscData); | |||
| if (m_oscData && m_oscData->target) | |||
| { | |||
| @@ -1558,8 +1558,8 @@ void CarlaEngine::osc_send_control_exit() | |||
| void CarlaEngine::osc_send_bridge_audio_count(const int32_t ins, const int32_t outs, const int32_t total) | |||
| { | |||
| qDebug("CarlaEngine::osc_send_bridge_audio_count(%i, %i, %i)", ins, outs, total); | |||
| Q_ASSERT(m_oscData); | |||
| Q_ASSERT(total >= 0 && total >= ins + outs); | |||
| CARLA_ASSERT(m_oscData); | |||
| CARLA_ASSERT(total >= 0 && total >= ins + outs); | |||
| if (m_oscData && m_oscData->target) | |||
| { | |||
| @@ -1573,8 +1573,8 @@ void CarlaEngine::osc_send_bridge_audio_count(const int32_t ins, const int32_t o | |||
| void CarlaEngine::osc_send_bridge_midi_count(const int32_t ins, const int32_t outs, const int32_t total) | |||
| { | |||
| qDebug("CarlaEngine::osc_send_bridge_midi_count(%i, %i, %i)", ins, outs, total); | |||
| Q_ASSERT(m_oscData); | |||
| Q_ASSERT(total >= 0 && total >= ins + outs); | |||
| CARLA_ASSERT(m_oscData); | |||
| CARLA_ASSERT(total >= 0 && total >= ins + outs); | |||
| if (m_oscData && m_oscData->target) | |||
| { | |||
| @@ -1588,8 +1588,8 @@ void CarlaEngine::osc_send_bridge_midi_count(const int32_t ins, const int32_t ou | |||
| void CarlaEngine::osc_send_bridge_parameter_count(const int32_t ins, const int32_t outs, const int32_t total) | |||
| { | |||
| qDebug("CarlaEngine::osc_send_bridge_parameter_count(%i, %i, %i)", ins, outs, total); | |||
| Q_ASSERT(m_oscData); | |||
| Q_ASSERT(total >= 0 && total >= ins + outs); | |||
| CARLA_ASSERT(m_oscData); | |||
| CARLA_ASSERT(total >= 0 && total >= ins + outs); | |||
| if (m_oscData && m_oscData->target) | |||
| { | |||
| @@ -1603,8 +1603,8 @@ void CarlaEngine::osc_send_bridge_parameter_count(const int32_t ins, const int32 | |||
| void CarlaEngine::osc_send_bridge_program_count(const int32_t count) | |||
| { | |||
| qDebug("CarlaEngine::osc_send_bridge_program_count(%i)", count); | |||
| Q_ASSERT(m_oscData); | |||
| Q_ASSERT(count >= 0); | |||
| CARLA_ASSERT(m_oscData); | |||
| CARLA_ASSERT(count >= 0); | |||
| if (m_oscData && m_oscData->target) | |||
| { | |||
| @@ -1618,8 +1618,8 @@ void CarlaEngine::osc_send_bridge_program_count(const int32_t count) | |||
| void CarlaEngine::osc_send_bridge_midi_program_count(const int32_t count) | |||
| { | |||
| qDebug("CarlaEngine::osc_send_bridge_midi_program_count(%i)", count); | |||
| Q_ASSERT(m_oscData); | |||
| Q_ASSERT(count >= 0); | |||
| CARLA_ASSERT(m_oscData); | |||
| CARLA_ASSERT(count >= 0); | |||
| if (m_oscData && m_oscData->target) | |||
| { | |||
| @@ -1633,11 +1633,11 @@ void CarlaEngine::osc_send_bridge_midi_program_count(const int32_t count) | |||
| void CarlaEngine::osc_send_bridge_plugin_info(const int32_t category, const int32_t hints, const char* const name, const char* const label, const char* const maker, const char* const copyright, const int64_t uniqueId) | |||
| { | |||
| qDebug("CarlaEngine::osc_send_bridge_plugin_info(%i, %i, \"%s\", \"%s\", \"%s\", \"%s\", " P_INT64 ")", category, hints, name, label, maker, copyright, uniqueId); | |||
| Q_ASSERT(m_oscData); | |||
| Q_ASSERT(name); | |||
| Q_ASSERT(label); | |||
| Q_ASSERT(maker); | |||
| Q_ASSERT(copyright); | |||
| CARLA_ASSERT(m_oscData); | |||
| CARLA_ASSERT(name); | |||
| CARLA_ASSERT(label); | |||
| CARLA_ASSERT(maker); | |||
| CARLA_ASSERT(copyright); | |||
| if (m_oscData && m_oscData->target) | |||
| { | |||
| @@ -1651,9 +1651,9 @@ void CarlaEngine::osc_send_bridge_plugin_info(const int32_t category, const int3 | |||
| void CarlaEngine::osc_send_bridge_parameter_info(const int32_t index, const char* const name, const char* const unit) | |||
| { | |||
| qDebug("CarlaEngine::osc_send_bridge_parameter_info(%i, \"%s\", \"%s\")", index, name, unit); | |||
| Q_ASSERT(m_oscData); | |||
| Q_ASSERT(name); | |||
| Q_ASSERT(unit); | |||
| CARLA_ASSERT(m_oscData); | |||
| CARLA_ASSERT(name); | |||
| CARLA_ASSERT(unit); | |||
| if (m_oscData && m_oscData->target) | |||
| { | |||
| @@ -1667,7 +1667,7 @@ void CarlaEngine::osc_send_bridge_parameter_info(const int32_t index, const char | |||
| void CarlaEngine::osc_send_bridge_parameter_data(const int32_t index, const int32_t type, const int32_t rindex, const int32_t hints, const int32_t midiChannel, const int32_t midiCC) | |||
| { | |||
| qDebug("CarlaEngine::osc_send_bridge_parameter_data(%i, %i, %i, %i, %i, %i)", index, type, rindex, hints, midiChannel, midiCC); | |||
| Q_ASSERT(m_oscData); | |||
| CARLA_ASSERT(m_oscData); | |||
| if (m_oscData && m_oscData->target) | |||
| { | |||
| @@ -1681,7 +1681,7 @@ void CarlaEngine::osc_send_bridge_parameter_data(const int32_t index, const int3 | |||
| void CarlaEngine::osc_send_bridge_parameter_ranges(const int32_t index, const double def, const double min, const double max, const double step, const double stepSmall, const double stepLarge) | |||
| { | |||
| qDebug("CarlaEngine::osc_send_bridge_parameter_ranges(%i, %g, %g, %g, %g, %g, %g)", index, def, min, max, step, stepSmall, stepLarge); | |||
| Q_ASSERT(m_oscData); | |||
| CARLA_ASSERT(m_oscData); | |||
| if (m_oscData && m_oscData->target) | |||
| { | |||
| @@ -1695,7 +1695,7 @@ void CarlaEngine::osc_send_bridge_parameter_ranges(const int32_t index, const do | |||
| void CarlaEngine::osc_send_bridge_program_info(const int32_t index, const char* const name) | |||
| { | |||
| qDebug("CarlaEngine::osc_send_bridge_program_info(%i, \"%s\")", index, name); | |||
| Q_ASSERT(m_oscData); | |||
| CARLA_ASSERT(m_oscData); | |||
| if (m_oscData && m_oscData->target) | |||
| { | |||
| @@ -1709,7 +1709,7 @@ void CarlaEngine::osc_send_bridge_program_info(const int32_t index, const char* | |||
| void CarlaEngine::osc_send_bridge_midi_program_info(const int32_t index, const int32_t bank, const int32_t program, const char* const label) | |||
| { | |||
| qDebug("CarlaEngine::osc_send_bridge_midi_program_info(%i, %i, %i, \"%s\")", index, bank, program, label); | |||
| Q_ASSERT(m_oscData); | |||
| CARLA_ASSERT(m_oscData); | |||
| if (m_oscData && m_oscData->target) | |||
| { | |||
| @@ -1723,9 +1723,9 @@ void CarlaEngine::osc_send_bridge_midi_program_info(const int32_t index, const i | |||
| void CarlaEngine::osc_send_bridge_configure(const char* const key, const char* const value) | |||
| { | |||
| qDebug("CarlaEngine::osc_send_bridge_configure(\"%s\", \"%s\")", key, value); | |||
| Q_ASSERT(m_oscData); | |||
| Q_ASSERT(key); | |||
| Q_ASSERT(value); | |||
| CARLA_ASSERT(m_oscData); | |||
| CARLA_ASSERT(key); | |||
| CARLA_ASSERT(value); | |||
| if (m_oscData && m_oscData->target) | |||
| { | |||
| @@ -1739,7 +1739,7 @@ void CarlaEngine::osc_send_bridge_configure(const char* const key, const char* c | |||
| void CarlaEngine::osc_send_bridge_set_parameter_value(const int32_t index, const double value) | |||
| { | |||
| qDebug("CarlaEngine::osc_send_bridge_set_parameter_value(%i, %g)", index, value); | |||
| Q_ASSERT(m_oscData); | |||
| CARLA_ASSERT(m_oscData); | |||
| if (m_oscData && m_oscData->target) | |||
| { | |||
| @@ -1753,7 +1753,7 @@ void CarlaEngine::osc_send_bridge_set_parameter_value(const int32_t index, const | |||
| void CarlaEngine::osc_send_bridge_set_default_value(const int32_t index, const double value) | |||
| { | |||
| qDebug("CarlaEngine::osc_send_bridge_set_default_value(%i, %g)", index, value); | |||
| Q_ASSERT(m_oscData); | |||
| CARLA_ASSERT(m_oscData); | |||
| if (m_oscData && m_oscData->target) | |||
| { | |||
| @@ -1767,7 +1767,7 @@ void CarlaEngine::osc_send_bridge_set_default_value(const int32_t index, const d | |||
| void CarlaEngine::osc_send_bridge_set_program(const int32_t index) | |||
| { | |||
| qDebug("CarlaEngine::osc_send_bridge_set_program(%i)", index); | |||
| Q_ASSERT(m_oscData); | |||
| CARLA_ASSERT(m_oscData); | |||
| if (m_oscData && m_oscData->target) | |||
| { | |||
| @@ -1781,7 +1781,7 @@ void CarlaEngine::osc_send_bridge_set_program(const int32_t index) | |||
| void CarlaEngine::osc_send_bridge_set_midi_program(const int32_t index) | |||
| { | |||
| qDebug("CarlaEngine::osc_send_bridge_set_midi_program(%i)", index); | |||
| Q_ASSERT(m_oscData); | |||
| CARLA_ASSERT(m_oscData); | |||
| if (m_oscData && m_oscData->target) | |||
| { | |||
| @@ -1795,7 +1795,7 @@ void CarlaEngine::osc_send_bridge_set_midi_program(const int32_t index) | |||
| void CarlaEngine::osc_send_bridge_set_custom_data(const char* const stype, const char* const key, const char* const value) | |||
| { | |||
| qDebug("CarlaEngine::osc_send_bridge_set_custom_data(\"%s\", \"%s\", \"%s\")", stype, key, value); | |||
| Q_ASSERT(m_oscData); | |||
| CARLA_ASSERT(m_oscData); | |||
| if (m_oscData && m_oscData->target) | |||
| { | |||
| @@ -1809,7 +1809,7 @@ void CarlaEngine::osc_send_bridge_set_custom_data(const char* const stype, const | |||
| void CarlaEngine::osc_send_bridge_set_chunk_data(const char* const chunkFile) | |||
| { | |||
| qDebug("CarlaEngine::osc_send_bridge_set_chunk_data(\"%s\")", chunkFile); | |||
| Q_ASSERT(m_oscData); | |||
| CARLA_ASSERT(m_oscData); | |||
| if (m_oscData && m_oscData->target) | |||
| { | |||
| @@ -1822,8 +1822,8 @@ void CarlaEngine::osc_send_bridge_set_chunk_data(const char* const chunkFile) | |||
| void CarlaEngine::osc_send_bridge_set_input_peak_value(const int32_t portId, const double value) | |||
| { | |||
| Q_ASSERT(m_oscData); | |||
| Q_ASSERT(portId == 1 || portId == 2); | |||
| CARLA_ASSERT(m_oscData); | |||
| CARLA_ASSERT(portId == 1 || portId == 2); | |||
| if (m_oscData && m_oscData->target) | |||
| { | |||
| @@ -1836,8 +1836,8 @@ void CarlaEngine::osc_send_bridge_set_input_peak_value(const int32_t portId, con | |||
| void CarlaEngine::osc_send_bridge_set_output_peak_value(const int32_t portId, const double value) | |||
| { | |||
| Q_ASSERT(m_oscData); | |||
| Q_ASSERT(portId == 1 || portId == 2); | |||
| CARLA_ASSERT(m_oscData); | |||
| CARLA_ASSERT(portId == 1 || portId == 2); | |||
| if (m_oscData && m_oscData->target) | |||
| { | |||
| @@ -332,14 +332,14 @@ void CarlaEngineJack::handleProcessCallback(uint32_t nframes) | |||
| void* midiOut = jackbridge_port_get_buffer(rackJackPorts[rackPortMidiOut], nframes); | |||
| // assert buffers | |||
| Q_ASSERT(audioIn1); | |||
| Q_ASSERT(audioIn2); | |||
| Q_ASSERT(audioOut1); | |||
| Q_ASSERT(audioOut2); | |||
| Q_ASSERT(controlIn); | |||
| Q_ASSERT(controlOut); | |||
| Q_ASSERT(midiIn); | |||
| Q_ASSERT(midiOut); | |||
| CARLA_ASSERT(audioIn1); | |||
| CARLA_ASSERT(audioIn2); | |||
| CARLA_ASSERT(audioOut1); | |||
| CARLA_ASSERT(audioOut2); | |||
| CARLA_ASSERT(controlIn); | |||
| CARLA_ASSERT(controlOut); | |||
| CARLA_ASSERT(midiIn); | |||
| CARLA_ASSERT(midiOut); | |||
| // create temporary audio buffers | |||
| float ains_tmp_buf1[nframes]; | |||
| @@ -179,8 +179,8 @@ void CarlaEngineRtAudio::handleProcessCallback(void* outputBuffer, void* inputBu | |||
| float* outsPtr = (float*)outputBuffer; | |||
| // assert buffers | |||
| Q_ASSERT(insPtr); | |||
| Q_ASSERT(outsPtr); | |||
| CARLA_ASSERT(insPtr); | |||
| CARLA_ASSERT(outsPtr); | |||
| // create temporary audio buffers | |||
| float ains_tmp_buf1[nframes]; | |||
| @@ -122,7 +122,7 @@ public: | |||
| PluginCategory category() | |||
| { | |||
| Q_ASSERT(descriptor); | |||
| CARLA_ASSERT(descriptor); | |||
| if (descriptor) | |||
| return (PluginCategory)descriptor->category; | |||
| @@ -145,8 +145,8 @@ public: | |||
| uint32_t parameterScalePointCount(const uint32_t parameterId) | |||
| { | |||
| Q_ASSERT(descriptor); | |||
| Q_ASSERT(parameterId < param.count); | |||
| CARLA_ASSERT(descriptor); | |||
| CARLA_ASSERT(parameterId < param.count); | |||
| int32_t rindex = param.data[parameterId].rindex; | |||
| @@ -166,9 +166,9 @@ public: | |||
| double getParameterValue(const uint32_t parameterId) | |||
| { | |||
| Q_ASSERT(descriptor); | |||
| Q_ASSERT(handle); | |||
| Q_ASSERT(parameterId < param.count); | |||
| CARLA_ASSERT(descriptor); | |||
| CARLA_ASSERT(handle); | |||
| CARLA_ASSERT(parameterId < param.count); | |||
| if (descriptor && handle) | |||
| return descriptor->get_parameter_value(handle, parameterId); | |||
| @@ -178,9 +178,9 @@ public: | |||
| double getParameterScalePointValue(const uint32_t parameterId, const uint32_t scalePointId) | |||
| { | |||
| Q_ASSERT(descriptor); | |||
| Q_ASSERT(parameterId < param.count); | |||
| Q_ASSERT(scalePointId < parameterScalePointCount(parameterId)); | |||
| CARLA_ASSERT(descriptor); | |||
| CARLA_ASSERT(parameterId < param.count); | |||
| CARLA_ASSERT(scalePointId < parameterScalePointCount(parameterId)); | |||
| const int32_t rindex = param.data[parameterId].rindex; | |||
| @@ -202,7 +202,7 @@ public: | |||
| void getLabel(char* const strBuf) | |||
| { | |||
| Q_ASSERT(descriptor); | |||
| CARLA_ASSERT(descriptor); | |||
| if (descriptor && descriptor->label) | |||
| strncpy(strBuf, descriptor->label, STR_MAX); | |||
| @@ -212,7 +212,7 @@ public: | |||
| void getMaker(char* const strBuf) | |||
| { | |||
| Q_ASSERT(descriptor); | |||
| CARLA_ASSERT(descriptor); | |||
| if (descriptor && descriptor->maker) | |||
| strncpy(strBuf, descriptor->maker, STR_MAX); | |||
| @@ -222,7 +222,7 @@ public: | |||
| void getCopyright(char* const strBuf) | |||
| { | |||
| Q_ASSERT(descriptor); | |||
| CARLA_ASSERT(descriptor); | |||
| if (descriptor && descriptor->copyright) | |||
| strncpy(strBuf, descriptor->copyright, STR_MAX); | |||
| @@ -232,7 +232,7 @@ public: | |||
| void getRealName(char* const strBuf) | |||
| { | |||
| Q_ASSERT(descriptor); | |||
| CARLA_ASSERT(descriptor); | |||
| if (descriptor && descriptor->name) | |||
| strncpy(strBuf, descriptor->name, STR_MAX); | |||
| @@ -242,8 +242,8 @@ public: | |||
| void getParameterName(const uint32_t parameterId, char* const strBuf) | |||
| { | |||
| Q_ASSERT(descriptor); | |||
| Q_ASSERT(parameterId < param.count); | |||
| CARLA_ASSERT(descriptor); | |||
| CARLA_ASSERT(parameterId < param.count); | |||
| const int32_t rindex = param.data[parameterId].rindex; | |||
| @@ -263,9 +263,9 @@ public: | |||
| void getParameterText(const uint32_t parameterId, char* const strBuf) | |||
| { | |||
| Q_ASSERT(descriptor); | |||
| Q_ASSERT(handle); | |||
| Q_ASSERT(parameterId < param.count); | |||
| CARLA_ASSERT(descriptor); | |||
| CARLA_ASSERT(handle); | |||
| CARLA_ASSERT(parameterId < param.count); | |||
| if (descriptor && handle) | |||
| { | |||
| @@ -285,9 +285,9 @@ public: | |||
| void getParameterUnit(const uint32_t parameterId, char* const strBuf) | |||
| { | |||
| Q_ASSERT(descriptor); | |||
| Q_ASSERT(handle); | |||
| Q_ASSERT(parameterId < param.count); | |||
| CARLA_ASSERT(descriptor); | |||
| CARLA_ASSERT(handle); | |||
| CARLA_ASSERT(parameterId < param.count); | |||
| if (descriptor && handle) | |||
| { | |||
| @@ -307,9 +307,9 @@ public: | |||
| void getParameterScalePointLabel(const uint32_t parameterId, const uint32_t scalePointId, char* const strBuf) | |||
| { | |||
| Q_ASSERT(descriptor); | |||
| Q_ASSERT(parameterId < param.count); | |||
| Q_ASSERT(scalePointId < parameterScalePointCount(parameterId)); | |||
| CARLA_ASSERT(descriptor); | |||
| CARLA_ASSERT(parameterId < param.count); | |||
| CARLA_ASSERT(scalePointId < parameterScalePointCount(parameterId)); | |||
| int32_t rindex = param.data[parameterId].rindex; | |||
| @@ -337,9 +337,9 @@ public: | |||
| void setParameterValue(const uint32_t parameterId, double value, const bool sendGui, const bool sendOsc, const bool sendCallback) | |||
| { | |||
| Q_ASSERT(descriptor); | |||
| Q_ASSERT(handle); | |||
| Q_ASSERT(parameterId < param.count); | |||
| CARLA_ASSERT(descriptor); | |||
| CARLA_ASSERT(handle); | |||
| CARLA_ASSERT(parameterId < param.count); | |||
| if (descriptor) | |||
| { | |||
| @@ -354,11 +354,11 @@ public: | |||
| void setCustomData(const CustomDataType type, const char* const key, const char* const value, const bool sendGui) | |||
| { | |||
| Q_ASSERT(descriptor); | |||
| Q_ASSERT(handle); | |||
| Q_ASSERT(type == CUSTOM_DATA_STRING); | |||
| Q_ASSERT(key); | |||
| Q_ASSERT(value); | |||
| CARLA_ASSERT(descriptor); | |||
| CARLA_ASSERT(handle); | |||
| CARLA_ASSERT(type == CUSTOM_DATA_STRING); | |||
| CARLA_ASSERT(key); | |||
| CARLA_ASSERT(value); | |||
| if (type != CUSTOM_DATA_STRING) | |||
| return qCritical("NativePlugin::setCustomData(%s, \"%s\", \"%s\", %s) - type is not string", CustomDataType2str(type), key, value, bool2str(sendGui)); | |||
| @@ -380,9 +380,9 @@ public: | |||
| void setMidiProgram(int32_t index, const bool sendGui, const bool sendOsc, const bool sendCallback, const bool block) | |||
| { | |||
| Q_ASSERT(descriptor); | |||
| Q_ASSERT(handle); | |||
| Q_ASSERT(index >= -1 && index < (int32_t)midiprog.count); | |||
| CARLA_ASSERT(descriptor); | |||
| CARLA_ASSERT(handle); | |||
| CARLA_ASSERT(index >= -1 && index < (int32_t)midiprog.count); | |||
| if (index < -1) | |||
| index = -1; | |||
| @@ -413,7 +413,7 @@ public: | |||
| void showGui(const bool yesNo) | |||
| { | |||
| Q_ASSERT(descriptor); | |||
| CARLA_ASSERT(descriptor); | |||
| if (descriptor && handle) | |||
| descriptor->show_gui(handle, yesNo); | |||
| @@ -422,7 +422,7 @@ public: | |||
| void idleGui() | |||
| { | |||
| // FIXME - this should not be called if there's no GUI! | |||
| Q_ASSERT(descriptor); | |||
| CARLA_ASSERT(descriptor); | |||
| if (descriptor && descriptor->idle_gui && handle) | |||
| descriptor->idle_gui(handle); | |||
| @@ -434,7 +434,7 @@ public: | |||
| void reload() | |||
| { | |||
| qDebug("NativePlugin::reload() - start"); | |||
| Q_ASSERT(descriptor); | |||
| CARLA_ASSERT(descriptor); | |||
| // Safely disable plugin for reload | |||
| const ScopedDisabler m(this); | |||
| @@ -785,8 +785,8 @@ public: | |||
| for (i=0; i < midiprog.count; i++) | |||
| { | |||
| const MidiProgram* const mpDesc = &descriptor->midiPrograms[i]; | |||
| Q_ASSERT(mpDesc->program < 128); | |||
| Q_ASSERT(mpDesc->name); | |||
| CARLA_ASSERT(mpDesc->program < 128); | |||
| CARLA_ASSERT(mpDesc->name); | |||
| midiprog.data[i].bank = mpDesc->bank; | |||
| midiprog.data[i].program = mpDesc->program; | |||
| @@ -1481,10 +1481,10 @@ public: | |||
| bool handleWriteMidiEvent(MidiEvent* event) | |||
| { | |||
| Q_ASSERT(m_enabled); | |||
| Q_ASSERT(mOut.count > 0); | |||
| Q_ASSERT(isProcessing); | |||
| Q_ASSERT(event); | |||
| CARLA_ASSERT(m_enabled); | |||
| CARLA_ASSERT(mOut.count > 0); | |||
| CARLA_ASSERT(isProcessing); | |||
| CARLA_ASSERT(event); | |||
| if (! m_enabled) | |||
| return false; | |||
| @@ -1509,25 +1509,25 @@ public: | |||
| static uint32_t carla_host_get_buffer_size(HostHandle handle) | |||
| { | |||
| Q_ASSERT(handle); | |||
| CARLA_ASSERT(handle); | |||
| return ((NativePlugin*)handle)->handleGetBufferSize(); | |||
| } | |||
| static double carla_host_get_sample_rate(HostHandle handle) | |||
| { | |||
| Q_ASSERT(handle); | |||
| CARLA_ASSERT(handle); | |||
| return ((NativePlugin*)handle)->handleGetSampleRate(); | |||
| } | |||
| static const TimeInfo* carla_host_get_time_info(HostHandle handle) | |||
| { | |||
| Q_ASSERT(handle); | |||
| CARLA_ASSERT(handle); | |||
| return ((NativePlugin*)handle)->handleGetTimeInfo(); | |||
| } | |||
| static bool carla_host_write_midi_event(HostHandle handle, MidiEvent* event) | |||
| { | |||
| Q_ASSERT(handle); | |||
| CARLA_ASSERT(handle); | |||
| return ((NativePlugin*)handle)->handleWriteMidiEvent(event); | |||
| } | |||
| @@ -1540,7 +1540,7 @@ public: | |||
| static const PluginDescriptor* getPlugin(size_t index) | |||
| { | |||
| Q_ASSERT(index < pluginDescriptors.size()); | |||
| CARLA_ASSERT(index < pluginDescriptors.size()); | |||
| if (index < pluginDescriptors.size()) | |||
| return pluginDescriptors[index]; | |||
| @@ -28,7 +28,7 @@ void osc_error_handler(const int num, const char* const msg, const char* const p | |||
| CarlaOsc::CarlaOsc(CarlaEngine* const engine_) : | |||
| engine(engine_) | |||
| { | |||
| Q_ASSERT(engine); | |||
| CARLA_ASSERT(engine); | |||
| qDebug("CarlaOsc::CarlaOsc(%p)", engine_); | |||
| m_serverPathTCP = nullptr; | |||
| @@ -50,8 +50,8 @@ CarlaOsc::~CarlaOsc() | |||
| void CarlaOsc::init(const char* const name) | |||
| { | |||
| Q_ASSERT(name); | |||
| Q_ASSERT(m_name_len == 0); | |||
| CARLA_ASSERT(name); | |||
| CARLA_ASSERT(m_name_len == 0); | |||
| qDebug("CarlaOsc::init(\"%s\")", name); | |||
| m_name = strdup(name); | |||
| @@ -79,7 +79,7 @@ void CarlaOsc::init(const char* const name) | |||
| void CarlaOsc::close() | |||
| { | |||
| Q_ASSERT(m_name); | |||
| CARLA_ASSERT(m_name); | |||
| qDebug("CarlaOsc::close()"); | |||
| osc_clear_data(&m_controlData); | |||
| @@ -110,8 +110,8 @@ int CarlaOsc::handleMessage(const char* const path, const int argc, const lo_arg | |||
| qDebug("CarlaOsc::handleMessage(%s, %i, %p, %s, %p)", path, argc, argv, types, msg); | |||
| #endif | |||
| Q_ASSERT(m_serverThreadTCP || m_serverPathUDP); | |||
| Q_ASSERT(path); | |||
| CARLA_ASSERT(m_serverThreadTCP || m_serverPathUDP); | |||
| CARLA_ASSERT(path); | |||
| // Initial path check | |||
| if (strcmp(path, "/register") == 0) | |||
| @@ -211,8 +211,8 @@ public: | |||
| x_balanceLeft(-1.0), | |||
| x_balanceRight(1.0) | |||
| { | |||
| Q_ASSERT(engine); | |||
| Q_ASSERT(id < CarlaEngine::maxPluginNumber()); | |||
| CARLA_ASSERT(engine); | |||
| CARLA_ASSERT(id < CarlaEngine::maxPluginNumber()); | |||
| qDebug("CarlaPlugin::CarlaPlugin(%p, %i)", engine, id); | |||
| m_type = PLUGIN_NONE; | |||
| @@ -438,7 +438,7 @@ public: | |||
| */ | |||
| virtual uint32_t parameterScalePointCount(const uint32_t parameterId) | |||
| { | |||
| Q_ASSERT(parameterId < param.count); | |||
| CARLA_ASSERT(parameterId < param.count); | |||
| return 0; | |||
| } | |||
| @@ -496,7 +496,7 @@ public: | |||
| */ | |||
| const ParameterData* parameterData(const uint32_t parameterId) const | |||
| { | |||
| Q_ASSERT(parameterId < param.count); | |||
| CARLA_ASSERT(parameterId < param.count); | |||
| if (parameterId < param.count) | |||
| return ¶m.data[parameterId]; | |||
| @@ -509,7 +509,7 @@ public: | |||
| */ | |||
| const ParameterRanges* parameterRanges(const uint32_t parameterId) const | |||
| { | |||
| Q_ASSERT(parameterId < param.count); | |||
| CARLA_ASSERT(parameterId < param.count); | |||
| if (parameterId < param.count) | |||
| return ¶m.ranges[parameterId]; | |||
| @@ -522,7 +522,7 @@ public: | |||
| */ | |||
| bool parameterIsOutput(const uint32_t parameterId) const | |||
| { | |||
| Q_ASSERT(parameterId < param.count); | |||
| CARLA_ASSERT(parameterId < param.count); | |||
| if (parameterId < param.count) | |||
| return (param.data[parameterId].type == PARAMETER_OUTPUT); | |||
| @@ -537,7 +537,7 @@ public: | |||
| */ | |||
| const midi_program_t* midiProgramData(const uint32_t index) const | |||
| { | |||
| Q_ASSERT(index < midiprog.count); | |||
| CARLA_ASSERT(index < midiprog.count); | |||
| if (index < midiprog.count) | |||
| return &midiprog.data[index]; | |||
| @@ -552,7 +552,7 @@ public: | |||
| */ | |||
| const CustomData* customData(const size_t index) const | |||
| { | |||
| Q_ASSERT(index < custom.size()); | |||
| CARLA_ASSERT(index < custom.size()); | |||
| if (index < custom.size()) | |||
| return &custom[index]; | |||
| @@ -571,7 +571,7 @@ public: | |||
| */ | |||
| virtual int32_t chunkData(void** const dataPtr) | |||
| { | |||
| Q_ASSERT(dataPtr); | |||
| CARLA_ASSERT(dataPtr); | |||
| return 0; | |||
| } | |||
| @@ -584,7 +584,7 @@ public: | |||
| */ | |||
| virtual double getParameterValue(const uint32_t parameterId) | |||
| { | |||
| Q_ASSERT(parameterId < param.count); | |||
| CARLA_ASSERT(parameterId < param.count); | |||
| return 0.0; | |||
| } | |||
| @@ -594,8 +594,8 @@ public: | |||
| */ | |||
| virtual double getParameterScalePointValue(const uint32_t parameterId, const uint32_t scalePointId) | |||
| { | |||
| Q_ASSERT(parameterId < param.count); | |||
| Q_ASSERT(scalePointId < parameterScalePointCount(parameterId)); | |||
| CARLA_ASSERT(parameterId < param.count); | |||
| CARLA_ASSERT(scalePointId < parameterScalePointCount(parameterId)); | |||
| return 0.0; | |||
| } | |||
| @@ -639,7 +639,7 @@ public: | |||
| */ | |||
| virtual void getParameterName(const uint32_t parameterId, char* const strBuf) | |||
| { | |||
| Q_ASSERT(parameterId < param.count); | |||
| CARLA_ASSERT(parameterId < param.count); | |||
| *strBuf = 0; | |||
| } | |||
| @@ -649,7 +649,7 @@ public: | |||
| */ | |||
| virtual void getParameterSymbol(const uint32_t parameterId, char* const strBuf) | |||
| { | |||
| Q_ASSERT(parameterId < param.count); | |||
| CARLA_ASSERT(parameterId < param.count); | |||
| *strBuf = 0; | |||
| } | |||
| @@ -659,7 +659,7 @@ public: | |||
| */ | |||
| virtual void getParameterText(const uint32_t parameterId, char* const strBuf) | |||
| { | |||
| Q_ASSERT(parameterId < param.count); | |||
| CARLA_ASSERT(parameterId < param.count); | |||
| *strBuf = 0; | |||
| } | |||
| @@ -669,7 +669,7 @@ public: | |||
| */ | |||
| virtual void getParameterUnit(const uint32_t parameterId, char* const strBuf) | |||
| { | |||
| Q_ASSERT(parameterId < param.count); | |||
| CARLA_ASSERT(parameterId < param.count); | |||
| *strBuf = 0; | |||
| } | |||
| @@ -679,8 +679,8 @@ public: | |||
| */ | |||
| virtual void getParameterScalePointLabel(const uint32_t parameterId, const uint32_t scalePointId, char* const strBuf) | |||
| { | |||
| Q_ASSERT(parameterId < param.count); | |||
| Q_ASSERT(scalePointId < parameterScalePointCount(parameterId)); | |||
| CARLA_ASSERT(parameterId < param.count); | |||
| CARLA_ASSERT(scalePointId < parameterScalePointCount(parameterId)); | |||
| *strBuf = 0; | |||
| } | |||
| @@ -690,7 +690,7 @@ public: | |||
| */ | |||
| void getProgramName(const uint32_t index, char* const strBuf) | |||
| { | |||
| Q_ASSERT(index < prog.count); | |||
| CARLA_ASSERT(index < prog.count); | |||
| if (index < prog.count && prog.names[index]) | |||
| strncpy(strBuf, prog.names[index], STR_MAX); | |||
| @@ -705,7 +705,7 @@ public: | |||
| */ | |||
| void getMidiProgramName(const uint32_t index, char* const strBuf) | |||
| { | |||
| Q_ASSERT(index < midiprog.count); | |||
| CARLA_ASSERT(index < midiprog.count); | |||
| if (index < midiprog.count && midiprog.data[index].name) | |||
| strncpy(strBuf, midiprog.data[index].name, STR_MAX); | |||
| @@ -811,7 +811,7 @@ public: | |||
| */ | |||
| void setDryWet(double value, const bool sendOsc, const bool sendCallback) | |||
| { | |||
| Q_ASSERT(value >= 0.0 && value <= 1.0); | |||
| CARLA_ASSERT(value >= 0.0 && value <= 1.0); | |||
| if (value < 0.0) | |||
| value = 0.0; | |||
| @@ -844,7 +844,7 @@ public: | |||
| */ | |||
| void setVolume(double value, const bool sendOsc, const bool sendCallback) | |||
| { | |||
| Q_ASSERT(value >= 0.0 && value <= 1.27); | |||
| CARLA_ASSERT(value >= 0.0 && value <= 1.27); | |||
| if (value < 0.0) | |||
| value = 0.0; | |||
| @@ -877,7 +877,7 @@ public: | |||
| */ | |||
| void setBalanceLeft(double value, const bool sendOsc, const bool sendCallback) | |||
| { | |||
| Q_ASSERT(value >= -1.0 && value <= 1.0); | |||
| CARLA_ASSERT(value >= -1.0 && value <= 1.0); | |||
| if (value < -1.0) | |||
| value = -1.0; | |||
| @@ -910,7 +910,7 @@ public: | |||
| */ | |||
| void setBalanceRight(double value, const bool sendOsc, const bool sendCallback) | |||
| { | |||
| Q_ASSERT(value >= -1.0 && value <= 1.0); | |||
| CARLA_ASSERT(value >= -1.0 && value <= 1.0); | |||
| if (value < -1.0) | |||
| value = -1.0; | |||
| @@ -964,7 +964,7 @@ public: | |||
| */ | |||
| virtual void setParameterValue(const uint32_t parameterId, double value, const bool sendGui, const bool sendOsc, const bool sendCallback) | |||
| { | |||
| Q_ASSERT(parameterId < param.count); | |||
| CARLA_ASSERT(parameterId < param.count); | |||
| if (sendGui) | |||
| uiParameterChange(parameterId, value); | |||
| @@ -993,7 +993,7 @@ public: | |||
| */ | |||
| void setParameterValueByRIndex(const int32_t rindex, const double value, const bool sendGui, const bool sendOsc, const bool sendCallback) | |||
| { | |||
| Q_ASSERT(rindex >= PARAMETER_BALANCE_RIGHT && rindex != PARAMETER_NULL); | |||
| CARLA_ASSERT(rindex >= PARAMETER_BALANCE_RIGHT && rindex != PARAMETER_NULL); | |||
| if (rindex == PARAMETER_ACTIVE) | |||
| return setActive(value > 0.0, sendOsc, sendCallback); | |||
| @@ -1019,7 +1019,7 @@ public: | |||
| */ | |||
| void setParameterMidiChannel(const uint32_t parameterId, uint8_t channel, const bool sendOsc, const bool sendCallback) | |||
| { | |||
| Q_ASSERT(parameterId < param.count && channel < 16); | |||
| CARLA_ASSERT(parameterId < param.count && channel < 16); | |||
| if (channel >= 16) | |||
| channel = 16; | |||
| @@ -1043,7 +1043,7 @@ public: | |||
| */ | |||
| void setParameterMidiCC(const uint32_t parameterId, int16_t cc, const bool sendOsc, const bool sendCallback) | |||
| { | |||
| Q_ASSERT(parameterId < param.count && cc >= -1); | |||
| CARLA_ASSERT(parameterId < param.count && cc >= -1); | |||
| if (cc < -1 || cc > 0x5F) | |||
| cc = -1; | |||
| @@ -1074,9 +1074,9 @@ public: | |||
| */ | |||
| virtual void setCustomData(const CustomDataType type, const char* const key, const char* const value, const bool sendGui) | |||
| { | |||
| Q_ASSERT(type != CUSTOM_DATA_INVALID); | |||
| Q_ASSERT(key); | |||
| Q_ASSERT(value); | |||
| CARLA_ASSERT(type != CUSTOM_DATA_INVALID); | |||
| CARLA_ASSERT(key); | |||
| CARLA_ASSERT(value); | |||
| if (type == CUSTOM_DATA_INVALID) | |||
| return qCritical("CarlaPlugin::setCustomData(%s, \"%s\", \"%s\", %s) - type is invalid", CustomDataType2str(type), key, value, bool2str(sendGui)); | |||
| @@ -1137,7 +1137,7 @@ public: | |||
| */ | |||
| virtual void setChunkData(const char* const stringData) | |||
| { | |||
| Q_ASSERT(stringData); | |||
| CARLA_ASSERT(stringData); | |||
| } | |||
| /*! | |||
| @@ -1154,7 +1154,7 @@ public: | |||
| */ | |||
| virtual void setProgram(int32_t index, const bool sendGui, const bool sendOsc, const bool sendCallback, const bool block) | |||
| { | |||
| Q_ASSERT(index >= -1 && index < (int32_t)prog.count); | |||
| CARLA_ASSERT(index >= -1 && index < (int32_t)prog.count); | |||
| if (index < -1) | |||
| index = -1; | |||
| @@ -1211,7 +1211,7 @@ public: | |||
| */ | |||
| virtual void setMidiProgram(int32_t index, const bool sendGui, const bool sendOsc, const bool sendCallback, const bool block) | |||
| { | |||
| Q_ASSERT(index >= -1 && index < (int32_t)midiprog.count); | |||
| CARLA_ASSERT(index >= -1 && index < (int32_t)midiprog.count); | |||
| if (index < -1) | |||
| index = -1; | |||
| @@ -1260,7 +1260,7 @@ public: | |||
| */ | |||
| void setMidiProgramById(const uint32_t bank, const uint32_t program, const bool sendGui, const bool sendOsc, const bool sendCallback, const bool block) | |||
| { | |||
| Q_ASSERT(program < 128); | |||
| CARLA_ASSERT(program < 128); | |||
| for (uint32_t i=0; i < midiprog.count; i++) | |||
| { | |||
| @@ -1642,9 +1642,9 @@ public: | |||
| */ | |||
| void sendMidiSingleNote(const uint8_t channel, const uint8_t note, const uint8_t velo, const bool sendGui, const bool sendOsc, const bool sendCallback) | |||
| { | |||
| Q_ASSERT(channel < 16); | |||
| Q_ASSERT(note < 128); | |||
| Q_ASSERT(velo < 128); | |||
| CARLA_ASSERT(channel < 16); | |||
| CARLA_ASSERT(note < 128); | |||
| CARLA_ASSERT(velo < 128); | |||
| engineMidiLock(); | |||
| for (unsigned short i=0; i < MAX_MIDI_EVENTS; i++) | |||
| @@ -1879,7 +1879,7 @@ public: | |||
| */ | |||
| virtual void uiParameterChange(const uint32_t index, const double value) | |||
| { | |||
| Q_ASSERT(index < param.count); | |||
| CARLA_ASSERT(index < param.count); | |||
| Q_UNUSED(value); | |||
| } | |||
| @@ -1889,7 +1889,7 @@ public: | |||
| */ | |||
| virtual void uiProgramChange(const uint32_t index) | |||
| { | |||
| Q_ASSERT(index < prog.count); | |||
| CARLA_ASSERT(index < prog.count); | |||
| } | |||
| /*! | |||
| @@ -1897,7 +1897,7 @@ public: | |||
| */ | |||
| virtual void uiMidiProgramChange(const uint32_t index) | |||
| { | |||
| Q_ASSERT(index < midiprog.count); | |||
| CARLA_ASSERT(index < midiprog.count); | |||
| } | |||
| /*! | |||
| @@ -1905,9 +1905,9 @@ public: | |||
| */ | |||
| virtual void uiNoteOn(const uint8_t channel, const uint8_t note, const uint8_t velo) | |||
| { | |||
| Q_ASSERT(channel < 16); | |||
| Q_ASSERT(note < 128); | |||
| Q_ASSERT(velo > 0 && velo < 128); | |||
| CARLA_ASSERT(channel < 16); | |||
| CARLA_ASSERT(note < 128); | |||
| CARLA_ASSERT(velo > 0 && velo < 128); | |||
| } | |||
| /*! | |||
| @@ -1915,8 +1915,8 @@ public: | |||
| */ | |||
| virtual void uiNoteOff(const uint8_t channel, const uint8_t note) | |||
| { | |||
| Q_ASSERT(channel < 16); | |||
| Q_ASSERT(note < 128); | |||
| CARLA_ASSERT(channel < 16); | |||
| CARLA_ASSERT(note < 128); | |||
| } | |||
| // ------------------------------------------------------------------- | |||
| @@ -424,7 +424,7 @@ const char* getPluginTypeString(const PluginType type) | |||
| void* getPointer(const uintptr_t addr) | |||
| { | |||
| Q_ASSERT(addr != 0); | |||
| CARLA_ASSERT(addr != 0); | |||
| qDebug("CarlaBackend::getPointer(" P_UINTPTR ")", addr); | |||
| uintptr_t* const ptr = (uintptr_t*)addr; | |||
| @@ -433,7 +433,7 @@ void* getPointer(const uintptr_t addr) | |||
| PluginCategory getPluginCategoryFromName(const char* const name) | |||
| { | |||
| Q_ASSERT(name); | |||
| CARLA_ASSERT(name); | |||
| qDebug("CarlaBackend::getPluginCategoryFromName(\"%s\")", name); | |||
| QString qname(name); | |||
| @@ -29,7 +29,7 @@ CarlaCheckThread::CarlaCheckThread(CarlaBackend::CarlaEngine* const engine_, QOb | |||
| engine(engine_) | |||
| { | |||
| qDebug("CarlaCheckThread::CarlaCheckThread(%p, %p)", engine, parent); | |||
| Q_ASSERT(engine); | |||
| CARLA_ASSERT(engine); | |||
| } | |||
| CarlaCheckThread::~CarlaCheckThread() | |||
| @@ -107,7 +107,7 @@ public: | |||
| long uniqueId() | |||
| { | |||
| Q_ASSERT(ldescriptor); | |||
| CARLA_ASSERT(ldescriptor); | |||
| return ldescriptor->UniqueID; | |||
| } | |||
| @@ -117,9 +117,9 @@ public: | |||
| int32_t chunkData(void** const dataPtr) | |||
| { | |||
| Q_ASSERT(dataPtr); | |||
| Q_ASSERT(descriptor); | |||
| Q_ASSERT(descriptor->get_custom_data); | |||
| CARLA_ASSERT(dataPtr); | |||
| CARLA_ASSERT(descriptor); | |||
| CARLA_ASSERT(descriptor->get_custom_data); | |||
| unsigned long dataSize = 0; | |||
| @@ -134,14 +134,14 @@ public: | |||
| double getParameterValue(const uint32_t parameterId) | |||
| { | |||
| Q_ASSERT(parameterId < param.count); | |||
| CARLA_ASSERT(parameterId < param.count); | |||
| return paramBuffers[parameterId]; | |||
| } | |||
| void getLabel(char* const strBuf) | |||
| { | |||
| Q_ASSERT(ldescriptor); | |||
| CARLA_ASSERT(ldescriptor); | |||
| if (ldescriptor && ldescriptor->Label) | |||
| strncpy(strBuf, ldescriptor->Label, STR_MAX); | |||
| @@ -151,7 +151,7 @@ public: | |||
| void getMaker(char* const strBuf) | |||
| { | |||
| Q_ASSERT(ldescriptor); | |||
| CARLA_ASSERT(ldescriptor); | |||
| if (ldescriptor && ldescriptor->Maker) | |||
| strncpy(strBuf, ldescriptor->Maker, STR_MAX); | |||
| @@ -161,7 +161,7 @@ public: | |||
| void getCopyright(char* const strBuf) | |||
| { | |||
| Q_ASSERT(ldescriptor); | |||
| CARLA_ASSERT(ldescriptor); | |||
| if (ldescriptor && ldescriptor->Copyright) | |||
| strncpy(strBuf, ldescriptor->Copyright, STR_MAX); | |||
| @@ -171,7 +171,7 @@ public: | |||
| void getRealName(char* const strBuf) | |||
| { | |||
| Q_ASSERT(ldescriptor); | |||
| CARLA_ASSERT(ldescriptor); | |||
| if (ldescriptor && ldescriptor->Name) | |||
| strncpy(strBuf, ldescriptor->Name, STR_MAX); | |||
| @@ -181,8 +181,8 @@ public: | |||
| void getParameterName(const uint32_t parameterId, char* const strBuf) | |||
| { | |||
| Q_ASSERT(ldescriptor); | |||
| Q_ASSERT(parameterId < param.count); | |||
| CARLA_ASSERT(ldescriptor); | |||
| CARLA_ASSERT(parameterId < param.count); | |||
| int32_t rindex = param.data[parameterId].rindex; | |||
| @@ -194,8 +194,8 @@ public: | |||
| void getGuiInfo(GuiType* const type, bool* const resizable) | |||
| { | |||
| Q_ASSERT(type); | |||
| Q_ASSERT(resizable); | |||
| CARLA_ASSERT(type); | |||
| CARLA_ASSERT(resizable); | |||
| *type = (m_hints & PLUGIN_HAS_GUI) ? GUI_EXTERNAL_OSC : GUI_NONE; | |||
| *resizable = false; | |||
| @@ -206,7 +206,7 @@ public: | |||
| void setParameterValue(const uint32_t parameterId, double value, const bool sendGui, const bool sendOsc, const bool sendCallback) | |||
| { | |||
| Q_ASSERT(parameterId < param.count); | |||
| CARLA_ASSERT(parameterId < param.count); | |||
| paramBuffers[parameterId] = fixParameterValue(value, param.ranges[parameterId]); | |||
| @@ -215,9 +215,9 @@ public: | |||
| void setCustomData(const CustomDataType type, const char* const key, const char* const value, const bool sendGui) | |||
| { | |||
| Q_ASSERT(type == CUSTOM_DATA_STRING); | |||
| Q_ASSERT(key); | |||
| Q_ASSERT(value); | |||
| CARLA_ASSERT(type == CUSTOM_DATA_STRING); | |||
| CARLA_ASSERT(key); | |||
| CARLA_ASSERT(value); | |||
| if (type != CUSTOM_DATA_STRING) | |||
| return qCritical("DssiPlugin::setCustomData(%s, \"%s\", \"%s\", %s) - type is not string", CustomDataType2str(type), key, value, bool2str(sendGui)); | |||
| @@ -247,8 +247,8 @@ public: | |||
| void setChunkData(const char* const stringData) | |||
| { | |||
| Q_ASSERT(m_hints & PLUGIN_USES_CHUNKS); | |||
| Q_ASSERT(stringData); | |||
| CARLA_ASSERT(m_hints & PLUGIN_USES_CHUNKS); | |||
| CARLA_ASSERT(stringData); | |||
| static QByteArray chunk; | |||
| chunk = QByteArray::fromBase64(stringData); | |||
| @@ -269,7 +269,7 @@ public: | |||
| void setMidiProgram(int32_t index, const bool sendGui, const bool sendOsc, const bool sendCallback, const bool block) | |||
| { | |||
| Q_ASSERT(index >= -1 && index < (int32_t)midiprog.count); | |||
| CARLA_ASSERT(index >= -1 && index < (int32_t)midiprog.count); | |||
| if (index < -1) | |||
| index = -1; | |||
| @@ -301,7 +301,7 @@ public: | |||
| #ifndef BUILD_BRIDGE | |||
| void showGui(const bool yesNo) | |||
| { | |||
| Q_ASSERT(osc.thread); | |||
| CARLA_ASSERT(osc.thread); | |||
| if (! osc.thread) | |||
| { | |||
| @@ -334,7 +334,7 @@ public: | |||
| void reload() | |||
| { | |||
| qDebug("DssiPlugin::reload() - start"); | |||
| Q_ASSERT(descriptor && ldescriptor); | |||
| CARLA_ASSERT(descriptor && ldescriptor); | |||
| // Safely disable plugin for reload | |||
| const ScopedDisabler m(this); | |||
| @@ -737,9 +737,9 @@ public: | |||
| for (i=0; i < midiprog.count; i++) | |||
| { | |||
| const DSSI_Program_Descriptor* const pdesc = descriptor->get_program(handle, i); | |||
| Q_ASSERT(pdesc); | |||
| Q_ASSERT(pdesc->Program < 128); | |||
| Q_ASSERT(pdesc->Name); | |||
| CARLA_ASSERT(pdesc); | |||
| CARLA_ASSERT(pdesc->Program < 128); | |||
| CARLA_ASSERT(pdesc->Name); | |||
| midiprog.data[i].bank = pdesc->Bank; | |||
| midiprog.data[i].program = pdesc->Program; | |||
| @@ -1349,7 +1349,7 @@ public: | |||
| #ifndef BUILD_BRIDGE | |||
| void uiParameterChange(const uint32_t index, const double value) | |||
| { | |||
| Q_ASSERT(index < param.count); | |||
| CARLA_ASSERT(index < param.count); | |||
| if (index >= param.count) | |||
| return; | |||
| @@ -1361,7 +1361,7 @@ public: | |||
| void uiMidiProgramChange(const uint32_t index) | |||
| { | |||
| Q_ASSERT(index < midiprog.count); | |||
| CARLA_ASSERT(index < midiprog.count); | |||
| if (index >= midiprog.count) | |||
| return; | |||
| @@ -1373,9 +1373,9 @@ public: | |||
| void uiNoteOn(const uint8_t channel, const uint8_t note, const uint8_t velo) | |||
| { | |||
| Q_ASSERT(channel < 16); | |||
| Q_ASSERT(note < 128); | |||
| Q_ASSERT(velo > 0 && velo < 128); | |||
| CARLA_ASSERT(channel < 16); | |||
| CARLA_ASSERT(note < 128); | |||
| CARLA_ASSERT(velo > 0 && velo < 128); | |||
| if (! osc.data.target) | |||
| return; | |||
| @@ -1389,8 +1389,8 @@ public: | |||
| void uiNoteOff(const uint8_t channel, const uint8_t note) | |||
| { | |||
| Q_ASSERT(channel < 16); | |||
| Q_ASSERT(note < 128); | |||
| CARLA_ASSERT(channel < 16); | |||
| CARLA_ASSERT(note < 128); | |||
| if (! osc.data.target) | |||
| return; | |||
| @@ -98,7 +98,7 @@ public: | |||
| uint32_t parameterScalePointCount(const uint32_t parameterId) | |||
| { | |||
| Q_ASSERT(parameterId < param.count); | |||
| CARLA_ASSERT(parameterId < param.count); | |||
| switch (parameterId) | |||
| { | |||
| @@ -116,15 +116,15 @@ public: | |||
| double getParameterValue(const uint32_t parameterId) | |||
| { | |||
| Q_ASSERT(parameterId < param.count); | |||
| CARLA_ASSERT(parameterId < param.count); | |||
| return paramBuffers[parameterId]; | |||
| } | |||
| double getParameterScalePointValue(const uint32_t parameterId, const uint32_t scalePointId) | |||
| { | |||
| Q_ASSERT(parameterId < param.count); | |||
| Q_ASSERT(scalePointId < parameterScalePointCount(parameterId)); | |||
| CARLA_ASSERT(parameterId < param.count); | |||
| CARLA_ASSERT(scalePointId < parameterScalePointCount(parameterId)); | |||
| switch (parameterId) | |||
| { | |||
| @@ -182,7 +182,7 @@ public: | |||
| void getParameterName(const uint32_t parameterId, char* const strBuf) | |||
| { | |||
| Q_ASSERT(parameterId < param.count); | |||
| CARLA_ASSERT(parameterId < param.count); | |||
| switch (parameterId) | |||
| { | |||
| @@ -236,7 +236,7 @@ public: | |||
| void getParameterUnit(const uint32_t parameterId, char* const strBuf) | |||
| { | |||
| Q_ASSERT(parameterId < param.count); | |||
| CARLA_ASSERT(parameterId < param.count); | |||
| switch (parameterId) | |||
| { | |||
| @@ -254,8 +254,8 @@ public: | |||
| void getParameterScalePointLabel(const uint32_t parameterId, const uint32_t scalePointId, char* const strBuf) | |||
| { | |||
| Q_ASSERT(parameterId < param.count); | |||
| Q_ASSERT(scalePointId < parameterScalePointCount(parameterId)); | |||
| CARLA_ASSERT(parameterId < param.count); | |||
| CARLA_ASSERT(scalePointId < parameterScalePointCount(parameterId)); | |||
| switch (parameterId) | |||
| { | |||
| @@ -295,7 +295,7 @@ public: | |||
| void setParameterValue(const uint32_t parameterId, double value, const bool sendGui, const bool sendOsc, const bool sendCallback) | |||
| { | |||
| Q_ASSERT(parameterId < param.count); | |||
| CARLA_ASSERT(parameterId < param.count); | |||
| paramBuffers[parameterId] = fixParameterValue(value, param.ranges[parameterId]); | |||
| switch (parameterId) | |||
| @@ -355,7 +355,7 @@ public: | |||
| void setMidiProgram(int32_t index, const bool sendGui, const bool sendOsc, const bool sendCallback, const bool block) | |||
| { | |||
| Q_ASSERT(index >= -1 && index < (int32_t)midiprog.count); | |||
| CARLA_ASSERT(index >= -1 && index < (int32_t)midiprog.count); | |||
| if (index < -1) | |||
| index = -1; | |||
| @@ -388,7 +388,7 @@ public: | |||
| void reload() | |||
| { | |||
| qDebug("FluidSynthPlugin::reload() - start"); | |||
| Q_ASSERT(f_synth); | |||
| CARLA_ASSERT(f_synth); | |||
| // Safely disable plugin for reload | |||
| const ScopedDisabler m(this); | |||
| @@ -759,7 +759,7 @@ public: | |||
| midiprog.count += 1; | |||
| // soundfonts must always have at least 1 midi-program | |||
| Q_ASSERT(midiprog.count > 0); | |||
| CARLA_ASSERT(midiprog.count > 0); | |||
| if (midiprog.count > 0) | |||
| midiprog.data = new midi_program_t[midiprog.count]; | |||
| @@ -769,7 +769,7 @@ public: | |||
| f_sfont->iteration_start(f_sfont); | |||
| while (f_sfont->iteration_next(f_sfont, &f_preset)) | |||
| { | |||
| Q_ASSERT(i < midiprog.count); | |||
| CARLA_ASSERT(i < midiprog.count); | |||
| midiprog.data[i].bank = f_preset.get_banknum(&f_preset); | |||
| midiprog.data[i].program = f_preset.get_num(&f_preset); | |||
| midiprog.data[i].name = strdup(f_preset.get_name(&f_preset)); | |||
| @@ -118,7 +118,7 @@ public: | |||
| long uniqueId() | |||
| { | |||
| Q_ASSERT(descriptor); | |||
| CARLA_ASSERT(descriptor); | |||
| return descriptor->UniqueID; | |||
| } | |||
| @@ -128,7 +128,7 @@ public: | |||
| uint32_t parameterScalePointCount(const uint32_t parameterId) | |||
| { | |||
| Q_ASSERT(parameterId < param.count); | |||
| CARLA_ASSERT(parameterId < param.count); | |||
| int32_t rindex = param.data[parameterId].rindex; | |||
| @@ -148,15 +148,15 @@ public: | |||
| double getParameterValue(const uint32_t parameterId) | |||
| { | |||
| Q_ASSERT(parameterId < param.count); | |||
| CARLA_ASSERT(parameterId < param.count); | |||
| return paramBuffers[parameterId]; | |||
| } | |||
| double getParameterScalePointValue(const uint32_t parameterId, const uint32_t scalePointId) | |||
| { | |||
| Q_ASSERT(parameterId < param.count); | |||
| Q_ASSERT(scalePointId < parameterScalePointCount(parameterId)); | |||
| CARLA_ASSERT(parameterId < param.count); | |||
| CARLA_ASSERT(scalePointId < parameterScalePointCount(parameterId)); | |||
| int32_t rindex = param.data[parameterId].rindex; | |||
| @@ -178,7 +178,7 @@ public: | |||
| void getLabel(char* const strBuf) | |||
| { | |||
| Q_ASSERT(descriptor); | |||
| CARLA_ASSERT(descriptor); | |||
| if (descriptor && descriptor->Label) | |||
| strncpy(strBuf, descriptor->Label, STR_MAX); | |||
| @@ -188,7 +188,7 @@ public: | |||
| void getMaker(char* const strBuf) | |||
| { | |||
| Q_ASSERT(descriptor); | |||
| CARLA_ASSERT(descriptor); | |||
| if (rdf_descriptor && rdf_descriptor->Creator) | |||
| strncpy(strBuf, rdf_descriptor->Creator, STR_MAX); | |||
| @@ -200,7 +200,7 @@ public: | |||
| void getCopyright(char* const strBuf) | |||
| { | |||
| Q_ASSERT(descriptor); | |||
| CARLA_ASSERT(descriptor); | |||
| if (descriptor && descriptor->Copyright) | |||
| strncpy(strBuf, descriptor->Copyright, STR_MAX); | |||
| @@ -210,7 +210,7 @@ public: | |||
| void getRealName(char* const strBuf) | |||
| { | |||
| Q_ASSERT(descriptor); | |||
| CARLA_ASSERT(descriptor); | |||
| if (rdf_descriptor && rdf_descriptor->Title) | |||
| strncpy(strBuf, rdf_descriptor->Title, STR_MAX); | |||
| @@ -222,8 +222,8 @@ public: | |||
| void getParameterName(const uint32_t parameterId, char* const strBuf) | |||
| { | |||
| Q_ASSERT(descriptor); | |||
| Q_ASSERT(parameterId < param.count); | |||
| CARLA_ASSERT(descriptor); | |||
| CARLA_ASSERT(parameterId < param.count); | |||
| int32_t rindex = param.data[parameterId].rindex; | |||
| @@ -235,7 +235,7 @@ public: | |||
| void getParameterSymbol(const uint32_t parameterId, char* const strBuf) | |||
| { | |||
| Q_ASSERT(parameterId < param.count); | |||
| CARLA_ASSERT(parameterId < param.count); | |||
| int32_t rindex = param.data[parameterId].rindex; | |||
| @@ -255,7 +255,7 @@ public: | |||
| void getParameterUnit(const uint32_t parameterId, char* const strBuf) | |||
| { | |||
| Q_ASSERT(parameterId < param.count); | |||
| CARLA_ASSERT(parameterId < param.count); | |||
| int32_t rindex = param.data[parameterId].rindex; | |||
| @@ -294,8 +294,8 @@ public: | |||
| void getParameterScalePointLabel(const uint32_t parameterId, const uint32_t scalePointId, char* const strBuf) | |||
| { | |||
| Q_ASSERT(parameterId < param.count); | |||
| Q_ASSERT(scalePointId < parameterScalePointCount(parameterId)); | |||
| CARLA_ASSERT(parameterId < param.count); | |||
| CARLA_ASSERT(scalePointId < parameterScalePointCount(parameterId)); | |||
| int32_t rindex = param.data[parameterId].rindex; | |||
| @@ -323,7 +323,7 @@ public: | |||
| void setParameterValue(const uint32_t parameterId, double value, const bool sendGui, const bool sendOsc, const bool sendCallback) | |||
| { | |||
| Q_ASSERT(parameterId < param.count); | |||
| CARLA_ASSERT(parameterId < param.count); | |||
| paramBuffers[parameterId] = fixParameterValue(value, param.ranges[parameterId]); | |||
| @@ -336,7 +336,7 @@ public: | |||
| void reload() | |||
| { | |||
| qDebug("LadspaPlugin::reload() - start"); | |||
| Q_ASSERT(descriptor); | |||
| CARLA_ASSERT(descriptor); | |||
| // Safely disable plugin for reload | |||
| const ScopedDisabler m(this); | |||
| @@ -127,7 +127,7 @@ public: | |||
| void reload() | |||
| { | |||
| qDebug("LinuxSamplerPlugin::reload() - start"); | |||
| Q_ASSERT(instrument); | |||
| CARLA_ASSERT(instrument); | |||
| // Safely disable plugin for reload | |||
| const ScopedDisabler m(this); | |||
| @@ -234,7 +234,7 @@ public: | |||
| midiprog.count += instrumentIds.size(); | |||
| // sound kits must always have at least 1 midi-program | |||
| Q_ASSERT(midiprog.count > 0); | |||
| CARLA_ASSERT(midiprog.count > 0); | |||
| if (midiprog.count > 0) | |||
| midiprog.data = new midi_program_t [midiprog.count]; | |||
| @@ -465,7 +465,7 @@ public: | |||
| PluginCategory category() | |||
| { | |||
| Q_ASSERT(rdf_descriptor); | |||
| CARLA_ASSERT(rdf_descriptor); | |||
| LV2_Property category = rdf_descriptor->Type; | |||
| @@ -499,7 +499,7 @@ public: | |||
| long uniqueId() | |||
| { | |||
| Q_ASSERT(rdf_descriptor); | |||
| CARLA_ASSERT(rdf_descriptor); | |||
| return rdf_descriptor->UniqueID; | |||
| } | |||
| @@ -535,8 +535,8 @@ public: | |||
| uint32_t parameterScalePointCount(const uint32_t parameterId) | |||
| { | |||
| Q_ASSERT(parameterId < param.count); | |||
| Q_ASSERT(rdf_descriptor); | |||
| CARLA_ASSERT(parameterId < param.count); | |||
| CARLA_ASSERT(rdf_descriptor); | |||
| int32_t rindex = param.data[parameterId].rindex; | |||
| @@ -554,15 +554,15 @@ public: | |||
| double getParameterValue(const uint32_t parameterId) | |||
| { | |||
| Q_ASSERT(parameterId < param.count); | |||
| CARLA_ASSERT(parameterId < param.count); | |||
| return paramBuffers[parameterId]; | |||
| } | |||
| double getParameterScalePointValue(const uint32_t parameterId, const uint32_t scalePointId) | |||
| { | |||
| Q_ASSERT(parameterId < param.count); | |||
| Q_ASSERT(scalePointId < parameterScalePointCount(parameterId)); | |||
| CARLA_ASSERT(parameterId < param.count); | |||
| CARLA_ASSERT(scalePointId < parameterScalePointCount(parameterId)); | |||
| int32_t rindex = param.data[parameterId].rindex; | |||
| @@ -582,7 +582,7 @@ public: | |||
| void getLabel(char* const strBuf) | |||
| { | |||
| Q_ASSERT(rdf_descriptor); | |||
| CARLA_ASSERT(rdf_descriptor); | |||
| if (rdf_descriptor && rdf_descriptor->URI) | |||
| strncpy(strBuf, rdf_descriptor->URI, STR_MAX); | |||
| @@ -592,7 +592,7 @@ public: | |||
| void getMaker(char* const strBuf) | |||
| { | |||
| Q_ASSERT(rdf_descriptor); | |||
| CARLA_ASSERT(rdf_descriptor); | |||
| if (rdf_descriptor && rdf_descriptor->Author) | |||
| strncpy(strBuf, rdf_descriptor->Author, STR_MAX); | |||
| @@ -602,7 +602,7 @@ public: | |||
| void getCopyright(char* const strBuf) | |||
| { | |||
| Q_ASSERT(rdf_descriptor); | |||
| CARLA_ASSERT(rdf_descriptor); | |||
| if (rdf_descriptor && rdf_descriptor->License) | |||
| strncpy(strBuf, rdf_descriptor->License, STR_MAX); | |||
| @@ -612,7 +612,7 @@ public: | |||
| void getRealName(char* const strBuf) | |||
| { | |||
| Q_ASSERT(rdf_descriptor); | |||
| CARLA_ASSERT(rdf_descriptor); | |||
| if (rdf_descriptor && rdf_descriptor->Name) | |||
| strncpy(strBuf, rdf_descriptor->Name, STR_MAX); | |||
| @@ -622,8 +622,8 @@ public: | |||
| void getParameterName(const uint32_t parameterId, char* const strBuf) | |||
| { | |||
| Q_ASSERT(rdf_descriptor); | |||
| Q_ASSERT(parameterId < param.count); | |||
| CARLA_ASSERT(rdf_descriptor); | |||
| CARLA_ASSERT(parameterId < param.count); | |||
| int32_t rindex = param.data[parameterId].rindex; | |||
| @@ -635,8 +635,8 @@ public: | |||
| void getParameterSymbol(const uint32_t parameterId, char* const strBuf) | |||
| { | |||
| Q_ASSERT(rdf_descriptor); | |||
| Q_ASSERT(parameterId < param.count); | |||
| CARLA_ASSERT(rdf_descriptor); | |||
| CARLA_ASSERT(parameterId < param.count); | |||
| int32_t rindex = param.data[parameterId].rindex; | |||
| @@ -648,8 +648,8 @@ public: | |||
| void getParameterUnit(const uint32_t parameterId, char* const strBuf) | |||
| { | |||
| Q_ASSERT(rdf_descriptor); | |||
| Q_ASSERT(parameterId < param.count); | |||
| CARLA_ASSERT(rdf_descriptor); | |||
| CARLA_ASSERT(parameterId < param.count); | |||
| int32_t rindex = param.data[parameterId].rindex; | |||
| @@ -745,9 +745,9 @@ public: | |||
| void getParameterScalePointLabel(const uint32_t parameterId, const uint32_t scalePointId, char* const strBuf) | |||
| { | |||
| Q_ASSERT(rdf_descriptor); | |||
| Q_ASSERT(parameterId < param.count); | |||
| Q_ASSERT(scalePointId < parameterScalePointCount(parameterId)); | |||
| CARLA_ASSERT(rdf_descriptor); | |||
| CARLA_ASSERT(parameterId < param.count); | |||
| CARLA_ASSERT(scalePointId < parameterScalePointCount(parameterId)); | |||
| int32_t rindex = param.data[parameterId].rindex; | |||
| @@ -772,8 +772,8 @@ public: | |||
| void getGuiInfo(GuiType* const type, bool* const resizable) | |||
| { | |||
| Q_ASSERT(type); | |||
| Q_ASSERT(resizable); | |||
| CARLA_ASSERT(type); | |||
| CARLA_ASSERT(resizable); | |||
| *type = gui.type; | |||
| *resizable = gui.resizable; | |||
| @@ -784,7 +784,7 @@ public: | |||
| void setParameterValue(const uint32_t parameterId, double value, const bool sendGui, const bool sendOsc, const bool sendCallback) | |||
| { | |||
| Q_ASSERT(parameterId < param.count); | |||
| CARLA_ASSERT(parameterId < param.count); | |||
| paramBuffers[parameterId] = fixParameterValue(value, param.ranges[parameterId]); | |||
| @@ -793,9 +793,9 @@ public: | |||
| void setCustomData(const CustomDataType type, const char* const key, const char* const value, const bool sendGui) | |||
| { | |||
| Q_ASSERT(type != CUSTOM_DATA_INVALID); | |||
| Q_ASSERT(key); | |||
| Q_ASSERT(value); | |||
| CARLA_ASSERT(type != CUSTOM_DATA_INVALID); | |||
| CARLA_ASSERT(key); | |||
| CARLA_ASSERT(value); | |||
| if (type == CUSTOM_DATA_INVALID) | |||
| return qCritical("Lv2Plugin::setCustomData(%s, \"%s\", \"%s\", %s) - type is invalid", CustomDataType2str(type), key, value, bool2str(sendGui)); | |||
| @@ -861,7 +861,7 @@ public: | |||
| void setMidiProgram(int32_t index, const bool sendGui, const bool sendOsc, const bool sendCallback, const bool block) | |||
| { | |||
| Q_ASSERT(index >= -1 && index < (int32_t)midiprog.count); | |||
| CARLA_ASSERT(index >= -1 && index < (int32_t)midiprog.count); | |||
| if (index < -1) | |||
| index = -1; | |||
| @@ -893,7 +893,7 @@ public: | |||
| void setGuiContainer(GuiContainer* const container) | |||
| { | |||
| qDebug("Lv2Plugin::setGuiContainer(%p)", container); | |||
| Q_ASSERT(container); | |||
| CARLA_ASSERT(container); | |||
| switch(gui.type) | |||
| { | |||
| @@ -905,9 +905,9 @@ public: | |||
| { | |||
| QDialog* const dialog = (QDialog*)container->parent(); | |||
| QWidget* const widget = (QWidget*)ui.widget; | |||
| Q_ASSERT(dialog); | |||
| Q_ASSERT(dialog->layout()); | |||
| Q_ASSERT(widget); | |||
| CARLA_ASSERT(dialog); | |||
| CARLA_ASSERT(dialog->layout()); | |||
| CARLA_ASSERT(widget); | |||
| container->setVisible(false); | |||
| dialog->layout()->addWidget(widget); | |||
| widget->adjustSize(); | |||
| @@ -1001,7 +1001,7 @@ public: | |||
| case GUI_EXTERNAL_OSC: | |||
| #ifndef BUILD_BRIDGE | |||
| Q_ASSERT(osc.thread); | |||
| CARLA_ASSERT(osc.thread); | |||
| if (! osc.thread) | |||
| { | |||
| @@ -1080,7 +1080,7 @@ public: | |||
| void reload() | |||
| { | |||
| qDebug("Lv2Plugin::reload() - start"); | |||
| Q_ASSERT(descriptor && rdf_descriptor); | |||
| CARLA_ASSERT(descriptor && rdf_descriptor); | |||
| // Safely disable plugin for reload | |||
| const ScopedDisabler m(this); | |||
| @@ -1764,9 +1764,9 @@ public: | |||
| for (i=0; i < midiprog.count; i++) | |||
| { | |||
| const LV2_Program_Descriptor* const pdesc = ext.programs->get_program(handle, i); | |||
| Q_ASSERT(pdesc); | |||
| Q_ASSERT(pdesc->program < 128); | |||
| Q_ASSERT(pdesc->name); | |||
| CARLA_ASSERT(pdesc); | |||
| CARLA_ASSERT(pdesc->program < 128); | |||
| CARLA_ASSERT(pdesc->name); | |||
| midiprog.data[i].bank = pdesc->bank; | |||
| midiprog.data[i].program = pdesc->program; | |||
| @@ -2348,7 +2348,7 @@ public: | |||
| else if (param.data[k].type == PARAMETER_LV2_TIME) | |||
| { | |||
| rindex = param.data[k].rindex; | |||
| Q_ASSERT(rindex >= 0 && rindex < (int32_t)rdf_descriptor->PortCount); | |||
| CARLA_ASSERT(rindex >= 0 && rindex < (int32_t)rdf_descriptor->PortCount); | |||
| switch (rdf_descriptor->Ports[rindex].Designation) | |||
| { | |||
| @@ -2707,7 +2707,7 @@ public: | |||
| void postEventHandleCustom(const int32_t size, const int32_t, const double, const void* const data) | |||
| { | |||
| qDebug("Lv2Plugin::postEventHandleCustom(%i, %p)", size, data); | |||
| Q_ASSERT(ext.worker && ext.worker->work); | |||
| CARLA_ASSERT(ext.worker && ext.worker->work); | |||
| if (ext.worker && ext.worker->work) | |||
| ext.worker->work(handle, carla_lv2_worker_respond, this, size, data); | |||
| @@ -2715,7 +2715,7 @@ public: | |||
| void uiParameterChange(const uint32_t index, const double value) | |||
| { | |||
| Q_ASSERT(index < param.count); | |||
| CARLA_ASSERT(index < param.count); | |||
| if (index >= param.count) | |||
| return; | |||
| @@ -2739,7 +2739,7 @@ public: | |||
| void uiMidiProgramChange(const uint32_t index) | |||
| { | |||
| Q_ASSERT(index < midiprog.count); | |||
| CARLA_ASSERT(index < midiprog.count); | |||
| if (index >= midiprog.count) | |||
| return; | |||
| @@ -2760,9 +2760,9 @@ public: | |||
| void uiNoteOn(const uint8_t channel, const uint8_t note, const uint8_t velo) | |||
| { | |||
| Q_ASSERT(channel < 16); | |||
| Q_ASSERT(note < 128); | |||
| Q_ASSERT(velo > 0 && velo < 128); | |||
| CARLA_ASSERT(channel < 16); | |||
| CARLA_ASSERT(note < 128); | |||
| CARLA_ASSERT(velo > 0 && velo < 128); | |||
| #ifndef BUILD_BRIDGE | |||
| if (gui.type == GUI_EXTERNAL_OSC) | |||
| @@ -2796,8 +2796,8 @@ public: | |||
| void uiNoteOff(const uint8_t channel, const uint8_t note) | |||
| { | |||
| Q_ASSERT(channel < 16); | |||
| Q_ASSERT(note < 128); | |||
| CARLA_ASSERT(channel < 16); | |||
| CARLA_ASSERT(note < 128); | |||
| #ifndef BUILD_BRIDGE | |||
| if (gui.type == GUI_EXTERNAL_OSC) | |||
| @@ -2946,7 +2946,7 @@ public: | |||
| uint32_t getCustomURID(const char* const uri) | |||
| { | |||
| qDebug("Lv2Plugin::getCustomURID(%s)", uri); | |||
| Q_ASSERT(uri); | |||
| CARLA_ASSERT(uri); | |||
| if (! uri) | |||
| return CARLA_URI_MAP_ID_NULL; | |||
| @@ -2965,7 +2965,7 @@ public: | |||
| const char* getCustomURIString(const LV2_URID urid) const | |||
| { | |||
| qDebug("Lv2Plugin::getCustomURIString(%i)", urid); | |||
| Q_ASSERT(urid > CARLA_URI_MAP_ID_NULL); | |||
| CARLA_ASSERT(urid > CARLA_URI_MAP_ID_NULL); | |||
| if (urid == CARLA_URI_MAP_ID_NULL) | |||
| return nullptr; | |||
| @@ -2980,8 +2980,8 @@ public: | |||
| void handleTransferAtom(const int32_t portIndex, const LV2_Atom* const atom) | |||
| { | |||
| qDebug("Lv2Plugin::handleTransferAtom(%i, %p)", portIndex, atom); | |||
| Q_ASSERT(portIndex >= 0); | |||
| Q_ASSERT(atom); | |||
| CARLA_ASSERT(portIndex >= 0); | |||
| CARLA_ASSERT(atom); | |||
| atomQueueIn.put(portIndex, atom); | |||
| } | |||
| @@ -2989,8 +2989,8 @@ public: | |||
| void handleTransferEvent(const int32_t portIndex, const LV2_Atom* const atom) | |||
| { | |||
| qDebug("Lv2Plugin::handleTransferEvent(%i, %p)", portIndex, atom); | |||
| Q_ASSERT(portIndex >= 0); | |||
| Q_ASSERT(atom); | |||
| CARLA_ASSERT(portIndex >= 0); | |||
| CARLA_ASSERT(atom); | |||
| atomQueueIn.put(portIndex, atom); | |||
| } | |||
| @@ -3009,7 +3009,7 @@ public: | |||
| if (index >= 0 && index < (int32_t)prog.count && ext.programs) | |||
| { | |||
| const char* const progName = ext.programs->get_program(handle, index)->name; | |||
| Q_ASSERT(progName); | |||
| CARLA_ASSERT(progName); | |||
| if (prog.names[index]) | |||
| free((void*)prog.names[index]); | |||
| @@ -3023,8 +3023,8 @@ public: | |||
| LV2_State_Status handleStateStore(const uint32_t key, const void* const value, const size_t size, const uint32_t type, const uint32_t flags) | |||
| { | |||
| Q_ASSERT(key > 0); | |||
| Q_ASSERT(value); | |||
| CARLA_ASSERT(key > 0); | |||
| CARLA_ASSERT(value); | |||
| CustomDataType dtype; | |||
| const char* const uriKey = getCustomURIString(key); | |||
| @@ -3092,7 +3092,7 @@ public: | |||
| const void* handleStateRetrieve(const uint32_t key, size_t* const size, uint32_t* const type, uint32_t* const flags) | |||
| { | |||
| Q_ASSERT(key > CARLA_URI_MAP_ID_NULL); | |||
| CARLA_ASSERT(key > CARLA_URI_MAP_ID_NULL); | |||
| const char* const uriKey = getCustomURIString(key); | |||
| @@ -3191,7 +3191,7 @@ public: | |||
| uint32_t handleUiPortMap(const char* const symbol) | |||
| { | |||
| Q_ASSERT(symbol); | |||
| CARLA_ASSERT(symbol); | |||
| if (! symbol) | |||
| return LV2UI_INVALID_PORT_INDEX; | |||
| @@ -3207,8 +3207,8 @@ public: | |||
| int handleUiResize(const int width, const int height) | |||
| { | |||
| Q_ASSERT(width > 0); | |||
| Q_ASSERT(height > 0); | |||
| CARLA_ASSERT(width > 0); | |||
| CARLA_ASSERT(height > 0); | |||
| if (width <= 0 || height <= 0) | |||
| return 1; | |||
| @@ -3224,8 +3224,8 @@ public: | |||
| { | |||
| if (format == 0) | |||
| { | |||
| Q_ASSERT(buffer); | |||
| Q_ASSERT(bufferSize == sizeof(float)); | |||
| CARLA_ASSERT(buffer); | |||
| CARLA_ASSERT(bufferSize == sizeof(float)); | |||
| if (bufferSize != sizeof(float)) | |||
| return; | |||
| @@ -3240,14 +3240,14 @@ public: | |||
| } | |||
| else if (format == CARLA_URI_MAP_ID_ATOM_TRANSFER_ATOM) | |||
| { | |||
| Q_ASSERT(buffer); | |||
| CARLA_ASSERT(buffer); | |||
| const LV2_Atom* const atom = (const LV2_Atom*)buffer; | |||
| handleTransferAtom(rindex, atom); | |||
| } | |||
| else if (format == CARLA_URI_MAP_ID_ATOM_TRANSFER_EVENT) | |||
| { | |||
| Q_ASSERT(buffer); | |||
| CARLA_ASSERT(buffer); | |||
| const LV2_Atom* const atom = (const LV2_Atom*)buffer; | |||
| handleTransferEvent(rindex, atom); | |||
| @@ -3259,8 +3259,8 @@ public: | |||
| #ifndef BUILD_BRIDGE | |||
| bool isUiBridgeable(const uint32_t uiId) | |||
| { | |||
| Q_ASSERT(rdf_descriptor); | |||
| Q_ASSERT(uiId < rdf_descriptor->UICount); | |||
| CARLA_ASSERT(rdf_descriptor); | |||
| CARLA_ASSERT(uiId < rdf_descriptor->UICount); | |||
| if (uiId >= rdf_descriptor->UICount) | |||
| return false; | |||
| @@ -3279,7 +3279,7 @@ public: | |||
| bool isUiResizable() | |||
| { | |||
| Q_ASSERT(ui.rdf_descriptor); | |||
| CARLA_ASSERT(ui.rdf_descriptor); | |||
| if (! ui.rdf_descriptor) | |||
| return false; | |||
| @@ -3394,8 +3394,8 @@ public: | |||
| static uint32_t carla_lv2_event_ref(const LV2_Event_Callback_Data callback_data, LV2_Event* const event) | |||
| { | |||
| qDebug("Lv2Plugin::carla_lv2_event_ref(%p, %p)", callback_data, event); | |||
| Q_ASSERT(callback_data); | |||
| Q_ASSERT(event); | |||
| CARLA_ASSERT(callback_data); | |||
| CARLA_ASSERT(event); | |||
| return 0; | |||
| } | |||
| @@ -3403,8 +3403,8 @@ public: | |||
| static uint32_t carla_lv2_event_unref(const LV2_Event_Callback_Data callback_data, LV2_Event* const event) | |||
| { | |||
| qDebug("Lv2Plugin::carla_lv2_event_unref(%p, %p)", callback_data, event); | |||
| Q_ASSERT(callback_data); | |||
| Q_ASSERT(event); | |||
| CARLA_ASSERT(callback_data); | |||
| CARLA_ASSERT(event); | |||
| return 0; | |||
| } | |||
| @@ -3414,8 +3414,8 @@ public: | |||
| static int carla_lv2_log_printf(const LV2_Log_Handle handle, const LV2_URID type, const char* const fmt, ...) | |||
| { | |||
| qDebug("Lv2Plugin::carla_lv2_log_printf(%p, %i, \"%s\", ...)", handle, type, fmt); | |||
| Q_ASSERT(handle); | |||
| Q_ASSERT(type > 0); | |||
| CARLA_ASSERT(handle); | |||
| CARLA_ASSERT(type > 0); | |||
| #ifndef DEBUG | |||
| if (type == CARLA_URI_MAP_ID_LOG_TRACE) | |||
| @@ -3433,8 +3433,8 @@ public: | |||
| static int carla_lv2_log_vprintf(const LV2_Log_Handle handle, const LV2_URID type, const char* const fmt, va_list ap) | |||
| { | |||
| qDebug("Lv2Plugin::carla_lv2_log_vprintf(%p, %i, \"%s\", ...)", handle, type, fmt); | |||
| Q_ASSERT(handle); | |||
| Q_ASSERT(type > 0); | |||
| CARLA_ASSERT(handle); | |||
| CARLA_ASSERT(type > 0); | |||
| #ifndef DEBUG | |||
| if (type == CARLA_URI_MAP_ID_LOG_TRACE) | |||
| @@ -3473,7 +3473,7 @@ public: | |||
| static void carla_lv2_program_changed(const LV2_Programs_Handle handle, const int32_t index) | |||
| { | |||
| qDebug("Lv2Plugin::carla_lv2_program_changed(%p, %i)", handle, index); | |||
| Q_ASSERT(handle); | |||
| CARLA_ASSERT(handle); | |||
| if (! handle) | |||
| return; | |||
| @@ -3487,8 +3487,8 @@ public: | |||
| static char* carla_lv2_state_make_path(const LV2_State_Make_Path_Handle handle, const char* const path) | |||
| { | |||
| qDebug("Lv2Plugin::carla_lv2_state_make_path(%p, \"%s\")", handle, path); | |||
| Q_ASSERT(handle); | |||
| Q_ASSERT(path); | |||
| CARLA_ASSERT(handle); | |||
| CARLA_ASSERT(path); | |||
| if (! path) | |||
| return nullptr; | |||
| @@ -3501,8 +3501,8 @@ public: | |||
| static char* carla_lv2_state_map_abstract_path(const LV2_State_Map_Path_Handle handle, const char* const absolute_path) | |||
| { | |||
| qDebug("Lv2Plugin::carla_lv2_state_map_abstract_path(%p, \"%s\")", handle, absolute_path); | |||
| Q_ASSERT(handle); | |||
| Q_ASSERT(absolute_path); | |||
| CARLA_ASSERT(handle); | |||
| CARLA_ASSERT(absolute_path); | |||
| if (! absolute_path) | |||
| return nullptr; | |||
| @@ -3514,8 +3514,8 @@ public: | |||
| static char* carla_lv2_state_map_absolute_path(const LV2_State_Map_Path_Handle handle, const char* const abstract_path) | |||
| { | |||
| qDebug("Lv2Plugin::carla_lv2_state_map_absolute_path(%p, \"%s\")", handle, abstract_path); | |||
| Q_ASSERT(handle); | |||
| Q_ASSERT(abstract_path); | |||
| CARLA_ASSERT(handle); | |||
| CARLA_ASSERT(abstract_path); | |||
| if (! abstract_path) | |||
| return nullptr; | |||
| @@ -3527,7 +3527,7 @@ public: | |||
| static LV2_State_Status carla_lv2_state_store(const LV2_State_Handle handle, const uint32_t key, const void* const value, const size_t size, const uint32_t type, const uint32_t flags) | |||
| { | |||
| qDebug("Lv2Plugin::carla_lv2_state_store(%p, %i, %p, " P_SIZE ", %i, %i)", handle, key, value, size, type, flags); | |||
| Q_ASSERT(handle); | |||
| CARLA_ASSERT(handle); | |||
| if (! handle) | |||
| return LV2_STATE_ERR_UNKNOWN; | |||
| @@ -3539,7 +3539,7 @@ public: | |||
| static const void* carla_lv2_state_retrieve(const LV2_State_Handle handle, const uint32_t key, size_t* const size, uint32_t* const type, uint32_t* const flags) | |||
| { | |||
| qDebug("Lv2Plugin::carla_lv2_state_retrieve(%p, %i, %p, %p, %p)", handle, key, size, type, flags); | |||
| Q_ASSERT(handle); | |||
| CARLA_ASSERT(handle); | |||
| if (! handle) | |||
| return nullptr; | |||
| @@ -3561,8 +3561,8 @@ public: | |||
| static LV2_URID carla_lv2_urid_map(const LV2_URID_Map_Handle handle, const char* const uri) | |||
| { | |||
| qDebug("Lv2Plugin::carla_lv2_urid_map(%p, \"%s\")", handle, uri); | |||
| Q_ASSERT(handle); | |||
| Q_ASSERT(uri); | |||
| CARLA_ASSERT(handle); | |||
| CARLA_ASSERT(uri); | |||
| if (! uri) | |||
| return CARLA_URI_MAP_ID_NULL; | |||
| @@ -3620,8 +3620,8 @@ public: | |||
| static const char* carla_lv2_urid_unmap(const LV2_URID_Map_Handle handle, const LV2_URID urid) | |||
| { | |||
| qDebug("Lv2Plugin::carla_lv2_urid_unmap(%p, %i)", handle, urid); | |||
| Q_ASSERT(handle); | |||
| Q_ASSERT(urid > CARLA_URI_MAP_ID_NULL); | |||
| CARLA_ASSERT(handle); | |||
| CARLA_ASSERT(urid > CARLA_URI_MAP_ID_NULL); | |||
| if (urid == CARLA_URI_MAP_ID_NULL) | |||
| return nullptr; | |||
| @@ -3683,7 +3683,7 @@ public: | |||
| static LV2_Worker_Status carla_lv2_worker_schedule(const LV2_Worker_Schedule_Handle handle, const uint32_t size, const void* const data) | |||
| { | |||
| qDebug("Lv2Plugin::carla_lv2_worker_schedule(%p, %i, %p)", handle, size, data); | |||
| Q_ASSERT(handle); | |||
| CARLA_ASSERT(handle); | |||
| if (! handle) | |||
| return LV2_WORKER_ERR_UNKNOWN; | |||
| @@ -3695,7 +3695,7 @@ public: | |||
| static LV2_Worker_Status carla_lv2_worker_respond(const LV2_Worker_Respond_Handle handle, const uint32_t size, const void* const data) | |||
| { | |||
| qDebug("Lv2Plugin::carla_lv2_worker_respond(%p, %i, %p)", handle, size, data); | |||
| Q_ASSERT(handle); | |||
| CARLA_ASSERT(handle); | |||
| if (! handle) | |||
| return LV2_WORKER_ERR_UNKNOWN; | |||
| @@ -3709,7 +3709,7 @@ public: | |||
| static uint32_t carla_lv2_ui_port_map(const LV2UI_Feature_Handle handle, const char* const symbol) | |||
| { | |||
| qDebug("Lv2Plugin::carla_lv2_ui_port_map(%p, \"%s\")", handle, symbol); | |||
| Q_ASSERT(handle); | |||
| CARLA_ASSERT(handle); | |||
| if (! handle) | |||
| return LV2UI_INVALID_PORT_INDEX; | |||
| @@ -3723,7 +3723,7 @@ public: | |||
| static int carla_lv2_ui_resize(const LV2UI_Feature_Handle handle, const int width, const int height) | |||
| { | |||
| qDebug("Lv2Plugin::carla_lv2_ui_resize(%p, %i, %i)", handle, width, height); | |||
| Q_ASSERT(handle); | |||
| CARLA_ASSERT(handle); | |||
| if (! handle) | |||
| return 1; | |||
| @@ -3737,7 +3737,7 @@ public: | |||
| static void carla_lv2_external_ui_closed(const LV2UI_Controller controller) | |||
| { | |||
| qDebug("Lv2Plugin::carla_lv2_external_ui_closed(%p)", controller); | |||
| Q_ASSERT(controller); | |||
| CARLA_ASSERT(controller); | |||
| if (! controller) | |||
| return; | |||
| @@ -3751,7 +3751,7 @@ public: | |||
| static void carla_lv2_ui_write_function(const LV2UI_Controller controller, const uint32_t port_index, const uint32_t buffer_size, const uint32_t format, const void* const buffer) | |||
| { | |||
| qDebug("Lv2Plugin::carla_lv2_ui_write_function(%p, %i, %i, %i, %p)", controller, port_index, buffer_size, format, buffer); | |||
| Q_ASSERT(controller); | |||
| CARLA_ASSERT(controller); | |||
| if (! controller) | |||
| return; | |||
| @@ -69,7 +69,7 @@ public: | |||
| uint32_t getBufferSize() const | |||
| { | |||
| Q_ASSERT(host); | |||
| CARLA_ASSERT(host); | |||
| if (host) | |||
| return host->get_buffer_size(host->handle); | |||
| @@ -79,7 +79,7 @@ public: | |||
| double getSampleRate() const | |||
| { | |||
| Q_ASSERT(host); | |||
| CARLA_ASSERT(host); | |||
| if (host) | |||
| return host->get_sample_rate(host->handle); | |||
| @@ -89,7 +89,7 @@ public: | |||
| const TimeInfo* getTimeInfo() const | |||
| { | |||
| Q_ASSERT(host); | |||
| CARLA_ASSERT(host); | |||
| if (host) | |||
| return host->get_time_info(host->handle); | |||
| @@ -99,7 +99,7 @@ public: | |||
| void writeMidiEvent(MidiEvent* event) | |||
| { | |||
| Q_ASSERT(host); | |||
| CARLA_ASSERT(host); | |||
| if (host) | |||
| host->write_midi_event(host->handle, event); | |||
| @@ -163,48 +163,48 @@ protected: | |||
| virtual PortType getPortType(uint32_t index) | |||
| { | |||
| Q_ASSERT(index < getPortCount()); | |||
| CARLA_ASSERT(index < getPortCount()); | |||
| return PORT_TYPE_NULL; | |||
| } | |||
| virtual uint32_t getPortHints(uint32_t index) | |||
| { | |||
| Q_ASSERT(index < getPortCount()); | |||
| CARLA_ASSERT(index < getPortCount()); | |||
| return 0; | |||
| } | |||
| virtual const char* getPortName(uint32_t index) | |||
| { | |||
| Q_ASSERT(index < getPortCount()); | |||
| CARLA_ASSERT(index < getPortCount()); | |||
| return nullptr; | |||
| } | |||
| virtual void getParameterRanges(uint32_t index, ParameterRanges* ranges) | |||
| { | |||
| Q_ASSERT(index < getPortCount()); | |||
| Q_ASSERT(ranges); | |||
| CARLA_ASSERT(index < getPortCount()); | |||
| CARLA_ASSERT(ranges); | |||
| } | |||
| virtual double getParameterValue(uint32_t index) | |||
| { | |||
| Q_ASSERT(index < getPortCount()); | |||
| CARLA_ASSERT(index < getPortCount()); | |||
| return 0.0; | |||
| } | |||
| virtual const char* getParameterText(uint32_t index) | |||
| { | |||
| Q_ASSERT(index < getPortCount()); | |||
| CARLA_ASSERT(index < getPortCount()); | |||
| return nullptr; | |||
| } | |||
| virtual const char* getParameterUnit(uint32_t index) | |||
| { | |||
| Q_ASSERT(index < getPortCount()); | |||
| CARLA_ASSERT(index < getPortCount()); | |||
| return nullptr; | |||
| } | |||
| @@ -218,28 +218,28 @@ protected: | |||
| virtual void getMidiProgram(uint32_t index, MidiProgram* midiProgram) | |||
| { | |||
| Q_ASSERT(index < getMidiProgramCount()); | |||
| Q_ASSERT(midiProgram); | |||
| CARLA_ASSERT(index < getMidiProgramCount()); | |||
| CARLA_ASSERT(midiProgram); | |||
| } | |||
| // ------------------------------------------------------------------- | |||
| virtual void setParameterValue(uint32_t index, double value) | |||
| { | |||
| Q_ASSERT(index < getPortCount()); | |||
| CARLA_ASSERT(index < getPortCount()); | |||
| Q_UNUSED(value); | |||
| } | |||
| virtual void setMidiProgram(uint32_t bank, uint32_t program) | |||
| { | |||
| Q_ASSERT(program < 128); | |||
| CARLA_ASSERT(program < 128); | |||
| Q_UNUSED(bank); | |||
| } | |||
| virtual void setCustomData(const char* key, const char* value) | |||
| { | |||
| Q_ASSERT(key); | |||
| Q_ASSERT(value); | |||
| CARLA_ASSERT(key); | |||
| CARLA_ASSERT(value); | |||
| } | |||
| // ------------------------------------------------------------------- | |||
| @@ -267,9 +267,9 @@ protected: | |||
| virtual void process(float** inBuffer, float** outBuffer, const uint32_t frames, uint32_t midiEventCount, MidiEvent* midiEvents) | |||
| { | |||
| Q_ASSERT(inBuffer); | |||
| Q_ASSERT(outBuffer); | |||
| Q_ASSERT(midiEvents); | |||
| CARLA_ASSERT(inBuffer); | |||
| CARLA_ASSERT(outBuffer); | |||
| CARLA_ASSERT(midiEvents); | |||
| Q_UNUSED(frames); | |||
| Q_UNUSED(midiEventCount); | |||
| @@ -157,7 +157,7 @@ protected: | |||
| uint8_t status = midiEvent.data[0]; | |||
| uint8_t channel = status & 0x0F; | |||
| Q_ASSERT(channel < 16); | |||
| CARLA_ASSERT(channel < 16); | |||
| if (channel >= 16) | |||
| continue; | |||
| @@ -125,7 +125,7 @@ public: | |||
| PluginCategory category() | |||
| { | |||
| Q_ASSERT(effect); | |||
| CARLA_ASSERT(effect); | |||
| intptr_t category = effect->dispatcher(effect, effGetPlugCategory, 0, 0, nullptr, 0.0f); | |||
| @@ -153,7 +153,7 @@ public: | |||
| long uniqueId() | |||
| { | |||
| Q_ASSERT(effect); | |||
| CARLA_ASSERT(effect); | |||
| return effect->uniqueID; | |||
| } | |||
| @@ -163,8 +163,8 @@ public: | |||
| int32_t chunkData(void** const dataPtr) | |||
| { | |||
| Q_ASSERT(dataPtr); | |||
| Q_ASSERT(effect); | |||
| CARLA_ASSERT(dataPtr); | |||
| CARLA_ASSERT(effect); | |||
| if (effect) | |||
| return effect->dispatcher(effect, effGetChunk, 0 /* bank */, 0, dataPtr, 0.0f); | |||
| @@ -177,8 +177,8 @@ public: | |||
| double getParameterValue(const uint32_t parameterId) | |||
| { | |||
| Q_ASSERT(effect); | |||
| Q_ASSERT(parameterId < param.count); | |||
| CARLA_ASSERT(effect); | |||
| CARLA_ASSERT(parameterId < param.count); | |||
| if (effect) | |||
| return effect->getParameter(effect, parameterId); | |||
| @@ -188,7 +188,7 @@ public: | |||
| void getLabel(char* const strBuf) | |||
| { | |||
| Q_ASSERT(effect); | |||
| CARLA_ASSERT(effect); | |||
| if (effect) | |||
| effect->dispatcher(effect, effGetProductString, 0, 0, strBuf, 0.0f); | |||
| @@ -198,7 +198,7 @@ public: | |||
| void getMaker(char* const strBuf) | |||
| { | |||
| Q_ASSERT(effect); | |||
| CARLA_ASSERT(effect); | |||
| if (effect) | |||
| effect->dispatcher(effect, effGetVendorString, 0, 0, strBuf, 0.0f); | |||
| @@ -208,7 +208,7 @@ public: | |||
| void getCopyright(char* const strBuf) | |||
| { | |||
| Q_ASSERT(effect); | |||
| CARLA_ASSERT(effect); | |||
| if (effect) | |||
| effect->dispatcher(effect, effGetVendorString, 0, 0, strBuf, 0.0f); | |||
| @@ -218,7 +218,7 @@ public: | |||
| void getRealName(char* const strBuf) | |||
| { | |||
| Q_ASSERT(effect); | |||
| CARLA_ASSERT(effect); | |||
| if (effect) | |||
| effect->dispatcher(effect, effGetEffectName, 0, 0, strBuf, 0.0f); | |||
| @@ -228,8 +228,8 @@ public: | |||
| void getParameterName(const uint32_t parameterId, char* const strBuf) | |||
| { | |||
| Q_ASSERT(effect); | |||
| Q_ASSERT(parameterId < param.count); | |||
| CARLA_ASSERT(effect); | |||
| CARLA_ASSERT(parameterId < param.count); | |||
| if (effect) | |||
| effect->dispatcher(effect, effGetParamName, parameterId, 0, strBuf, 0.0f); | |||
| @@ -239,8 +239,8 @@ public: | |||
| void getParameterText(const uint32_t parameterId, char* const strBuf) | |||
| { | |||
| Q_ASSERT(effect); | |||
| Q_ASSERT(parameterId < param.count); | |||
| CARLA_ASSERT(effect); | |||
| CARLA_ASSERT(parameterId < param.count); | |||
| if (effect) | |||
| { | |||
| @@ -255,8 +255,8 @@ public: | |||
| void getParameterUnit(const uint32_t parameterId, char* const strBuf) | |||
| { | |||
| Q_ASSERT(effect); | |||
| Q_ASSERT(parameterId < param.count); | |||
| CARLA_ASSERT(effect); | |||
| CARLA_ASSERT(parameterId < param.count); | |||
| if (effect) | |||
| effect->dispatcher(effect, effGetParamLabel, parameterId, 0, strBuf, 0.0f); | |||
| @@ -275,7 +275,7 @@ public: | |||
| void setParameterValue(const uint32_t parameterId, double value, const bool sendGui, const bool sendOsc, const bool sendCallback) | |||
| { | |||
| Q_ASSERT(parameterId < param.count); | |||
| CARLA_ASSERT(parameterId < param.count); | |||
| effect->setParameter(effect, parameterId, fixParameterValue(value, param.ranges[parameterId])); | |||
| @@ -284,8 +284,8 @@ public: | |||
| void setChunkData(const char* const stringData) | |||
| { | |||
| Q_ASSERT(m_hints & PLUGIN_USES_CHUNKS); | |||
| Q_ASSERT(stringData); | |||
| CARLA_ASSERT(m_hints & PLUGIN_USES_CHUNKS); | |||
| CARLA_ASSERT(stringData); | |||
| static QByteArray chunk; | |||
| chunk = QByteArray::fromBase64(stringData); | |||
| @@ -304,7 +304,7 @@ public: | |||
| void setProgram(int32_t index, const bool sendGui, const bool sendOsc, const bool sendCallback, const bool block) | |||
| { | |||
| Q_ASSERT(index >= -1 && index < (int32_t)prog.count); | |||
| CARLA_ASSERT(index >= -1 && index < (int32_t)prog.count); | |||
| if (index < -1) | |||
| index = -1; | |||
| @@ -334,7 +334,7 @@ public: | |||
| void setGuiContainer(GuiContainer* const container) | |||
| { | |||
| qDebug("VstPlugin::setGuiContainer(%p)", container); | |||
| Q_ASSERT(container); | |||
| CARLA_ASSERT(container); | |||
| if (gui.type == GUI_EXTERNAL_OSC) | |||
| return; | |||
| @@ -388,7 +388,7 @@ public: | |||
| if (gui.type == GUI_EXTERNAL_OSC) | |||
| { | |||
| #ifndef BUILD_BRIDGE | |||
| Q_ASSERT(osc.thread); | |||
| CARLA_ASSERT(osc.thread); | |||
| if (! osc.thread) | |||
| { | |||
| @@ -447,7 +447,7 @@ public: | |||
| void reload() | |||
| { | |||
| qDebug("VstPlugin::reload() - start"); | |||
| Q_ASSERT(effect); | |||
| CARLA_ASSERT(effect); | |||
| // Safely disable plugin for reload | |||
| const ScopedDisabler m(this); | |||
| @@ -1353,7 +1353,7 @@ public: | |||
| #ifndef BUILD_BRIDGE | |||
| void uiParameterChange(const uint32_t index, const double value) | |||
| { | |||
| Q_ASSERT(index < param.count); | |||
| CARLA_ASSERT(index < param.count); | |||
| if (index >= param.count) | |||
| return; | |||
| @@ -1364,7 +1364,7 @@ public: | |||
| void uiProgramChange(const uint32_t index) | |||
| { | |||
| Q_ASSERT(index < prog.count); | |||
| CARLA_ASSERT(index < prog.count); | |||
| if (index >= prog.count) | |||
| return; | |||
| @@ -1375,9 +1375,9 @@ public: | |||
| void uiNoteOn(const uint8_t channel, const uint8_t note, const uint8_t velo) | |||
| { | |||
| Q_ASSERT(channel < 16); | |||
| Q_ASSERT(note < 128); | |||
| Q_ASSERT(velo > 0 && velo < 128); | |||
| CARLA_ASSERT(channel < 16); | |||
| CARLA_ASSERT(note < 128); | |||
| CARLA_ASSERT(velo > 0 && velo < 128); | |||
| if (gui.type == GUI_EXTERNAL_OSC && osc.data.target) | |||
| { | |||
| @@ -1391,8 +1391,8 @@ public: | |||
| void uiNoteOff(const uint8_t channel, const uint8_t note) | |||
| { | |||
| Q_ASSERT(channel < 16); | |||
| Q_ASSERT(note < 128); | |||
| CARLA_ASSERT(channel < 16); | |||
| CARLA_ASSERT(note < 128); | |||
| if (gui.type == GUI_EXTERNAL_OSC && osc.data.target) | |||
| { | |||
| @@ -1408,8 +1408,8 @@ public: | |||
| void handleAudioMasterAutomate(const uint32_t index, const double value) | |||
| { | |||
| //Q_ASSERT(m_enabled); | |||
| Q_ASSERT(index < param.count); | |||
| //CARLA_ASSERT(m_enabled); | |||
| CARLA_ASSERT(index < param.count); | |||
| if (index >= param.count /*|| ! m_enabled*/) | |||
| return; | |||
| @@ -1511,7 +1511,7 @@ public: | |||
| intptr_t handleAudioMasterIOChanged() | |||
| { | |||
| qDebug("VstPlugin::handleAudioMasterIOChanged()"); | |||
| Q_ASSERT(m_enabled); | |||
| CARLA_ASSERT(m_enabled); | |||
| // TESTING | |||
| @@ -1556,9 +1556,9 @@ public: | |||
| intptr_t handleAudioMasterProcessEvents(const VstEvents* const vstEvents) | |||
| { | |||
| Q_ASSERT(m_enabled); | |||
| Q_ASSERT(midi.portMout); | |||
| Q_ASSERT(isProcessing); | |||
| CARLA_ASSERT(m_enabled); | |||
| CARLA_ASSERT(midi.portMout); | |||
| CARLA_ASSERT(isProcessing); | |||
| if (! m_enabled) | |||
| return 0; | |||
| @@ -1747,7 +1747,7 @@ public: | |||
| if (! self->effect) | |||
| self->effect = effect; | |||
| Q_ASSERT(self->effect == effect); | |||
| CARLA_ASSERT(self->effect == effect); | |||
| if (self->effect != effect) | |||
| { | |||
| @@ -1771,7 +1771,7 @@ public: | |||
| switch (opcode) | |||
| { | |||
| case audioMasterAutomate: | |||
| Q_ASSERT(self); | |||
| CARLA_ASSERT(self); | |||
| if (self) | |||
| self->handleAudioMasterAutomate(index, opt); | |||
| else | |||
| @@ -1787,7 +1787,7 @@ public: | |||
| break; | |||
| case audioMasterIdle: | |||
| Q_ASSERT(effect); | |||
| CARLA_ASSERT(effect); | |||
| if (effect) | |||
| effect->dispatcher(effect, effEditIdle, 0, 0, nullptr, 0.0f); | |||
| else | |||
| @@ -1802,7 +1802,7 @@ public: | |||
| case audioMasterWantMidi: | |||
| // Deprecated in VST SDK 2.4 | |||
| Q_ASSERT(self); | |||
| CARLA_ASSERT(self); | |||
| if (self) | |||
| self->handleAudioMasterWantMidi(); | |||
| else | |||
| @@ -1811,7 +1811,7 @@ public: | |||
| #endif | |||
| case audioMasterGetTime: | |||
| Q_ASSERT(self); | |||
| CARLA_ASSERT(self); | |||
| if (self) | |||
| { | |||
| ret = (intptr_t)self->handleAudioMasterGetTime(); | |||
| @@ -1838,7 +1838,7 @@ public: | |||
| break; | |||
| case audioMasterProcessEvents: | |||
| Q_ASSERT(self && ptr); | |||
| CARLA_ASSERT(self && ptr); | |||
| if (self) | |||
| { | |||
| if (ptr) | |||
| @@ -1856,7 +1856,7 @@ public: | |||
| break; | |||
| case audioMasterTempoAt: | |||
| Q_ASSERT(self); | |||
| CARLA_ASSERT(self); | |||
| // Deprecated in VST SDK 2.4 | |||
| if (self) | |||
| ret = self->handleAudioMasterTempoAt(); | |||
| @@ -1882,7 +1882,7 @@ public: | |||
| #endif | |||
| case audioMasterIOChanged: | |||
| Q_ASSERT(self); | |||
| CARLA_ASSERT(self); | |||
| if (self) | |||
| ret = self->handleAudioMasterIOChanged(); | |||
| else | |||
| @@ -1891,7 +1891,7 @@ public: | |||
| case audioMasterNeedIdle: | |||
| // Deprecated in VST SDK 2.4 | |||
| Q_ASSERT(self); | |||
| CARLA_ASSERT(self); | |||
| if (self) | |||
| self->handleAudioMasterNeedIdle(); | |||
| else | |||
| @@ -1899,7 +1899,7 @@ public: | |||
| break; | |||
| case audioMasterSizeWindow: | |||
| Q_ASSERT(self); | |||
| CARLA_ASSERT(self); | |||
| if (self) | |||
| { | |||
| if (index > 0 && value > 0) | |||
| @@ -1912,7 +1912,7 @@ public: | |||
| break; | |||
| case audioMasterGetSampleRate: | |||
| Q_ASSERT(self); | |||
| CARLA_ASSERT(self); | |||
| if (self) | |||
| { | |||
| ret = self->handleAudioMasterGetSampleRate(); | |||
| @@ -1925,7 +1925,7 @@ public: | |||
| break; | |||
| case audioMasterGetBlockSize: | |||
| Q_ASSERT(self); | |||
| CARLA_ASSERT(self); | |||
| if (self) | |||
| { | |||
| ret = self->handleAudioMasterGetBlockSize(); | |||
| @@ -2001,7 +2001,7 @@ public: | |||
| #endif | |||
| case audioMasterGetVendorString: | |||
| Q_ASSERT(ptr); | |||
| CARLA_ASSERT(ptr); | |||
| if (ptr) | |||
| strcpy((char*)ptr, "Cadence"); | |||
| else | |||
| @@ -2009,7 +2009,7 @@ public: | |||
| break; | |||
| case audioMasterGetProductString: | |||
| Q_ASSERT(ptr); | |||
| CARLA_ASSERT(ptr); | |||
| if (ptr) | |||
| strcpy((char*)ptr, "Carla"); | |||
| else | |||
| @@ -2031,7 +2031,7 @@ public: | |||
| #endif | |||
| case audioMasterCanDo: | |||
| Q_ASSERT(ptr); | |||
| CARLA_ASSERT(ptr); | |||
| if (ptr) | |||
| ret = hostCanDo((const char*)ptr); | |||
| else | |||
| @@ -2055,7 +2055,7 @@ public: | |||
| break; | |||
| case audioMasterUpdateDisplay: | |||
| Q_ASSERT(effect); | |||
| CARLA_ASSERT(effect); | |||
| if (self) | |||
| self->handleAudioMasterUpdateDisplay(); | |||
| if (effect) | |||
| @@ -283,7 +283,7 @@ public: | |||
| protected: | |||
| bool libOpen(const char* const filename) | |||
| { | |||
| Q_ASSERT(filename); | |||
| CARLA_ASSERT(filename); | |||
| if (m_filename) | |||
| free(m_filename); | |||
| @@ -40,8 +40,8 @@ CarlaBridgeOsc::CarlaBridgeOsc(CarlaClient* const client_, const char* const nam | |||
| : client(client_) | |||
| { | |||
| qDebug("CarlaBridgeOsc::CarlaOsc(%p, \"%s\")", client, name); | |||
| Q_ASSERT(client); | |||
| Q_ASSERT(name); | |||
| CARLA_ASSERT(client); | |||
| CARLA_ASSERT(name); | |||
| m_serverPath = nullptr; | |||
| m_serverThread = nullptr; | |||
| @@ -64,9 +64,9 @@ CarlaBridgeOsc::~CarlaBridgeOsc() | |||
| bool CarlaBridgeOsc::init(const char* const url) | |||
| { | |||
| qDebug("CarlaBridgeOsc::init(\"%s\")", url); | |||
| Q_ASSERT(! m_serverPath); | |||
| Q_ASSERT(! m_serverThread); | |||
| Q_ASSERT(url); | |||
| CARLA_ASSERT(! m_serverPath); | |||
| CARLA_ASSERT(! m_serverThread); | |||
| CARLA_ASSERT(url); | |||
| char* host = lo_url_get_hostname(url); | |||
| char* port = lo_url_get_port(url); | |||
| @@ -101,8 +101,8 @@ bool CarlaBridgeOsc::init(const char* const url) | |||
| void CarlaBridgeOsc::close() | |||
| { | |||
| qDebug("CarlaBridgeOsc::close()"); | |||
| Q_ASSERT(m_serverPath); | |||
| Q_ASSERT(m_serverThread); | |||
| CARLA_ASSERT(m_serverPath); | |||
| CARLA_ASSERT(m_serverThread); | |||
| osc_clear_data(&m_controlData); | |||
| @@ -119,9 +119,9 @@ void CarlaBridgeOsc::close() | |||
| int CarlaBridgeOsc::handleMessage(const char* const path, const int argc, const lo_arg* const* const argv, const char* const types, const lo_message msg) | |||
| { | |||
| qDebug("CarlaBridgeOsc::handleMessage(\"%s\", %i, %p, \"%s\", %p)", path, argc, argv, types, msg); | |||
| Q_ASSERT(m_serverPath); | |||
| Q_ASSERT(m_serverThread); | |||
| Q_ASSERT(path); | |||
| CARLA_ASSERT(m_serverPath); | |||
| CARLA_ASSERT(m_serverThread); | |||
| CARLA_ASSERT(path); | |||
| // Check if message is for this client | |||
| if ((! path) || strlen(path) <= m_nameSize || strncmp(path+1, m_name, m_nameSize) != 0) | |||
| @@ -24,8 +24,8 @@ | |||
| #define CARLA_BRIDGE_OSC_HANDLE_ARGS const int argc, const lo_arg* const* const argv, const char* const types | |||
| #define CARLA_BRIDGE_OSC_CHECK_OSC_TYPES(/* argc, types, */ argcToCompare, typesToCompare) \ | |||
| Q_ASSERT(m_serverPath); \ | |||
| Q_ASSERT(m_serverThread); \ | |||
| CARLA_ASSERT(m_serverPath); \ | |||
| CARLA_ASSERT(m_serverThread); \ | |||
| /* check argument count */ \ | |||
| if (argc != argcToCompare) \ | |||
| { \ | |||
| @@ -75,7 +75,7 @@ public: | |||
| void sendOscConfigure(const char* const key, const char* const value) | |||
| { | |||
| Q_ASSERT(m_controlData.target); | |||
| CARLA_ASSERT(m_controlData.target); | |||
| if (m_controlData.target) | |||
| osc_send_configure(&m_controlData, key, value); | |||
| @@ -83,7 +83,7 @@ public: | |||
| void sendOscControl(const int32_t index, const float value) | |||
| { | |||
| Q_ASSERT(m_controlData.target); | |||
| CARLA_ASSERT(m_controlData.target); | |||
| if (m_controlData.target) | |||
| osc_send_control(&m_controlData, index, value); | |||
| @@ -91,7 +91,7 @@ public: | |||
| void sendOscProgram(const int32_t index) | |||
| { | |||
| Q_ASSERT(m_controlData.target); | |||
| CARLA_ASSERT(m_controlData.target); | |||
| if (m_controlData.target) | |||
| osc_send_program(&m_controlData, index); | |||
| @@ -99,7 +99,7 @@ public: | |||
| void sendOscMidiProgram(const int32_t index) | |||
| { | |||
| Q_ASSERT(m_controlData.target); | |||
| CARLA_ASSERT(m_controlData.target); | |||
| if (m_controlData.target) | |||
| osc_send_midi_program(&m_controlData, index); | |||
| @@ -107,7 +107,7 @@ public: | |||
| void sendOscMidi(const uint8_t midiBuf[4]) | |||
| { | |||
| Q_ASSERT(m_controlData.target); | |||
| CARLA_ASSERT(m_controlData.target); | |||
| if (m_controlData.target) | |||
| osc_send_midi(&m_controlData, midiBuf); | |||
| @@ -115,7 +115,7 @@ public: | |||
| void sendOscUpdate() | |||
| { | |||
| Q_ASSERT(m_controlData.target); | |||
| CARLA_ASSERT(m_controlData.target); | |||
| if (m_controlData.target) | |||
| osc_send_update(&m_controlData, m_serverPath); | |||
| @@ -123,7 +123,7 @@ public: | |||
| void sendOscExiting() | |||
| { | |||
| Q_ASSERT(m_controlData.target); | |||
| CARLA_ASSERT(m_controlData.target); | |||
| if (m_controlData.target) | |||
| osc_send_exiting(&m_controlData); | |||
| @@ -132,7 +132,7 @@ public: | |||
| #ifdef BUILD_BRIDGE_PLUGIN | |||
| void sendOscBridgeUpdate() | |||
| { | |||
| Q_ASSERT(m_controlData.target && m_serverPath); | |||
| CARLA_ASSERT(m_controlData.target && m_serverPath); | |||
| if (m_controlData.target && m_serverPath) | |||
| osc_send_bridge_update(&m_controlData, m_serverPath); | |||
| @@ -140,8 +140,8 @@ public: | |||
| void sendOscBridgeError(const char* const error) | |||
| { | |||
| Q_ASSERT(m_controlData.target && m_serverPath); | |||
| Q_ASSERT(error); | |||
| CARLA_ASSERT(m_controlData.target && m_serverPath); | |||
| CARLA_ASSERT(error); | |||
| if (m_controlData.target && m_serverPath) | |||
| osc_send_bridge_error(&m_controlData, error); | |||
| @@ -151,7 +151,7 @@ public: | |||
| #ifdef BRIDGE_LV2 | |||
| void sendOscLv2TransferAtom(const int32_t portIndex, const char* const typeStr, const char* const atomBuf) | |||
| { | |||
| Q_ASSERT(m_controlData.target); | |||
| CARLA_ASSERT(m_controlData.target); | |||
| if (m_controlData.target) | |||
| osc_send_lv2_transfer_atom(&m_controlData, portIndex, typeStr, atomBuf); | |||
| @@ -159,7 +159,7 @@ public: | |||
| void sendOscLv2TransferEvent(const int32_t portIndex, const char* const typeStr, const char* const atomBuf) | |||
| { | |||
| Q_ASSERT(m_controlData.target); | |||
| CARLA_ASSERT(m_controlData.target); | |||
| if (m_controlData.target) | |||
| osc_send_lv2_transfer_event(&m_controlData, portIndex, typeStr, atomBuf); | |||
| @@ -200,7 +200,7 @@ private: | |||
| static int osc_message_handler(const char* const path, const char* const types, lo_arg** const argv, const int argc, const lo_message msg, void* const user_data) | |||
| { | |||
| Q_ASSERT(user_data); | |||
| CARLA_ASSERT(user_data); | |||
| CarlaBridgeOsc* const _this_ = (CarlaBridgeOsc*)user_data; | |||
| return _this_->handleMessage(path, argc, argv, types, msg); | |||
| } | |||
| @@ -113,8 +113,8 @@ public: | |||
| callback(callback_) | |||
| { | |||
| qDebug("BridgePluginGUI::BridgePluginGUI(%p, %p, \"%s\", %s", parent, callback, pluginName, bool2str(resizable)); | |||
| Q_ASSERT(callback); | |||
| Q_ASSERT(pluginName); | |||
| CARLA_ASSERT(callback); | |||
| CARLA_ASSERT(pluginName); | |||
| m_firstShow = true; | |||
| m_resizable = resizable; | |||
| @@ -138,8 +138,8 @@ public: | |||
| ~BridgePluginGUI() | |||
| { | |||
| qDebug("BridgePluginGUI::~BridgePluginGUI()"); | |||
| Q_ASSERT(container); | |||
| Q_ASSERT(vbLayout); | |||
| CARLA_ASSERT(container); | |||
| CARLA_ASSERT(vbLayout); | |||
| delete container; | |||
| delete vbLayout; | |||
| @@ -255,15 +255,15 @@ public: | |||
| ~BridgePluginClient() | |||
| { | |||
| qDebug("BridgePluginClient::~BridgePluginClient()"); | |||
| Q_ASSERT(msgTimer == 0); | |||
| Q_ASSERT(! pluginGui); | |||
| CARLA_ASSERT(msgTimer == 0); | |||
| CARLA_ASSERT(! pluginGui); | |||
| } | |||
| void setStuff(CarlaBackend::CarlaEngine* const engine, CarlaBackend::CarlaPlugin* const plugin) | |||
| { | |||
| qDebug("BridgePluginClient::setStuff(%p, %p)", engine, plugin); | |||
| Q_ASSERT(engine); | |||
| Q_ASSERT(plugin); | |||
| CARLA_ASSERT(engine); | |||
| CARLA_ASSERT(plugin); | |||
| this->engine = engine; | |||
| this->plugin = plugin; | |||
| @@ -325,7 +325,7 @@ public: | |||
| void show() | |||
| { | |||
| qDebug("BridgePluginClient::show()"); | |||
| Q_ASSERT(pluginGui); | |||
| CARLA_ASSERT(pluginGui); | |||
| if (plugin) | |||
| plugin->showGui(true); | |||
| @@ -337,7 +337,7 @@ public: | |||
| void hide() | |||
| { | |||
| qDebug("BridgePluginClient::hide()"); | |||
| Q_ASSERT(pluginGui); | |||
| CARLA_ASSERT(pluginGui); | |||
| if (pluginGui) | |||
| pluginGui->hide(); | |||
| @@ -349,7 +349,7 @@ public: | |||
| void resize(int width, int height) | |||
| { | |||
| qDebug("BridgePluginClient::resize(%i, %i)", width, height); | |||
| Q_ASSERT(pluginGui); | |||
| CARLA_ASSERT(pluginGui); | |||
| if (pluginGui) | |||
| pluginGui->setNewSize(width, height); | |||
| @@ -360,7 +360,7 @@ public: | |||
| void createWindow(const bool resizable) | |||
| { | |||
| qDebug("BridgePluginClient::createWindow(%s)", bool2str(resizable)); | |||
| Q_ASSERT(plugin); | |||
| CARLA_ASSERT(plugin); | |||
| pluginGui = new BridgePluginGUI(nullptr, this, plugin->name(), resizable); | |||
| plugin->setGuiContainer(pluginGui->getContainer()); | |||
| @@ -372,7 +372,7 @@ public: | |||
| void setParameter(const int32_t rindex, const double value) | |||
| { | |||
| qDebug("CarlaPluginClient::setParameter(%i, %g)", rindex, value); | |||
| Q_ASSERT(plugin); | |||
| CARLA_ASSERT(plugin); | |||
| if (! plugin) | |||
| return; | |||
| @@ -383,9 +383,9 @@ public: | |||
| void setProgram(const uint32_t index) | |||
| { | |||
| qDebug("CarlaPluginClient::setProgram(%i)", index); | |||
| Q_ASSERT(engine); | |||
| Q_ASSERT(plugin); | |||
| Q_ASSERT(index < plugin->programCount()); | |||
| CARLA_ASSERT(engine); | |||
| CARLA_ASSERT(plugin); | |||
| CARLA_ASSERT(index < plugin->programCount()); | |||
| if (! (plugin && engine)) | |||
| return; | |||
| @@ -406,8 +406,8 @@ public: | |||
| void setMidiProgram(const uint32_t index) | |||
| { | |||
| qDebug("CarlaPluginClient::setMidiProgram(%i)", index); | |||
| Q_ASSERT(engine); | |||
| Q_ASSERT(plugin); | |||
| CARLA_ASSERT(engine); | |||
| CARLA_ASSERT(plugin); | |||
| if (! (plugin && engine)) | |||
| return; | |||
| @@ -426,8 +426,8 @@ public: | |||
| void noteOn(const uint8_t channel, const uint8_t note, const uint8_t velo) | |||
| { | |||
| qDebug("CarlaPluginClient::noteOn(%i, %i, %i)", channel, note, velo); | |||
| Q_ASSERT(plugin); | |||
| Q_ASSERT(velo > 0); | |||
| CARLA_ASSERT(plugin); | |||
| CARLA_ASSERT(velo > 0); | |||
| if (! plugin) | |||
| return; | |||
| @@ -438,7 +438,7 @@ public: | |||
| void noteOff(const uint8_t channel, const uint8_t note) | |||
| { | |||
| qDebug("CarlaPluginClient::noteOff(%i, %i)", channel, note); | |||
| Q_ASSERT(plugin); | |||
| CARLA_ASSERT(plugin); | |||
| if (! plugin) | |||
| return; | |||
| @@ -452,8 +452,8 @@ public: | |||
| void saveNow() | |||
| { | |||
| qDebug("CarlaPluginClient::saveNow()"); | |||
| Q_ASSERT(plugin); | |||
| Q_ASSERT(engine); | |||
| CARLA_ASSERT(plugin); | |||
| CARLA_ASSERT(engine); | |||
| if (! (plugin && engine)) | |||
| return; | |||
| @@ -500,7 +500,7 @@ public: | |||
| void setCustomData(const char* const type, const char* const key, const char* const value) | |||
| { | |||
| qDebug("CarlaPluginClient::setCustomData(\"%s\", \"%s\", \"%s\")", type, key, value); | |||
| Q_ASSERT(plugin); | |||
| CARLA_ASSERT(plugin); | |||
| if (! plugin) | |||
| return; | |||
| @@ -511,7 +511,7 @@ public: | |||
| void setChunkData(const char* const filePath) | |||
| { | |||
| qDebug("CarlaPluginClient::setChunkData(\"%s\")", filePath); | |||
| Q_ASSERT(plugin); | |||
| CARLA_ASSERT(plugin); | |||
| if (! plugin) | |||
| return; | |||
| @@ -566,7 +566,7 @@ public: | |||
| break; | |||
| case CarlaBackend::CALLBACK_RESIZE_GUI: | |||
| Q_ASSERT(value1 > 0 && value2 > 0); | |||
| CARLA_ASSERT(value1 > 0 && value2 > 0); | |||
| nextWidth = value1; | |||
| nextHeight = value2; | |||
| break; | |||
| @@ -595,7 +595,7 @@ public: | |||
| static void callback(void* const ptr, CarlaBackend::CallbackType const action, const unsigned short, const int value1, const int value2, const double value3) | |||
| { | |||
| Q_ASSERT(ptr); | |||
| CARLA_ASSERT(ptr); | |||
| if (! ptr) | |||
| return; | |||
| @@ -653,7 +653,7 @@ protected: | |||
| if (! CarlaClient::runMessages()) | |||
| { | |||
| Q_ASSERT(msgTimer == 0); | |||
| CARLA_ASSERT(msgTimer == 0); | |||
| msgTimer = 0; | |||
| return; | |||
| } | |||
| @@ -60,7 +60,7 @@ public: | |||
| void exec(CarlaClient* const client, const bool showGui) | |||
| { | |||
| qDebug("CarlaToolkitGtk2::exec(%p)", client); | |||
| Q_ASSERT(client); | |||
| CARLA_ASSERT(client); | |||
| m_client = client; | |||
| @@ -117,7 +117,7 @@ public: | |||
| void show() | |||
| { | |||
| qDebug("CarlaToolkitGtk2::show()"); | |||
| Q_ASSERT(window); | |||
| CARLA_ASSERT(window); | |||
| if (window) | |||
| gtk_widget_show_all(window); | |||
| @@ -126,7 +126,7 @@ public: | |||
| void hide() | |||
| { | |||
| qDebug("CarlaToolkitGtk2::hide()"); | |||
| Q_ASSERT(window); | |||
| CARLA_ASSERT(window); | |||
| if (window) | |||
| gtk_widget_hide_all(window); | |||
| @@ -135,7 +135,7 @@ public: | |||
| void resize(int width, int height) | |||
| { | |||
| qDebug("CarlaToolkitGtk2::resize(%i, %i)", width, height); | |||
| Q_ASSERT(window); | |||
| CARLA_ASSERT(window); | |||
| if (window) | |||
| gtk_window_resize(GTK_WINDOW(window), width, height); | |||
| @@ -60,7 +60,7 @@ public: | |||
| void exec(CarlaClient* const client, const bool showGui) | |||
| { | |||
| qDebug("CarlaToolkitGtk3::exec(%p)", client); | |||
| Q_ASSERT(client); | |||
| CARLA_ASSERT(client); | |||
| m_client = client; | |||
| @@ -117,7 +117,7 @@ public: | |||
| void show() | |||
| { | |||
| qDebug("CarlaToolkitGtk3::show()"); | |||
| Q_ASSERT(window); | |||
| CARLA_ASSERT(window); | |||
| if (window) | |||
| gtk_widget_show_all(window); | |||
| @@ -126,7 +126,7 @@ public: | |||
| void hide() | |||
| { | |||
| qDebug("CarlaToolkitGtk3::hide()"); | |||
| Q_ASSERT(window); | |||
| CARLA_ASSERT(window); | |||
| if (window) | |||
| gtk_widget_hide(window); | |||
| @@ -135,7 +135,7 @@ public: | |||
| void resize(int width, int height) | |||
| { | |||
| qDebug("CarlaToolkitGtk3::resize(%i, %i)", width, height); | |||
| Q_ASSERT(window); | |||
| CARLA_ASSERT(window); | |||
| if (window) | |||
| gtk_window_resize(GTK_WINDOW(window), width, height); | |||
| @@ -91,13 +91,13 @@ public: | |||
| ~CarlaToolkitQt4() | |||
| { | |||
| qDebug("CarlaToolkitQt4::~CarlaToolkitQt4()"); | |||
| Q_ASSERT(! app); | |||
| CARLA_ASSERT(! app); | |||
| } | |||
| void init() | |||
| { | |||
| qDebug("CarlaToolkitQt4::init()"); | |||
| Q_ASSERT(! app); | |||
| CARLA_ASSERT(! app); | |||
| app = new BridgeApplication; | |||
| } | |||
| @@ -105,8 +105,8 @@ public: | |||
| void exec(CarlaClient* const client, const bool showGui) | |||
| { | |||
| qDebug("CarlaToolkitQt4::exec(%p)", client); | |||
| Q_ASSERT(app); | |||
| Q_ASSERT(client); | |||
| CARLA_ASSERT(app); | |||
| CARLA_ASSERT(client); | |||
| m_client = client; | |||
| @@ -163,7 +163,7 @@ public: | |||
| void quit() | |||
| { | |||
| qDebug("CarlaToolkitQt4::quit()"); | |||
| Q_ASSERT(app); | |||
| CARLA_ASSERT(app); | |||
| if (window) | |||
| { | |||
| @@ -197,7 +197,7 @@ public: | |||
| void show() | |||
| { | |||
| qDebug("CarlaToolkitQt4::show()"); | |||
| Q_ASSERT(window); | |||
| CARLA_ASSERT(window); | |||
| if (window) | |||
| window->show(); | |||
| @@ -206,7 +206,7 @@ public: | |||
| void hide() | |||
| { | |||
| qDebug("CarlaToolkitQt4::hide()"); | |||
| Q_ASSERT(window); | |||
| CARLA_ASSERT(window); | |||
| if (window) | |||
| window->hide(); | |||
| @@ -215,7 +215,7 @@ public: | |||
| void resize(int width, int height) | |||
| { | |||
| qDebug("CarlaToolkitQt4::resize(%i, %i)", width, height); | |||
| Q_ASSERT(window); | |||
| CARLA_ASSERT(window); | |||
| if (window) | |||
| window->setFixedSize(width, height); | |||
| @@ -37,7 +37,7 @@ class CarlaToolkit | |||
| public: | |||
| CarlaToolkit(const char* const title) | |||
| { | |||
| Q_ASSERT(title); | |||
| CARLA_ASSERT(title); | |||
| m_title = strdup(title ? title : "(null)"); | |||
| m_client = nullptr; | |||
| @@ -462,7 +462,7 @@ public: | |||
| void setParameter(const int32_t rindex, const double value) | |||
| { | |||
| Q_ASSERT(handle && descriptor); | |||
| CARLA_ASSERT(handle && descriptor); | |||
| if (handle && descriptor && descriptor->port_event) | |||
| { | |||
| @@ -477,7 +477,7 @@ public: | |||
| void setMidiProgram(const uint32_t bank, const uint32_t program) | |||
| { | |||
| Q_ASSERT(handle); | |||
| CARLA_ASSERT(handle); | |||
| if (handle && programs) | |||
| programs->select_program(handle, bank, program); | |||
| @@ -485,7 +485,7 @@ public: | |||
| void noteOn(const uint8_t channel, const uint8_t note, const uint8_t velo) | |||
| { | |||
| Q_ASSERT(handle && descriptor); | |||
| CARLA_ASSERT(handle && descriptor); | |||
| if (handle && descriptor && descriptor->port_event) | |||
| { | |||
| @@ -503,7 +503,7 @@ public: | |||
| void noteOff(const uint8_t channel, const uint8_t note) | |||
| { | |||
| Q_ASSERT(handle && descriptor); | |||
| CARLA_ASSERT(handle && descriptor); | |||
| if (handle && descriptor && descriptor->port_event) | |||
| { | |||
| @@ -524,7 +524,7 @@ public: | |||
| uint32_t getCustomURID(const char* const uri) | |||
| { | |||
| qDebug("CarlaLv2Client::getCustomURID(%s)", uri); | |||
| Q_ASSERT(uri); | |||
| CARLA_ASSERT(uri); | |||
| if (! uri) | |||
| return CARLA_URI_MAP_ID_NULL; | |||
| @@ -543,7 +543,7 @@ public: | |||
| const char* getCustomURIString(const LV2_URID urid) const | |||
| { | |||
| qDebug("CarlaLv2Client::getCustomURIString(%i)", urid); | |||
| Q_ASSERT(urid > CARLA_URI_MAP_ID_NULL); | |||
| CARLA_ASSERT(urid > CARLA_URI_MAP_ID_NULL); | |||
| if (urid == CARLA_URI_MAP_ID_NULL) | |||
| return nullptr; | |||
| @@ -558,8 +558,8 @@ public: | |||
| void handleTransferAtom(const int32_t portIndex, const LV2_Atom* const atom) | |||
| { | |||
| qDebug("CarlaLv2Client::handleTransferEvent(%i, %p)", portIndex, atom); | |||
| Q_ASSERT(portIndex >= 0); | |||
| Q_ASSERT(atom); | |||
| CARLA_ASSERT(portIndex >= 0); | |||
| CARLA_ASSERT(atom); | |||
| if (handle && descriptor && descriptor->port_event) | |||
| descriptor->port_event(handle, portIndex, atom->size, CARLA_URI_MAP_ID_ATOM_TRANSFER_ATOM, atom); | |||
| @@ -568,8 +568,8 @@ public: | |||
| void handleTransferEvent(const int32_t portIndex, const LV2_Atom* const atom) | |||
| { | |||
| qDebug("CarlaLv2Client::handleTransferEvent(%i, %p)", portIndex, atom); | |||
| Q_ASSERT(portIndex >= 0); | |||
| Q_ASSERT(atom); | |||
| CARLA_ASSERT(portIndex >= 0); | |||
| CARLA_ASSERT(atom); | |||
| if (handle && descriptor && descriptor->port_event) | |||
| descriptor->port_event(handle, portIndex, atom->size, CARLA_URI_MAP_ID_ATOM_TRANSFER_EVENT, atom); | |||
| @@ -625,7 +625,7 @@ public: | |||
| uint32_t handleUiPortMap(const char* const symbol) | |||
| { | |||
| Q_ASSERT(symbol); | |||
| CARLA_ASSERT(symbol); | |||
| if (! symbol) | |||
| return LV2UI_INVALID_PORT_INDEX; | |||
| @@ -642,8 +642,8 @@ public: | |||
| int handleUiResize(int width, int height) | |||
| { | |||
| Q_ASSERT(width > 0); | |||
| Q_ASSERT(height > 0); | |||
| CARLA_ASSERT(width > 0); | |||
| CARLA_ASSERT(height > 0); | |||
| if (width <= 0 || height <= 0) | |||
| return 1; | |||
| @@ -658,8 +658,8 @@ public: | |||
| { | |||
| if (format == 0) | |||
| { | |||
| Q_ASSERT(buffer); | |||
| Q_ASSERT(bufferSize == sizeof(float)); | |||
| CARLA_ASSERT(buffer); | |||
| CARLA_ASSERT(bufferSize == sizeof(float)); | |||
| if (bufferSize != sizeof(float)) | |||
| return; | |||
| @@ -669,7 +669,7 @@ public: | |||
| } | |||
| else if (format == CARLA_URI_MAP_ID_ATOM_TRANSFER_ATOM) | |||
| { | |||
| Q_ASSERT(buffer); | |||
| CARLA_ASSERT(buffer); | |||
| const LV2_Atom* const atom = (const LV2_Atom*)buffer; | |||
| QByteArray chunk((const char*)buffer, bufferSize); | |||
| @@ -677,7 +677,7 @@ public: | |||
| } | |||
| else if (format == CARLA_URI_MAP_ID_ATOM_TRANSFER_EVENT) | |||
| { | |||
| Q_ASSERT(buffer); | |||
| CARLA_ASSERT(buffer); | |||
| const LV2_Atom* const atom = (const LV2_Atom*)buffer; | |||
| QByteArray chunk((const char*)buffer, bufferSize); | |||
| @@ -690,8 +690,8 @@ public: | |||
| static uint32_t carla_lv2_event_ref(const LV2_Event_Callback_Data callback_data, LV2_Event* const event) | |||
| { | |||
| qDebug("CarlaLv2Client::carla_lv2_event_ref(%p, %p)", callback_data, event); | |||
| Q_ASSERT(callback_data); | |||
| Q_ASSERT(event); | |||
| CARLA_ASSERT(callback_data); | |||
| CARLA_ASSERT(event); | |||
| return 0; | |||
| } | |||
| @@ -699,8 +699,8 @@ public: | |||
| static uint32_t carla_lv2_event_unref(const LV2_Event_Callback_Data callback_data, LV2_Event* const event) | |||
| { | |||
| qDebug("CarlaLv2Client::carla_lv2_event_unref(%p, %p)", callback_data, event); | |||
| Q_ASSERT(callback_data); | |||
| Q_ASSERT(event); | |||
| CARLA_ASSERT(callback_data); | |||
| CARLA_ASSERT(event); | |||
| return 0; | |||
| } | |||
| @@ -710,8 +710,8 @@ public: | |||
| static int carla_lv2_log_printf(const LV2_Log_Handle handle, const LV2_URID type, const char* const fmt, ...) | |||
| { | |||
| qDebug("CarlaLv2Client::carla_lv2_log_printf(%p, %i, %s, ...)", handle, type, fmt); | |||
| Q_ASSERT(handle); | |||
| Q_ASSERT(type > 0); | |||
| CARLA_ASSERT(handle); | |||
| CARLA_ASSERT(type > 0); | |||
| #ifndef DEBUG | |||
| if (type == CARLA_URI_MAP_ID_LOG_TRACE) | |||
| @@ -729,8 +729,8 @@ public: | |||
| static int carla_lv2_log_vprintf(const LV2_Log_Handle handle, const LV2_URID type, const char* const fmt, va_list ap) | |||
| { | |||
| qDebug("CarlaLv2Client::carla_lv2_log_vprintf(%p, %i, %s, ...)", handle, type, fmt); | |||
| Q_ASSERT(handle); | |||
| Q_ASSERT(type > 0); | |||
| CARLA_ASSERT(handle); | |||
| CARLA_ASSERT(type > 0); | |||
| #ifndef DEBUG | |||
| if (type == CARLA_URI_MAP_ID_LOG_TRACE) | |||
| @@ -769,7 +769,7 @@ public: | |||
| static void carla_lv2_program_changed(const LV2_Programs_Handle handle, const int32_t index) | |||
| { | |||
| qDebug("CarlaLv2Client::carla_lv2_program_changed(%p, %i)", handle, index); | |||
| Q_ASSERT(handle); | |||
| CARLA_ASSERT(handle); | |||
| if (! handle) | |||
| return; | |||
| @@ -783,8 +783,8 @@ public: | |||
| static char* carla_lv2_state_make_path(const LV2_State_Make_Path_Handle handle, const char* const path) | |||
| { | |||
| qDebug("CarlaLv2Client::carla_lv2_state_make_path(%p, %p)", handle, path); | |||
| Q_ASSERT(handle); | |||
| Q_ASSERT(path); | |||
| CARLA_ASSERT(handle); | |||
| CARLA_ASSERT(path); | |||
| if (! path) | |||
| return nullptr; | |||
| @@ -797,8 +797,8 @@ public: | |||
| static char* carla_lv2_state_map_abstract_path(const LV2_State_Map_Path_Handle handle, const char* const absolute_path) | |||
| { | |||
| qDebug("CarlaLv2Client::carla_lv2_state_map_abstract_path(%p, %p)", handle, absolute_path); | |||
| Q_ASSERT(handle); | |||
| Q_ASSERT(absolute_path); | |||
| CARLA_ASSERT(handle); | |||
| CARLA_ASSERT(absolute_path); | |||
| if (! absolute_path) | |||
| return nullptr; | |||
| @@ -810,8 +810,8 @@ public: | |||
| static char* carla_lv2_state_map_absolute_path(const LV2_State_Map_Path_Handle handle, const char* const abstract_path) | |||
| { | |||
| qDebug("CarlaLv2Client::carla_lv2_state_map_absolute_path(%p, %p)", handle, abstract_path); | |||
| Q_ASSERT(handle); | |||
| Q_ASSERT(abstract_path); | |||
| CARLA_ASSERT(handle); | |||
| CARLA_ASSERT(abstract_path); | |||
| if (! abstract_path) | |||
| return nullptr; | |||
| @@ -833,8 +833,8 @@ public: | |||
| static LV2_URID carla_lv2_urid_map(const LV2_URID_Map_Handle handle, const char* const uri) | |||
| { | |||
| qDebug("CarlaLv2Client::carla_lv2_urid_map(%p, %s)", handle, uri); | |||
| Q_ASSERT(handle); | |||
| Q_ASSERT(uri); | |||
| CARLA_ASSERT(handle); | |||
| CARLA_ASSERT(uri); | |||
| if (! uri) | |||
| return CARLA_URI_MAP_ID_NULL; | |||
| @@ -892,8 +892,8 @@ public: | |||
| static const char* carla_lv2_urid_unmap(const LV2_URID_Map_Handle handle, const LV2_URID urid) | |||
| { | |||
| qDebug("CarlaLv2Client::carla_lv2_urid_unmap(%p, %i)", handle, urid); | |||
| Q_ASSERT(handle); | |||
| Q_ASSERT(urid > CARLA_URI_MAP_ID_NULL); | |||
| CARLA_ASSERT(handle); | |||
| CARLA_ASSERT(urid > CARLA_URI_MAP_ID_NULL); | |||
| if (urid == CARLA_URI_MAP_ID_NULL) | |||
| return nullptr; | |||
| @@ -953,7 +953,7 @@ public: | |||
| static uint32_t carla_lv2_ui_port_map(const LV2UI_Feature_Handle handle, const char* const symbol) | |||
| { | |||
| qDebug("CarlaLv2Client::carla_lv2_ui_port_map(%p, %s)", handle, symbol); | |||
| Q_ASSERT(handle); | |||
| CARLA_ASSERT(handle); | |||
| if (! handle) | |||
| return LV2UI_INVALID_PORT_INDEX; | |||
| @@ -968,7 +968,7 @@ public: | |||
| static int carla_lv2_ui_resize(const LV2UI_Feature_Handle handle, const int width, const int height) | |||
| { | |||
| qDebug("CarlaLv2Client::carla_lv2_ui_resize(%p, %i, %i)", handle, width, height); | |||
| Q_ASSERT(handle); | |||
| CARLA_ASSERT(handle); | |||
| if (! handle) | |||
| return 1; | |||
| @@ -982,7 +982,7 @@ public: | |||
| static void carla_lv2_ui_write_function(const LV2UI_Controller controller, const uint32_t port_index, const uint32_t buffer_size, const uint32_t format, const void* const buffer) | |||
| { | |||
| qDebug("CarlaLv2Client::carla_lv2_ui_write_function(%p, %i, %i, %i, %p)", controller, port_index, buffer_size, format, buffer); | |||
| Q_ASSERT(controller); | |||
| CARLA_ASSERT(controller); | |||
| if (! controller) | |||
| return; | |||
| @@ -230,7 +230,7 @@ public: | |||
| intptr_t handleAdioMasterSizeWindow(int32_t width, int32_t height) | |||
| { | |||
| Q_ASSERT(widget); | |||
| CARLA_ASSERT(widget); | |||
| widget->setFixedSize(width, height); | |||
| @@ -220,7 +220,7 @@ void do_ladspa_check(void* const libHandle, const bool init) | |||
| while ((descriptor = descFn(i++))) | |||
| { | |||
| Q_ASSERT(descriptor->run); | |||
| CARLA_ASSERT(descriptor->run); | |||
| int hints = 0; | |||
| int audioIns = 0; | |||
| @@ -385,8 +385,8 @@ void do_dssi_check(void* const libHandle, const bool init) | |||
| while ((descriptor = descFn(i++))) | |||
| { | |||
| const LADSPA_Descriptor* const ldescriptor = descriptor->LADSPA_Plugin; | |||
| Q_ASSERT(ldescriptor); | |||
| Q_ASSERT(ldescriptor->run || descriptor->run_synth || descriptor->run_multiple_synths); | |||
| CARLA_ASSERT(ldescriptor); | |||
| CARLA_ASSERT(ldescriptor->run || descriptor->run_synth || descriptor->run_multiple_synths); | |||
| int hints = 0; | |||
| int audioIns = 0; | |||
| @@ -608,7 +608,7 @@ void do_lv2_check(const char* const bundle, const bool init) | |||
| for (int i=0; i < URIs.count(); i++) | |||
| { | |||
| const LV2_RDF_Descriptor* const rdf_descriptor = lv2_rdf_new(URIs.at(i).toUtf8().constData()); | |||
| Q_ASSERT(rdf_descriptor && rdf_descriptor->URI); | |||
| CARLA_ASSERT(rdf_descriptor && rdf_descriptor->URI); | |||
| if (init) | |||
| { | |||
| @@ -102,6 +102,12 @@ | |||
| # endif | |||
| #endif | |||
| #ifdef NDEBUG | |||
| # define CARLA_ASSERT(cond) ((!(cond)) ? carla_assert(#cond,__FILE__,__LINE__) : pass()) | |||
| #else | |||
| # define CARLA_ASSERT Q_ASSERT | |||
| #endif | |||
| // carla_setprocname | |||
| #ifdef Q_OS_LINUX | |||
| # include <sys/prctl.h> | |||
| @@ -119,7 +125,13 @@ void carla_setprocname(const char* const /*name*/) | |||
| #endif | |||
| static inline | |||
| const char* bool2str(bool yesno) | |||
| void carla_assert(const char* const assertion, const char* const file, const int line) | |||
| { | |||
| qCritical("Carla assertion failure: \"%s\" in file %s, line %i", assertion, file, line); | |||
| } | |||
| static inline | |||
| const char* bool2str(const bool yesno) | |||
| { | |||
| return yesno ? "true" : "false"; | |||
| } | |||
| @@ -30,7 +30,7 @@ | |||
| static inline | |||
| const LADSPA_RDF_Descriptor* ladspa_rdf_dup(const LADSPA_RDF_Descriptor* const rdf_descriptor) | |||
| { | |||
| Q_ASSERT(rdf_descriptor); | |||
| CARLA_ASSERT(rdf_descriptor); | |||
| LADSPA_RDF_Descriptor* const new_descriptor = new LADSPA_RDF_Descriptor; | |||
| @@ -135,7 +135,7 @@ bool is_ladspa_port_good(const LADSPA_PortDescriptor port1, const LADSPA_PortDes | |||
| static inline | |||
| bool is_ladspa_rdf_descriptor_valid(const LADSPA_RDF_Descriptor* const rdf_descriptor, const LADSPA_Descriptor* const descriptor) | |||
| { | |||
| Q_ASSERT(descriptor); | |||
| CARLA_ASSERT(descriptor); | |||
| if (! rdf_descriptor) | |||
| return false; | |||
| @@ -27,7 +27,7 @@ | |||
| static inline | |||
| void* lib_open(const char* const filename) | |||
| { | |||
| Q_ASSERT(filename); | |||
| CARLA_ASSERT(filename); | |||
| #ifdef Q_OS_WIN | |||
| return LoadLibraryA(filename); | |||
| #else | |||
| @@ -38,7 +38,7 @@ void* lib_open(const char* const filename) | |||
| static inline | |||
| bool lib_close(void* const lib) | |||
| { | |||
| Q_ASSERT(lib); | |||
| CARLA_ASSERT(lib); | |||
| #ifdef Q_OS_WIN | |||
| return FreeLibrary((HMODULE)lib); | |||
| #else | |||
| @@ -49,8 +49,8 @@ bool lib_close(void* const lib) | |||
| static inline | |||
| void* lib_symbol(void* const lib, const char* const symbol) | |||
| { | |||
| Q_ASSERT(lib); | |||
| Q_ASSERT(symbol); | |||
| CARLA_ASSERT(lib); | |||
| CARLA_ASSERT(symbol); | |||
| #ifdef Q_OS_WIN | |||
| return (void*)GetProcAddress((HMODULE)lib, symbol); | |||
| #else | |||
| @@ -61,7 +61,7 @@ void* lib_symbol(void* const lib, const char* const symbol) | |||
| static inline | |||
| const char* lib_error(const char* const filename) | |||
| { | |||
| Q_ASSERT(filename); | |||
| CARLA_ASSERT(filename); | |||
| #ifdef Q_OS_WIN | |||
| static char libError[2048]; | |||
| memset(libError, 0, sizeof(char)*2048); | |||
| @@ -342,7 +342,7 @@ static Lv2WorldClass Lv2World; | |||
| static inline | |||
| const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI URI) | |||
| { | |||
| Q_ASSERT(URI); | |||
| CARLA_ASSERT(URI); | |||
| Lilv::Plugins lilvPlugins = Lv2World.get_all_plugins(); | |||
| @@ -1065,7 +1065,7 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI URI) | |||
| static inline | |||
| const LV2_RDF_Descriptor* lv2_rdf_dup(const LV2_RDF_Descriptor* const rdf_descriptor) | |||
| { | |||
| Q_ASSERT(rdf_descriptor); | |||
| CARLA_ASSERT(rdf_descriptor); | |||
| LV2_RDF_Descriptor* const new_descriptor = new LV2_RDF_Descriptor; | |||
| @@ -40,7 +40,7 @@ struct CarlaOscData { | |||
| static inline | |||
| void osc_clear_data(CarlaOscData* const oscData) | |||
| { | |||
| Q_ASSERT(oscData); | |||
| CARLA_ASSERT(oscData); | |||
| qDebug("osc_clear_data(path:\"%s\")", oscData->path); | |||
| if (oscData->path) | |||
| @@ -60,9 +60,9 @@ void osc_clear_data(CarlaOscData* const oscData) | |||
| static inline | |||
| void osc_send_configure(const CarlaOscData* const oscData, const char* const key, const char* const value) | |||
| { | |||
| Q_ASSERT(oscData && oscData->path); | |||
| Q_ASSERT(key); | |||
| Q_ASSERT(value); | |||
| CARLA_ASSERT(oscData && oscData->path); | |||
| CARLA_ASSERT(key); | |||
| CARLA_ASSERT(value); | |||
| qDebug("osc_send_configure(path:\"%s\", \"%s\", \"%s\")", oscData->path, key, value); | |||
| if (oscData->target) | |||
| @@ -77,8 +77,8 @@ void osc_send_configure(const CarlaOscData* const oscData, const char* const key | |||
| static inline | |||
| void osc_send_control(const CarlaOscData* const oscData, const int32_t index, const float value) | |||
| { | |||
| Q_ASSERT(oscData && oscData->path); | |||
| Q_ASSERT(index != -1); | |||
| CARLA_ASSERT(oscData && oscData->path); | |||
| CARLA_ASSERT(index != -1); | |||
| qDebug("osc_send_control(path:\"%s\", %i, %f)", oscData->path, index, value); | |||
| if (oscData->target) | |||
| @@ -93,8 +93,8 @@ void osc_send_control(const CarlaOscData* const oscData, const int32_t index, co | |||
| static inline | |||
| void osc_send_program(const CarlaOscData* const oscData, const int32_t index) | |||
| { | |||
| Q_ASSERT(oscData && oscData->path); | |||
| Q_ASSERT(index >= 0); | |||
| CARLA_ASSERT(oscData && oscData->path); | |||
| CARLA_ASSERT(index >= 0); | |||
| qDebug("osc_send_program(path:\"%s\", %i)", oscData->path, index); | |||
| if (oscData->target) | |||
| @@ -109,9 +109,9 @@ void osc_send_program(const CarlaOscData* const oscData, const int32_t index) | |||
| static inline | |||
| void osc_send_program(const CarlaOscData* const oscData, const int32_t bank, const int32_t program) | |||
| { | |||
| Q_ASSERT(oscData && oscData->path); | |||
| Q_ASSERT(program >= 0 && program < 128); | |||
| Q_ASSERT(bank >= 0); | |||
| CARLA_ASSERT(oscData && oscData->path); | |||
| CARLA_ASSERT(program >= 0 && program < 128); | |||
| CARLA_ASSERT(bank >= 0); | |||
| qDebug("osc_send_program(path:\"%s\", %i, %i)", oscData->path, bank, program); | |||
| if (oscData->target) | |||
| @@ -126,8 +126,8 @@ void osc_send_program(const CarlaOscData* const oscData, const int32_t bank, con | |||
| static inline | |||
| void osc_send_midi_program(const CarlaOscData* const oscData, const int32_t index) | |||
| { | |||
| Q_ASSERT(oscData && oscData->path); | |||
| Q_ASSERT(index >= 0); | |||
| CARLA_ASSERT(oscData && oscData->path); | |||
| CARLA_ASSERT(index >= 0); | |||
| qDebug("osc_send_midi_program(path:\"%s\", %i)", oscData->path, index); | |||
| if (oscData->target) | |||
| @@ -142,9 +142,9 @@ void osc_send_midi_program(const CarlaOscData* const oscData, const int32_t inde | |||
| static inline | |||
| void osc_send_midi_program(const CarlaOscData* const oscData, const int32_t bank, const int32_t program) | |||
| { | |||
| Q_ASSERT(oscData && oscData->path); | |||
| Q_ASSERT(program >= 0 && program < 128); | |||
| Q_ASSERT(bank >= 0); | |||
| CARLA_ASSERT(oscData && oscData->path); | |||
| CARLA_ASSERT(program >= 0 && program < 128); | |||
| CARLA_ASSERT(bank >= 0); | |||
| qDebug("osc_send_midi_program(path:\"%s\", %i, %i)", oscData->path, bank, program); | |||
| if (oscData->target) | |||
| @@ -159,9 +159,9 @@ void osc_send_midi_program(const CarlaOscData* const oscData, const int32_t bank | |||
| static inline | |||
| void osc_send_midi(const CarlaOscData* const oscData, const uint8_t buf[4]) | |||
| { | |||
| Q_ASSERT(oscData && oscData->path); | |||
| Q_ASSERT(buf[0] == 0); | |||
| Q_ASSERT(buf[1] != 0); | |||
| CARLA_ASSERT(oscData && oscData->path); | |||
| CARLA_ASSERT(buf[0] == 0); | |||
| CARLA_ASSERT(buf[1] != 0); | |||
| qDebug("osc_send_midi(path:\"%s\", 0x%X, %03u, %03u)", oscData->path, buf[1], buf[2], buf[3]); | |||
| if (oscData->target) | |||
| @@ -176,8 +176,8 @@ void osc_send_midi(const CarlaOscData* const oscData, const uint8_t buf[4]) | |||
| static inline | |||
| void osc_send_sample_rate(const CarlaOscData* const oscData, const float sampleRate) | |||
| { | |||
| Q_ASSERT(oscData && oscData->path); | |||
| Q_ASSERT(sampleRate > 0.0f); | |||
| CARLA_ASSERT(oscData && oscData->path); | |||
| CARLA_ASSERT(sampleRate > 0.0f); | |||
| qDebug("osc_send_sample_rate(path:\"%s\", %f)", oscData->path, sampleRate); | |||
| if (oscData->target) | |||
| @@ -193,8 +193,8 @@ void osc_send_sample_rate(const CarlaOscData* const oscData, const float sampleR | |||
| static inline | |||
| void osc_send_update(const CarlaOscData* const oscData, const char* const url) | |||
| { | |||
| Q_ASSERT(oscData && oscData->path); | |||
| Q_ASSERT(url); | |||
| CARLA_ASSERT(oscData && oscData->path); | |||
| CARLA_ASSERT(url); | |||
| qDebug("osc_send_update(path:\"%s\", \"%s\")", oscData->path, url); | |||
| if (oscData->target) | |||
| @@ -209,7 +209,7 @@ void osc_send_update(const CarlaOscData* const oscData, const char* const url) | |||
| static inline | |||
| void osc_send_exiting(const CarlaOscData* const oscData) | |||
| { | |||
| Q_ASSERT(oscData && oscData->path); | |||
| CARLA_ASSERT(oscData && oscData->path); | |||
| qDebug("osc_send_exiting(path:\"%s\")", oscData->path); | |||
| if (oscData->target) | |||
| @@ -225,7 +225,7 @@ void osc_send_exiting(const CarlaOscData* const oscData) | |||
| static inline | |||
| void osc_send_show(const CarlaOscData* const oscData) | |||
| { | |||
| Q_ASSERT(oscData && oscData->path); | |||
| CARLA_ASSERT(oscData && oscData->path); | |||
| qDebug("osc_send_show(path:\"%s\")", oscData->path); | |||
| if (oscData->target) | |||
| @@ -240,7 +240,7 @@ void osc_send_show(const CarlaOscData* const oscData) | |||
| static inline | |||
| void osc_send_hide(const CarlaOscData* const oscData) | |||
| { | |||
| Q_ASSERT(oscData && oscData->path); | |||
| CARLA_ASSERT(oscData && oscData->path); | |||
| qDebug("osc_send_hide(path:\"%s\")", oscData->path); | |||
| if (oscData->target) | |||
| @@ -255,7 +255,7 @@ void osc_send_hide(const CarlaOscData* const oscData) | |||
| static inline | |||
| void osc_send_quit(const CarlaOscData* const oscData) | |||
| { | |||
| Q_ASSERT(oscData && oscData->path); | |||
| CARLA_ASSERT(oscData && oscData->path); | |||
| qDebug("osc_send_quit(path:\"%s\")", oscData->path); | |||
| if (oscData->target) | |||
| @@ -272,8 +272,8 @@ void osc_send_quit(const CarlaOscData* const oscData) | |||
| static inline | |||
| void osc_send_bridge_update(const CarlaOscData* const oscData, const char* const url) | |||
| { | |||
| Q_ASSERT(oscData && oscData->path); | |||
| Q_ASSERT(url); | |||
| CARLA_ASSERT(oscData && oscData->path); | |||
| CARLA_ASSERT(url); | |||
| qDebug("osc_send_bridge_update(path:\"%s\", \"%s\")", oscData->path, url); | |||
| if (oscData->target) | |||
| @@ -288,8 +288,8 @@ void osc_send_bridge_update(const CarlaOscData* const oscData, const char* const | |||
| static inline | |||
| void osc_send_bridge_error(const CarlaOscData* const oscData, const char* const error) | |||
| { | |||
| Q_ASSERT(oscData && oscData->path); | |||
| Q_ASSERT(error); | |||
| CARLA_ASSERT(oscData && oscData->path); | |||
| CARLA_ASSERT(error); | |||
| qDebug("osc_send_bridge_error(path:\"%s\", \"%s\")", oscData->path, error); | |||
| if (oscData->target) | |||
| @@ -305,10 +305,10 @@ void osc_send_bridge_error(const CarlaOscData* const oscData, const char* const | |||
| static inline | |||
| void osc_send_lv2_transfer_atom(const CarlaOscData* const oscData, const int32_t portIndex, const char* const typeStr, const char* const atomBuf) | |||
| { | |||
| Q_ASSERT(oscData && oscData->path); | |||
| Q_ASSERT(portIndex >= 0); | |||
| Q_ASSERT(typeStr); | |||
| Q_ASSERT(atomBuf); | |||
| CARLA_ASSERT(oscData && oscData->path); | |||
| CARLA_ASSERT(portIndex >= 0); | |||
| CARLA_ASSERT(typeStr); | |||
| CARLA_ASSERT(atomBuf); | |||
| qDebug("osc_send_lv2_transfer_atom(path:\"%s\", %i, \"%s\", \"%s\")", oscData->path, portIndex, typeStr, atomBuf); | |||
| if (oscData->target) | |||
| @@ -323,10 +323,10 @@ void osc_send_lv2_transfer_atom(const CarlaOscData* const oscData, const int32_t | |||
| static inline | |||
| void osc_send_lv2_transfer_event(const CarlaOscData* const oscData, const int32_t portIndex, const char* const typeStr, const char* const atomBuf) | |||
| { | |||
| Q_ASSERT(oscData && oscData->path); | |||
| Q_ASSERT(portIndex >= 0); | |||
| Q_ASSERT(typeStr); | |||
| Q_ASSERT(atomBuf); | |||
| CARLA_ASSERT(oscData && oscData->path); | |||
| CARLA_ASSERT(portIndex >= 0); | |||
| CARLA_ASSERT(typeStr); | |||
| CARLA_ASSERT(atomBuf); | |||
| qDebug("osc_send_lv2_transfer_event(path:\"%s\", %i, \"%s\", \"%s\")", oscData->path, portIndex, typeStr, atomBuf); | |||
| if (oscData->target) | |||
| @@ -84,8 +84,8 @@ public: | |||
| void put(const uint32_t portIndex, const LV2_Atom* const atom, const bool lock = true) | |||
| { | |||
| Q_ASSERT(atom && atom->size > 0); | |||
| Q_ASSERT(indexPool + atom->size < MAX_POOL_SIZE); // overflow | |||
| CARLA_ASSERT(atom && atom->size > 0); | |||
| CARLA_ASSERT(indexPool + atom->size < MAX_POOL_SIZE); // overflow | |||
| if (full || atom->size == 0 || indexPool + atom->size >= MAX_POOL_SIZE) | |||
| return; | |||
| @@ -115,7 +115,7 @@ public: | |||
| bool get(uint32_t* const portIndex, const LV2_Atom** const atom, const bool lock = true) | |||
| { | |||
| Q_ASSERT(portIndex && atom); | |||
| CARLA_ASSERT(portIndex && atom); | |||
| if (empty || ! (portIndex && atom)) | |||
| return false; | |||