make all TimeAxisView derived types return PresentationInfo for sorting
This commit is contained in:
parent
050035e787
commit
eee83c25a9
|
@ -1038,3 +1038,9 @@ AutomationTimeAxisView::cut_copy_clear_one (AutomationLine& line, Selection& sel
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
PresentationInfo const &
|
||||
AutomationTimeAxisView::presentation_info () const
|
||||
{
|
||||
return _route->presentation_info();
|
||||
}
|
||||
|
|
|
@ -73,6 +73,8 @@ class AutomationTimeAxisView : public TimeAxisView {
|
|||
void set_samples_per_pixel (double);
|
||||
std::string name() const { return _name; }
|
||||
|
||||
ARDOUR::PresentationInfo const & presentation_info () const;
|
||||
|
||||
void add_automation_event (GdkEvent *, framepos_t, double, bool with_guard_points);
|
||||
|
||||
void clear_lines ();
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -2924,3 +2924,9 @@ RouteTimeAxisView::remove_child (boost::shared_ptr<TimeAxisView> c)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
PresentationInfo const &
|
||||
RouteTimeAxisView::presentation_info () const
|
||||
{
|
||||
return _route->presentation_info();
|
||||
}
|
||||
|
|
|
@ -75,16 +75,18 @@ class ItemCounts;
|
|||
class RouteTimeAxisView : public RouteUI, public TimeAxisView
|
||||
{
|
||||
public:
|
||||
RouteTimeAxisView (PublicEditor&, ARDOUR::Session*, ArdourCanvas::Canvas& canvas);
|
||||
virtual ~RouteTimeAxisView ();
|
||||
RouteTimeAxisView (PublicEditor&, ARDOUR::Session*, ArdourCanvas::Canvas& canvas);
|
||||
virtual ~RouteTimeAxisView ();
|
||||
|
||||
void set_route (boost::shared_ptr<ARDOUR::Route>);
|
||||
|
||||
ARDOUR::PresentationInfo const & presentation_info () const;
|
||||
|
||||
void show_selection (TimeSelection&);
|
||||
void set_button_names ();
|
||||
|
||||
void set_samples_per_pixel (double);
|
||||
void set_height (uint32_t h, TrackHeightMode m = OnlySelf);
|
||||
void set_height (uint32_t h, TrackHeightMode m = OnlySelf);
|
||||
void show_timestretch (framepos_t start, framepos_t end, int layers, int layer);
|
||||
void hide_timestretch ();
|
||||
void selection_click (GdkEventButton*);
|
||||
|
@ -333,4 +335,3 @@ private:
|
|||
};
|
||||
|
||||
#endif /* __ardour_route_time_axis_h__ */
|
||||
|
||||
|
|
|
@ -39,7 +39,9 @@
|
|||
#include "pbd/signals.h"
|
||||
|
||||
#include "ardour/types.h"
|
||||
#include "ardour/presentation_info.h"
|
||||
#include "ardour/region.h"
|
||||
|
||||
#include "evoral/Parameter.hpp"
|
||||
|
||||
#include "canvas/line.h"
|
||||
|
@ -102,6 +104,8 @@ class TimeAxisView : public virtual AxisView
|
|||
|
||||
static void setup_sizes ();
|
||||
|
||||
virtual ARDOUR::PresentationInfo const & presentation_info () const = 0;
|
||||
|
||||
/** @return index of this TimeAxisView within its parent */
|
||||
int order () const { return _order; }
|
||||
|
||||
|
|
|
@ -274,3 +274,9 @@ VCATimeAxisView::drop_release (GdkEventButton*)
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
PresentationInfo const &
|
||||
VCATimeAxisView::presentation_info () const
|
||||
{
|
||||
return _vca->presentation_info();
|
||||
}
|
||||
|
|
|
@ -39,6 +39,8 @@ class VCATimeAxisView : public TimeAxisView
|
|||
VCATimeAxisView (PublicEditor&, ARDOUR::Session*, ArdourCanvas::Canvas& canvas);
|
||||
virtual ~VCATimeAxisView ();
|
||||
|
||||
ARDOUR::PresentationInfo const & presentation_info () const;
|
||||
|
||||
void set_vca (boost::shared_ptr<ARDOUR::VCA>);
|
||||
boost::shared_ptr<ARDOUR::VCA> vca() const { return _vca; }
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user