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
This commit is contained in:
Carl Hetherington 2012-05-27 20:07:13 +00:00
parent d33c0d96fb
commit f722858e43
8 changed files with 19 additions and 19 deletions

View File

@ -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 */

View File

@ -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);

View File

@ -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

View File

@ -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&);

View File

@ -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);
}
}

View File

@ -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 */

View File

@ -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
}

View File

@ -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