copy plugin state to all instances when instantiating.
authorRobin Gareus <robin@gareus.org>
Sun, 17 Apr 2016 14:09:25 +0000 (16:09 +0200)
committerRobin Gareus <robin@gareus.org>
Sun, 17 Apr 2016 14:09:25 +0000 (16:09 +0200)
libs/ardour/plugin_insert.cc

index 740fa5250640f5d8ab7f1aaeda49728ed2bc8178..19c661287fba38d1e25dd9a070c90f999eb31a48 100644 (file)
@@ -117,12 +117,14 @@ PluginInsert::set_count (uint32_t num)
                for (uint32_t n = 0; n < diff; ++n) {
                        boost::shared_ptr<Plugin> p = plugin_factory (_plugins[0]);
                        add_plugin (p);
-                       if (active ()) {
-                               p->activate ();
-                       }
 
                        if (require_state) {
-                               /* XXX do something */
+                               XMLNode& state = _plugins[0]->get_state ();
+                               p->set_state (state, Stateful::loading_state_version);
+                       }
+
+                       if (active ()) {
+                               p->activate ();
                        }
                }
                PluginConfigChanged (); /* EMIT SIGNAL */