From 2327070a171df3c6356247307b01ecc13fa40f93 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 15 Dec 2025 17:07:41 -0700 Subject: [PATCH] use grid to control distance that arrow keys move automation by Note that this requires a musical grid type; other types will use a single quarter note. This should likely be addressed. --- gtk2_ardour/editor_actions.cc | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/gtk2_ardour/editor_actions.cc b/gtk2_ardour/editor_actions.cc index f135f9e6db..c3912c1a29 100644 --- a/gtk2_ardour/editor_actions.cc +++ b/gtk2_ardour/editor_actions.cc @@ -1618,7 +1618,13 @@ Editor::automation_move_points_later () add_command (new MementoCommand (atv->line()->memento_command_binder(), &atv->line()->the_list()->get_state(), 0)); ControlPoint* point (points.front()); timepos_t model_time ((*point->model())->when); - model_time += Temporal::BBT_Offset (0, 1, 0); + + bool success; + Temporal::Beats how_far (get_grid_type_as_beats (success, model_time)); + if (!success) { + how_far = Temporal::Beats (1, 0); + } + model_time += Temporal::BBT_Offset (0, how_far.get_beats(), how_far.get_ticks()); atv->line()->the_list()->modify (point->model(), model_time, (*point->model())->value); add_command (new MementoCommand(atv->line()->memento_command_binder (), 0, &atv->line()->the_list()->get_state())); commit_reversible_command (); @@ -1645,7 +1651,13 @@ Editor::automation_move_points_earlier () add_command (new MementoCommand (atv->line()->memento_command_binder(), &atv->line()->the_list()->get_state(), 0)); ControlPoint* point (points.front()); timepos_t model_time ((*point->model())->when); - model_time = model_time.earlier (Temporal::BBT_Offset (0, 1, 0)); + + bool success; + Temporal::Beats how_far (get_grid_type_as_beats (success, model_time)); + if (!success) { + how_far = Temporal::Beats (1, 0); + } + model_time = model_time.earlier (Temporal::BBT_Offset (0, how_far.get_beats(), how_far.get_ticks())); atv->line()->the_list()->modify (point->model(), model_time, (*point->model())->value); add_command (new MementoCommand(atv->line()->memento_command_binder (), 0, &atv->line()->the_list()->get_state())); commit_reversible_command ();