summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-07-20 16:53:30 +0000
committerCarl Hetherington <carl@carlh.net>2010-07-20 16:53:30 +0000
commit2aaec8beeba0f694c945afe06147d4924587f67c (patch)
tree75b61a3c917893e6a2ee075ec4d3697c80365bfb /gtk2_ardour
parentbf91ed99ec2b1231c7150bde7f12c8ca573f0834 (diff)
Fix list corruption when modifying a view point in y only. Should fix #3329.
git-svn-id: svn://localhost/ardour2/branches/3.0@7450 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/automation_line.cc22
-rw-r--r--gtk2_ardour/automation_line.h2
2 files changed, 19 insertions, 5 deletions
diff --git a/gtk2_ardour/automation_line.cc b/gtk2_ardour/automation_line.cc
index da76e0abd5..71a29af3dc 100644
--- a/gtk2_ardour/automation_line.cc
+++ b/gtk2_ardour/automation_line.cc
@@ -223,6 +223,7 @@ AutomationLine::modify_point_y (ControlPoint& cp, double y)
);
cp.move_to (x, y, ControlPoint::Full);
+
reset_line_coords (cp);
if (line_points.size() > 1) {
@@ -279,12 +280,13 @@ AutomationLine::model_representation (ControlPoint& cp, ModelRepresentation& mr)
mr.xval = (*cp.model())->when;
} else {
mr.xval = trackview.editor().unit_to_frame (mr.xval);
+ view_to_model_coord_x (mr.xval);
}
- /* convert to model units
+ /* convert y to model units; the x was already done above
*/
- view_to_model_coord (mr.xval, mr.yval);
+ view_to_model_coord_y (mr.yval);
/* part 2: find out where the model point is now
*/
@@ -835,7 +837,6 @@ AutomationLine::sync_model_with_view_point (ControlPoint& cp, bool did_push, int
update_pending = true;
alist->modify (cp.model(), mr.xval, mr.yval);
-
/* change later points */
AutomationList::iterator i = cp.model();
@@ -1207,6 +1208,19 @@ AutomationLine::set_state (const XMLNode &node, int version)
void
AutomationLine::view_to_model_coord (double& x, double& y) const
{
+ view_to_model_coord_x (x);
+ view_to_model_coord_y (y);
+}
+
+void
+AutomationLine::view_to_model_coord_x (double& x) const
+{
+ x = _time_converter.from(x);
+}
+
+void
+AutomationLine::view_to_model_coord_y (double& y) const
+{
/* TODO: This should be more generic ... */
if (alist->parameter().type() == GainAutomation ||
alist->parameter().type() == EnvelopeAutomation) {
@@ -1221,8 +1235,6 @@ AutomationLine::view_to_model_coord (double& x, double& y) const
} else {
y = (int)(y * alist->parameter().max());
}
-
- x = _time_converter.from(x);
}
void
diff --git a/gtk2_ardour/automation_line.h b/gtk2_ardour/automation_line.h
index efc25eb84b..2b63cb1295 100644
--- a/gtk2_ardour/automation_line.h
+++ b/gtk2_ardour/automation_line.h
@@ -109,6 +109,8 @@ class AutomationLine : public sigc::trackable, public PBD::StatefulDestructible
std::string fraction_to_string (double) const;
double string_to_fraction (std::string const &) const;
void view_to_model_coord (double& x, double& y) const;
+ void view_to_model_coord_x (double &) const;
+ void view_to_model_coord_y (double &) const;
void model_to_view_coord (double& x, double& y) const;
void set_list(boost::shared_ptr<ARDOUR::AutomationList> list);