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.
21 #include "libardour-config.h"
26 #include <sigc++/bind.h>
28 #include "pbd/failed_constructor.h"
29 #include "pbd/xml++.h"
31 #include "ardour/audio_buffer.h"
32 #include "ardour/automation_list.h"
33 #include "ardour/buffer_set.h"
34 #include "ardour/event_type_map.h"
35 #include "ardour/ladspa_plugin.h"
36 #include "ardour/plugin.h"
37 #include "ardour/plugin_insert.h"
38 #include "ardour/port.h"
39 #include "ardour/route.h"
42 #include "ardour/lv2_plugin.h"
46 #include "ardour/vst_plugin.h"
49 #ifdef HAVE_AUDIOUNITS
50 #include "ardour/audio_unit.h"
53 #include "ardour/audioengine.h"
54 #include "ardour/session.h"
55 #include "ardour/types.h"
60 using namespace ARDOUR;
63 const string PluginInsert::port_automation_node_name = "PortAutomation";
65 PluginInsert::PluginInsert (Session& s, boost::shared_ptr<Plugin> plug)
66 : Processor (s, plug->name())
67 , _signal_analysis_collected_nframes(0)
68 , _signal_analysis_collect_nframes_max(0)
70 /* the first is the master */
72 _plugins.push_back (plug);
77 Glib::Mutex::Lock em (_session.engine().process_lock());
78 IO::PortCountChanged (max(input_streams(), output_streams()));
81 ProcessorCreated (this); /* EMIT SIGNAL */
84 PluginInsert::PluginInsert (Session& s, const XMLNode& node)
85 : Processor (s, "unnamed plugin insert"),
86 _signal_analysis_collected_nframes(0),
87 _signal_analysis_collect_nframes_max(0)
89 if (set_state (node)) {
90 throw failed_constructor();
93 // XXX: This would dump all automation, which has already been loaded by
94 // Processor. But this could also have been related to the Parameter change..
95 // will look into this later.
99 Glib::Mutex::Lock em (_session.engine().process_lock());
100 IO::PortCountChanged (max(input_streams(), output_streams()));
105 PluginInsert::set_count (uint32_t num)
107 bool require_state = !_plugins.empty();
109 /* this is a bad idea.... we shouldn't do this while active.
110 only a route holding their redirect_lock should be calling this
115 } else if (num > _plugins.size()) {
116 uint32_t diff = num - _plugins.size();
118 for (uint32_t n = 0; n < diff; ++n) {
119 _plugins.push_back (plugin_factory (_plugins[0]));
122 /* XXX do something */
126 } else if (num < _plugins.size()) {
127 uint32_t diff = _plugins.size() - num;
128 for (uint32_t n= 0; n < diff; ++n) {
137 PluginInsert::init ()
142 PluginInsert::~PluginInsert ()
144 GoingAway (); /* EMIT SIGNAL */
148 PluginInsert::auto_state_changed (Evoral::Parameter which)
150 if (which.type() != PluginAutomation)
153 boost::shared_ptr<AutomationControl> c
154 = boost::dynamic_pointer_cast<AutomationControl>(data().control (which));
156 if (c && ((AutomationList*)c->list().get())->automation_state() != Off) {
157 _plugins[0]->set_parameter (which.id(), c->list()->eval (_session.transport_frame()));
162 PluginInsert::output_streams() const
164 ChanCount out = _plugins.front()->get_info()->n_outputs;
166 if (out == ChanCount::INFINITE) {
167 return _plugins.front()->output_streams ();
169 out.set_audio (out.n_audio() * _plugins.size());
170 out.set_midi (out.n_midi() * _plugins.size());
176 PluginInsert::input_streams() const
178 ChanCount in = _plugins[0]->get_info()->n_inputs;
180 if (in == ChanCount::INFINITE) {
181 return _plugins[0]->input_streams ();
183 in.set_audio (in.n_audio() * _plugins.size());
184 in.set_midi (in.n_midi() * _plugins.size());
190 PluginInsert::natural_output_streams() const
192 return _plugins[0]->get_info()->n_outputs;
196 PluginInsert::natural_input_streams() const
198 return _plugins[0]->get_info()->n_inputs;
202 PluginInsert::is_generator() const
204 /* XXX more finesse is possible here. VST plugins have a
205 a specific "instrument" flag, for example.
208 return _plugins[0]->get_info()->n_inputs.n_audio() == 0;
212 PluginInsert::set_automatable ()
214 set<Evoral::Parameter> a = _plugins.front()->automatable ();
216 Plugin::ParameterDescriptor desc;
218 for (set<Evoral::Parameter>::iterator i = a.begin(); i != a.end(); ++i) {
219 if (i->type() == PluginAutomation) {
221 _plugins.front()->get_parameter_descriptor(i->id(), desc);
222 Evoral::Parameter param(*i);
223 param.set_range(desc.lower, desc.upper, _plugins.front()->default_value(i->id()));
224 boost::shared_ptr<AutomationList> list(new AutomationList(param));
225 add_control(boost::shared_ptr<AutomationControl>(new PluginControl(this, *i, list)));
231 PluginInsert::parameter_changed (Evoral::Parameter which, float val)
233 if (which.type() != PluginAutomation)
236 Plugins::iterator i = _plugins.begin();
238 /* don't set the first plugin, just all the slaves */
240 if (i != _plugins.end()) {
242 for (; i != _plugins.end(); ++i) {
243 (*i)->set_parameter (which, val);
249 PluginInsert::set_block_size (nframes_t nframes)
251 for (Plugins::iterator i = _plugins.begin(); i != _plugins.end(); ++i) {
252 (*i)->set_block_size (nframes);
257 PluginInsert::activate ()
259 for (Plugins::iterator i = _plugins.begin(); i != _plugins.end(); ++i) {
265 PluginInsert::deactivate ()
267 for (Plugins::iterator i = _plugins.begin(); i != _plugins.end(); ++i) {
273 PluginInsert::connect_and_run (BufferSet& bufs, nframes_t nframes, nframes_t offset, bool with_auto, nframes_t now)
275 // Calculate if, and how many frames we need to collect for analysis
276 nframes_t collect_signal_nframes = (_signal_analysis_collect_nframes_max -
277 _signal_analysis_collected_nframes);
278 if (nframes < collect_signal_nframes) { // we might not get all frames now
279 collect_signal_nframes = nframes;
282 ChanMapping in_map(input_streams());
283 ChanMapping out_map(output_streams());
285 /* Note that we've already required that plugins
286 be able to handle in-place processing.
293 for (Controls::iterator li = data().controls().begin(); li != data().controls().end(); ++li, ++n) {
295 boost::shared_ptr<AutomationControl> c
296 = boost::dynamic_pointer_cast<AutomationControl>(li->second);
298 if (c->parameter().type() == PluginAutomation && c->automation_playback()) {
301 const float val = c->list()->rt_safe_eval (now, valid);
311 if (collect_signal_nframes > 0) {
313 //std::cerr << "collect input, bufs " << bufs.count().n_audio() << " count, " << bufs.available().n_audio() << " available" << std::endl;
314 //std::cerr << " streams " << input_streams().n_audio() << std::endl;
315 //std::cerr << "filling buffer with " << collect_signal_nframes << " frames at " << _signal_analysis_collected_nframes << std::endl;
317 _signal_analysis_inputs.set_count(input_streams());
319 for (uint32_t i = 0; i < input_streams().n_audio(); ++i) {
320 _signal_analysis_inputs.get_audio(i).read_from(
322 collect_signal_nframes,
323 _signal_analysis_collected_nframes); // offset is for target buffer
328 for (Plugins::iterator i = _plugins.begin(); i != _plugins.end(); ++i) {
329 (*i)->connect_and_run(bufs, in_map, out_map, nframes, offset);
330 for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) {
331 in_map.offset_to(*t, natural_input_streams().get(*t));
332 out_map.offset_to(*t, natural_output_streams().get(*t));
336 if (collect_signal_nframes > 0) {
338 //std::cerr << " output, bufs " << bufs.count().n_audio() << " count, " << bufs.available().n_audio() << " available" << std::endl;
339 //std::cerr << " streams " << output_streams().n_audio() << std::endl;
341 _signal_analysis_outputs.set_count(output_streams());
343 for (uint32_t i = 0; i < output_streams().n_audio(); ++i) {
344 _signal_analysis_outputs.get_audio(i).read_from(
346 collect_signal_nframes,
347 _signal_analysis_collected_nframes); // offset is for target buffer
350 _signal_analysis_collected_nframes += collect_signal_nframes;
351 assert(_signal_analysis_collected_nframes <= _signal_analysis_collect_nframes_max);
353 if (_signal_analysis_collected_nframes == _signal_analysis_collect_nframes_max) {
354 _signal_analysis_collect_nframes_max = 0;
355 _signal_analysis_collected_nframes = 0;
357 AnalysisDataGathered(&_signal_analysis_inputs,
358 &_signal_analysis_outputs);
361 /* leave remaining channel buffers alone */
365 PluginInsert::silence (nframes_t nframes)
367 ChanMapping in_map(input_streams());
368 ChanMapping out_map(output_streams());
371 for (Plugins::iterator i = _plugins.begin(); i != _plugins.end(); ++i) {
372 (*i)->connect_and_run (_session.get_silent_buffers ((*i)->get_info()->n_inputs), in_map, out_map, nframes, 0);
378 PluginInsert::run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes)
382 if (_session.transport_rolling()) {
383 automation_run (bufs, nframes);
385 connect_and_run (bufs, nframes, 0, false);
389 /* FIXME: type, audio only */
391 uint32_t in = _plugins[0]->get_info()->n_inputs.n_audio();
392 uint32_t out = _plugins[0]->get_info()->n_outputs.n_audio();
396 /* not active, but something has make up for any channel count increase */
398 for (uint32_t n = out - in; n < out; ++n) {
399 memcpy (bufs.get_audio(n).data(), bufs.get_audio(in - 1).data(), sizeof (Sample) * nframes);
403 bufs.count().set_audio(out);
408 PluginInsert::set_parameter (Evoral::Parameter param, float val)
410 if (param.type() != PluginAutomation)
413 /* the others will be set from the event triggered by this */
415 _plugins[0]->set_parameter (param.id(), val);
417 boost::shared_ptr<AutomationControl> ac
418 = boost::dynamic_pointer_cast<AutomationControl>(data().control(param));
423 warning << "set_parameter called for nonexistant parameter "
424 << EventTypeMap::instance().to_symbol(param) << endmsg;
427 _session.set_dirty();
431 PluginInsert::get_parameter (Evoral::Parameter param)
433 if (param.type() != PluginAutomation)
437 _plugins[0]->get_parameter (param.id());
441 PluginInsert::automation_run (BufferSet& bufs, nframes_t nframes)
443 Evoral::ControlEvent next_event (0, 0.0f);
444 nframes_t now = _session.transport_frame ();
445 nframes_t end = now + nframes;
446 nframes_t offset = 0;
448 Glib::Mutex::Lock lm (data().control_lock(), Glib::TRY_LOCK);
451 connect_and_run (bufs, nframes, offset, false);
455 if (!data().find_next_event (now, end, next_event)) {
457 /* no events have a time within the relevant range */
459 connect_and_run (bufs, nframes, offset, true, now);
465 nframes_t cnt = min (((nframes_t) ceil (next_event.when) - now), nframes);
467 connect_and_run (bufs, cnt, offset, true, now);
473 if (!data().find_next_event (now, end, next_event)) {
478 /* cleanup anything that is left to do */
481 connect_and_run (bufs, nframes, offset, true, now);
486 PluginInsert::default_parameter_value (const Evoral::Parameter& param)
488 if (param.type() != PluginAutomation)
491 if (_plugins.empty()) {
492 fatal << _("programming error: ") << X_("PluginInsert::default_parameter_value() called with no plugin")
497 return _plugins[0]->default_value (param.id());
500 boost::shared_ptr<Plugin>
501 PluginInsert::plugin_factory (boost::shared_ptr<Plugin> other)
503 boost::shared_ptr<LadspaPlugin> lp;
505 boost::shared_ptr<LV2Plugin> lv2p;
508 boost::shared_ptr<VSTPlugin> vp;
510 #ifdef HAVE_AUDIOUNITS
511 boost::shared_ptr<AUPlugin> ap;
514 if ((lp = boost::dynamic_pointer_cast<LadspaPlugin> (other)) != 0) {
515 return boost::shared_ptr<Plugin> (new LadspaPlugin (*lp));
517 } else if ((lv2p = boost::dynamic_pointer_cast<LV2Plugin> (other)) != 0) {
518 return boost::shared_ptr<Plugin> (new LV2Plugin (*lv2p));
521 } else if ((vp = boost::dynamic_pointer_cast<VSTPlugin> (other)) != 0) {
522 return boost::shared_ptr<Plugin> (new VSTPlugin (*vp));
524 #ifdef HAVE_AUDIOUNITS
525 } else if ((ap = boost::dynamic_pointer_cast<AUPlugin> (other)) != 0) {
526 return boost::shared_ptr<Plugin> (new AUPlugin (*ap));
530 fatal << string_compose (_("programming error: %1"),
531 X_("unknown plugin type in PluginInsert::plugin_factory"))
534 return boost::shared_ptr<Plugin> ((Plugin*) 0);
538 PluginInsert::configure_io (ChanCount in, ChanCount out)
540 if (set_count (count_for_configuration (in, out)) < 0) {
544 /* if we're running replicated plugins, each plugin has
545 the same i/o configuration and we may need to announce how many
546 output streams there are.
548 if we running a single plugin, we need to configure it.
551 if (_plugins.front()->configure_io (in, out) < 0) {
555 // we don't know the analysis window size, so we must work with the
556 // current buffer size here. each request for data fills in these
557 // buffers and the analyser makes sure it gets enough data for the
559 session().ensure_buffer_set (_signal_analysis_inputs, in);
560 //_signal_analysis_inputs.set_count (in);
562 session().ensure_buffer_set (_signal_analysis_outputs, out);
563 //_signal_analysis_outputs.set_count (out);
565 // std::cerr << "set counts to i" << in.n_audio() << "/o" << out.n_audio() << std::endl;
567 return Processor::configure_io (in, out);
571 PluginInsert::can_support_io_configuration (const ChanCount& in, ChanCount& out) const
573 // Plugin has flexible I/O, so delegate to it
574 if (_plugins.front()->reconfigurable_io()) {
575 return _plugins.front()->can_support_io_configuration (in, out);
578 ChanCount inputs = _plugins[0]->get_info()->n_inputs;
579 ChanCount outputs = _plugins[0]->get_info()->n_outputs;
581 // Plugin inputs match requested inputs exactly
587 // See if replication is possible
588 // We can replicate if there exists a single factor f such that, for every type,
589 // the number of plugin inputs * f = the requested number of inputs
591 bool can_replicate = true;
592 for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) {
593 // No inputs of this type
594 if (inputs.get(*t) == 0 && in.get(*t) == 0) {
597 // Plugin has more inputs than requested, can not replicate
598 } else if (inputs.get(*t) >= in.get(*t)) {
599 can_replicate = false;
602 // Plugin inputs is not a factor of requested inputs, can not replicate
603 } else if (inputs.get(*t) == 0 || in.get(*t) % inputs.get(*t) != 0) {
604 can_replicate = false;
607 // Potential factor not set yet
609 f = in.get(*t) / inputs.get(*t);;
612 // Factor for this type does not match another type, can not replicate
613 if (f != (in.get(*t) / inputs.get(*t))) {
614 can_replicate = false;
620 for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) {
621 out.set (*t, outputs.get(*t) * f);
629 /* Number of plugin instances required to support a given channel configuration.
633 PluginInsert::count_for_configuration (ChanCount in, ChanCount out) const
635 if (_plugins.front()->reconfigurable_io()) {
636 /* plugin has flexible I/O, so the answer is always 1 */
637 /* this could change if we ever decide to replicate AU's */
641 // FIXME: take 'out' into consideration
643 ChanCount outputs = _plugins[0]->get_info()->n_outputs;
644 ChanCount inputs = _plugins[0]->get_info()->n_inputs;
646 if (inputs.n_total() == 0) {
647 /* instrument plugin, always legal, but throws away any existing streams */
651 if (inputs.n_total() == 1 && outputs == inputs
652 && ((inputs.n_audio() == 0 && in.n_audio() == 0)
653 || (inputs.n_midi() == 0 && in.n_midi() == 0))) {
654 /* mono plugin, replicate as needed to match in */
663 // assumes in is valid, so we must be replicating
664 if (inputs.n_total() < in.n_total()
665 && (in.n_total() % inputs.n_total() == 0)) {
667 return in.n_total() / inputs.n_total();
675 PluginInsert::get_state(void)
681 PluginInsert::state (bool full)
683 XMLNode& node = Processor::state (full);
685 node.add_property("type", _plugins[0]->state_node_name());
686 node.add_property("unique-id", _plugins[0]->unique_id());
687 node.add_property("count", string_compose("%1", _plugins.size()));
688 node.add_child_nocopy (_plugins[0]->get_state());
690 /* add port automation state */
691 //XMLNode *autonode = new XMLNode(port_automation_node_name);
692 set<Evoral::Parameter> automatable = _plugins[0]->automatable();
694 for (set<Evoral::Parameter>::iterator x = automatable.begin(); x != automatable.end(); ++x) {
696 /*XMLNode* child = new XMLNode("port");
697 snprintf(buf, sizeof(buf), "%" PRIu32, *x);
698 child->add_property("number", string(buf));
700 child->add_child_nocopy (automation_list (*x).state (full));
701 autonode->add_child_nocopy (*child);
703 //autonode->add_child_nocopy (((AutomationList*)data().control(*x)->list().get())->state (full));
706 //node.add_child_nocopy (*autonode);
712 PluginInsert::set_state(const XMLNode& node)
714 XMLNodeList nlist = node.children();
715 XMLNodeIterator niter;
716 XMLPropertyList plist;
717 const XMLProperty *prop;
718 ARDOUR::PluginType type;
720 if ((prop = node.property ("type")) == 0) {
721 error << _("XML node describing insert is missing the `type' field") << endmsg;
725 if (prop->value() == X_("ladspa") || prop->value() == X_("Ladspa")) { /* handle old school sessions */
726 type = ARDOUR::LADSPA;
727 } else if (prop->value() == X_("lv2")) {
729 } else if (prop->value() == X_("vst")) {
732 error << string_compose (_("unknown plugin type %1 in plugin insert state"),
738 prop = node.property ("unique-id");
740 error << _("Plugin has no unique ID field") << endmsg;
744 boost::shared_ptr<Plugin> plugin;
746 plugin = find_plugin (_session, prop->value(), type);
749 error << string_compose(_("Found a reference to a plugin (\"%1\") that is unknown.\n"
750 "Perhaps it was removed or moved since it was last used."), prop->value())
757 if ((prop = node.property ("count")) != 0) {
758 sscanf (prop->value().c_str(), "%u", &count);
761 if (_plugins.size() != count) {
763 _plugins.push_back (plugin);
765 for (uint32_t n=1; n < count; ++n) {
766 _plugins.push_back (plugin_factory (plugin));
770 for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
771 if ((*niter)->name() == plugin->state_node_name()) {
772 for (Plugins::iterator i = _plugins.begin(); i != _plugins.end(); ++i) {
773 (*i)->set_state (**niter);
779 const XMLNode* insert_node = &node;
781 // legacy sessions: search for child IOProcessor node
782 for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
783 if ((*niter)->name() == "IOProcessor") {
784 insert_node = *niter;
789 Processor::set_state (*insert_node);
791 /* look for port automation node */
793 for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
795 if ((*niter)->name() != port_automation_node_name) {
801 XMLNodeConstIterator iter;
806 cnodes = (*niter)->children ("Port");
808 for (iter = cnodes.begin(); iter != cnodes.end(); ++iter) {
812 if ((cprop = child->property("number")) != 0) {
813 port = cprop->value().c_str();
815 warning << _("PluginInsert: Auto: no plugin port number") << endmsg;
819 sscanf (port, "%" PRIu32, &port_id);
821 if (port_id >= _plugins[0]->parameter_count()) {
822 warning << _("PluginInsert: Auto: port id out of range") << endmsg;
826 boost::shared_ptr<AutomationControl> c = boost::dynamic_pointer_cast<AutomationControl>(
827 data().control(Evoral::Parameter(PluginAutomation, 0, port_id), true));
829 if (!child->children().empty()) {
830 c->alist()->set_state (*child->children().front());
832 if ((cprop = child->property("auto")) != 0) {
837 sscanf (cprop->value().c_str(), "0x%x", &x);
838 c->alist()->set_automation_state (AutoState (x));
844 c->alist()->set_automation_state (Off);
855 // The name of the PluginInsert comes from the plugin, nothing else
856 _name = plugin->get_info()->name;
862 PluginInsert::describe_parameter (Evoral::Parameter param)
864 if (param.type() != PluginAutomation)
865 return Automatable::describe_parameter(param);
867 return _plugins[0]->describe_parameter (param);
871 PluginInsert::signal_latency() const
874 return _user_latency;
877 return _plugins[0]->signal_latency ();
881 PluginInsert::type ()
883 boost::shared_ptr<LadspaPlugin> lp;
885 boost::shared_ptr<VSTPlugin> vp;
887 #ifdef HAVE_AUDIOUNITS
888 boost::shared_ptr<AUPlugin> ap;
891 PluginPtr other = plugin ();
893 if ((lp = boost::dynamic_pointer_cast<LadspaPlugin> (other)) != 0) {
894 return ARDOUR::LADSPA;
896 } else if ((vp = boost::dynamic_pointer_cast<VSTPlugin> (other)) != 0) {
899 #ifdef HAVE_AUDIOUNITS
900 } else if ((ap = boost::dynamic_pointer_cast<AUPlugin> (other)) != 0) {
901 return ARDOUR::AudioUnit;
905 return (ARDOUR::PluginType) 0;
909 PluginInsert::PluginControl::PluginControl (PluginInsert* p, const Evoral::Parameter ¶m, boost::shared_ptr<AutomationList> list)
910 : AutomationControl (p->session(), param, list, p->describe_parameter(param))
913 Plugin::ParameterDescriptor desc;
914 p->plugin(0)->get_parameter_descriptor (param.id(), desc);
915 _logarithmic = desc.logarithmic;
916 _toggled = desc.toggled;
920 PluginInsert::PluginControl::set_value (float val)
922 /* FIXME: probably should be taking out some lock here.. */
932 /*const float range = _list->get_max_y() - _list->get_min_y();
933 const float lower = _list->get_min_y();
936 val = lower + (range * val);
938 float log_lower = 0.0f;
940 log_lower = log(lower);
943 val = exp(log_lower + log(range) * val);
948 for (Plugins::iterator i = _plugin->_plugins.begin();
949 i != _plugin->_plugins.end(); ++i) {
950 (*i)->set_parameter (_list->parameter().id(), val);
953 boost::shared_ptr<Plugin> iasp = _plugin->_impulseAnalysisPlugin.lock();
955 iasp->set_parameter (_list->parameter().id(), val);
958 AutomationControl::set_value(val);
962 PluginInsert::PluginControl::get_value (void) const
964 /* FIXME: probably should be taking out some lock here.. */
966 float val = _plugin->get_parameter (_list->parameter());
980 return ((val - lower) / range);
984 boost::shared_ptr<Plugin>
985 PluginInsert::get_impulse_analysis_plugin()
987 boost::shared_ptr<Plugin> ret;
988 if (_impulseAnalysisPlugin.expired()) {
989 ret = plugin_factory(_plugins[0]);
990 _impulseAnalysisPlugin = ret;
992 ret = _impulseAnalysisPlugin.lock();
999 PluginInsert::collect_signal_for_analysis(nframes_t nframes)
1001 // called from outside the audio thread, so this should be safe
1002 // only do audio as analysis is (currently) only for audio plugins
1003 _signal_analysis_inputs.ensure_buffers( DataType::AUDIO, input_streams().n_audio(), nframes);
1004 _signal_analysis_outputs.ensure_buffers( DataType::AUDIO, output_streams().n_audio(), nframes);
1006 _signal_analysis_collected_nframes = 0;
1007 _signal_analysis_collect_nframes_max = nframes;