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, Placement placement)
62 : Processor (s, plug->name(), placement),
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", PreFader),
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) {
164 return _plugins.front()->output_streams ();
168 out.set_audio (out.n_audio() * _plugins.size());
169 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());
191 PluginInsert::natural_output_streams() const
193 return _plugins[0]->get_info()->n_outputs;
197 PluginInsert::natural_input_streams() const
199 return _plugins[0]->get_info()->n_inputs;
203 PluginInsert::is_generator() const
205 /* XXX more finesse is possible here. VST plugins have a
206 a specific "instrument" flag, for example.
209 return _plugins[0]->get_info()->n_inputs.n_audio() == 0;
213 PluginInsert::set_automatable ()
215 set<Evoral::Parameter> a = _plugins.front()->automatable ();
217 Plugin::ParameterDescriptor desc;
219 for (set<Evoral::Parameter>::iterator i = a.begin(); i != a.end(); ++i) {
220 if (i->type() == PluginAutomation) {
222 _plugins.front()->get_parameter_descriptor(i->id(), desc);
223 Evoral::Parameter param(*i);
224 param.set_range(desc.lower, desc.upper, _plugins.front()->default_value(i->id()));
225 boost::shared_ptr<AutomationList> list(new AutomationList(param));
226 add_control(boost::shared_ptr<AutomationControl>(new PluginControl(this, *i, list)));
232 PluginInsert::parameter_changed (Evoral::Parameter which, float val)
234 if (which.type() != PluginAutomation)
237 vector<boost::shared_ptr<Plugin> >::iterator i = _plugins.begin();
239 /* don't set the first plugin, just all the slaves */
241 if (i != _plugins.end()) {
243 for (; i != _plugins.end(); ++i) {
244 (*i)->set_parameter (which, val);
250 PluginInsert::set_block_size (nframes_t nframes)
252 for (vector<boost::shared_ptr<Plugin> >::iterator i = _plugins.begin(); i != _plugins.end(); ++i) {
253 (*i)->set_block_size (nframes);
258 PluginInsert::activate ()
260 for (vector<boost::shared_ptr<Plugin> >::iterator i = _plugins.begin(); i != _plugins.end(); ++i) {
266 PluginInsert::deactivate ()
268 for (vector<boost::shared_ptr<Plugin> >::iterator i = _plugins.begin(); i != _plugins.end(); ++i) {
274 PluginInsert::connect_and_run (BufferSet& bufs, nframes_t nframes, nframes_t offset, bool with_auto, nframes_t now)
276 // Calculate if, and how many frames we need to collect for analysis
277 nframes_t collect_signal_nframes = (_signal_analysis_collect_nframes_max -
278 _signal_analysis_collected_nframes);
279 if (nframes < collect_signal_nframes) { // we might not get all frames now
280 collect_signal_nframes = nframes;
283 uint32_t in_index = 0;
284 uint32_t out_index = 0;
286 /* Note that we've already required that plugins
287 be able to handle in-place processing.
294 for (Controls::iterator li = data().controls().begin(); li != data().controls().end(); ++li, ++n) {
296 boost::shared_ptr<AutomationControl> c
297 = boost::dynamic_pointer_cast<AutomationControl>(li->second);
299 if (c->parameter().type() == PluginAutomation && c->automation_playback()) {
302 const float val = c->list()->rt_safe_eval (now, valid);
312 if (collect_signal_nframes > 0) {
314 //std::cerr << "collect input, bufs " << bufs.count().n_audio() << " count, " << bufs.available().n_audio() << " available" << std::endl;
315 //std::cerr << " streams " << input_streams().n_audio() << std::endl;
316 //std::cerr << "filling buffer with " << collect_signal_nframes << " frames at " << _signal_analysis_collected_nframes << std::endl;
317 for (uint32_t i = 0; i < input_streams().n_audio(); ++i) {
318 _signal_analysis_input_bufferset.get_audio(i).read_from(
320 collect_signal_nframes,
321 _signal_analysis_collected_nframes); // offset is for target buffer
325 for (vector<boost::shared_ptr<Plugin> >::iterator i = _plugins.begin(); i != _plugins.end(); ++i) {
326 (*i)->connect_and_run (bufs, in_index, out_index, nframes, offset);
329 if (collect_signal_nframes > 0) {
331 //std::cerr << " output, bufs " << bufs.count().n_audio() << " count, " << bufs.available().n_audio() << " available" << std::endl;
332 //std::cerr << " streams " << output_streams().n_audio() << std::endl;
333 for (uint32_t i = 0; i < output_streams().n_audio(); ++i) {
334 _signal_analysis_output_bufferset.get_audio(i).read_from(
336 collect_signal_nframes,
337 _signal_analysis_collected_nframes); // offset is for target buffer
340 _signal_analysis_collected_nframes += collect_signal_nframes;
341 assert(_signal_analysis_collected_nframes <= _signal_analysis_collect_nframes_max);
343 if (_signal_analysis_collected_nframes == _signal_analysis_collect_nframes_max) {
344 _signal_analysis_collect_nframes_max = 0;
345 _signal_analysis_collected_nframes = 0;
347 AnalysisDataGathered(&_signal_analysis_input_bufferset,
348 &_signal_analysis_output_bufferset);
351 /* leave remaining channel buffers alone */
355 PluginInsert::silence (nframes_t nframes, nframes_t offset)
357 uint32_t in_index = 0;
358 uint32_t out_index = 0;
361 for (vector<boost::shared_ptr<Plugin> >::iterator i = _plugins.begin(); i != _plugins.end(); ++i) {
362 (*i)->connect_and_run (_session.get_silent_buffers ((*i)->get_info()->n_inputs), in_index, out_index, nframes, offset);
368 PluginInsert::run_in_place (BufferSet& bufs, nframes_t start_frame, nframes_t end_frame, nframes_t nframes, nframes_t offset)
372 if (_session.transport_rolling()) {
373 automation_run (bufs, nframes, offset);
375 connect_and_run (bufs, nframes, offset, false);
379 /* FIXME: type, audio only */
381 uint32_t in = _plugins[0]->get_info()->n_inputs.n_audio();
382 uint32_t out = _plugins[0]->get_info()->n_outputs.n_audio();
386 /* not active, but something has make up for any channel count increase */
388 for (uint32_t n = out - in; n < out; ++n) {
389 memcpy (bufs.get_audio(n).data(nframes, offset), bufs.get_audio(in - 1).data(nframes, offset), sizeof (Sample) * nframes);
393 bufs.count().set_audio(out);
398 PluginInsert::set_parameter (Evoral::Parameter param, float val)
400 if (param.type() != PluginAutomation)
403 /* the others will be set from the event triggered by this */
405 _plugins[0]->set_parameter (param.id(), val);
407 boost::shared_ptr<AutomationControl> ac
408 = boost::dynamic_pointer_cast<AutomationControl>(data().control(param));
413 warning << "set_parameter called for nonexistant parameter "
414 << EventTypeMap::instance().to_symbol(param) << endmsg;
417 _session.set_dirty();
421 PluginInsert::get_parameter (Evoral::Parameter param)
423 if (param.type() != PluginAutomation)
427 _plugins[0]->get_parameter (param.id());
431 PluginInsert::automation_run (BufferSet& bufs, nframes_t nframes, nframes_t offset)
433 Evoral::ControlEvent next_event (0, 0.0f);
434 nframes_t now = _session.transport_frame ();
435 nframes_t end = now + nframes;
437 Glib::Mutex::Lock lm (data().control_lock(), Glib::TRY_LOCK);
440 connect_and_run (bufs, nframes, offset, false);
444 if (!data().find_next_event (now, end, next_event)) {
446 /* no events have a time within the relevant range */
448 connect_and_run (bufs, nframes, offset, true, now);
454 nframes_t cnt = min (((nframes_t) ceil (next_event.when) - now), nframes);
456 connect_and_run (bufs, cnt, offset, true, now);
462 if (!data().find_next_event (now, end, next_event)) {
467 /* cleanup anything that is left to do */
470 connect_and_run (bufs, nframes, offset, true, now);
475 PluginInsert::default_parameter_value (const Evoral::Parameter& param)
477 if (param.type() != PluginAutomation)
480 if (_plugins.empty()) {
481 fatal << _("programming error: ") << X_("PluginInsert::default_parameter_value() called with no plugin")
486 return _plugins[0]->default_value (param.id());
489 boost::shared_ptr<Plugin>
490 PluginInsert::plugin_factory (boost::shared_ptr<Plugin> other)
492 boost::shared_ptr<LadspaPlugin> lp;
494 boost::shared_ptr<LV2Plugin> lv2p;
497 boost::shared_ptr<VSTPlugin> vp;
499 #ifdef HAVE_AUDIOUNITS
500 boost::shared_ptr<AUPlugin> ap;
503 if ((lp = boost::dynamic_pointer_cast<LadspaPlugin> (other)) != 0) {
504 return boost::shared_ptr<Plugin> (new LadspaPlugin (*lp));
506 } else if ((lv2p = boost::dynamic_pointer_cast<LV2Plugin> (other)) != 0) {
507 return boost::shared_ptr<Plugin> (new LV2Plugin (*lv2p));
510 } else if ((vp = boost::dynamic_pointer_cast<VSTPlugin> (other)) != 0) {
511 return boost::shared_ptr<Plugin> (new VSTPlugin (*vp));
513 #ifdef HAVE_AUDIOUNITS
514 } else if ((ap = boost::dynamic_pointer_cast<AUPlugin> (other)) != 0) {
515 return boost::shared_ptr<Plugin> (new AUPlugin (*ap));
519 fatal << string_compose (_("programming error: %1"),
520 X_("unknown plugin type in PluginInsert::plugin_factory"))
523 return boost::shared_ptr<Plugin> ((Plugin*) 0);
527 PluginInsert::configure_io (ChanCount in, ChanCount out)
529 if (set_count (count_for_configuration (in, out)) < 0) {
533 /* if we're running replicated plugins, each plugin has
534 the same i/o configuration and we may need to announce how many
535 output streams there are.
537 if we running a single plugin, we need to configure it.
540 if (_plugins.front()->configure_io (in, out) < 0) {
544 // we don't know the analysis window size, so we must work with the
545 // current buffer size here. each request for data fills in these
546 // buffers and the analyser makes sure it gets enough data for the
548 _signal_analysis_input_bufferset.ensure_buffers (in, session().engine().frames_per_cycle());
549 _signal_analysis_input_bufferset.set_count(in);
551 _signal_analysis_output_bufferset.ensure_buffers(out, session().engine().frames_per_cycle());
552 _signal_analysis_output_bufferset.set_count(out);
555 return Processor::configure_io (in, out);
559 PluginInsert::can_support_io_configuration (const ChanCount& in, ChanCount& out) const
561 if (_plugins.front()->reconfigurable_io()) {
562 /* plugin has flexible I/O, so delegate to it */
563 return _plugins.front()->can_support_io_configuration (in, out);
566 ChanCount outputs = _plugins[0]->get_info()->n_outputs;
567 ChanCount inputs = _plugins[0]->get_info()->n_inputs;
569 if ((inputs.n_total() == 0)
570 || (inputs.n_total() == 1 && outputs == inputs)
571 || (inputs.n_total() == 1 && outputs == inputs
572 && ((inputs.n_audio() == 0 && in.n_audio() == 0)
573 || (inputs.n_midi() == 0 && in.n_midi() == 0)))
579 bool can_replicate = true;
581 /* if number of inputs is a factor of the requested input
582 configuration for every type, we can replicate.
584 for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) {
585 if (inputs.get(*t) >= in.get(*t) || (inputs.get(*t) % in.get(*t) != 0)) {
586 can_replicate = false;
591 if (!can_replicate || (in.n_total() % inputs.n_total() != 0)) {
595 if (inputs.n_total() == 0) {
596 /* instrument plugin, always legal, but throws away any existing streams */
598 } else if (inputs.n_total() == 1 && outputs == inputs
599 && ((inputs.n_audio() == 0 && in.n_audio() == 0)
600 || (inputs.n_midi() == 0 && in.n_midi() == 0))) {
601 /* mono, single-typed plugin, replicate as needed to match in */
603 } else if (inputs == in) {
607 /* replicate - note that we've already verified that
608 the replication count is constant across all data types.
610 for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) {
611 out.set (*t, outputs.get(*t) * (in.get(*t) / inputs.get(*t)));
618 /* Number of plugin instances required to support a given channel configuration.
622 PluginInsert::count_for_configuration (ChanCount in, ChanCount out) const
624 if (_plugins.front()->reconfigurable_io()) {
625 /* plugin has flexible I/O, so the answer is always 1 */
626 /* this could change if we ever decide to replicate AU's */
630 // FIXME: take 'out' into consideration
632 ChanCount outputs = _plugins[0]->get_info()->n_outputs;
633 ChanCount inputs = _plugins[0]->get_info()->n_inputs;
635 if (inputs.n_total() == 0) {
636 /* instrument plugin, always legal, but throws away any existing streams */
640 if (inputs.n_total() == 1 && outputs == inputs
641 && ((inputs.n_audio() == 0 && in.n_audio() == 0)
642 || (inputs.n_midi() == 0 && in.n_midi() == 0))) {
643 /* mono plugin, replicate as needed to match in */
652 // assumes in is valid, so we must be replicating
653 if (inputs.n_total() < in.n_total()
654 && (in.n_total() % inputs.n_total() == 0)) {
656 return in.n_total() / inputs.n_total();
664 PluginInsert::get_state(void)
670 PluginInsert::state (bool full)
672 XMLNode& node = Processor::state (full);
674 node.add_property("type", _plugins[0]->state_node_name());
675 node.add_property("unique-id", _plugins[0]->unique_id());
676 node.add_property("count", string_compose("%1", _plugins.size()));
677 node.add_child_nocopy (_plugins[0]->get_state());
679 /* add port automation state */
680 //XMLNode *autonode = new XMLNode(port_automation_node_name);
681 set<Evoral::Parameter> automatable = _plugins[0]->automatable();
683 for (set<Evoral::Parameter>::iterator x = automatable.begin(); x != automatable.end(); ++x) {
685 /*XMLNode* child = new XMLNode("port");
686 snprintf(buf, sizeof(buf), "%" PRIu32, *x);
687 child->add_property("number", string(buf));
689 child->add_child_nocopy (automation_list (*x).state (full));
690 autonode->add_child_nocopy (*child);
692 //autonode->add_child_nocopy (((AutomationList*)data().control(*x)->list().get())->state (full));
695 //node.add_child_nocopy (*autonode);
701 PluginInsert::set_state(const XMLNode& node)
703 XMLNodeList nlist = node.children();
704 XMLNodeIterator niter;
705 XMLPropertyList plist;
706 const XMLProperty *prop;
707 ARDOUR::PluginType type;
709 if ((prop = node.property ("type")) == 0) {
710 error << _("XML node describing insert is missing the `type' field") << endmsg;
714 if (prop->value() == X_("ladspa") || prop->value() == X_("Ladspa")) { /* handle old school sessions */
715 type = ARDOUR::LADSPA;
716 } else if (prop->value() == X_("lv2")) {
718 } else if (prop->value() == X_("vst")) {
721 error << string_compose (_("unknown plugin type %1 in plugin insert state"),
727 prop = node.property ("unique-id");
729 error << _("Plugin has no unique ID field") << endmsg;
733 boost::shared_ptr<Plugin> plugin;
735 plugin = find_plugin (_session, prop->value(), type);
738 error << string_compose(_("Found a reference to a plugin (\"%1\") that is unknown.\n"
739 "Perhaps it was removed or moved since it was last used."), prop->value())
746 if ((prop = node.property ("count")) != 0) {
747 sscanf (prop->value().c_str(), "%u", &count);
750 if (_plugins.size() != count) {
752 _plugins.push_back (plugin);
754 for (uint32_t n=1; n < count; ++n) {
755 _plugins.push_back (plugin_factory (plugin));
759 for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
760 if ((*niter)->name() == plugin->state_node_name()) {
761 for (vector<boost::shared_ptr<Plugin> >::iterator i = _plugins.begin(); i != _plugins.end(); ++i) {
762 (*i)->set_state (**niter);
768 const XMLNode* insert_node = &node;
770 // legacy sessions: search for child IOProcessor node
771 for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
772 if ((*niter)->name() == "IOProcessor") {
773 insert_node = *niter;
778 Processor::set_state (*insert_node);
780 /* look for port automation node */
782 for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
784 if ((*niter)->name() != port_automation_node_name) {
790 XMLNodeConstIterator iter;
795 cnodes = (*niter)->children ("Port");
797 for(iter = cnodes.begin(); iter != cnodes.end(); ++iter){
801 if ((cprop = child->property("number")) != 0) {
802 port = cprop->value().c_str();
804 warning << _("PluginInsert: Auto: no plugin port number") << endmsg;
808 sscanf (port, "%" PRIu32, &port_id);
810 if (port_id >= _plugins[0]->parameter_count()) {
811 warning << _("PluginInsert: Auto: port id out of range") << endmsg;
815 boost::shared_ptr<AutomationControl> c = boost::dynamic_pointer_cast<AutomationControl>(
816 data().control(Evoral::Parameter(PluginAutomation, 0, port_id), true));
818 if (!child->children().empty()) {
819 c->alist()->set_state (*child->children().front());
821 if ((cprop = child->property("auto")) != 0) {
826 sscanf (cprop->value().c_str(), "0x%x", &x);
827 c->alist()->set_automation_state (AutoState (x));
833 c->alist()->set_automation_state (Off);
844 if (niter == nlist.end()) {
845 warning << string_compose(_("XML node describing a port automation is missing the `%1' information"), port_automation_node_name) << endmsg;
848 // The name of the PluginInsert comes from the plugin, nothing else
849 _name = plugin->get_info()->name;
855 PluginInsert::describe_parameter (Evoral::Parameter param)
857 if (param.type() != PluginAutomation)
858 return Automatable::describe_parameter(param);
860 return _plugins[0]->describe_parameter (param);
864 PluginInsert::signal_latency() const
867 return _user_latency;
870 return _plugins[0]->signal_latency ();
874 PluginInsert::type ()
876 boost::shared_ptr<LadspaPlugin> lp;
878 boost::shared_ptr<VSTPlugin> vp;
880 #ifdef HAVE_AUDIOUNITS
881 boost::shared_ptr<AUPlugin> ap;
884 PluginPtr other = plugin ();
886 if ((lp = boost::dynamic_pointer_cast<LadspaPlugin> (other)) != 0) {
887 return ARDOUR::LADSPA;
889 } else if ((vp = boost::dynamic_pointer_cast<VSTPlugin> (other)) != 0) {
892 #ifdef HAVE_AUDIOUNITS
893 } else if ((ap = boost::dynamic_pointer_cast<AUPlugin> (other)) != 0) {
894 return ARDOUR::AudioUnit;
898 return (ARDOUR::PluginType) 0;
902 PluginInsert::PluginControl::PluginControl (PluginInsert* p, const Evoral::Parameter ¶m, boost::shared_ptr<AutomationList> list)
903 : AutomationControl (p->session(), param, list, p->describe_parameter(param))
906 Plugin::ParameterDescriptor desc;
907 p->plugin(0)->get_parameter_descriptor (param.id(), desc);
908 _logarithmic = desc.logarithmic;
909 _toggled = desc.toggled;
913 PluginInsert::PluginControl::set_value (float val)
915 /* FIXME: probably should be taking out some lock here.. */
925 /*const float range = _list->get_max_y() - _list->get_min_y();
926 const float lower = _list->get_min_y();
929 val = lower + (range * val);
931 float log_lower = 0.0f;
933 log_lower = log(lower);
936 val = exp(log_lower + log(range) * val);
941 for (vector<boost::shared_ptr<Plugin> >::iterator i = _plugin->_plugins.begin();
942 i != _plugin->_plugins.end(); ++i) {
943 (*i)->set_parameter (_list->parameter().id(), val);
946 boost::shared_ptr<Plugin> iasp = _plugin->_impulseAnalysisPlugin.lock();
948 iasp->set_parameter (_list->parameter().id(), val);
951 AutomationControl::set_value(val);
955 PluginInsert::PluginControl::get_value (void) const
957 /* FIXME: probably should be taking out some lock here.. */
959 float val = _plugin->get_parameter (_list->parameter());
973 return ((val - lower) / range);
977 boost::shared_ptr<Plugin>
978 PluginInsert::get_impulse_analysis_plugin()
980 boost::shared_ptr<Plugin> ret;
981 if (_impulseAnalysisPlugin.expired()) {
982 ret = plugin_factory(_plugins[0]);
983 _impulseAnalysisPlugin = ret;
985 ret = _impulseAnalysisPlugin.lock();