diff options
author | Robin Gareus <robin@gareus.org> | 2016-04-15 17:57:40 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2016-04-15 17:57:40 +0200 |
commit | 424cacfbc83516d9e935bd93135e58b34dcfc002 (patch) | |
tree | c106cbc68fbb6e26b07e8c8e8608385b60f19cce /libs/ardour/route.cc | |
parent | 6f4ccfcd3b8ea971170b339fa93d501680cf44b3 (diff) |
variable plugin port config.
* extend plugin API (query IO ports)
* collect possible variable plugin configurations (AU, Lua)
* prepare semi-automatic configuration (presets: mono, stereo, N)
Diffstat (limited to 'libs/ardour/route.cc')
-rw-r--r-- | libs/ardour/route.cc | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index 51fc33a395..7ef2a62a24 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -2506,6 +2506,45 @@ Route::add_remove_sidechain (boost::shared_ptr<Processor> proc, bool add) } bool +Route::plugin_preset_output (boost::shared_ptr<Processor> proc, ChanCount outs) +{ + boost::shared_ptr<PluginInsert> pi; + if ((pi = boost::dynamic_pointer_cast<PluginInsert>(proc)) == 0) { + return false; + } + + { + Glib::Threads::RWLock::ReaderLock lm (_processor_lock); + ProcessorList::iterator i = find (_processors.begin(), _processors.end(), proc); + if (i == _processors.end ()) { + return false; + } + } + + { + Glib::Threads::Mutex::Lock lx (AudioEngine::instance()->process_lock ()); + Glib::Threads::RWLock::WriterLock lm (_processor_lock); + + const ChanCount& old (pi->preset_out ()); + if (!pi->set_preset_out (outs)) { + return true; // no change, OK + } + + list<pair<ChanCount, ChanCount> > c = try_configure_processors_unlocked (n_inputs (), 0); + if (c.empty()) { + /* not possible */ + pi->set_preset_out (old); + return false; + } + configure_processors_unlocked (0); + } + + processors_changed (RouteProcessorChange ()); /* EMIT SIGNAL */ + _session.set_dirty (); + return true; +} + +bool Route::reset_plugin_insert (boost::shared_ptr<Processor> proc) { ChanCount unused; |