trigger_ui: remove redundant action bindings; rename trigger_scene to trigger_cue

This commit is contained in:
Ben Loftis 2022-01-31 18:32:36 -06:00
parent 2fdf54874a
commit 63912069f4
4 changed files with 9 additions and 48 deletions

View file

@ -232,9 +232,6 @@ CueEntry::rec_state_changed ()
set_default_colors (); set_default_colors ();
} }
Gtkmm2ext::Bindings* CueBoxUI::bindings = 0;
Glib::RefPtr<Gtk::ActionGroup> CueBoxUI::trigger_actions;
CueBoxUI::CueBoxUI (ArdourCanvas::Item* parent) CueBoxUI::CueBoxUI (ArdourCanvas::Item* parent)
: ArdourCanvas::Rectangle (parent) : ArdourCanvas::Rectangle (parent)
, _context_menu (0) , _context_menu (0)
@ -413,35 +410,7 @@ CueBoxUI::set_all_quantization (Temporal::BBT_Offset const& q, uint64_t idx)
} }
void void
CueBoxUI::setup_actions_and_bindings () CueBoxUI::trigger_cue (uint64_t n)
{
load_bindings ();
register_actions ();
}
void
CueBoxUI::load_bindings ()
{
bindings = Bindings::get_bindings (X_("Triggers"));
}
void
CueBoxUI::register_actions ()
{
#if 0
trigger_actions = ActionManager::create_action_group (bindings, X_("Triggers"));
for (int32_t n = 0; n < CueBox::default_triggers_per_box; ++n) {
const std::string action_name = string_compose ("trigger-scene-%1", n);
const std::string display_name = string_compose (_("Scene %1"), n);
ActionManager::register_toggle_action (trigger_actions, action_name.c_str(), display_name.c_str(), sigc::bind (sigc::ptr_fun (CueBoxUI::trigger_scene), n));
}
#endif
}
void
CueBoxUI::trigger_scene (uint64_t n)
{ {
_session->cue_bang (n); _session->cue_bang (n);
} }
@ -496,7 +465,7 @@ CueBoxUI::event (GdkEvent* ev, uint64_t n)
switch (ev->type) { switch (ev->type) {
case GDK_BUTTON_PRESS: case GDK_BUTTON_PRESS:
if (ev->button.button==1) { if (ev->button.button==1) {
trigger_scene (n); trigger_cue (n);
} }
break; break;
case GDK_2BUTTON_PRESS: case GDK_2BUTTON_PRESS:

View file

@ -76,10 +76,7 @@ public:
CueBoxUI (ArdourCanvas::Item* parent); CueBoxUI (ArdourCanvas::Item* parent);
~CueBoxUI (); ~CueBoxUI ();
void trigger_scene (uint64_t n); void trigger_cue (uint64_t n);
static Glib::RefPtr<Gtk::ActionGroup> trigger_actions;
static void setup_actions_and_bindings ();
void _size_allocate (ArdourCanvas::Rect const&); void _size_allocate (ArdourCanvas::Rect const&);
@ -100,11 +97,6 @@ private:
Gtk::Menu* _context_menu; Gtk::Menu* _context_menu;
Gtk::ColorSelectionDialog _color_dialog; Gtk::ColorSelectionDialog _color_dialog;
static Gtkmm2ext::Bindings* bindings;
static void load_bindings ();
static void register_actions ();
typedef std::vector<ArdourCanvas::Rectangle*> Slots; typedef std::vector<ArdourCanvas::Rectangle*> Slots;
Slots _slots; Slots _slots;

View file

@ -155,18 +155,18 @@ TriggerUI::load_bindings ()
void void
TriggerUI::register_actions () TriggerUI::register_actions ()
{ {
trigger_actions = ActionManager::create_action_group (bindings, X_("Triggers")); trigger_actions = ActionManager::create_action_group (bindings, X_("Cues"));
for (int32_t n = 0; n < default_triggers_per_box; ++n) { for (int32_t n = 0; n < default_triggers_per_box; ++n) {
const std::string action_name = string_compose ("trigger-scene-%1", n); const std::string action_name = string_compose ("trigger-cue-%1", n);
const std::string display_name = string_compose (_("Scene %1"), n); const std::string display_name = string_compose (_("Trigger Cue %1"), n);
ActionManager::register_toggle_action (trigger_actions, action_name.c_str (), display_name.c_str (), sigc::bind (sigc::ptr_fun (TriggerUI::trigger_scene), n)); ActionManager::register_toggle_action (trigger_actions, action_name.c_str (), display_name.c_str (), sigc::bind (sigc::ptr_fun (TriggerUI::trigger_cue), n));
} }
} }
void void
TriggerUI::trigger_scene (int32_t n) TriggerUI::trigger_cue (int32_t n)
{ {
Session* s = AudioEngine::instance()->session(); Session* s = AudioEngine::instance()->session();

View file

@ -93,7 +93,7 @@ private:
/* Actions for Triggers: accessed via ardour_ui and shortcuts and lua */ /* Actions for Triggers: accessed via ardour_ui and shortcuts and lua */
static Glib::RefPtr<Gtk::ActionGroup> trigger_actions; static Glib::RefPtr<Gtk::ActionGroup> trigger_actions;
static void trigger_scene (int32_t); static void trigger_cue (int32_t);
static Gtkmm2ext::Bindings* bindings; static Gtkmm2ext::Bindings* bindings;
static void load_bindings (); static void load_bindings ();
static void register_actions (); static void register_actions ();