Add option add automation-lane points on the line -- #7397
authorRobin Gareus <robin@gareus.org>
Sat, 17 Jun 2017 20:53:58 +0000 (22:53 +0200)
committerRobin Gareus <robin@gareus.org>
Sun, 18 Jun 2017 20:13:02 +0000 (22:13 +0200)
gtk2_ardour/automation_time_axis.cc
gtk2_ardour/rc_option_editor.cc
gtk2_ardour/ui_config_vars.h

index f575cb2a456035dd298c33a5d8e3283fd78585fc..b2902633ae8ceaf03ee01963683c96cd222d712b 100644 (file)
@@ -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;
 
index 5a4580f5d4ed81b1adfc625c3b3a1919d3f24149..6af8887bd2a23034736e9666bcb426e69237e9c1 100644 (file)
@@ -2394,6 +2394,16 @@ RCOptionEditor::RCOptionEditor ()
                     sigc::mem_fun (*_rc_config, &RCConfiguration::set_automation_follows_regions)
                     ));
 
+       bo = new BoolOption (
+                    "new-automation-points-on-lane",
+                    _("Ignore Y-axis click position when adding new automation-points"),
+                    sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_new_automation_points_on_lane),
+                    sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_new_automation_points_on_lane)
+                    );
+       add_option (_("Editor"), bo);
+       Gtkmm2ext::UI::instance()->set_tip (bo->tip_widget(),
+                       _("<b>When enabled</b> The new points drawn in any automation lane will be placed on the existing line, regardless of mouse y-axis position."));
+
        ComboOption<FadeShape>* fadeshape = new ComboOption<FadeShape> (
                        "default-fade-shape",
                        _("Default fade shape"),
index 19147c305a3c1484b424e701718d50c217188766..bbefc91b01597790b5a2d38a91d456f7197814be 100644 (file)
@@ -32,6 +32,7 @@ UI_CONFIG_VARIABLE (bool, color_regions_using_track_color, "color-regions-using-
 UI_CONFIG_VARIABLE (bool, show_waveform_clipping, "show-waveform-clipping", true)
 UI_CONFIG_VARIABLE (uint32_t, lock_gui_after_seconds, "lock-gui-after-seconds", 0)
 UI_CONFIG_VARIABLE (bool, draggable_playhead, "draggable-playhead", true)
+UI_CONFIG_VARIABLE (bool, new_automation_points_on_lane, "new-automation-points-on-lane", false)
 UI_CONFIG_VARIABLE (std::string, keyboard_layout, "keyboard-layout", "ansi")
 UI_CONFIG_VARIABLE (std::string, keyboard_layout_name, "keyboard-layout-name", "ansi")
 UI_CONFIG_VARIABLE (std::string, default_bindings, "default-bindings", "ardour")