About 85% complete (missing vst bank/presets and some minor stuff)
")) + + def done(self, r): + QDialog.done(self, r) + self.close() + +# ------------------------------------------------------------------------------------------------------------ +# Plugin Parameter + +class PluginParameter(QWidget, ui_carla_parameter.Ui_PluginParameter): + def __init__(self, parent, pInfo, pluginId, tabIndex): + QWidget.__init__(self, parent) + self.setupUi(self) + + pType = pInfo['type'] + pHints = pInfo['hints'] + + self.m_midiCC = -1 + self.m_midiChannel = 1 + self.m_pluginId = pluginId + self.m_parameterId = pInfo['index'] + self.m_tabIndex = tabIndex + + self.label.setText(pInfo['name']) + + for MIDI_CC in MIDI_CC_LIST: + self.combo.addItem(MIDI_CC) + + if pType == PARAMETER_INPUT: + self.widget.set_minimum(pInfo['minimum']) + self.widget.set_maximum(pInfo['maximum']) + self.widget.set_default(pInfo['default']) + self.widget.set_value(pInfo['current'], False) + self.widget.set_label(pInfo['unit']) + self.widget.set_step(pInfo['step']) + self.widget.set_step_small(pInfo['stepSmall']) + self.widget.set_step_large(pInfo['stepLarge']) + self.widget.set_scalepoints(pInfo['scalepoints'], bool(pHints & PARAMETER_USES_SCALEPOINTS)) + + if not pHints & PARAMETER_IS_ENABLED: + self.widget.set_read_only(True) + self.combo.setEnabled(False) + self.sb_channel.setEnabled(False) + + elif not pHints & PARAMETER_IS_AUTOMABLE: + self.combo.setEnabled(False) + self.sb_channel.setEnabled(False) + + elif pType == PARAMETER_OUTPUT: + self.widget.set_minimum(pInfo['minimum']) + self.widget.set_maximum(pInfo['maximum']) + self.widget.set_value(pInfo['current'], False) + self.widget.set_label(pInfo['unit']) + self.widget.set_read_only(True) + + if not pHints & PARAMETER_IS_AUTOMABLE: + self.combo.setEnabled(False) + self.sb_channel.setEnabled(False) + + else: + self.widget.setVisible(False) + self.combo.setVisible(False) + self.sb_channel.setVisible(False) + + self.set_parameter_midi_cc(pInfo['midiCC']) + self.set_parameter_midi_channel(pInfo['midiChannel']) + + self.connect(self.widget, SIGNAL("valueChanged(double)"), SLOT("slot_valueChanged(double)")) + self.connect(self.sb_channel, SIGNAL("valueChanged(int)"), SLOT("slot_midiChannelChanged(int)")) + self.connect(self.combo, SIGNAL("currentIndexChanged(int)"), SLOT("slot_midiCcChanged(int)")) + + #if force_parameters_style: + #self.widget.force_plastique_style() + + if pHints & PARAMETER_USES_CUSTOM_TEXT: + self.widget.set_text_call(self.textCallBack) + + self.widget.updateAll() + + def setDefaultValue(self, value): + self.widget.set_default(value) + + def set_parameter_value(self, value, send=True): + self.widget.set_value(value, send) + + def set_parameter_midi_cc(self, cc): + self.m_midiCC = cc + self.set_MIDI_CC_in_ComboBox(cc) + + def set_parameter_midi_channel(self, channel): + self.m_midiChannel = channel+1 + self.sb_channel.setValue(channel+1) + + def set_MIDI_CC_in_ComboBox(self, cc): + for i in range(len(MIDI_CC_LIST)): + ccText = MIDI_CC_LIST[i].split(" ")[0] + if int(ccText, 16) == cc: + ccIndex = i + break + else: + ccIndex = -1 + + self.combo.setCurrentIndex(ccIndex+1) + + def tabIndex(self): + return self.m_tabIndex + + def textCallBack(self): + return cString(Carla.host.get_parameter_text(self.m_pluginId, self.m_parameterId)) + + @pyqtSlot(float) + def slot_valueChanged(self, value): + self.emit(SIGNAL("valueChanged(int, double)"), self.m_parameterId, value) + + @pyqtSlot(int) + def slot_midiCcChanged(self, ccIndex): + if ccIndex <= 0: + cc = -1 + else: + ccText = MIDI_CC_LIST[ccIndex - 1].split(" ")[0] + cc = int(ccText, 16) + + if self.m_midiCC != cc: + self.emit(SIGNAL("midiCcChanged(int, int)"), self.m_parameterId, cc) + + self.m_midiCC = cc + + @pyqtSlot(int) + def slot_midiChannelChanged(self, channel): + if self.m_midiChannel != channel: + self.emit(SIGNAL("midiChannelChanged(int, int)"), self.m_parameterId, channel) + + self.m_midiChannel = channel diff --git a/source/discovery/carla-discovery.cpp b/source/discovery/carla-discovery.cpp index 722001f90..89033c8cb 100644 --- a/source/discovery/carla-discovery.cpp +++ b/source/discovery/carla-discovery.cpp @@ -721,6 +721,12 @@ void do_lv2_check(const char* const bundle, const bool init) URIs.append(QString(uri)); } + if (URIs.count() == 0) + { + DISCOVERY_OUT("warning", "LV2 Bundle doesn't provide any plugins"); + return; + } + // Get & check every plugin-instance for (int i=0; i < URIs.count(); i++) { diff --git a/source/includes/lv2_rdf.hpp b/source/includes/lv2_rdf.hpp index 173071e4c..8fc5d8f66 100644 --- a/source/includes/lv2_rdf.hpp +++ b/source/includes/lv2_rdf.hpp @@ -119,19 +119,22 @@ struct LV2_Type { #define LV2_IS_PORT_UNIT_SEMITONE(x) ((x) == LV2_PORT_UNIT_SEMITONE) // Port Types -#define LV2_PORT_INPUT 0x01 -#define LV2_PORT_OUTPUT 0x02 -#define LV2_PORT_CONTROL 0x04 -#define LV2_PORT_AUDIO 0x08 -#define LV2_PORT_CV 0x10 -#define LV2_PORT_ATOM 0x20 -#define LV2_PORT_ATOM_SEQUENCE (0x40 | LV2_PORT_ATOM) -#define LV2_PORT_EVENT 0x80 -#define LV2_PORT_MIDI_LL 0x100 +#define LV2_PORT_INPUT 0x001 +#define LV2_PORT_OUTPUT 0x002 +#define LV2_PORT_CONTROL 0x004 +#define LV2_PORT_AUDIO 0x008 +#define LV2_PORT_CV 0x010 +#define LV2_PORT_ATOM 0x020 +#define LV2_PORT_ATOM_SEQUENCE (0x040 | LV2_PORT_ATOM) +#define LV2_PORT_ATOM_URID (0x080 | LV2_PORT_ATOM) +#define LV2_PORT_EVENT 0x100 +#define LV2_PORT_MIDI_LL 0x200 // Port Data Types #define LV2_PORT_DATA_MIDI_EVENT 0x1000 -#define LV2_PORT_DATA_PATCH_MESSAGE 0x2000 +#define LV2_PORT_DATA_OBJECT 0x2000 +#define LV2_PORT_DATA_PATCH_MESSAGE 0x4000 +#define LV2_PORT_DATA_TIME 0x8000 #define LV2_IS_PORT_INPUT(x) ((x) & LV2_PORT_INPUT) #define LV2_IS_PORT_OUTPUT(x) ((x) & LV2_PORT_OUTPUT) diff --git a/source/utils/carla_utils.hpp b/source/utils/carla_utils.hpp index 855bf45c2..948d3ec11 100644 --- a/source/utils/carla_utils.hpp +++ b/source/utils/carla_utils.hpp @@ -178,7 +178,7 @@ class CarlaMutex { public: CarlaMutex() - : pmutex(PTHREAD_MUTEX_INITIALIZER) + //: pmutex PTHREAD_MUTEX_INITIALIZER { pthread_mutex_init(&pmutex, nullptr); }