@@ -495,7 +495,7 @@ public: | |||||
#ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
if (options.processMode == PROCESS_MODE_SINGLE_CLIENT || options.processMode == PROCESS_MODE_MULTIPLE_CLIENTS) | if (options.processMode == PROCESS_MODE_SINGLE_CLIENT || options.processMode == PROCESS_MODE_MULTIPLE_CLIENTS) | ||||
#endif | #endif | ||||
return jackbridge_client_name_size(); | |||||
return jackbridge_client_name_size() - 3; // reserve space for "_2" forced-stereo ports | |||||
return CarlaEngine::maxClientNameSize(); | return CarlaEngine::maxClientNameSize(); | ||||
} | } | ||||
@@ -414,11 +414,12 @@ public: | |||||
paramBuffers = new float[params]; | paramBuffers = new float[params]; | ||||
} | } | ||||
const int portNameSize = x_engine->maxPortNameSize() - 2; | |||||
char portName[portNameSize]; | |||||
bool needsCtrlIn = false; | bool needsCtrlIn = false; | ||||
bool needsCtrlOut = false; | bool needsCtrlOut = false; | ||||
const int portNameSize = x_engine->maxPortNameSize(); | |||||
CarlaString portName; | |||||
for (unsigned long i=0; i < portCount; i++) | for (unsigned long i=0; i < portCount; i++) | ||||
{ | { | ||||
const LADSPA_PortDescriptor portType = ldescriptor->PortDescriptors[i]; | const LADSPA_PortDescriptor portType = ldescriptor->PortDescriptors[i]; | ||||
@@ -426,16 +427,17 @@ public: | |||||
if (LADSPA_IS_PORT_AUDIO(portType)) | if (LADSPA_IS_PORT_AUDIO(portType)) | ||||
{ | { | ||||
portName.clear(); | |||||
#ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
if (x_engine->processMode() == PROCESS_MODE_SINGLE_CLIENT) | if (x_engine->processMode() == PROCESS_MODE_SINGLE_CLIENT) | ||||
{ | { | ||||
strcpy(portName, m_name); | |||||
strcat(portName, ":"); | |||||
strncat(portName, ldescriptor->PortNames[i], portNameSize/2); | |||||
portName = m_name; | |||||
portName += ":"; | |||||
} | } | ||||
else | |||||
#endif | #endif | ||||
strncpy(portName, ldescriptor->PortNames[i], portNameSize); | |||||
portName += ldescriptor->PortNames[i]; | |||||
portName.truncate(portNameSize); | |||||
if (LADSPA_IS_PORT_INPUT(portType)) | if (LADSPA_IS_PORT_INPUT(portType)) | ||||
{ | { | ||||
@@ -445,7 +447,7 @@ public: | |||||
if (forcedStereoIn) | if (forcedStereoIn) | ||||
{ | { | ||||
strcat(portName, "_"); | |||||
portName += "_2"; | |||||
aIn.ports[1] = (CarlaEngineAudioPort*)x_client->addPort(CarlaEnginePortTypeAudio, portName, true); | aIn.ports[1] = (CarlaEngineAudioPort*)x_client->addPort(CarlaEnginePortTypeAudio, portName, true); | ||||
aIn.rindexes[1] = i; | aIn.rindexes[1] = i; | ||||
} | } | ||||
@@ -459,7 +461,7 @@ public: | |||||
if (forcedStereoOut) | if (forcedStereoOut) | ||||
{ | { | ||||
strcat(portName, "_"); | |||||
portName += "_2"; | |||||
aOut.ports[1] = (CarlaEngineAudioPort*)x_client->addPort(CarlaEnginePortTypeAudio, portName, false); | aOut.ports[1] = (CarlaEngineAudioPort*)x_client->addPort(CarlaEnginePortTypeAudio, portName, false); | ||||
aOut.rindexes[1] = i; | aOut.rindexes[1] = i; | ||||
} | } | ||||
@@ -624,45 +626,51 @@ public: | |||||
if (needsCtrlIn) | if (needsCtrlIn) | ||||
{ | { | ||||
portName.clear(); | |||||
#ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
if (x_engine->processMode() == PROCESS_MODE_SINGLE_CLIENT) | if (x_engine->processMode() == PROCESS_MODE_SINGLE_CLIENT) | ||||
{ | { | ||||
strcpy(portName, m_name); | |||||
strcat(portName, ":control-in"); | |||||
portName = m_name; | |||||
portName += ":"; | |||||
} | } | ||||
else | |||||
#endif | #endif | ||||
strcpy(portName, "control-in"); | |||||
portName += "control-in"; | |||||
portName.truncate(portNameSize); | |||||
param.portCin = (CarlaEngineControlPort*)x_client->addPort(CarlaEnginePortTypeControl, portName, true); | param.portCin = (CarlaEngineControlPort*)x_client->addPort(CarlaEnginePortTypeControl, portName, true); | ||||
} | } | ||||
if (needsCtrlOut) | if (needsCtrlOut) | ||||
{ | { | ||||
portName.clear(); | |||||
#ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
if (x_engine->processMode() == PROCESS_MODE_SINGLE_CLIENT) | if (x_engine->processMode() == PROCESS_MODE_SINGLE_CLIENT) | ||||
{ | { | ||||
strcpy(portName, m_name); | |||||
strcat(portName, ":control-out"); | |||||
portName = m_name; | |||||
portName += ":"; | |||||
} | } | ||||
else | |||||
#endif | #endif | ||||
strcpy(portName, "control-out"); | |||||
portName += "control-out"; | |||||
portName.truncate(portNameSize); | |||||
param.portCout = (CarlaEngineControlPort*)x_client->addPort(CarlaEnginePortTypeControl, portName, false); | param.portCout = (CarlaEngineControlPort*)x_client->addPort(CarlaEnginePortTypeControl, portName, false); | ||||
} | } | ||||
if (mIns == 1) | if (mIns == 1) | ||||
{ | { | ||||
portName.clear(); | |||||
#ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
if (x_engine->processMode() == PROCESS_MODE_SINGLE_CLIENT) | if (x_engine->processMode() == PROCESS_MODE_SINGLE_CLIENT) | ||||
{ | { | ||||
strcpy(portName, m_name); | |||||
strcat(portName, ":midi-in"); | |||||
portName = m_name; | |||||
portName += ":"; | |||||
} | } | ||||
else | |||||
#endif | #endif | ||||
strcpy(portName, "midi-in"); | |||||
portName += "midi-in"; | |||||
portName.truncate(portNameSize); | |||||
midi.portMin = (CarlaEngineMidiPort*)x_client->addPort(CarlaEnginePortTypeMIDI, portName, true); | midi.portMin = (CarlaEngineMidiPort*)x_client->addPort(CarlaEnginePortTypeMIDI, portName, true); | ||||
} | } | ||||
@@ -414,79 +414,94 @@ public: | |||||
param.data = new ParameterData[params]; | param.data = new ParameterData[params]; | ||||
param.ranges = new ParameterRanges[params]; | param.ranges = new ParameterRanges[params]; | ||||
const int portNameSize = x_engine->maxPortNameSize() - 1; | |||||
char portName[portNameSize]; | |||||
const int portNameSize = x_engine->maxPortNameSize(); | |||||
CarlaString portName; | |||||
// --------------------------------------- | // --------------------------------------- | ||||
// Audio Outputs | // Audio Outputs | ||||
#ifndef BUILD_BRIDGE | |||||
if (x_engine->processMode() == PROCESS_MODE_SINGLE_CLIENT) | |||||
{ | { | ||||
strcpy(portName, m_name); | |||||
strcat(portName, ":out-left"); | |||||
} | |||||
else | |||||
#endif | |||||
strcpy(portName, "out-left"); | |||||
portName.clear(); | |||||
aOut.ports[0] = (CarlaEngineAudioPort*)x_client->addPort(CarlaEnginePortTypeAudio, portName, false); | |||||
aOut.rindexes[0] = 0; | |||||
if (x_engine->processMode() == PROCESS_MODE_SINGLE_CLIENT) | |||||
{ | |||||
portName = m_name; | |||||
portName += ":"; | |||||
} | |||||
#ifndef BUILD_BRIDGE | |||||
if (x_engine->processMode() == PROCESS_MODE_SINGLE_CLIENT) | |||||
{ | |||||
strcpy(portName, m_name); | |||||
strcat(portName, ":out-right"); | |||||
portName += "out-left"; | |||||
portName.truncate(portNameSize); | |||||
aOut.ports[0] = (CarlaEngineAudioPort*)x_client->addPort(CarlaEnginePortTypeAudio, portName, false); | |||||
aOut.rindexes[0] = 0; | |||||
} | } | ||||
else | |||||
#endif | |||||
strcpy(portName, "out-right"); | |||||
aOut.ports[1] = (CarlaEngineAudioPort*)x_client->addPort(CarlaEnginePortTypeAudio, portName, false); | |||||
aOut.rindexes[1] = 1; | |||||
{ | |||||
portName.clear(); | |||||
if (x_engine->processMode() == PROCESS_MODE_SINGLE_CLIENT) | |||||
{ | |||||
portName = m_name; | |||||
portName += ":"; | |||||
} | |||||
portName += "out-right"; | |||||
portName.truncate(portNameSize); | |||||
aOut.ports[1] = (CarlaEngineAudioPort*)x_client->addPort(CarlaEnginePortTypeAudio, portName, false); | |||||
aOut.rindexes[1] = 1; | |||||
} | |||||
// --------------------------------------- | // --------------------------------------- | ||||
// MIDI Input | // MIDI Input | ||||
#ifndef BUILD_BRIDGE | |||||
if (x_engine->processMode() == PROCESS_MODE_SINGLE_CLIENT) | |||||
{ | { | ||||
strcpy(portName, m_name); | |||||
strcat(portName, ":midi-in"); | |||||
} | |||||
else | |||||
#endif | |||||
strcpy(portName, "midi-in"); | |||||
portName.clear(); | |||||
if (x_engine->processMode() == PROCESS_MODE_SINGLE_CLIENT) | |||||
{ | |||||
portName = m_name; | |||||
portName += ":"; | |||||
} | |||||
portName += "midi-in"; | |||||
portName.truncate(portNameSize); | |||||
midi.portMin = (CarlaEngineMidiPort*)x_client->addPort(CarlaEnginePortTypeMIDI, portName, true); | |||||
midi.portMin = (CarlaEngineMidiPort*)x_client->addPort(CarlaEnginePortTypeMIDI, portName, true); | |||||
} | |||||
// --------------------------------------- | // --------------------------------------- | ||||
// Parameters | // Parameters | ||||
#ifndef BUILD_BRIDGE | |||||
if (x_engine->processMode() == PROCESS_MODE_SINGLE_CLIENT) | |||||
{ | { | ||||
strcpy(portName, m_name); | |||||
strcat(portName, ":control-in"); | |||||
} | |||||
else | |||||
#endif | |||||
strcpy(portName, "control-in"); | |||||
portName.clear(); | |||||
param.portCin = (CarlaEngineControlPort*)x_client->addPort(CarlaEnginePortTypeControl, portName, true); | |||||
if (x_engine->processMode() == PROCESS_MODE_SINGLE_CLIENT) | |||||
{ | |||||
portName = m_name; | |||||
portName += ":"; | |||||
} | |||||
#ifndef BUILD_BRIDGE | |||||
if (x_engine->processMode() == PROCESS_MODE_SINGLE_CLIENT) | |||||
{ | |||||
strcpy(portName, m_name); | |||||
strcat(portName, ":control-out"); | |||||
portName += "control-in"; | |||||
portName.truncate(portNameSize); | |||||
param.portCin = (CarlaEngineControlPort*)x_client->addPort(CarlaEnginePortTypeControl, portName, true); | |||||
} | } | ||||
else | |||||
#endif | |||||
strcpy(portName, "control-out"); | |||||
param.portCout = (CarlaEngineControlPort*)x_client->addPort(CarlaEnginePortTypeControl, portName, false); | |||||
{ | |||||
portName.clear(); | |||||
if (x_engine->processMode() == PROCESS_MODE_SINGLE_CLIENT) | |||||
{ | |||||
portName = m_name; | |||||
portName += ":"; | |||||
} | |||||
portName += "control-out"; | |||||
portName.truncate(portNameSize); | |||||
param.portCout = (CarlaEngineControlPort*)x_client->addPort(CarlaEnginePortTypeControl, portName, false); | |||||
} | |||||
// ---------------------- | // ---------------------- | ||||
j = FluidSynthReverbOnOff; | j = FluidSynthReverbOnOff; | ||||
@@ -784,7 +799,6 @@ public: | |||||
//f_sfont->free(f_sfont); | //f_sfont->free(f_sfont); | ||||
#ifndef BUILD_BRIDGE | |||||
// Update OSC Names | // Update OSC Names | ||||
if (x_engine->isOscControlRegisted()) | if (x_engine->isOscControlRegisted()) | ||||
{ | { | ||||
@@ -793,7 +807,6 @@ public: | |||||
for (i=0; i < midiprog.count; i++) | for (i=0; i < midiprog.count; i++) | ||||
x_engine->osc_send_control_set_midi_program_data(m_id, i, midiprog.data[i].bank, midiprog.data[i].program, midiprog.data[i].name); | x_engine->osc_send_control_set_midi_program_data(m_id, i, midiprog.data[i].bank, midiprog.data[i].program, midiprog.data[i].name); | ||||
} | } | ||||
#endif | |||||
if (init) | if (init) | ||||
{ | { | ||||
@@ -1184,9 +1197,7 @@ public: | |||||
fluid_synth_set_gain(f_synth, x_volume); | fluid_synth_set_gain(f_synth, x_volume); | ||||
// Output VU | // Output VU | ||||
#ifndef BUILD_BRIDGE | |||||
if (x_engine->processMode() != PROCESS_MODE_CONTINUOUS_RACK) | if (x_engine->processMode() != PROCESS_MODE_CONTINUOUS_RACK) | ||||
#endif | |||||
{ | { | ||||
for (k=0; i < 2 && k < frames; k++) | for (k=0; i < 2 && k < frames; k++) | ||||
{ | { | ||||
@@ -415,7 +415,7 @@ public: | |||||
bool needsCtrlIn = false; | bool needsCtrlIn = false; | ||||
bool needsCtrlOut = false; | bool needsCtrlOut = false; | ||||
const int portNameSize = x_engine->maxPortNameSize() - 3; | |||||
const int portNameSize = x_engine->maxPortNameSize(); | |||||
CarlaString portName; | CarlaString portName; | ||||
for (unsigned long i=0; i < portCount; i++) | for (unsigned long i=0; i < portCount; i++) | ||||
@@ -435,7 +435,6 @@ public: | |||||
portName += ":"; | portName += ":"; | ||||
} | } | ||||
#endif | #endif | ||||
portName += descriptor->PortNames[i]; | portName += descriptor->PortNames[i]; | ||||
portName.truncate(portNameSize); | portName.truncate(portNameSize); | ||||
@@ -282,59 +282,79 @@ public: | |||||
aOut.ports = new CarlaEngineAudioPort*[aOuts]; | aOut.ports = new CarlaEngineAudioPort*[aOuts]; | ||||
aOut.rindexes = new uint32_t[aOuts]; | aOut.rindexes = new uint32_t[aOuts]; | ||||
const int portNameSize = x_engine->maxPortNameSize() - 1; | |||||
char portName[portNameSize]; | |||||
const int portNameSize = x_engine->maxPortNameSize(); | |||||
CarlaString portName; | |||||
// --------------------------------------- | // --------------------------------------- | ||||
// Audio Outputs | // Audio Outputs | ||||
if (x_engine->processMode() == PROCESS_MODE_SINGLE_CLIENT) | |||||
{ | { | ||||
strcpy(portName, m_name); | |||||
strcat(portName, ":out-left"); | |||||
} | |||||
else | |||||
strcpy(portName, "out-left"); | |||||
portName.clear(); | |||||
if (x_engine->processMode() == PROCESS_MODE_SINGLE_CLIENT) | |||||
{ | |||||
portName = m_name; | |||||
portName += ":"; | |||||
} | |||||
aOut.ports[0] = (CarlaEngineAudioPort*)x_client->addPort(CarlaEnginePortTypeAudio, portName, false); | |||||
aOut.rindexes[0] = 0; | |||||
portName += "out-left"; | |||||
portName.truncate(portNameSize); | |||||
if (x_engine->processMode() == PROCESS_MODE_SINGLE_CLIENT) | |||||
{ | |||||
strcpy(portName, m_name); | |||||
strcat(portName, ":out-right"); | |||||
aOut.ports[0] = (CarlaEngineAudioPort*)x_client->addPort(CarlaEnginePortTypeAudio, portName, false); | |||||
aOut.rindexes[0] = 0; | |||||
} | } | ||||
else | |||||
strcpy(portName, "out-right"); | |||||
aOut.ports[1] = (CarlaEngineAudioPort*)x_client->addPort(CarlaEnginePortTypeAudio, portName, false); | |||||
aOut.rindexes[1] = 1; | |||||
{ | |||||
portName.clear(); | |||||
if (x_engine->processMode() == PROCESS_MODE_SINGLE_CLIENT) | |||||
{ | |||||
portName = m_name; | |||||
portName += ":"; | |||||
} | |||||
portName += "out-right"; | |||||
portName.truncate(portNameSize); | |||||
aOut.ports[1] = (CarlaEngineAudioPort*)x_client->addPort(CarlaEnginePortTypeAudio, portName, false); | |||||
aOut.rindexes[1] = 1; | |||||
} | |||||
// --------------------------------------- | // --------------------------------------- | ||||
// Control Input | // Control Input | ||||
if (x_engine->processMode() == PROCESS_MODE_SINGLE_CLIENT) | |||||
{ | { | ||||
strcpy(portName, m_name); | |||||
strcat(portName, ":control-in"); | |||||
} | |||||
else | |||||
strcpy(portName, "control-in"); | |||||
portName.clear(); | |||||
if (x_engine->processMode() == PROCESS_MODE_SINGLE_CLIENT) | |||||
{ | |||||
portName = m_name; | |||||
portName += ":"; | |||||
} | |||||
param.portCin = (CarlaEngineControlPort*)x_client->addPort(CarlaEnginePortTypeControl, portName, true); | |||||
portName += "control-in"; | |||||
portName.truncate(portNameSize); | |||||
param.portCin = (CarlaEngineControlPort*)x_client->addPort(CarlaEnginePortTypeControl, portName, true); | |||||
} | |||||
// --------------------------------------- | // --------------------------------------- | ||||
// MIDI Input | // MIDI Input | ||||
if (x_engine->processMode() == PROCESS_MODE_SINGLE_CLIENT) | |||||
{ | { | ||||
strcpy(portName, m_name); | |||||
strcat(portName, ":midi-in"); | |||||
} | |||||
else | |||||
strcpy(portName, "midi-in"); | |||||
portName.clear(); | |||||
midi.portMin = (CarlaEngineMidiPort*)x_client->addPort(CarlaEnginePortTypeMIDI, portName, true); | |||||
if (x_engine->processMode() == PROCESS_MODE_SINGLE_CLIENT) | |||||
{ | |||||
portName = m_name; | |||||
portName += ":"; | |||||
} | |||||
portName += "midi-in"; | |||||
portName.truncate(portNameSize); | |||||
midi.portMin = (CarlaEngineMidiPort*)x_client->addPort(CarlaEnginePortTypeMIDI, portName, true); | |||||
} | |||||
// --------------------------------------- | // --------------------------------------- | ||||
@@ -392,7 +412,6 @@ public: | |||||
midiprog.data[i].name = strdup(info.InstrumentName.c_str()); | midiprog.data[i].name = strdup(info.InstrumentName.c_str()); | ||||
} | } | ||||
#ifndef BUILD_BRIDGE | |||||
// Update OSC Names | // Update OSC Names | ||||
if (x_engine->isOscControlRegisted()) | if (x_engine->isOscControlRegisted()) | ||||
{ | { | ||||
@@ -401,7 +420,6 @@ public: | |||||
for (i=0; i < midiprog.count; i++) | for (i=0; i < midiprog.count; i++) | ||||
x_engine->osc_send_control_set_midi_program_data(m_id, i, midiprog.data[i].bank, midiprog.data[i].program, midiprog.data[i].name); | x_engine->osc_send_control_set_midi_program_data(m_id, i, midiprog.data[i].bank, midiprog.data[i].program, midiprog.data[i].name); | ||||
} | } | ||||
#endif | |||||
if (init) | if (init) | ||||
{ | { | ||||
@@ -778,9 +796,7 @@ public: | |||||
} | } | ||||
// Output VU | // Output VU | ||||
#ifndef BUILD_BRIDGE | |||||
if (x_engine->processMode() != PROCESS_MODE_CONTINUOUS_RACK) | if (x_engine->processMode() != PROCESS_MODE_CONTINUOUS_RACK) | ||||
#endif | |||||
{ | { | ||||
for (k=0; i < 2 && k < frames; k++) | for (k=0; i < 2 && k < frames; k++) | ||||
{ | { | ||||
@@ -1327,27 +1327,29 @@ public: | |||||
paramBuffers = new float[params]; | paramBuffers = new float[params]; | ||||
} | } | ||||
const int portNameSize = x_engine->maxPortNameSize() - 2; | |||||
char portName[portNameSize]; | |||||
bool needsCtrlIn = false; | bool needsCtrlIn = false; | ||||
bool needsCtrlOut = false; | bool needsCtrlOut = false; | ||||
const int portNameSize = x_engine->maxPortNameSize(); | |||||
CarlaString portName; | |||||
for (uint32_t i=0; i < portCount; i++) | for (uint32_t i=0; i < portCount; i++) | ||||
{ | { | ||||
const LV2_Property portType = rdf_descriptor->Ports[i].Type; | const LV2_Property portType = rdf_descriptor->Ports[i].Type; | ||||
if (LV2_IS_PORT_AUDIO(portType) || LV2_IS_PORT_ATOM_SEQUENCE(portType) || LV2_IS_PORT_CV(portType) || LV2_IS_PORT_EVENT(portType) || LV2_IS_PORT_MIDI_LL(portType)) | if (LV2_IS_PORT_AUDIO(portType) || LV2_IS_PORT_ATOM_SEQUENCE(portType) || LV2_IS_PORT_CV(portType) || LV2_IS_PORT_EVENT(portType) || LV2_IS_PORT_MIDI_LL(portType)) | ||||
{ | { | ||||
portName.clear(); | |||||
#ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
if (x_engine->processMode() == PROCESS_MODE_SINGLE_CLIENT) | if (x_engine->processMode() == PROCESS_MODE_SINGLE_CLIENT) | ||||
{ | { | ||||
strcpy(portName, m_name); | |||||
strcat(portName, ":"); | |||||
strncat(portName, rdf_descriptor->Ports[i].Name, portNameSize/2); | |||||
portName = m_name; | |||||
portName += ":"; | |||||
} | } | ||||
else | |||||
#endif | #endif | ||||
strncpy(portName, rdf_descriptor->Ports[i].Name, portNameSize); | |||||
portName += rdf_descriptor->Ports[i].Name; | |||||
portName.truncate(portNameSize); | |||||
} | } | ||||
if (LV2_IS_PORT_AUDIO(portType)) | if (LV2_IS_PORT_AUDIO(portType)) | ||||
@@ -1360,7 +1362,7 @@ public: | |||||
if (forcedStereoIn) | if (forcedStereoIn) | ||||
{ | { | ||||
strcat(portName, "_"); | |||||
portName += "_2"; | |||||
aIn.ports[1] = (CarlaEngineAudioPort*)x_client->addPort(CarlaEnginePortTypeAudio, portName, true); | aIn.ports[1] = (CarlaEngineAudioPort*)x_client->addPort(CarlaEnginePortTypeAudio, portName, true); | ||||
aIn.rindexes[1] = i; | aIn.rindexes[1] = i; | ||||
} | } | ||||
@@ -1374,7 +1376,7 @@ public: | |||||
if (forcedStereoOut) | if (forcedStereoOut) | ||||
{ | { | ||||
strcat(portName, "_"); | |||||
portName += "_2"; | |||||
aOut.ports[1] = (CarlaEngineAudioPort*)x_client->addPort(CarlaEnginePortTypeAudio, portName, false); | aOut.ports[1] = (CarlaEngineAudioPort*)x_client->addPort(CarlaEnginePortTypeAudio, portName, false); | ||||
aOut.rindexes[1] = i; | aOut.rindexes[1] = i; | ||||
} | } | ||||
@@ -1720,30 +1722,34 @@ public: | |||||
if (needsCtrlIn) | if (needsCtrlIn) | ||||
{ | { | ||||
portName.clear(); | |||||
#ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
if (x_engine->processMode() == PROCESS_MODE_SINGLE_CLIENT) | if (x_engine->processMode() == PROCESS_MODE_SINGLE_CLIENT) | ||||
{ | { | ||||
strcpy(portName, m_name); | |||||
strcat(portName, ":control-in"); | |||||
portName = m_name; | |||||
portName += ":"; | |||||
} | } | ||||
else | |||||
#endif | #endif | ||||
strcpy(portName, "control-in"); | |||||
portName += "control-in"; | |||||
portName.truncate(portNameSize); | |||||
param.portCin = (CarlaEngineControlPort*)x_client->addPort(CarlaEnginePortTypeControl, portName, true); | param.portCin = (CarlaEngineControlPort*)x_client->addPort(CarlaEnginePortTypeControl, portName, true); | ||||
} | } | ||||
if (needsCtrlOut) | if (needsCtrlOut) | ||||
{ | { | ||||
portName.clear(); | |||||
#ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
if (x_engine->processMode() == PROCESS_MODE_SINGLE_CLIENT) | if (x_engine->processMode() == PROCESS_MODE_SINGLE_CLIENT) | ||||
{ | { | ||||
strcpy(portName, m_name); | |||||
strcat(portName, ":control-out"); | |||||
portName = m_name; | |||||
portName += ":"; | |||||
} | } | ||||
else | |||||
#endif | #endif | ||||
strcpy(portName, "control-out"); | |||||
portName += "control-out"; | |||||
portName.truncate(portNameSize); | |||||
param.portCout = (CarlaEngineControlPort*)x_client->addPort(CarlaEnginePortTypeControl, portName, false); | param.portCout = (CarlaEngineControlPort*)x_client->addPort(CarlaEnginePortTypeControl, portName, false); | ||||
} | } | ||||
@@ -755,7 +755,6 @@ public: | |||||
midiprog.data[i].name = strdup(mpDesc->name); | midiprog.data[i].name = strdup(mpDesc->name); | ||||
} | } | ||||
#ifndef BUILD_BRIDGE | |||||
// Update OSC Names | // Update OSC Names | ||||
if (x_engine->isOscControlRegisted()) | if (x_engine->isOscControlRegisted()) | ||||
{ | { | ||||
@@ -764,7 +763,6 @@ public: | |||||
for (i=0; i < midiprog.count; i++) | for (i=0; i < midiprog.count; i++) | ||||
x_engine->osc_send_control_set_midi_program_data(m_id, i, midiprog.data[i].bank, midiprog.data[i].program, midiprog.data[i].name); | x_engine->osc_send_control_set_midi_program_data(m_id, i, midiprog.data[i].bank, midiprog.data[i].program, midiprog.data[i].name); | ||||
} | } | ||||
#endif | |||||
if (init) | if (init) | ||||
{ | { | ||||
@@ -827,11 +825,7 @@ public: | |||||
// -------------------------------------------------------------------------------------------------------- | // -------------------------------------------------------------------------------------------------------- | ||||
// Input VU | // Input VU | ||||
#ifndef BUILD_BRIDGE | |||||
if (aIn.count > 0 && x_engine->processMode() != PROCESS_MODE_CONTINUOUS_RACK) | if (aIn.count > 0 && x_engine->processMode() != PROCESS_MODE_CONTINUOUS_RACK) | ||||
#else | |||||
if (aIn.count > 0) | |||||
#endif | |||||
{ | { | ||||
if (aIn.count == 1) | if (aIn.count == 1) | ||||
{ | { | ||||
@@ -1276,9 +1270,7 @@ public: | |||||
} | } | ||||
// Output VU | // Output VU | ||||
#ifndef BUILD_BRIDGE | |||||
if (x_engine->processMode() != PROCESS_MODE_CONTINUOUS_RACK) | if (x_engine->processMode() != PROCESS_MODE_CONTINUOUS_RACK) | ||||
#endif | |||||
{ | { | ||||
for (k=0; i < 2 && k < frames; k++) | for (k=0; i < 2 && k < frames; k++) | ||||
{ | { | ||||
@@ -516,19 +516,26 @@ public: | |||||
param.ranges = new ParameterRanges[params]; | param.ranges = new ParameterRanges[params]; | ||||
} | } | ||||
const int portNameSize = x_engine->maxPortNameSize() - 1; | |||||
char portName[portNameSize]; | |||||
bool needsCtrlIn = (aOuts > 0 || params > 0); | bool needsCtrlIn = (aOuts > 0 || params > 0); | ||||
const int portNameSize = x_engine->maxPortNameSize(); | |||||
CarlaString portName; | |||||
// Audio Ins | // Audio Ins | ||||
for (j=0; j < aIns; j++) | for (j=0; j < aIns; j++) | ||||
{ | { | ||||
portName.clear(); | |||||
#ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
if (x_engine->processMode() == PROCESS_MODE_SINGLE_CLIENT) | if (x_engine->processMode() == PROCESS_MODE_SINGLE_CLIENT) | ||||
sprintf(portName, "%s:input_%02i", m_name, j+1); | |||||
else | |||||
{ | |||||
portName = m_name; | |||||
portName += ":"; | |||||
} | |||||
#endif | #endif | ||||
sprintf(portName, "input_%02i", j+1); | |||||
char tmp[12] = { 0 }; | |||||
sprintf(tmp, "input_%02i", j+1); | |||||
portName += tmp; | |||||
aIn.ports[j] = (CarlaEngineAudioPort*)x_client->addPort(CarlaEnginePortTypeAudio, portName, true); | aIn.ports[j] = (CarlaEngineAudioPort*)x_client->addPort(CarlaEnginePortTypeAudio, portName, true); | ||||
aIn.rindexes[j] = j; | aIn.rindexes[j] = j; | ||||
@@ -537,12 +544,18 @@ public: | |||||
// Audio Outs | // Audio Outs | ||||
for (j=0; j < aOuts; j++) | for (j=0; j < aOuts; j++) | ||||
{ | { | ||||
portName.clear(); | |||||
#ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
if (x_engine->processMode() == PROCESS_MODE_SINGLE_CLIENT) | if (x_engine->processMode() == PROCESS_MODE_SINGLE_CLIENT) | ||||
sprintf(portName, "%s:output_%02i", m_name, j+1); | |||||
else | |||||
{ | |||||
portName = m_name; | |||||
portName += ":"; | |||||
} | |||||
#endif | #endif | ||||
sprintf(portName, "output_%02i", j+1); | |||||
char tmp[12] = { 0 }; | |||||
sprintf(tmp, "output_%02i", j+1); | |||||
portName += tmp; | |||||
aOut.ports[j] = (CarlaEngineAudioPort*)x_client->addPort(CarlaEnginePortTypeAudio, portName, false); | aOut.ports[j] = (CarlaEngineAudioPort*)x_client->addPort(CarlaEnginePortTypeAudio, portName, false); | ||||
aOut.rindexes[j] = j; | aOut.rindexes[j] = j; | ||||
@@ -665,45 +678,51 @@ public: | |||||
if (needsCtrlIn) | if (needsCtrlIn) | ||||
{ | { | ||||
portName.clear(); | |||||
#ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
if (x_engine->processMode() == PROCESS_MODE_SINGLE_CLIENT) | if (x_engine->processMode() == PROCESS_MODE_SINGLE_CLIENT) | ||||
{ | { | ||||
strcpy(portName, m_name); | |||||
strcat(portName, ":control-in"); | |||||
portName = m_name; | |||||
portName += ":"; | |||||
} | } | ||||
else | |||||
#endif | #endif | ||||
strcpy(portName, "control-in"); | |||||
portName += "control-in"; | |||||
portName.truncate(portNameSize); | |||||
param.portCin = (CarlaEngineControlPort*)x_client->addPort(CarlaEnginePortTypeControl, portName, true); | param.portCin = (CarlaEngineControlPort*)x_client->addPort(CarlaEnginePortTypeControl, portName, true); | ||||
} | } | ||||
if (mIns == 1) | if (mIns == 1) | ||||
{ | { | ||||
portName.clear(); | |||||
#ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
if (x_engine->processMode() == PROCESS_MODE_SINGLE_CLIENT) | if (x_engine->processMode() == PROCESS_MODE_SINGLE_CLIENT) | ||||
{ | { | ||||
strcpy(portName, m_name); | |||||
strcat(portName, ":midi-in"); | |||||
portName = m_name; | |||||
portName += ":"; | |||||
} | } | ||||
else | |||||
#endif | #endif | ||||
strcpy(portName, "midi-in"); | |||||
portName += "midi-in"; | |||||
portName.truncate(portNameSize); | |||||
midi.portMin = (CarlaEngineMidiPort*)x_client->addPort(CarlaEnginePortTypeMIDI, portName, true); | midi.portMin = (CarlaEngineMidiPort*)x_client->addPort(CarlaEnginePortTypeMIDI, portName, true); | ||||
} | } | ||||
if (mOuts == 1) | if (mOuts == 1) | ||||
{ | { | ||||
portName.clear(); | |||||
#ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
if (x_engine->processMode() == PROCESS_MODE_SINGLE_CLIENT) | if (x_engine->processMode() == PROCESS_MODE_SINGLE_CLIENT) | ||||
{ | { | ||||
strcpy(portName, m_name); | |||||
strcat(portName, ":midi-out"); | |||||
portName = m_name; | |||||
portName += ":"; | |||||
} | } | ||||
else | |||||
#endif | #endif | ||||
strcpy(portName, "midi-out"); | |||||
portName += "midi-out"; | |||||
portName.truncate(portNameSize); | |||||
midi.portMout = (CarlaEngineMidiPort*)x_client->addPort(CarlaEnginePortTypeMIDI, portName, false); | midi.portMout = (CarlaEngineMidiPort*)x_client->addPort(CarlaEnginePortTypeMIDI, portName, false); | ||||
} | } | ||||
@@ -1,7 +1,6 @@ | |||||
# Carla TODO | # Carla TODO | ||||
CODE CLEANUP: | CODE CLEANUP: | ||||
- Use CarlaString in portNameSize stuff | |||||
- Create PluginGUI class in C++ code, remove python one (need to handle parent somehow) | - Create PluginGUI class in C++ code, remove python one (need to handle parent somehow) | ||||
GENERAL: | GENERAL: | ||||