From 38c5939e4c4398706297d4925bf98d0069a926b7 Mon Sep 17 00:00:00 2001 From: Grygorii Zharun Date: Thu, 15 May 2014 03:51:10 -0500 Subject: [PATCH] [Summary] Fixed tracks i/o reconnectio issue [Details] Tracks record enabling influented tracks order in processing list. This processing list was used to connect/reconnect tracks i/o, which appears to be misdesing. Fixed by creating a list sorted by track remoted id which reflacts it's position. [Revieved by] Conceptualy discussed with Paul Davis [git-p4: depot-paths = "//Abdaw/dev_main/tracks/": change = 460733] --- libs/ardour/session.cc | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index f183694ad7..1a1d33ca29 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -106,6 +106,13 @@ using namespace std; using namespace ARDOUR; using namespace PBD; +namespace { + bool compare_roots_by_remote_id (const boost::shared_ptr& route1, const boost::shared_ptr& route2) + { + return route1->remote_control_id() < route2->remote_control_id(); + } +} + bool Session::_disable_all_loaded_plugins = false; PBD::Signal1 Session::AudioEngineSetupRequired; @@ -2109,9 +2116,8 @@ Session::reconnect_existing_routes (bool withLock, bool reconnect_master) //ChanCount inputs = ChanCount::ZERO; //ChanCount outputs = ChanCount::ZERO; - resort_routes(); - - boost::shared_ptr existing_routes = routes.reader (); + RouteList existing_routes = *routes.reader (); + existing_routes.sort(compare_roots_by_remote_id); { PBD::Unwinder protect_ignore_changes (_reconnecting_routes_in_progress, true); @@ -2124,8 +2130,8 @@ Session::reconnect_existing_routes (bool withLock, bool reconnect_master) uint32_t input_n = 0; uint32_t output_n = 0; - RouteList::iterator rIter = existing_routes->begin(); - for (; rIter != existing_routes->end(); ++rIter) { + RouteList::iterator rIter = existing_routes.begin(); + for (; rIter != existing_routes.end(); ++rIter) { if (*rIter == _master_out || *rIter == _monitor_out) { continue;