mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-15 19:16:40 +01:00
fix route ordering (and related possible crash on re-order)
This commit is contained in:
parent
2ca06335f7
commit
94a57e64f6
2 changed files with 46 additions and 0 deletions
|
|
@ -706,6 +706,9 @@ Mixer_UI::sync_presentation_info_from_treeview ()
|
|||
bool change = false;
|
||||
uint32_t order = 0;
|
||||
|
||||
OrderingKeys sorted;
|
||||
const size_t cmp_max = rows.size ();
|
||||
|
||||
// special case master if it's got PI order 0 lets keep it there
|
||||
if (_session->master_out() && (_session->master_out()->presentation_info().order() == 0)) {
|
||||
order++;
|
||||
|
|
@ -743,9 +746,23 @@ Mixer_UI::sync_presentation_info_from_treeview ()
|
|||
change = true;
|
||||
}
|
||||
|
||||
sorted.push_back (OrderKeys (order, stripable, cmp_max));
|
||||
|
||||
++order;
|
||||
}
|
||||
|
||||
if (!change) {
|
||||
// VCA (and Mixbus) special cases according to SortByNewDisplayOrder
|
||||
uint32_t n = 0;
|
||||
SortByNewDisplayOrder cmp;
|
||||
sort (sorted.begin(), sorted.end(), cmp);
|
||||
for (OrderingKeys::iterator sr = sorted.begin(); sr != sorted.end(); ++sr, ++n) {
|
||||
if (sr->old_display_order != n) {
|
||||
change = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (change) {
|
||||
DEBUG_TRACE (DEBUG::OrderKeys, "... notify PI change from mixer GUI\n");
|
||||
_session->notify_presentation_info_change ();
|
||||
|
|
@ -1487,6 +1504,7 @@ Mixer_UI::initial_track_display ()
|
|||
}
|
||||
|
||||
redisplay_track_list ();
|
||||
sync_treeview_from_presentation_info ();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue