mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-24 14:17:21 +01:00
add API to query name of bound action
This commit is contained in:
parent
abe093dcc9
commit
cd14e8f2e1
2 changed files with 12 additions and 0 deletions
|
|
@ -1047,6 +1047,17 @@ Bindings::is_bound (KeyboardKey const& kb, Operation op) const
|
|||
return km.find(kb) != km.end();
|
||||
}
|
||||
|
||||
std::string
|
||||
Bindings::bound_name (KeyboardKey const& kb, Operation op) const
|
||||
{
|
||||
const KeybindingMap& km = get_keymap(op);
|
||||
KeybindingMap::const_iterator b = km.find(kb);
|
||||
if (b == km.end()) {
|
||||
return "";
|
||||
}
|
||||
return b->second.action_name;
|
||||
}
|
||||
|
||||
bool
|
||||
Bindings::is_registered (Operation op, std::string const& action_name) const
|
||||
{
|
||||
|
|
|
|||
|
|
@ -178,6 +178,7 @@ class LIBGTKMM2EXT_API Bindings {
|
|||
bool activate (MouseButton, Operation);
|
||||
|
||||
bool is_bound (KeyboardKey const&, Operation) const;
|
||||
std::string bound_name (KeyboardKey const&, Operation) const;
|
||||
bool is_registered (Operation op, std::string const& action_name) const;
|
||||
|
||||
KeyboardKey get_binding_for_action (Glib::RefPtr<Gtk::Action>, Operation& op);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue