diff options
author | Johannes Mueller <github@johannes-mueller.org> | 2018-10-27 21:36:21 +0200 |
---|---|---|
committer | Johannes Mueller <github@johannes-mueller.org> | 2018-11-01 18:53:27 +0100 |
commit | 732fd75f9ba8ddf369088fb5b9e4a91d17160e00 (patch) | |
tree | c944449a362d44294775c81e1fdf3c6dd98b8830 /libs/ardour/plugin_insert.cc | |
parent | 9a01ef35e71fb9885f08a43c9ebaf729ddb071e3 (diff) |
Update names of sidechains.
When a PluginInsert is created it does not have an owner right away. That's why
a we need to set the sidechains name once the owner is known, in order to
include owner's name into the name.
Furthermore we need to follow renames of the owner.
Diffstat (limited to 'libs/ardour/plugin_insert.cc')
-rw-r--r-- | libs/ardour/plugin_insert.cc | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/libs/ardour/plugin_insert.cc b/libs/ardour/plugin_insert.cc index d5056e7259..4fc97fb0c8 100644 --- a/libs/ardour/plugin_insert.cc +++ b/libs/ardour/plugin_insert.cc @@ -206,10 +206,12 @@ PluginInsert::add_sidechain (uint32_t n_audio, uint32_t n_midi) return false; } std::ostringstream n; - if (n_audio > 0 || n_midi > 0) { - n << "Sidechain " << Session::next_name_id (); - } else { + if (n_audio == 0 && n_midi == 0) { n << "TO BE RESET FROM XML"; + } else if (owner()) { + n << "SC " << owner()->name() << "/" << name() << " " << Session::next_name_id (); + } else { + n << "tobeRenamed"; } SideChain *sc = new SideChain (_session, n.str ()); _sidechain = boost::shared_ptr<SideChain> (sc); @@ -238,6 +240,25 @@ PluginInsert::del_sidechain () } void +PluginInsert::update_sidechain_name () +{ + if (!_sidechain) { + return; + } + + std::ostringstream n; + + n << "SC "; + if (owner()) { + n << owner()->name() << "/"; + } + + n << name() << " " << Session::next_name_id (); + + _sidechain->set_name (n.str()); +} + +void PluginInsert::control_list_automation_state_changed (Evoral::Parameter which, AutoState s) { if (which.type() != PluginAutomation) |