summaryrefslogtreecommitdiff
path: root/libs/ardour/route.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2008-12-08 18:16:12 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2008-12-08 18:16:12 +0000
commit42db44c1939410aab15eb3c0d08f6026fb58b003 (patch)
treef609009ae5823ae34100c272cb873a35ac8086ba /libs/ardour/route.cc
parent752d8d4b6f2f28fdd3fc810cfd956e4bec5b9ef8 (diff)
merge 3870-3890 from 2.0-ongoing into 3.X (compiles, runs, no other promises
git-svn-id: svn://localhost/ardour2/branches/3.0@4303 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/route.cc')
-rw-r--r--libs/ardour/route.cc32
1 files changed, 22 insertions, 10 deletions
diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc
index 78d4a85e61..5d1a26d3d0 100644
--- a/libs/ardour/route.cc
+++ b/libs/ardour/route.cc
@@ -57,7 +57,7 @@ using namespace ARDOUR;
using namespace PBD;
uint32_t Route::order_key_cnt = 0;
-sigc::signal<void> Route::SyncOrderKeys;
+sigc::signal<void,const char*> Route::SyncOrderKeys;
Route::Route (Session& sess, string name, int input_min, int input_max, int output_min, int output_max, Flag flg, DataType default_type)
: IO (sess, name, input_min, input_max, output_min, output_max, default_type),
@@ -177,20 +177,32 @@ Route::set_order_key (const char* name, long n)
}
void
-Route::sync_order_keys ()
+Route::sync_order_keys (const char* base)
{
- uint32_t key;
-
if (order_keys.empty()) {
return;
}
-
- OrderKeys::iterator x = order_keys.begin();
- key = x->second;
- ++x;
- for (; x != order_keys.end(); ++x) {
- x->second = key;
+ OrderKeys::iterator i;
+ uint32_t key;
+
+ if ((i = order_keys.find (base)) == order_keys.end()) {
+ /* key doesn't exist, use the first existing
+ key (this is done during session initialization)
+ */
+ i = order_keys.begin();
+ key = i->second;
+ ++i;
+ } else {
+ /* key exists - use it and reset all others
+ (actually, itself included)
+ */
+ i = order_keys.begin();
+ key = i->second;
+ }
+
+ for (; i != order_keys.end(); ++i) {
+ i->second = key;
}
}