summaryrefslogtreecommitdiff
path: root/gtk2_ardour/automation_line.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2012-04-23 00:35:49 +0000
committerCarl Hetherington <carl@carlh.net>2012-04-23 00:35:49 +0000
commit7070b8f753bac6338b0b1629ef543a8d694fb76c (patch)
tree006b13ddbdb259158913523c8288c304ff730076 /gtk2_ardour/automation_line.cc
parent8a98f466f9580cda97d952109ae5f8ccadfadc03 (diff)
Fix some confusion wrt did_push as a member and a local variable; pass push distances through the AutomationList's time converter so that they work properly; a few comment fixes.
git-svn-id: svn://localhost/ardour2/branches/3.0@12060 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/automation_line.cc')
-rw-r--r--gtk2_ardour/automation_line.cc20
1 files changed, 9 insertions, 11 deletions
diff --git a/gtk2_ardour/automation_line.cc b/gtk2_ardour/automation_line.cc
index 2af484b409..975281440a 100644
--- a/gtk2_ardour/automation_line.cc
+++ b/gtk2_ardour/automation_line.cc
@@ -254,7 +254,7 @@ AutomationLine::modify_point_y (ControlPoint& cp, double y)
}
alist->freeze ();
- sync_model_with_view_point (cp, false, 0);
+ sync_model_with_view_point (cp, 0);
alist->thaw ();
update_pending = false;
@@ -277,12 +277,12 @@ AutomationLine::reset_line_coords (ControlPoint& cp)
}
void
-AutomationLine::sync_model_with_view_points (list<ControlPoint*> cp, bool did_push, int64_t distance)
+AutomationLine::sync_model_with_view_points (list<ControlPoint*> cp, int64_t distance)
{
update_pending = true;
for (list<ControlPoint*>::iterator i = cp.begin(); i != cp.end(); ++i) {
- sync_model_with_view_point (**i, did_push, distance);
+ sync_model_with_view_point (**i, distance);
}
}
@@ -452,7 +452,7 @@ AutomationLine::start_drag_common (double x, float fraction)
}
/** Should be called to indicate motion during a drag.
- * @param x New x position of the drag in units, or undefined if ignore_x == true.
+ * @param x New x position of the drag in canvas units, or undefined if ignore_x == true.
* @param fraction New y fraction.
* @return x position and y fraction that were actually used (once clamped).
*/
@@ -570,7 +570,7 @@ AutomationLine::end_drag ()
points.sort (ControlPointSorter ());
}
- sync_model_with_view_points (points, did_push, rint (_drag_distance * trackview.editor().get_current_zoom ()));
+ sync_model_with_view_points (points, trackview.editor().unit_to_frame (_drag_distance));
alist->thaw ();
@@ -581,10 +581,11 @@ AutomationLine::end_drag ()
);
trackview.editor().session()->set_dirty ();
+ did_push = false;
}
void
-AutomationLine::sync_model_with_view_point (ControlPoint& cp, bool did_push, int64_t distance)
+AutomationLine::sync_model_with_view_point (ControlPoint& cp, framecnt_t distance)
{
/* find out where the visual control point is.
initial results are in canvas units. ask the
@@ -610,11 +611,8 @@ AutomationLine::sync_model_with_view_point (ControlPoint& cp, bool did_push, int
alist->modify (cp.model(), view_x, view_y);
if (did_push) {
-
- /* move all points after cp by the same distance
- */
-
- alist->slide (cp.model()++, distance);
+ /* move all points after cp by the same distance */
+ alist->slide (cp.model()++, _time_converter->from (distance));
}
}