View Issue Details

IDProjectCategoryView StatusLast Update
0004739ardourbugspublic2020-04-19 20:16
Reportertophatdave Assigned Tocth103  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Target Version3.0 
Summary0004739: [PATCH] Timestretch tool drag display not restricted to region(s) to which stretch will be applied
Description1 - create audio or midi track with overlapping regions
2 - switch track to layered view
3 - select timestretch tool
4 - apply timestretch to one of the regions and notice that region stretch indicator is not restricted to region that will be affected
TagsNo tags attached.

Relationships

related to 0004890 new When timestretching multiple regions, give each one its own indicator 

Activities

2012-02-24 08:14

 

patch_4739.diff (5,064 bytes)   
Index: automation_time_axis.h
===================================================================
--- automation_time_axis.h	(revision 11514)
+++ automation_time_axis.h	(working copy)
@@ -86,7 +86,7 @@
 	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 */
Index: editor_drag.cc
===================================================================
--- editor_drag.cc	(revision 11514)
+++ editor_drag.cc	(working copy)
@@ -3275,11 +3275,16 @@
 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);
Index: route_time_axis.cc
===================================================================
--- route_time_axis.cc	(revision 11514)
+++ route_time_axis.cc	(working copy)
@@ -768,13 +768,12 @@
 }
 
 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 ();
 
@@ -815,12 +814,11 @@
 
 	x1 = start / _editor.get_current_zoom();
 	x2 = (end - 1) / _editor.get_current_zoom();
-	y2 = current_height() - 2;
 
 	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
Index: route_time_axis.h
===================================================================
--- route_time_axis.h	(revision 11514)
+++ route_time_axis.h	(working copy)
@@ -81,7 +81,7 @@
 
 	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&);
Index: time_axis_view.cc
===================================================================
--- time_axis_view.cc	(revision 11514)
+++ time_axis_view.cc	(working copy)
@@ -780,10 +780,10 @@
 }
 
 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);
 	}
 }
 
Index: time_axis_view.h
===================================================================
--- time_axis_view.h	(revision 11514)
+++ time_axis_view.h	(working copy)
@@ -157,7 +157,7 @@
 	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 ();
 
 	virtual void hide_dependent_views (TimeAxisViewItem&) {}
Index: visual_time_axis.cc
===================================================================
--- visual_time_axis.cc	(revision 11514)
+++ visual_time_axis.cc	(working copy)
@@ -409,7 +409,7 @@
 // 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
 }
Index: visual_time_axis.h
===================================================================
--- visual_time_axis.h	(revision 11514)
+++ visual_time_axis.h	(working copy)
@@ -250,7 +250,7 @@
 		 *
 		 * @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
patch_4739.diff (5,064 bytes)   

tophatdave

2012-02-24 08:20

reporter   ~0012815

the attached patch implements one possible approach to making the timestretch drag work more as i expected.

in the case where multiple regions are selected and then the timestretch drag is performed, ideally, each region would have its own timestretch indicator, i.e. each region being scaled by the same percentage. the attached patch does not implement this behavior. however, i think the behavior of the patch is somewhat better in the multiselect case than currently exists.

cth103

2012-05-27 20:07

administrator   ~0013310

Patch applied to SVN 12460. Thanks!

system

2020-04-19 20:16

developer   ~0022976

Issue has been closed automatically, by Trigger Close Plugin.
Feel free to re-open with additional information if you think the issue is not resolved.

Issue History

Date Modified Username Field Change
2012-02-24 08:05 tophatdave New Issue
2012-02-24 08:14 tophatdave File Added: patch_4739.diff
2012-02-24 08:20 tophatdave Note Added: 0012815
2012-02-26 01:26 cth103 cost => 0.00
2012-02-26 01:26 cth103 Target Version => 3.0 beta4
2012-02-26 01:26 cth103 Summary Timestretch tool drag display not restricted to region(s) to which stretch will be applied => [PATCH] Timestretch tool drag display not restricted to region(s) to which stretch will be applied
2012-05-23 15:09 cth103 Target Version 3.0 beta4 => 3.0
2012-05-27 20:07 cth103 Note Added: 0013310
2012-05-27 20:07 cth103 Status new => resolved
2012-05-27 20:07 cth103 Resolution open => fixed
2012-05-27 20:07 cth103 Assigned To => cth103
2012-05-27 20:10 cth103 Relationship added related to 0004890
2020-04-19 20:16 system Note Added: 0022976
2020-04-19 20:16 system Status resolved => closed