13
0

Delete/BackSpc clears selected trigger-clos

This commit is contained in:
Robin Gareus 2022-12-02 19:19:20 +01:00
parent 753d395bb3
commit 899cacdf86
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
3 changed files with 18 additions and 0 deletions

View File

@ -8,5 +8,7 @@
<Binding key="F6" action="Cues/trigger-cue-5"/>
<Binding key="F7" action="Cues/trigger-cue-6"/>
<Binding key="F8" action="Cues/trigger-cue-7"/>
<Binding key="Delete" action="Cues/clear-trigger-slot"/>
<Binding key="BackSpace" action="Cues/clear-trigger-slot"/>
</Press>
</Bindings>

View File

@ -364,6 +364,18 @@ TriggerPage::initial_track_display ()
add_routes (rl);
}
void
TriggerPage::clear_selected_slot ()
{
Selection& selection (Editor::instance ().get_selection ());
TriggerSelection ts = selection.triggers;
if (ts.empty ()) {
return;
}
TriggerPtr trigger = ts.front ()->trigger ();
trigger->set_region (boost::shared_ptr<Region>());
}
void
TriggerPage::selection_changed ()
{
@ -758,6 +770,8 @@ TriggerPage::register_actions ()
{
Glib::RefPtr<ActionGroup> trigger_actions = ActionManager::create_action_group (bindings, X_("Cues"));
ActionManager::register_action (trigger_actions, "clear-trigger-slot", _("Clear Selected Slot"), sigc::mem_fun (*this, &TriggerPage::clear_selected_slot));
for (int32_t n = 0; n < TriggerBox::default_triggers_per_box; ++n) {
const std::string action_name = string_compose ("trigger-cue-%1", n);
const std::string display_name = string_compose (_("Trigger Cue %1"), cue_marker_name (n));

View File

@ -74,6 +74,8 @@ private:
void add_routes (ARDOUR::RouteList&);
void remove_route (TriggerStrip*);
void clear_selected_slot ();
void redisplay_track_list ();
void pi_property_changed (PBD::PropertyChange const&);
void stripable_property_changed (PBD::PropertyChange const&, boost::weak_ptr<ARDOUR::Stripable>);