kbd automation: no popup immediately after add, 2nd Return/Enter for that

Also, two different bindings for adding a point with and without guard points.
This commit is contained in:
Paul Davis
2025-08-21 18:55:09 -06:00
parent 05210fc7e2
commit 07b20aa60a
6 changed files with 13 additions and 6 deletions

View File

@@ -1,6 +1,7 @@
<Bindings name="Automation">
<Press>
<Binding key="Return" action="Automation/create-point"/>
<Binding key="Secondary-Return" action="Automation/create-point-with-guards"/>
<Binding key="Right" action="Automation/move-points-later"/>
<Binding key="Left" action="Automation/move-points-earlier"/>
<Binding key="Up" action="Automation/raise-points"/>

View File

@@ -1789,7 +1789,7 @@ AutomationLine::add (std::shared_ptr<AutomationControl> control, GdkEvent* event
std::list<Selectable*> results;
if (from_kbd) {
entry_required_post_add = true;
entry_required_post_add = false;
}
if (alist->editor_add (when, y, with_guard_points)) {

View File

@@ -363,7 +363,8 @@ EditingContext::register_automation_actions (Bindings* automation_bindings, std:
_automation_actions = ActionManager::create_action_group (automation_bindings, prefix + X_("Automation"));
reg_sens (_automation_actions, "create-point", _("Create Automation Point"), sigc::mem_fun (*this, &EditingContext::automation_create_point_at_edit_point));
reg_sens (_automation_actions, "create-point", _("Create Automation Point"), std::bind (sigc::mem_fun (*this, &EditingContext::automation_create_point_at_edit_point), false));
reg_sens (_automation_actions, "create-point-with-guards", _("Create Automation Point"), std::bind (sigc::mem_fun (*this, &EditingContext::automation_create_point_at_edit_point), true));
reg_sens (_automation_actions, "move-points-later", _("Create Automation P (at Playhead)"), sigc::mem_fun (*this, &EditingContext::automation_move_points_later));
reg_sens (_automation_actions, "move-points-earlier", _("Create Automation Point (at Playhead)"), sigc::mem_fun (*this, &EditingContext::automation_move_points_earlier));
reg_sens (_automation_actions, "raise-points", _("Create Automation Point (at Playhead)"), sigc::mem_fun (*this, &EditingContext::automation_raise_points));

View File

@@ -809,7 +809,7 @@ class EditingContext : public ARDOUR::SessionHandlePtr, public AxisViewProvider,
void center_screen_internal (samplepos_t, float);
virtual void automation_create_point_at_edit_point() {}
virtual void automation_create_point_at_edit_point(bool with_guard_points) {}
virtual void automation_raise_points () {}
virtual void automation_lower_points () {};
virtual void automation_move_points_later () {};

View File

@@ -1594,7 +1594,7 @@ private:
protected:
void _commit_tempo_map_edit (Temporal::TempoMap::WritableSharedPtr&, bool with_update = false);
void automation_create_point_at_edit_point();
void automation_create_point_at_edit_point (bool with_guard_points);
void automation_raise_points ();
void automation_lower_points ();
void automation_move_points_later ();

View File

@@ -1333,7 +1333,7 @@ Editor::register_region_actions ()
}
void
Editor::automation_create_point_at_edit_point ()
Editor::automation_create_point_at_edit_point (bool with_guard_points)
{
AutomationTimeAxisView* atv = dynamic_cast<AutomationTimeAxisView*> (entered_track);
if (!atv) {
@@ -1347,7 +1347,12 @@ Editor::automation_create_point_at_edit_point ()
event.button.button = 1;
event.button.state = 0;
atv->line()->add (atv->control(), &event, where, atv->line()->the_list()->eval (where), true, true);
if (atv->line()->the_list()->has_event_at (where)) {
atv->line()->begin_edit();
} else {
atv->line()->add (atv->control(), &event, where, atv->line()->the_list()->eval (where), with_guard_points, true);
}
}
void