@@ -605,21 +605,22 @@ public: | |||
// kPluginBridgeNonRtServerParameter* | |||
if (const uint32_t count = plugin->getParameterCount()) | |||
{ | |||
uint32_t paramIns, paramOuts; | |||
plugin->getParameterCountInfo(paramIns, paramOuts); | |||
// uint/ins, uint/outs | |||
// uint/count | |||
fShmNonRtServerControl.writeOpcode(kPluginBridgeNonRtServerParameterCount); | |||
fShmNonRtServerControl.writeUInt(paramIns); | |||
fShmNonRtServerControl.writeUInt(paramOuts); | |||
fShmNonRtServerControl.writeUInt(count); | |||
fShmNonRtServerControl.commitWrite(); | |||
for (uint32_t i=0, maxParams=pData->options.maxParameters; i<count && i<maxParams; ++i) | |||
for (uint32_t i=0; i<count; ++i) | |||
{ | |||
const ParameterData& paramData(plugin->getParameterData(i)); | |||
if (paramData.type != PARAMETER_INPUT && paramData.type != PARAMETER_OUTPUT) | |||
continue; | |||
if ((paramData.hints & PARAMETER_IS_ENABLED) == 0) | |||
continue; | |||
// kPluginBridgeNonRtServerParameterData1 | |||
{ | |||
const ParameterData& paramData(plugin->getParameterData(i)); | |||
// uint/index, int/rindex, uint/type, uint/hints, short/cc | |||
fShmNonRtServerControl.writeOpcode(kPluginBridgeNonRtServerParameterData1); | |||
fShmNonRtServerControl.writeUInt(i); | |||
@@ -1933,9 +1933,8 @@ public: | |||
} break; | |||
case kPluginBridgeNonRtServerParameterCount: { | |||
// uint/ins, uint/outs | |||
const uint32_t ins = fShmNonRtServerControl.readUInt(); | |||
const uint32_t outs = fShmNonRtServerControl.readUInt(); | |||
// uint/count | |||
const uint32_t count = fShmNonRtServerControl.readUInt(); | |||
// delete old data | |||
pData->param.clear(); | |||
@@ -1946,17 +1945,8 @@ public: | |||
fParams = nullptr; | |||
} | |||
if (uint32_t count = ins+outs) | |||
if (count > 0) | |||
{ | |||
const uint32_t maxParams(pData->engine->getOptions().maxParameters); | |||
if (count > maxParams) | |||
{ | |||
// this is expected right now, to be handled better later | |||
//carla_safe_assert_int2("count <= pData->engine->getOptions().maxParameters", __FILE__, __LINE__, count, maxParams); | |||
count = maxParams; | |||
} | |||
pData->param.createNew(count, false); | |||
fParams = new BridgeParamInfo[count]; | |||
@@ -777,41 +777,6 @@ class PluginEdit(QDialog): | |||
# ----------------------------------------------------------------- | |||
if parameterCount > self.host.maxParameters: | |||
fakeName = self.tr("This plugin has too many parameters to display here!") | |||
paramFakeListFull = [] | |||
paramFakeList = [] | |||
paramFakeWidth = QFontMetrics(self.font()).width(fakeName) | |||
parameter = { | |||
'type': PARAMETER_UNKNOWN, | |||
'hints': 0x0, | |||
'name': fakeName, | |||
'unit': "", | |||
'scalePoints': [], | |||
'index': 0, | |||
'default': 0.0, | |||
'minimum': 0.0, | |||
'maximum': 1.0, | |||
'step': 0.0, | |||
'stepSmall': 0.0, | |||
'stepLarge': 0.0, | |||
'midiCC': -1, | |||
'midiChannel': 1, | |||
'current': 0.0 | |||
} | |||
paramFakeList.append(parameter) | |||
paramFakeListFull.append((paramFakeList, paramFakeWidth)) | |||
self._createParameterWidgets(PARAMETER_UNKNOWN, paramFakeListFull, self.tr("Information")) | |||
return | |||
# ----------------------------------------------------------------- | |||
paramInputList = [] | |||
paramOutputList = [] | |||
paramInputWidth = 0 | |||
@@ -820,7 +785,7 @@ class PluginEdit(QDialog): | |||
paramInputListFull = [] # ([params], width) | |||
paramOutputListFull = [] # ([params], width) | |||
for i in range(parameterCount): | |||
for i in range(min(parameterCount, self.host.maxParameters)): | |||
paramInfo = self.host.get_parameter_info(self.fPluginId, i) | |||
paramData = self.host.get_parameter_data(self.fPluginId, i) | |||
paramRanges = self.host.get_parameter_ranges(self.fPluginId, i) | |||
@@ -79,7 +79,7 @@ enum PluginBridgeNonRtServerOpcode { | |||
kPluginBridgeNonRtServerPluginInfo2, // uint/size, str[] (realName), uint/size, str[] (label), uint/size, str[] (maker), uint/size, str[] (copyright) | |||
kPluginBridgeNonRtServerAudioCount, // uint/ins, uint/outs | |||
kPluginBridgeNonRtServerMidiCount, // uint/ins, uint/outs | |||
kPluginBridgeNonRtServerParameterCount, // uint/ins, uint/outs | |||
kPluginBridgeNonRtServerParameterCount, // uint/count | |||
kPluginBridgeNonRtServerProgramCount, // uint/count | |||
kPluginBridgeNonRtServerMidiProgramCount, // uint/count | |||
kPluginBridgeNonRtServerParameterData1, // uint/index, int/rindex, uint/type, uint/hints, short/cc | |||