diff options
author | Carl Hetherington <carl@carlh.net> | 2012-05-27 20:07:13 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2012-05-27 20:07:13 +0000 |
commit | f722858e43e3f26736254a27f5517019ae372305 (patch) | |
tree | b0fb8a86bb84a1db138b3eabade5ab7e61c9449c /gtk2_ardour | |
parent | d33c0d96fb1a44fe25115ab668495be8c712395e (diff) |
Patch from tophatdave to improve display of timestretch in
stacked layers mode (#4379).
git-svn-id: svn://localhost/ardour2/branches/3.0@12460 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/automation_time_axis.h | 2 | ||||
-rw-r--r-- | gtk2_ardour/editor_drag.cc | 7 | ||||
-rw-r--r-- | gtk2_ardour/route_time_axis.cc | 17 | ||||
-rw-r--r-- | gtk2_ardour/route_time_axis.h | 2 | ||||
-rw-r--r-- | gtk2_ardour/time_axis_view.cc | 4 | ||||
-rw-r--r-- | gtk2_ardour/time_axis_view.h | 2 | ||||
-rw-r--r-- | gtk2_ardour/visual_time_axis.cc | 2 | ||||
-rw-r--r-- | gtk2_ardour/visual_time_axis.h | 2 |
8 files changed, 19 insertions, 19 deletions
diff --git a/gtk2_ardour/automation_time_axis.h b/gtk2_ardour/automation_time_axis.h index d883b189c0..f1a9a8bd57 100644 --- a/gtk2_ardour/automation_time_axis.h +++ b/gtk2_ardour/automation_time_axis.h @@ -86,7 +86,7 @@ class AutomationTimeAxisView : public TimeAxisView { void get_selectables (ARDOUR::framepos_t start, ARDOUR::framepos_t end, double top, double bot, std::list<Selectable *>&); void get_inverted_selectables (Selection&, std::list<Selectable*>& results); - void show_timestretch (framepos_t /*start*/, framepos_t /*end*/) {} + void show_timestretch (framepos_t /*start*/, framepos_t /*end*/, int /*layers*/, int /*layer*/) {} void hide_timestretch () {} /* editing operations */ diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index 97590be1a9..ad8319ffee 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -3245,11 +3245,16 @@ void TimeFXDrag::motion (GdkEvent* event, bool) { RegionView* rv = _primary; + StreamView* cv = rv->get_time_axis_view().view (); + + pair<TimeAxisView*, double> const tv = _editor->trackview_by_y_position (grab_y()); + int layer = tv.first->layer_display() == Overlaid ? 0 : tv.second; + int layers = tv.first->layer_display() == Overlaid ? 1 : cv->layers(); framepos_t const pf = adjusted_current_frame (event); if (pf > rv->region()->position()) { - rv->get_time_axis_view().show_timestretch (rv->region()->position(), pf); + rv->get_time_axis_view().show_timestretch (rv->region()->position(), pf, layers, layer); } show_verbose_cursor_time (pf); diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc index 6b52e64572..d1a97630d5 100644 --- a/gtk2_ardour/route_time_axis.cc +++ b/gtk2_ardour/route_time_axis.cc @@ -757,13 +757,9 @@ RouteTimeAxisView::set_track_mode (TrackMode mode, bool apply_to_selection) } void -RouteTimeAxisView::show_timestretch (framepos_t start, framepos_t end) +RouteTimeAxisView::show_timestretch (framepos_t start, framepos_t end, int layers, int layer) { - double x1; - double x2; - double y2; - - TimeAxisView::show_timestretch (start, end); + TimeAxisView::show_timestretch (start, end, layers, layer); hide_timestretch (); @@ -802,14 +798,13 @@ RouteTimeAxisView::show_timestretch (framepos_t start, framepos_t end) timestretch_rect->show (); timestretch_rect->raise_to_top (); - x1 = start / _editor.get_current_zoom(); - x2 = (end - 1) / _editor.get_current_zoom(); - y2 = current_height() - 2; + double const x1 = start / _editor.get_current_zoom(); + double const x2 = (end - 1) / _editor.get_current_zoom(); timestretch_rect->property_x1() = x1; - timestretch_rect->property_y1() = 1.0; + timestretch_rect->property_y1() = current_height() * (layers - layer - 1) / layers; timestretch_rect->property_x2() = x2; - timestretch_rect->property_y2() = y2; + timestretch_rect->property_y2() = current_height() * (layers - layer) / layers; } void diff --git a/gtk2_ardour/route_time_axis.h b/gtk2_ardour/route_time_axis.h index eb1a212d0e..3cfd8c8774 100644 --- a/gtk2_ardour/route_time_axis.h +++ b/gtk2_ardour/route_time_axis.h @@ -81,7 +81,7 @@ public: void set_samples_per_unit (double); void set_height (uint32_t h); - void show_timestretch (framepos_t start, framepos_t end); + void show_timestretch (framepos_t start, framepos_t end, int layers, int layer); void hide_timestretch (); void selection_click (GdkEventButton*); void set_selected_points (PointSelection&); diff --git a/gtk2_ardour/time_axis_view.cc b/gtk2_ardour/time_axis_view.cc index 229a7065a2..ddf03e968e 100644 --- a/gtk2_ardour/time_axis_view.cc +++ b/gtk2_ardour/time_axis_view.cc @@ -764,10 +764,10 @@ TimeAxisView::set_samples_per_unit (double spu) } void -TimeAxisView::show_timestretch (framepos_t start, framepos_t end) +TimeAxisView::show_timestretch (framepos_t start, framepos_t end, int layers, int layer) { for (Children::iterator i = children.begin(); i != children.end(); ++i) { - (*i)->show_timestretch (start, end); + (*i)->show_timestretch (start, end, layers, layer); } } diff --git a/gtk2_ardour/time_axis_view.h b/gtk2_ardour/time_axis_view.h index ba69b3b154..5966d78ed8 100644 --- a/gtk2_ardour/time_axis_view.h +++ b/gtk2_ardour/time_axis_view.h @@ -157,7 +157,7 @@ class TimeAxisView : public virtual AxisView virtual void show_selection (TimeSelection&); virtual void hide_selection (); virtual void reshow_selection (TimeSelection&); - virtual void show_timestretch (framepos_t start, framepos_t end); + virtual void show_timestretch (framepos_t start, framepos_t end, int layers, int layer); virtual void hide_timestretch (); /* editing operations */ diff --git a/gtk2_ardour/visual_time_axis.cc b/gtk2_ardour/visual_time_axis.cc index 10c8513ec8..bad9ce30e9 100644 --- a/gtk2_ardour/visual_time_axis.cc +++ b/gtk2_ardour/visual_time_axis.cc @@ -409,7 +409,7 @@ VisualTimeAxis::name_entry_key_release_handler(GdkEventKey* ev) // Super class methods not handled by VisualTimeAxis void -VisualTimeAxis::show_timestretch (framepos_t start, framepos_t end) +VisualTimeAxis::show_timestretch (framepos_t start, framepos_t end, int layers, int layer) { // Not handled by purely visual TimeAxis } diff --git a/gtk2_ardour/visual_time_axis.h b/gtk2_ardour/visual_time_axis.h index df0a061ba6..25ec1d8ef3 100644 --- a/gtk2_ardour/visual_time_axis.h +++ b/gtk2_ardour/visual_time_axis.h @@ -250,7 +250,7 @@ class VisualTimeAxis : public TimeAxisView * * @todo should VisualTimeAxis handle this? */ - void show_timestretch (nframes_t start, nframes_t end); + void show_timestretch (nframes_t start, nframes_t end, int layers, int layer); /** * Not handle by purely visual TimeAxis |