summaryrefslogtreecommitdiff
path: root/gtk2_ardour/automation_time_axis.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2017-06-17 22:53:58 +0200
committerRobin Gareus <robin@gareus.org>2017-06-18 22:13:02 +0200
commit973d58e8f9f6bbf79ee7eee5647d4dcc4a3ae602 (patch)
tree47c335e26ea1618baa94006d88b3391fe1574285 /gtk2_ardour/automation_time_axis.cc
parentc2cba9e57c2d1b0c18b4094521fa98d66ca3ddde (diff)
Add option add automation-lane points on the line -- #7397
Diffstat (limited to 'gtk2_ardour/automation_time_axis.cc')
-rw-r--r--gtk2_ardour/automation_time_axis.cc27
1 files changed, 15 insertions, 12 deletions
diff --git a/gtk2_ardour/automation_time_axis.cc b/gtk2_ardour/automation_time_axis.cc
index f575cb2a45..b2902633ae 100644
--- a/gtk2_ardour/automation_time_axis.cc
+++ b/gtk2_ardour/automation_time_axis.cc
@@ -625,21 +625,24 @@ AutomationTimeAxisView::add_automation_event (GdkEvent* event, framepos_t frame,
return;
}
- double x = 0;
-
- _line->grab_item().canvas_to_item (x, y);
-
- /* compute vertical fractional position */
-
- y = 1.0 - (y / _line->height());
-
- /* map using line */
-
- _line->view_to_model_coord (x, y);
-
MusicFrame when (frame, 0);
_editor.snap_to_with_modifier (when, event);
+ if (UIConfiguration::instance().get_new_automation_points_on_lane()) {
+ if (_control->list()->size () == 0) {
+ y = _control->get_value ();
+ } else {
+ y = _control->list()->eval (when.frame);
+ }
+ } else {
+ double x = 0;
+ _line->grab_item().canvas_to_item (x, y);
+ /* compute vertical fractional position */
+ y = 1.0 - (y / _line->height());
+ /* map using line */
+ _line->view_to_model_coord (x, y);
+ }
+
XMLNode& before = list->get_state();
std::list<Selectable*> results;