Browse Source

Add carla_get_plugin_latency host function

Signed-off-by: falkTX <falktx@falktx.com>
tags/v2.4.1
parent
commit
f9d0e06260
2 changed files with 19 additions and 0 deletions
  1. +7
    -0
      source/backend/CarlaHost.h
  2. +12
    -0
      source/backend/CarlaStandalone.cpp

+ 7
- 0
source/backend/CarlaHost.h View File

@@ -893,6 +893,13 @@ CARLA_EXPORT float carla_get_current_parameter_value(CarlaHostHandle handle, uin
*/
CARLA_EXPORT float carla_get_internal_parameter_value(CarlaHostHandle handle, uint pluginId, int32_t parameterId);

/*!
* Get a plugin's internal latency, in samples.
* @param pluginId Plugin
* @see InternalParameterIndex
*/
CARLA_EXPORT uint32_t carla_get_plugin_latency(CarlaHostHandle handle, uint pluginId);

/*!
* Get a plugin's peak values.
* @param pluginId Plugin


+ 12
- 0
source/backend/CarlaStandalone.cpp View File

@@ -1960,6 +1960,18 @@ float carla_get_internal_parameter_value(CarlaHostHandle handle, uint pluginId,

// --------------------------------------------------------------------------------------------------------------------

uint32_t carla_get_plugin_latency(CarlaHostHandle handle, uint pluginId)
{
CARLA_SAFE_ASSERT_RETURN(handle->engine != nullptr, 0);

if (const CarlaPluginPtr plugin = handle->engine->getPlugin(pluginId))
return plugin->getLatency();

return 0;
}

// --------------------------------------------------------------------------------------------------------------------

const float* carla_get_peak_values(CarlaHostHandle handle, uint pluginId)
{
CARLA_SAFE_ASSERT_RETURN(handle->engine != nullptr, nullptr);


Loading…
Cancel
Save