diff --git a/libs/ardour/ardour/region_fx_plugin.h b/libs/ardour/ardour/region_fx_plugin.h index 10809b5547..74f28cf43f 100644 --- a/libs/ardour/ardour/region_fx_plugin.h +++ b/libs/ardour/ardour/region_fx_plugin.h @@ -155,6 +155,10 @@ public: return _required_buffers; } + /* wrapped Plugin API */ + PBD::Signal0 TailChanged; + samplecnt_t effective_tail () const; + private: /* disallow copy construction */ RegionFxPlugin (RegionFxPlugin const&); diff --git a/libs/ardour/audioregion.cc b/libs/ardour/audioregion.cc index 55cdccd52b..ffec0b9b54 100644 --- a/libs/ardour/audioregion.cc +++ b/libs/ardour/audioregion.cc @@ -2483,7 +2483,7 @@ AudioRegion::_add_plugin (std::shared_ptr rfx, std::shared_ptrLatencyChanged.connect_same_thread (*this, boost::bind (&AudioRegion::fx_latency_changed, this, false)); - rfx->plugin()->TailChanged.connect_same_thread (*this, boost::bind (&AudioRegion::fx_tail_changed, this, false)); + rfx->TailChanged.connect_same_thread (*this, boost::bind (&AudioRegion::fx_tail_changed, this, false)); rfx->set_block_size (_session.get_block_size ()); if (from_set_state) { @@ -2570,7 +2570,7 @@ AudioRegion::fx_tail_changed (bool no_emit) { uint32_t t = 0; for (auto const& rfx : _plugins) { - t = max (t, rfx->plugin()->effective_tail ()); + t = max (t, rfx->effective_tail ()); } if (t == _fx_tail) { return; diff --git a/libs/ardour/region_fx_plugin.cc b/libs/ardour/region_fx_plugin.cc index a61aee9290..b069cdf259 100644 --- a/libs/ardour/region_fx_plugin.cc +++ b/libs/ardour/region_fx_plugin.cc @@ -390,6 +390,7 @@ RegionFxPlugin::add_plugin (std::shared_ptr plugin) plugin->ParameterChangedExternally.connect_same_thread (*this, boost::bind (&RegionFxPlugin::parameter_changed_externally, this, _1, _2)); plugin->StartTouch.connect_same_thread (*this, boost::bind (&RegionFxPlugin::start_touch, this, _1)); plugin->EndTouch.connect_same_thread (*this, boost::bind (&RegionFxPlugin::end_touch, this, _1)); + plugin->TailChanged.connect_same_thread (*this, [this](){ TailChanged (); }); } plugin->set_insert (this, _plugins.size ()); @@ -466,6 +467,12 @@ RegionFxPlugin::signal_latency () const return _plugins.front ()->signal_latency (); } +ARDOUR::samplecnt_t +RegionFxPlugin::effective_tail () const +{ + return _plugins.front ()->effective_tail (); +} + PlugInsertBase::UIElements RegionFxPlugin::ui_elements () const {