Trim function that is only used once.
authorCarl Hetherington <carl@carlh.net>
Wed, 23 Nov 2011 19:29:48 +0000 (19:29 +0000)
committerCarl Hetherington <carl@carlh.net>
Wed, 23 Nov 2011 19:29:48 +0000 (19:29 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@10804 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/ardour/plugin_insert.h
libs/ardour/plugin_insert.cc

index 0e530c5d8e17ace54e8b9312304e2770b1cab873..b7a89b663ffe5e355e44d4aa08e491112aeb90df 100644 (file)
@@ -186,7 +186,6 @@ class PluginInsert : public Processor
        void set_control_ids (const XMLNode&, int version);
 
        boost::shared_ptr<Plugin> plugin_factory (boost::shared_ptr<Plugin>);
-       void add_plugin_with_activation (boost::shared_ptr<Plugin>);
        void add_plugin (boost::shared_ptr<Plugin>);
 };
 
index aae9278e93e7982417ca8621a08d18c20c8f3cb5..b7c338aa205f11b4c91ab5c394b43e7da493bf6c 100644 (file)
@@ -94,7 +94,11 @@ PluginInsert::set_count (uint32_t num)
                uint32_t diff = num - _plugins.size();
 
                for (uint32_t n = 0; n < diff; ++n) {
-                       add_plugin_with_activation (plugin_factory (_plugins[0]));
+                       boost::shared_ptr<Plugin> p = plugin_factory (_plugins[0]);
+                       add_plugin (p);
+                       if (active ()) {
+                               p->activate ();
+                       }
 
                        if (require_state) {
                                /* XXX do something */
@@ -1272,17 +1276,6 @@ PluginInsert::collect_signal_for_analysis (framecnt_t nframes)
        _signal_analysis_collect_nframes_max = nframes;
 }
 
-/** Add a plugin to our list and activate it if we have already been activated */
-void
-PluginInsert::add_plugin_with_activation (boost::shared_ptr<Plugin> plugin)
-{
-       plugin->set_insert_info (this);
-       _plugins.push_back (plugin);
-       if (active()) {
-               plugin->activate ();
-       }
-}
-
 /** Add a plugin to our list */
 void
 PluginInsert::add_plugin (boost::shared_ptr<Plugin> plugin)