Browse Source

Fixup carla-control to be in sync with main carla

tags/v2.1-rc2
falkTX 5 years ago
parent
commit
57d29b421b
3 changed files with 66 additions and 22 deletions
  1. +1
    -0
      data/windows/Dockerfile
  2. +40
    -10
      source/backend/engine/CarlaEngineOscSend.cpp
  3. +25
    -12
      source/frontend/carla_control.py

+ 1
- 0
data/windows/Dockerfile View File

@@ -20,6 +20,7 @@ RUN apt-get install -qy mingw-w64 && \
apt-get install -qy automake binutils build-essential cmake libglib2.0-dev-bin libtool-bin && \
apt-get clean

# basic setup
RUN locale-gen en_US.UTF-8
RUN echo "source /etc/bash_completion" >> $HOME/.bashrc



+ 40
- 10
source/backend/engine/CarlaEngineOscSend.cpp View File

@@ -131,33 +131,63 @@ void CarlaEngineOsc::sendPluginParameterInfo(const CarlaPlugin* const plugin, co
CARLA_SAFE_ASSERT_RETURN(plugin != nullptr,);
carla_debug("CarlaEngineOsc::sendPluginParameterInfo(%p, %u)", plugin, index);

char bufName[STR_MAX+1], bufUnit[STR_MAX+1];
char bufName[STR_MAX+1], bufUnit[STR_MAX+1], bufComment[STR_MAX+1], bufGroupName[STR_MAX+1];
carla_zeroChars(bufName, STR_MAX+1);
carla_zeroChars(bufUnit, STR_MAX+1);
carla_zeroChars(bufComment, STR_MAX+1);
carla_zeroChars(bufGroupName, STR_MAX+1);

if (! plugin->getParameterName(index, bufName))
bufName[0] = '\0';
if (! plugin->getParameterUnit(index, bufUnit))
bufUnit[0] = '\0';
if (! plugin->getParameterComment(index, bufComment))
bufComment[0] = '\0';
if (! plugin->getParameterGroupName(index, bufGroupName))
bufGroupName[0] = '\0';

const ParameterData& paramData(plugin->getParameterData(index));
const ParameterRanges& paramRanges(plugin->getParameterRanges(index));

char targetPath[std::strlen(fControlDataTCP.path)+20];
const int32_t pluginId = static_cast<int32_t>(plugin->getId());
const int32_t paramId = static_cast<int32_t>(index);

char targetPath[std::strlen(fControlDataTCP.path)+24];

std::strcpy(targetPath, fControlDataTCP.path);
std::strcat(targetPath, "/param");
try_lo_send(fControlDataTCP.target, targetPath, "iiiiiissfffffff",
static_cast<int32_t>(plugin->getId()), static_cast<int32_t>(index),
static_cast<int32_t>(paramData.type), static_cast<int32_t>(paramData.hints),
static_cast<int32_t>(paramData.mappedControlIndex), static_cast<int32_t>(paramData.midiChannel),
bufName, bufUnit,
std::strcat(targetPath, "/paramInfo");
try_lo_send(fControlDataTCP.target, targetPath, "iissss",
pluginId,
paramId,
bufName,
bufUnit,
bufComment,
bufGroupName);

std::strcpy(targetPath, fControlDataTCP.path);
std::strcat(targetPath, "/paramData");
try_lo_send(fControlDataTCP.target, targetPath, "iiiiiifff",
pluginId,
paramId,
static_cast<int32_t>(paramData.type),
static_cast<int32_t>(paramData.hints),
static_cast<int32_t>(paramData.midiChannel),
static_cast<int32_t>(paramData.mappedControlIndex),
static_cast<double>(paramData.mappedMinimum),
static_cast<double>(paramData.mappedMaximum),
static_cast<double>(plugin->getParameterValue(index)));

std::strcpy(targetPath, fControlDataTCP.path);
std::strcat(targetPath, "/paramRanges");
try_lo_send(fControlDataTCP.target, targetPath, "iiffffff",
pluginId,
paramId,
static_cast<double>(paramRanges.def),
static_cast<double>(paramRanges.min),
static_cast<double>(paramRanges.max),
static_cast<double>(paramRanges.step),
static_cast<double>(paramRanges.stepSmall),
static_cast<double>(paramRanges.stepLarge),
static_cast<double>(plugin->getParameterValue(index)));
static_cast<double>(paramRanges.stepLarge));
}

void CarlaEngineOsc::sendPluginDataCount(const CarlaPlugin* const plugin) const noexcept


+ 25
- 12
source/frontend/carla_control.py View File

@@ -376,34 +376,49 @@ class CarlaControlServerTCP(Server):
self.host._set_midiCountInfo(pluginId, {'ins': midiOuts, 'outs': midiOuts})
self.host._set_parameterCountInfo(pluginId, paramTotal, {'ins': paramIns, 'outs': paramOuts})

@make_method('/ctrl/param', 'iiiiiissfffffff')
def carla_param(self, path, args):
@make_method('/ctrl/paramInfo', 'iissss')
def carla_paramInfo(self, path, args):
if DEBUG: print(path, args)
self.fReceivedMsgs = True
(
pluginId, paramId, type_, hints, mappedControlIndex, midiChan, name, unit,
def_, min_, max_, step, stepSmall, stepLarge, value
) = args

hints &= ~(PARAMETER_USES_SCALEPOINTS | PARAMETER_USES_CUSTOM_TEXT)
pluginId, paramId, name, unit, comment, groupName = args

paramInfo = {
'name': name,
'symbol': "",
'unit': unit,
'comment': comment,
'groupName': groupName,
'scalePointCount': 0,
'scalePoints': [],
}
self.host._set_parameterInfo(pluginId, paramId, paramInfo)

@make_method('/ctrl/paramData', 'iiiiiifff')
def carla_paramData(self, path, args):
if DEBUG: print(path, args)
self.fReceivedMsgs = True
pluginId, paramId, type_, hints, midiChan, mappedCtrl, mappedMin, mappedMax, value = args

hints &= ~(PARAMETER_USES_SCALEPOINTS | PARAMETER_USES_CUSTOM_TEXT)

paramData = {
'type': type_,
'hints': hints,
'index': paramId,
'rindex': -1,
'mappedControlIndex': mappedControlIndex,
'midiChannel': midiChan,
'mappedControlIndex': mappedCtrl,
'mappedMinimum': mappedMin,
'mappedMaximum': mappedMax,
}
self.host._set_parameterData(pluginId, paramId, paramData)
self.host._set_parameterValue(pluginId, paramId, value)

@make_method('/ctrl/paramRanges', 'iiffffff')
def carla_paramRanges(self, path, args):
if DEBUG: print(path, args)
self.fReceivedMsgs = True
pluginId, paramId, def_, min_, max_, step, stepSmall, stepLarge = args

paramRanges = {
'def': def_,
@@ -413,9 +428,7 @@ class CarlaControlServerTCP(Server):
'stepSmall': stepSmall,
'stepLarge': stepLarge,
}
self.host._set_parameterRangesUpdate(pluginId, paramId, paramRanges)

self.host._set_parameterValue(pluginId, paramId, value)
self.host._set_parameterRanges(pluginId, paramId, paramRanges)

@make_method('/ctrl/count', 'iiiiii')
def carla_count(self, path, args):


Loading…
Cancel
Save