make all TimeAxisView derived types return PresentationInfo for sorting

This commit is contained in:
Paul Davis 2016-06-02 08:54:33 -04:00
parent 050035e787
commit eee83c25a9
8 changed files with 32 additions and 20 deletions

View file

@ -527,22 +527,7 @@ Drag::add_midi_region (MidiTimeAxisView* view, bool commit)
struct PresentationInfoTimeAxisViewSorter {
bool operator() (TimeAxisView* a, TimeAxisView* b) {
RouteTimeAxisView* ra = dynamic_cast<RouteTimeAxisView*> (a);
RouteTimeAxisView* rb = dynamic_cast<RouteTimeAxisView*> (b);
/* anything not a route goes at the end */
if (!ra && rb) {
return false;
}
if (!rb && ra) {
return true;
}
if (!ra && !rb) {
/* XXXX pointer comparison. Should use
presentation_info in a time axis view
*/
return a < b;
}
return ra->route()->presentation_info () < rb->route()->presentation_info();
return a->presentation_info() < b->presentation_info();
}
};