diff options
Diffstat (limited to 'libs/ardour/route.cc')
-rw-r--r-- | libs/ardour/route.cc | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index 4541783cf1..35c456622c 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -2654,7 +2654,7 @@ Route::handle_transport_stopped (bool /*abort_ignored*/, bool did_locate, bool c void Route::input_change_handler (IOChange change, void * /*src*/) { - if ((change & ConfigurationChanged)) { + if ((change.type & IOChange::ConfigurationChanged)) { configure_processors (0); _phase_invert.resize (_input->n_ports().n_audio ()); io_changed (); /* EMIT SIGNAL */ @@ -2664,10 +2664,33 @@ Route::input_change_handler (IOChange change, void * /*src*/) void Route::output_change_handler (IOChange change, void * /*src*/) { - if ((change & ConfigurationChanged)) { + if ((change.type & IOChange::ConfigurationChanged)) { /* XXX resize all listeners to match _main_outs? */ + /* auto-connect newly-created outputs */ + if (Config->get_output_auto_connect()) { + + ChanCount start = change.before; + + for (DataType::iterator i = DataType::begin(); i != DataType::end(); ++i) { + if (change.before.get(*i) < change.after.get(*i)) { + /* the existing ChanCounts don't matter for this call as they are only + to do with matching input and output indices, and we are only changing + outputs here. + */ + ChanCount dummy; + + /* only auto-connect the newly-created outputs, not the ones that were + already there + */ + start.set (*i, start.get (*i) + 1); + + _session.auto_connect_route (this, dummy, dummy, false, ChanCount(), change.before); + } + } + } + // configure_processors (0); } } |