_was_activated = false;
_has_state_interface = false;
_can_write_automation = false;
+ _max_latency = 0;
+ _current_latency = 0;
_impl->block_length = _session.get_block_size();
_instance_access_feature.URI = "http://lv2plug.in/ns/ext/instance-access";
lilv_instance_connect_port(_impl->instance, i, &_control_data[i]);
if (latent && i == latency_index) {
+ LilvNode *max;
+ lilv_port_get_range(_impl->plugin, port, NULL, NULL, &max);
+ _max_latency = max ? lilv_node_as_float(max) : .02 * _sample_rate;
_latency_control_port = &_control_data[i];
*_latency_control_port = 0;
}
}
Plugin::IOPortDescription
-LV2Plugin::describe_io_port (ARDOUR::DataType dt, bool input, uint32_t id)
+LV2Plugin::describe_io_port (ARDOUR::DataType dt, bool input, uint32_t id) const
{
PortFlags match = 0;
switch (dt) {
}
}
+framecnt_t
+LV2Plugin::max_latency () const
+{
+ return _max_latency;
+}
+
framecnt_t
LV2Plugin::signal_latency() const
{
_next_cycle_speed = _session.transport_speed();
_next_cycle_start = _session.transport_frame() + (nframes * _next_cycle_speed);
+ if (_latency_control_port) {
+ framecnt_t new_latency = signal_latency ();
+ if (_current_latency != new_latency) {
+ LatencyChanged (_current_latency, new_latency); /* EMIT SIGNAL */
+ }
+ _current_latency = new_latency;
+ }
return 0;
}
patch_writable = lilv_new_uri(world, LV2_PATCH__writable);
patch_Message = lilv_new_uri(world, LV2_PATCH__Message);
#ifdef LV2_EXTENDED
- lv2_noSampleAccurateCtrl = lilv_new_uri(world, LV2_CORE_PREFIX "noSampleAccurateControls");
+ lv2_noSampleAccurateCtrl = lilv_new_uri(world, "http://ardour.org/lv2/ext#noSampleAccurateControls");
auto_can_write_automatation = lilv_new_uri(world, LV2_AUTOMATE_URI__can_write);
auto_automation_control = lilv_new_uri(world, LV2_AUTOMATE_URI__control);
auto_automation_controlled = lilv_new_uri(world, LV2_AUTOMATE_URI__controlled);