Display VCAs at the end of the Track/Bus list

This commit is contained in:
Robin Gareus 2016-12-22 01:38:55 +01:00
parent 7f88207b43
commit 851cdf26c9
3 changed files with 23 additions and 5 deletions

View File

@ -1094,11 +1094,12 @@ EditorRoutes::sync_treeview_from_presentation_info ()
}
OrderingKeys sorted;
const size_t cmp_max = rows.size ();
for (TreeModel::Children::iterator ri = rows.begin(); ri != rows.end(); ++ri, ++old_order) {
boost::shared_ptr<Stripable> stripable = (*ri)[_columns.stripable];
/* use global order */
sorted.push_back (OrderKeys (old_order, stripable->presentation_info().order()));
sorted.push_back (OrderKeys (old_order, stripable, cmp_max));
}
SortByNewDisplayOrder cmp;

View File

@ -784,10 +784,11 @@ Mixer_UI::sync_treeview_from_presentation_info ()
}
OrderingKeys sorted;
const size_t cmp_max = rows.size ();
for (TreeModel::Children::iterator ri = rows.begin(); ri != rows.end(); ++ri, ++old_order) {
boost::shared_ptr<Stripable> stripable = (*ri)[stripable_columns.stripable];
sorted.push_back (OrderKeys (old_order, stripable->presentation_info().order()));
sorted.push_back (OrderKeys (old_order, stripable, cmp_max));
}
SortByNewDisplayOrder cmp;

View File

@ -29,17 +29,33 @@
struct OrderKeys {
uint32_t old_display_order;
uint32_t new_display_order;
uint32_t compare_order;
OrderKeys (uint32_t ok, uint32_t nk)
OrderKeys (uint32_t ok, boost::shared_ptr<ARDOUR::Stripable> s, uint32_t cmp_max)
: old_display_order (ok)
, new_display_order (nk) {}
{
new_display_order = s->presentation_info().order();
compare_order = new_display_order;
if (s->presentation_info().flags () & ARDOUR::PresentationInfo::VCA) {
compare_order += 2 * cmp_max;
}
#ifdef MIXBUS
if (s->presentation_info().flags () & ARDOUR::PresentationInfo::Mixbus || s->mixbus()) {
compare_order += cmp_max;
}
if (s->presentation_info().flags () & ARDOUR::PresentationInfo::MasterOut) {
compare_order += 3 * cmp_max;
}
#endif
}
};
typedef std::vector<OrderKeys> OrderingKeys;
struct SortByNewDisplayOrder {
bool operator() (const OrderKeys& a, const OrderKeys& b) {
return a.new_display_order < b.new_display_order;
return a.compare_order < b.compare_order;
}
};