2 Copyright (C) 2000 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 #include <sigc++/bind.h>
24 #include "pbd/failed_constructor.h"
25 #include "pbd/xml++.h"
27 #include "ardour/audio_buffer.h"
28 #include "ardour/automation_list.h"
29 #include "ardour/buffer_set.h"
30 #include "ardour/event_type_map.h"
31 #include "ardour/ladspa_plugin.h"
32 #include "ardour/plugin.h"
33 #include "ardour/plugin_insert.h"
34 #include "ardour/port.h"
35 #include "ardour/route.h"
38 #include "ardour/lv2_plugin.h"
42 #include "ardour/vst_plugin.h"
45 #ifdef HAVE_AUDIOUNITS
46 #include "ardour/audio_unit.h"
49 #include "ardour/audioengine.h"
50 #include "ardour/session.h"
51 #include "ardour/types.h"
56 using namespace ARDOUR;
59 const string PluginInsert::port_automation_node_name = "PortAutomation";
61 PluginInsert::PluginInsert (Session& s, boost::shared_ptr<Plugin> plug)
62 : Processor (s, plug->name())
63 , _signal_analysis_collected_nframes(0)
64 , _signal_analysis_collect_nframes_max(0)
66 /* the first is the master */
68 _plugins.push_back (plug);
73 Glib::Mutex::Lock em (_session.engine().process_lock());
74 IO::PortCountChanged (max(input_streams(), output_streams()));
77 ProcessorCreated (this); /* EMIT SIGNAL */
80 PluginInsert::PluginInsert (Session& s, const XMLNode& node)
81 : Processor (s, "unnamed plugin insert"),
82 _signal_analysis_collected_nframes(0),
83 _signal_analysis_collect_nframes_max(0)
85 if (set_state (node)) {
86 throw failed_constructor();
89 // XXX: This would dump all automation, which has already been loaded by
90 // Processor. But this could also have been related to the Parameter change..
91 // will look into this later.
95 Glib::Mutex::Lock em (_session.engine().process_lock());
96 IO::PortCountChanged (max(input_streams(), output_streams()));
101 PluginInsert::set_count (uint32_t num)
103 bool require_state = !_plugins.empty();
105 /* this is a bad idea.... we shouldn't do this while active.
106 only a route holding their redirect_lock should be calling this
111 } else if (num > _plugins.size()) {
112 uint32_t diff = num - _plugins.size();
114 for (uint32_t n = 0; n < diff; ++n) {
115 _plugins.push_back (plugin_factory (_plugins[0]));
118 /* XXX do something */
122 } else if (num < _plugins.size()) {
123 uint32_t diff = _plugins.size() - num;
124 for (uint32_t n= 0; n < diff; ++n) {
133 PluginInsert::init ()
138 PluginInsert::~PluginInsert ()
140 GoingAway (); /* EMIT SIGNAL */
144 PluginInsert::auto_state_changed (Evoral::Parameter which)
146 if (which.type() != PluginAutomation)
149 boost::shared_ptr<AutomationControl> c
150 = boost::dynamic_pointer_cast<AutomationControl>(data().control (which));
152 if (c && ((AutomationList*)c->list().get())->automation_state() != Off) {
153 _plugins[0]->set_parameter (which.id(), c->list()->eval (_session.transport_frame()));
158 PluginInsert::output_streams() const
160 ChanCount out = _plugins.front()->get_info()->n_outputs;
162 if (out == ChanCount::INFINITE) {
163 return _plugins.front()->output_streams ();
165 out.set_audio (out.n_audio() * _plugins.size());
166 out.set_midi (out.n_midi() * _plugins.size());
172 PluginInsert::input_streams() const
174 ChanCount in = _plugins[0]->get_info()->n_inputs;
176 if (in == ChanCount::INFINITE) {
177 return _plugins[0]->input_streams ();
179 in.set_audio (in.n_audio() * _plugins.size());
180 in.set_midi (in.n_midi() * _plugins.size());
186 PluginInsert::natural_output_streams() const
188 return _plugins[0]->get_info()->n_outputs;
192 PluginInsert::natural_input_streams() const
194 return _plugins[0]->get_info()->n_inputs;
198 PluginInsert::is_generator() const
200 /* XXX more finesse is possible here. VST plugins have a
201 a specific "instrument" flag, for example.
204 return _plugins[0]->get_info()->n_inputs.n_audio() == 0;
208 PluginInsert::set_automatable ()
210 set<Evoral::Parameter> a = _plugins.front()->automatable ();
212 Plugin::ParameterDescriptor desc;
214 for (set<Evoral::Parameter>::iterator i = a.begin(); i != a.end(); ++i) {
215 if (i->type() == PluginAutomation) {
217 _plugins.front()->get_parameter_descriptor(i->id(), desc);
218 Evoral::Parameter param(*i);
219 param.set_range(desc.lower, desc.upper, _plugins.front()->default_value(i->id()));
220 boost::shared_ptr<AutomationList> list(new AutomationList(param));
221 add_control(boost::shared_ptr<AutomationControl>(new PluginControl(this, *i, list)));
227 PluginInsert::parameter_changed (Evoral::Parameter which, float val)
229 if (which.type() != PluginAutomation)
232 Plugins::iterator i = _plugins.begin();
234 /* don't set the first plugin, just all the slaves */
236 if (i != _plugins.end()) {
238 for (; i != _plugins.end(); ++i) {
239 (*i)->set_parameter (which, val);
245 PluginInsert::set_block_size (nframes_t nframes)
247 for (Plugins::iterator i = _plugins.begin(); i != _plugins.end(); ++i) {
248 (*i)->set_block_size (nframes);
253 PluginInsert::activate ()
255 for (Plugins::iterator i = _plugins.begin(); i != _plugins.end(); ++i) {
261 PluginInsert::deactivate ()
263 for (Plugins::iterator i = _plugins.begin(); i != _plugins.end(); ++i) {
269 PluginInsert::connect_and_run (BufferSet& bufs, nframes_t nframes, nframes_t offset, bool with_auto, nframes_t now)
271 // Calculate if, and how many frames we need to collect for analysis
272 nframes_t collect_signal_nframes = (_signal_analysis_collect_nframes_max -
273 _signal_analysis_collected_nframes);
274 if (nframes < collect_signal_nframes) { // we might not get all frames now
275 collect_signal_nframes = nframes;
278 ChanMapping in_map(input_streams());
279 ChanMapping out_map(output_streams());
281 /* Note that we've already required that plugins
282 be able to handle in-place processing.
289 for (Controls::iterator li = data().controls().begin(); li != data().controls().end(); ++li, ++n) {
291 boost::shared_ptr<AutomationControl> c
292 = boost::dynamic_pointer_cast<AutomationControl>(li->second);
294 if (c->parameter().type() == PluginAutomation && c->automation_playback()) {
297 const float val = c->list()->rt_safe_eval (now, valid);
307 if (collect_signal_nframes > 0) {
309 //std::cerr << "collect input, bufs " << bufs.count().n_audio() << " count, " << bufs.available().n_audio() << " available" << std::endl;
310 //std::cerr << " streams " << input_streams().n_audio() << std::endl;
311 //std::cerr << "filling buffer with " << collect_signal_nframes << " frames at " << _signal_analysis_collected_nframes << std::endl;
313 _signal_analysis_inputs.set_count(input_streams());
315 for (uint32_t i = 0; i < input_streams().n_audio(); ++i) {
316 _signal_analysis_inputs.get_audio(i).read_from(
318 collect_signal_nframes,
319 _signal_analysis_collected_nframes); // offset is for target buffer
324 for (Plugins::iterator i = _plugins.begin(); i != _plugins.end(); ++i) {
325 (*i)->connect_and_run(bufs, in_map, out_map, nframes, offset);
326 for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) {
327 in_map.offset_to(*t, natural_input_streams().get(*t));
328 out_map.offset_to(*t, natural_output_streams().get(*t));
332 if (collect_signal_nframes > 0) {
334 //std::cerr << " output, bufs " << bufs.count().n_audio() << " count, " << bufs.available().n_audio() << " available" << std::endl;
335 //std::cerr << " streams " << output_streams().n_audio() << std::endl;
337 _signal_analysis_outputs.set_count(output_streams());
339 for (uint32_t i = 0; i < output_streams().n_audio(); ++i) {
340 _signal_analysis_outputs.get_audio(i).read_from(
342 collect_signal_nframes,
343 _signal_analysis_collected_nframes); // offset is for target buffer
346 _signal_analysis_collected_nframes += collect_signal_nframes;
347 assert(_signal_analysis_collected_nframes <= _signal_analysis_collect_nframes_max);
349 if (_signal_analysis_collected_nframes == _signal_analysis_collect_nframes_max) {
350 _signal_analysis_collect_nframes_max = 0;
351 _signal_analysis_collected_nframes = 0;
353 AnalysisDataGathered(&_signal_analysis_inputs,
354 &_signal_analysis_outputs);
357 /* leave remaining channel buffers alone */
361 PluginInsert::silence (nframes_t nframes)
363 ChanMapping in_map(input_streams());
364 ChanMapping out_map(output_streams());
367 for (Plugins::iterator i = _plugins.begin(); i != _plugins.end(); ++i) {
368 (*i)->connect_and_run (_session.get_silent_buffers ((*i)->get_info()->n_inputs), in_map, out_map, nframes, 0);
374 PluginInsert::run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes)
378 if (_session.transport_rolling()) {
379 automation_run (bufs, nframes);
381 connect_and_run (bufs, nframes, 0, false);
385 /* FIXME: type, audio only */
387 uint32_t in = _plugins[0]->get_info()->n_inputs.n_audio();
388 uint32_t out = _plugins[0]->get_info()->n_outputs.n_audio();
392 /* not active, but something has make up for any channel count increase */
394 for (uint32_t n = out - in; n < out; ++n) {
395 memcpy (bufs.get_audio(n).data(), bufs.get_audio(in - 1).data(), sizeof (Sample) * nframes);
399 bufs.count().set_audio(out);
404 PluginInsert::set_parameter (Evoral::Parameter param, float val)
406 if (param.type() != PluginAutomation)
409 /* the others will be set from the event triggered by this */
411 _plugins[0]->set_parameter (param.id(), val);
413 boost::shared_ptr<AutomationControl> ac
414 = boost::dynamic_pointer_cast<AutomationControl>(data().control(param));
419 warning << "set_parameter called for nonexistant parameter "
420 << EventTypeMap::instance().to_symbol(param) << endmsg;
423 _session.set_dirty();
427 PluginInsert::get_parameter (Evoral::Parameter param)
429 if (param.type() != PluginAutomation)
433 _plugins[0]->get_parameter (param.id());
437 PluginInsert::automation_run (BufferSet& bufs, nframes_t nframes)
439 Evoral::ControlEvent next_event (0, 0.0f);
440 nframes_t now = _session.transport_frame ();
441 nframes_t end = now + nframes;
442 nframes_t offset = 0;
444 Glib::Mutex::Lock lm (data().control_lock(), Glib::TRY_LOCK);
447 connect_and_run (bufs, nframes, offset, false);
451 if (!data().find_next_event (now, end, next_event)) {
453 /* no events have a time within the relevant range */
455 connect_and_run (bufs, nframes, offset, true, now);
461 nframes_t cnt = min (((nframes_t) ceil (next_event.when) - now), nframes);
463 connect_and_run (bufs, cnt, offset, true, now);
469 if (!data().find_next_event (now, end, next_event)) {
474 /* cleanup anything that is left to do */
477 connect_and_run (bufs, nframes, offset, true, now);
482 PluginInsert::default_parameter_value (const Evoral::Parameter& param)
484 if (param.type() != PluginAutomation)
487 if (_plugins.empty()) {
488 fatal << _("programming error: ") << X_("PluginInsert::default_parameter_value() called with no plugin")
493 return _plugins[0]->default_value (param.id());
496 boost::shared_ptr<Plugin>
497 PluginInsert::plugin_factory (boost::shared_ptr<Plugin> other)
499 boost::shared_ptr<LadspaPlugin> lp;
501 boost::shared_ptr<LV2Plugin> lv2p;
504 boost::shared_ptr<VSTPlugin> vp;
506 #ifdef HAVE_AUDIOUNITS
507 boost::shared_ptr<AUPlugin> ap;
510 if ((lp = boost::dynamic_pointer_cast<LadspaPlugin> (other)) != 0) {
511 return boost::shared_ptr<Plugin> (new LadspaPlugin (*lp));
513 } else if ((lv2p = boost::dynamic_pointer_cast<LV2Plugin> (other)) != 0) {
514 return boost::shared_ptr<Plugin> (new LV2Plugin (*lv2p));
517 } else if ((vp = boost::dynamic_pointer_cast<VSTPlugin> (other)) != 0) {
518 return boost::shared_ptr<Plugin> (new VSTPlugin (*vp));
520 #ifdef HAVE_AUDIOUNITS
521 } else if ((ap = boost::dynamic_pointer_cast<AUPlugin> (other)) != 0) {
522 return boost::shared_ptr<Plugin> (new AUPlugin (*ap));
526 fatal << string_compose (_("programming error: %1"),
527 X_("unknown plugin type in PluginInsert::plugin_factory"))
530 return boost::shared_ptr<Plugin> ((Plugin*) 0);
534 PluginInsert::configure_io (ChanCount in, ChanCount out)
536 if (set_count (count_for_configuration (in, out)) < 0) {
540 /* if we're running replicated plugins, each plugin has
541 the same i/o configuration and we may need to announce how many
542 output streams there are.
544 if we running a single plugin, we need to configure it.
547 if (_plugins.front()->configure_io (in, out) < 0) {
551 // we don't know the analysis window size, so we must work with the
552 // current buffer size here. each request for data fills in these
553 // buffers and the analyser makes sure it gets enough data for the
555 session().ensure_buffer_set (_signal_analysis_inputs, in);
556 //_signal_analysis_inputs.set_count (in);
558 session().ensure_buffer_set (_signal_analysis_outputs, out);
559 //_signal_analysis_outputs.set_count (out);
561 // std::cerr << "set counts to i" << in.n_audio() << "/o" << out.n_audio() << std::endl;
563 return Processor::configure_io (in, out);
567 PluginInsert::can_support_io_configuration (const ChanCount& in, ChanCount& out) const
569 // Plugin has flexible I/O, so delegate to it
570 if (_plugins.front()->reconfigurable_io()) {
571 return _plugins.front()->can_support_io_configuration (in, out);
574 ChanCount inputs = _plugins[0]->get_info()->n_inputs;
575 ChanCount outputs = _plugins[0]->get_info()->n_outputs;
577 // Plugin inputs match requested inputs exactly
583 // See if replication is possible
584 // We can replicate if there exists a single factor f such that, for every type,
585 // the number of plugin inputs * f = the requested number of inputs
587 bool can_replicate = true;
588 for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) {
589 // No inputs of this type
590 if (inputs.get(*t) == 0 && in.get(*t) == 0) {
593 // Plugin has more inputs than requested, can not replicate
594 } else if (inputs.get(*t) >= in.get(*t)) {
595 can_replicate = false;
598 // Plugin inputs is not a factor of requested inputs, can not replicate
599 } else if (inputs.get(*t) == 0 || in.get(*t) % inputs.get(*t) != 0) {
600 can_replicate = false;
603 // Potential factor not set yet
605 f = in.get(*t) / inputs.get(*t);;
608 // Factor for this type does not match another type, can not replicate
609 if (f != (in.get(*t) / inputs.get(*t))) {
610 can_replicate = false;
616 for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) {
617 out.set (*t, outputs.get(*t) * f);
625 /* Number of plugin instances required to support a given channel configuration.
629 PluginInsert::count_for_configuration (ChanCount in, ChanCount out) const
631 if (_plugins.front()->reconfigurable_io()) {
632 /* plugin has flexible I/O, so the answer is always 1 */
633 /* this could change if we ever decide to replicate AU's */
637 // FIXME: take 'out' into consideration
639 ChanCount outputs = _plugins[0]->get_info()->n_outputs;
640 ChanCount inputs = _plugins[0]->get_info()->n_inputs;
642 if (inputs.n_total() == 0) {
643 /* instrument plugin, always legal, but throws away any existing streams */
647 if (inputs.n_total() == 1 && outputs == inputs
648 && ((inputs.n_audio() == 0 && in.n_audio() == 0)
649 || (inputs.n_midi() == 0 && in.n_midi() == 0))) {
650 /* mono plugin, replicate as needed to match in */
659 // assumes in is valid, so we must be replicating
660 if (inputs.n_total() < in.n_total()
661 && (in.n_total() % inputs.n_total() == 0)) {
663 return in.n_total() / inputs.n_total();
671 PluginInsert::get_state(void)
677 PluginInsert::state (bool full)
679 XMLNode& node = Processor::state (full);
681 node.add_property("type", _plugins[0]->state_node_name());
682 node.add_property("unique-id", _plugins[0]->unique_id());
683 node.add_property("count", string_compose("%1", _plugins.size()));
684 node.add_child_nocopy (_plugins[0]->get_state());
686 /* add port automation state */
687 //XMLNode *autonode = new XMLNode(port_automation_node_name);
688 set<Evoral::Parameter> automatable = _plugins[0]->automatable();
690 for (set<Evoral::Parameter>::iterator x = automatable.begin(); x != automatable.end(); ++x) {
692 /*XMLNode* child = new XMLNode("port");
693 snprintf(buf, sizeof(buf), "%" PRIu32, *x);
694 child->add_property("number", string(buf));
696 child->add_child_nocopy (automation_list (*x).state (full));
697 autonode->add_child_nocopy (*child);
699 //autonode->add_child_nocopy (((AutomationList*)data().control(*x)->list().get())->state (full));
702 //node.add_child_nocopy (*autonode);
708 PluginInsert::set_state(const XMLNode& node)
710 XMLNodeList nlist = node.children();
711 XMLNodeIterator niter;
712 XMLPropertyList plist;
713 const XMLProperty *prop;
714 ARDOUR::PluginType type;
716 if ((prop = node.property ("type")) == 0) {
717 error << _("XML node describing insert is missing the `type' field") << endmsg;
721 if (prop->value() == X_("ladspa") || prop->value() == X_("Ladspa")) { /* handle old school sessions */
722 type = ARDOUR::LADSPA;
723 } else if (prop->value() == X_("lv2")) {
725 } else if (prop->value() == X_("vst")) {
728 error << string_compose (_("unknown plugin type %1 in plugin insert state"),
734 prop = node.property ("unique-id");
736 error << _("Plugin has no unique ID field") << endmsg;
740 boost::shared_ptr<Plugin> plugin;
742 plugin = find_plugin (_session, prop->value(), type);
745 error << string_compose(_("Found a reference to a plugin (\"%1\") that is unknown.\n"
746 "Perhaps it was removed or moved since it was last used."), prop->value())
753 if ((prop = node.property ("count")) != 0) {
754 sscanf (prop->value().c_str(), "%u", &count);
757 if (_plugins.size() != count) {
759 _plugins.push_back (plugin);
761 for (uint32_t n=1; n < count; ++n) {
762 _plugins.push_back (plugin_factory (plugin));
766 for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
767 if ((*niter)->name() == plugin->state_node_name()) {
768 for (Plugins::iterator i = _plugins.begin(); i != _plugins.end(); ++i) {
769 (*i)->set_state (**niter);
775 const XMLNode* insert_node = &node;
777 // legacy sessions: search for child IOProcessor node
778 for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
779 if ((*niter)->name() == "IOProcessor") {
780 insert_node = *niter;
785 Processor::set_state (*insert_node);
787 /* look for port automation node */
789 for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
791 if ((*niter)->name() != port_automation_node_name) {
797 XMLNodeConstIterator iter;
802 cnodes = (*niter)->children ("Port");
804 for (iter = cnodes.begin(); iter != cnodes.end(); ++iter) {
808 if ((cprop = child->property("number")) != 0) {
809 port = cprop->value().c_str();
811 warning << _("PluginInsert: Auto: no plugin port number") << endmsg;
815 sscanf (port, "%" PRIu32, &port_id);
817 if (port_id >= _plugins[0]->parameter_count()) {
818 warning << _("PluginInsert: Auto: port id out of range") << endmsg;
822 boost::shared_ptr<AutomationControl> c = boost::dynamic_pointer_cast<AutomationControl>(
823 data().control(Evoral::Parameter(PluginAutomation, 0, port_id), true));
825 if (!child->children().empty()) {
826 c->alist()->set_state (*child->children().front());
828 if ((cprop = child->property("auto")) != 0) {
833 sscanf (cprop->value().c_str(), "0x%x", &x);
834 c->alist()->set_automation_state (AutoState (x));
840 c->alist()->set_automation_state (Off);
851 // The name of the PluginInsert comes from the plugin, nothing else
852 _name = plugin->get_info()->name;
858 PluginInsert::describe_parameter (Evoral::Parameter param)
860 if (param.type() != PluginAutomation)
861 return Automatable::describe_parameter(param);
863 return _plugins[0]->describe_parameter (param);
867 PluginInsert::signal_latency() const
870 return _user_latency;
873 return _plugins[0]->signal_latency ();
877 PluginInsert::type ()
879 boost::shared_ptr<LadspaPlugin> lp;
881 boost::shared_ptr<VSTPlugin> vp;
883 #ifdef HAVE_AUDIOUNITS
884 boost::shared_ptr<AUPlugin> ap;
887 PluginPtr other = plugin ();
889 if ((lp = boost::dynamic_pointer_cast<LadspaPlugin> (other)) != 0) {
890 return ARDOUR::LADSPA;
892 } else if ((vp = boost::dynamic_pointer_cast<VSTPlugin> (other)) != 0) {
895 #ifdef HAVE_AUDIOUNITS
896 } else if ((ap = boost::dynamic_pointer_cast<AUPlugin> (other)) != 0) {
897 return ARDOUR::AudioUnit;
901 return (ARDOUR::PluginType) 0;
905 PluginInsert::PluginControl::PluginControl (PluginInsert* p, const Evoral::Parameter ¶m, boost::shared_ptr<AutomationList> list)
906 : AutomationControl (p->session(), param, list, p->describe_parameter(param))
909 Plugin::ParameterDescriptor desc;
910 p->plugin(0)->get_parameter_descriptor (param.id(), desc);
911 _logarithmic = desc.logarithmic;
912 _toggled = desc.toggled;
916 PluginInsert::PluginControl::set_value (float val)
918 /* FIXME: probably should be taking out some lock here.. */
928 /*const float range = _list->get_max_y() - _list->get_min_y();
929 const float lower = _list->get_min_y();
932 val = lower + (range * val);
934 float log_lower = 0.0f;
936 log_lower = log(lower);
939 val = exp(log_lower + log(range) * val);
944 for (Plugins::iterator i = _plugin->_plugins.begin();
945 i != _plugin->_plugins.end(); ++i) {
946 (*i)->set_parameter (_list->parameter().id(), val);
949 boost::shared_ptr<Plugin> iasp = _plugin->_impulseAnalysisPlugin.lock();
951 iasp->set_parameter (_list->parameter().id(), val);
954 AutomationControl::set_value(val);
958 PluginInsert::PluginControl::get_value (void) const
960 /* FIXME: probably should be taking out some lock here.. */
962 float val = _plugin->get_parameter (_list->parameter());
976 return ((val - lower) / range);
980 boost::shared_ptr<Plugin>
981 PluginInsert::get_impulse_analysis_plugin()
983 boost::shared_ptr<Plugin> ret;
984 if (_impulseAnalysisPlugin.expired()) {
985 ret = plugin_factory(_plugins[0]);
986 _impulseAnalysisPlugin = ret;
988 ret = _impulseAnalysisPlugin.lock();
995 PluginInsert::collect_signal_for_analysis(nframes_t nframes)
997 // called from outside the audio thread, so this should be safe
998 // only do audio as analysis is (currently) only for audio plugins
999 _signal_analysis_inputs.ensure_buffers( DataType::AUDIO, input_streams().n_audio(), nframes);
1000 _signal_analysis_outputs.ensure_buffers( DataType::AUDIO, output_streams().n_audio(), nframes);
1002 _signal_analysis_collected_nframes = 0;
1003 _signal_analysis_collect_nframes_max = nframes;