| @@ -22,8 +22,7 @@ CARLA_BACKEND_START_NAMESPACE | |||
| // ----------------------------------------------------------------------- | |||
| unsigned int CarlaPlugin::m_count = 0; | |||
| unsigned int CarlaPlugin::m_count = 0; | |||
| unsigned short CarlaEngine::m_maxPluginNumber = 0; | |||
| CarlaEngine::CarlaEngine() | |||
| @@ -696,6 +696,50 @@ public: | |||
| if (aIns <= 2 && aOuts <= 2 && (aIns == aOuts || aIns == 0 || aOuts == 0)) | |||
| m_hints |= PLUGIN_CAN_FORCE_STEREO; | |||
| // check latency | |||
| { | |||
| bool hasLatency = false; | |||
| uint32_t latency = 0; | |||
| for (uint32_t i=0; i < param.count; i++) | |||
| { | |||
| if (param.data[i].type == PARAMETER_LATENCY) | |||
| { | |||
| // pre-run so plugin can update latency control-port | |||
| float tmpIn[2][aIns]; | |||
| float tmpOut[2][aOuts]; | |||
| for (j=0; j < aIn.count; j++) | |||
| { | |||
| tmpIn[j][0] = 0.0f; | |||
| tmpIn[j][1] = 0.0f; | |||
| if (j == 0 || ! h2) | |||
| ldescriptor->connect_port(handle, aIn.rindexes[j], tmpIn[j]); | |||
| } | |||
| for (j=0; j < aOut.count; j++) | |||
| { | |||
| tmpOut[j][0] = 0.0f; | |||
| tmpOut[j][1] = 0.0f; | |||
| if (j == 0 || ! h2) | |||
| ldescriptor->connect_port(handle, aOut.rindexes[j], tmpOut[j]); | |||
| } | |||
| ldescriptor->activate(handle); | |||
| ldescriptor->run(handle, 2); | |||
| ldescriptor->deactivate(handle); | |||
| latency = rint(paramBuffers[i]); | |||
| hasLatency = true; | |||
| break; | |||
| } | |||
| } | |||
| // TODO - adjust latency now | |||
| } | |||
| reloadPrograms(true); | |||
| x_client->activate(); | |||
| @@ -665,6 +665,50 @@ public: | |||
| if (aIns <= 2 && aOuts <= 2 && (aIns == aOuts || aIns == 0 || aOuts == 0)) | |||
| m_hints |= PLUGIN_CAN_FORCE_STEREO; | |||
| // check latency | |||
| { | |||
| bool hasLatency = false; | |||
| uint32_t latency = 0; | |||
| for (uint32_t i=0; i < param.count; i++) | |||
| { | |||
| if (param.data[i].type == PARAMETER_LATENCY) | |||
| { | |||
| // pre-run so plugin can update latency control-port | |||
| float tmpIn[2][aIns]; | |||
| float tmpOut[2][aOuts]; | |||
| for (j=0; j < aIn.count; j++) | |||
| { | |||
| tmpIn[j][0] = 0.0f; | |||
| tmpIn[j][1] = 0.0f; | |||
| if (j == 0 || ! h2) | |||
| descriptor->connect_port(handle, aIn.rindexes[j], tmpIn[j]); | |||
| } | |||
| for (j=0; j < aOut.count; j++) | |||
| { | |||
| tmpOut[j][0] = 0.0f; | |||
| tmpOut[j][1] = 0.0f; | |||
| if (j == 0 || ! h2) | |||
| descriptor->connect_port(handle, aOut.rindexes[j], tmpOut[j]); | |||
| } | |||
| descriptor->activate(handle); | |||
| descriptor->run(handle, 2); | |||
| descriptor->deactivate(handle); | |||
| latency = rint(paramBuffers[i]); | |||
| hasLatency = true; | |||
| break; | |||
| } | |||
| } | |||
| // TODO - adjust latency now | |||
| } | |||
| x_client->activate(); | |||
| qDebug("LadspaPlugin::reload() - end"); | |||
| @@ -1737,6 +1737,41 @@ public: | |||
| m_hints |= PLUGIN_CAN_FORCE_STEREO; | |||
| } | |||
| // check latency | |||
| { | |||
| bool hasLatency = false; | |||
| uint32_t latency = 0; | |||
| for (uint32_t i=0; i < param.count; i++) | |||
| { | |||
| if (param.data[i].type == PARAMETER_LATENCY) | |||
| { | |||
| // pre-run so plugin can update latency control-port | |||
| for (j=0; j < aIn.count; j++) | |||
| { | |||
| if (j == 0 || ! h2) | |||
| descriptor->connect_port(handle, aIn.rindexes[j], nullptr); | |||
| } | |||
| for (j=0; j < aOut.count; j++) | |||
| { | |||
| if (j == 0 || ! h2) | |||
| descriptor->connect_port(handle, aOut.rindexes[j], nullptr); | |||
| } | |||
| descriptor->activate(handle); | |||
| descriptor->run(handle, 0); | |||
| descriptor->deactivate(handle); | |||
| latency = rint(paramBuffers[i]); | |||
| hasLatency = true; | |||
| break; | |||
| } | |||
| } | |||
| // TODO - adjust latency now | |||
| } | |||
| reloadPrograms(true); | |||
| x_client->activate(); | |||
| @@ -729,6 +729,13 @@ public: | |||
| if ((aIns == 0 || aIns == 2) && (aOuts == 0 || aOuts == 2)) | |||
| m_hints |= PLUGIN_CAN_FORCE_STEREO; | |||
| // check latency | |||
| { | |||
| uint32_t latency = effect->initialDelay; | |||
| // TODO - adjust latency now | |||
| } | |||
| reloadPrograms(true); | |||
| x_client->activate(); | |||