mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 23:35:03 +01:00
RegionFx: abstract Plugin tail API
This commit is contained in:
parent
fc07a92d36
commit
b6e187193d
3 changed files with 13 additions and 2 deletions
|
|
@ -155,6 +155,10 @@ public:
|
||||||
return _required_buffers;
|
return _required_buffers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* wrapped Plugin API */
|
||||||
|
PBD::Signal0<void> TailChanged;
|
||||||
|
samplecnt_t effective_tail () const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/* disallow copy construction */
|
/* disallow copy construction */
|
||||||
RegionFxPlugin (RegionFxPlugin const&);
|
RegionFxPlugin (RegionFxPlugin const&);
|
||||||
|
|
|
||||||
|
|
@ -2483,7 +2483,7 @@ AudioRegion::_add_plugin (std::shared_ptr<RegionFxPlugin> rfx, std::shared_ptr<R
|
||||||
}
|
}
|
||||||
|
|
||||||
rfx->LatencyChanged.connect_same_thread (*this, boost::bind (&AudioRegion::fx_latency_changed, this, false));
|
rfx->LatencyChanged.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 ());
|
rfx->set_block_size (_session.get_block_size ());
|
||||||
|
|
||||||
if (from_set_state) {
|
if (from_set_state) {
|
||||||
|
|
@ -2570,7 +2570,7 @@ AudioRegion::fx_tail_changed (bool no_emit)
|
||||||
{
|
{
|
||||||
uint32_t t = 0;
|
uint32_t t = 0;
|
||||||
for (auto const& rfx : _plugins) {
|
for (auto const& rfx : _plugins) {
|
||||||
t = max<uint32_t> (t, rfx->plugin()->effective_tail ());
|
t = max<uint32_t> (t, rfx->effective_tail ());
|
||||||
}
|
}
|
||||||
if (t == _fx_tail) {
|
if (t == _fx_tail) {
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -390,6 +390,7 @@ RegionFxPlugin::add_plugin (std::shared_ptr<Plugin> plugin)
|
||||||
plugin->ParameterChangedExternally.connect_same_thread (*this, boost::bind (&RegionFxPlugin::parameter_changed_externally, this, _1, _2));
|
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->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->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 ());
|
plugin->set_insert (this, _plugins.size ());
|
||||||
|
|
@ -466,6 +467,12 @@ RegionFxPlugin::signal_latency () const
|
||||||
return _plugins.front ()->signal_latency ();
|
return _plugins.front ()->signal_latency ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ARDOUR::samplecnt_t
|
||||||
|
RegionFxPlugin::effective_tail () const
|
||||||
|
{
|
||||||
|
return _plugins.front ()->effective_tail ();
|
||||||
|
}
|
||||||
|
|
||||||
PlugInsertBase::UIElements
|
PlugInsertBase::UIElements
|
||||||
RegionFxPlugin::ui_elements () const
|
RegionFxPlugin::ui_elements () const
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue