Update names of sidechains.
[ardour.git] / libs / ardour / route.cc
index 41a14b096e5127835941a95c26f18c88b4ecc14a..70c79a061c023ede61808c540fa0ad3c37f60991 100644 (file)
@@ -849,6 +849,11 @@ Route::add_processor (boost::shared_ptr<Processor> processor, boost::shared_ptr<
                processor->activate ();
        }
 
+       boost::shared_ptr<PluginInsert> pi = boost::dynamic_pointer_cast<PluginInsert> (processor);
+       if (pi) {
+               pi->update_sidechain_name ();
+       }
+
        return 0;
 }
 
@@ -4269,6 +4274,14 @@ Route::set_name (const string& str)
 
        SessionObject::set_name (newname);
 
+       for (uint32_t n = 0 ; ; ++n) {
+               boost::shared_ptr<PluginInsert> pi = boost::static_pointer_cast<PluginInsert> (nth_plugin (n));
+               if (!pi) {
+                       break;
+               }
+               pi->update_sidechain_name ();
+       }
+
        bool ret = (_input->set_name(newname) && _output->set_name(newname));
 
        if (ret) {