mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-04 04:39:33 +01:00
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.
This commit is contained in:
parent
3649987871
commit
2327070a17
1 changed files with 14 additions and 2 deletions
|
|
@ -1618,7 +1618,13 @@ Editor::automation_move_points_later ()
|
|||
add_command (new MementoCommand<AutomationList> (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<AutomationList>(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<AutomationList> (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<AutomationList>(atv->line()->memento_command_binder (), 0, &atv->line()->the_list()->get_state()));
|
||||
commit_reversible_command ();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue