diff options
author | David Robillard <d@drobilla.net> | 2014-11-29 01:25:27 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2014-11-29 01:25:27 -0500 |
commit | ed1bbefd193be8a21eb4436442ee7acf49c858a2 (patch) | |
tree | c2dbd24ca7b8b9485c125cb93a23d99ff05a9534 /gtk2_ardour | |
parent | f190e630ab2b3d2ff1f7c8640a7d4a072ea3437e (diff) |
Somewhat working gain automation.
This probably isn't correct in several ways, but it works more than it did, so
I figure it's push worthy.
Still not working:
* Saving mute automation list
* Dragged control points are not snapped to model restrictions
(boolean, in this case, but general problem)
* Line goes funny if you record mute automation
(as opposed to drawing it which works)
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/automation_line.cc | 7 | ||||
-rw-r--r-- | gtk2_ardour/automation_line.h | 1 |
2 files changed, 7 insertions, 1 deletions
diff --git a/gtk2_ardour/automation_line.cc b/gtk2_ardour/automation_line.cc index 4d39ff9b87..e87dce8367 100644 --- a/gtk2_ardour/automation_line.cc +++ b/gtk2_ardour/automation_line.cc @@ -1187,7 +1187,7 @@ AutomationLine::view_to_model_coord_y (double& y) const } void -AutomationLine::model_to_view_coord (double& x, double& y) const +AutomationLine::model_to_view_coord_y (double& y) const { /* TODO: This should be more generic (use ParameterDescriptor) */ if (alist->parameter().type() == GainAutomation || @@ -1201,7 +1201,12 @@ AutomationLine::model_to_view_coord (double& x, double& y) const } else { y = (y - alist->get_min_y()) / (double)(alist->get_max_y() - alist->get_min_y()); } +} +void +AutomationLine::model_to_view_coord (double& x, double& y) const +{ + model_to_view_coord_y (y); x = _time_converter->to (x) - _offset; } diff --git a/gtk2_ardour/automation_line.h b/gtk2_ardour/automation_line.h index cf940df5be..23fc17617a 100644 --- a/gtk2_ardour/automation_line.h +++ b/gtk2_ardour/automation_line.h @@ -122,6 +122,7 @@ public: void view_to_model_coord (double& x, double& y) const; void view_to_model_coord_y (double &) const; void model_to_view_coord (double& x, double& y) const; + void model_to_view_coord_y (double &) const; void set_list(boost::shared_ptr<ARDOUR::AutomationList> list); boost::shared_ptr<ARDOUR::AutomationList> the_list() const { return alist; } |