summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2015-10-03 11:08:47 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2015-10-03 13:13:57 -0400
commit53c47e0ccd663ee2118f988c0dde140b7aee4173 (patch)
tree5f07ba062fbad5adf303525a1eb57ba714ce896f
parent63577705887fdc25df1d3d10c6f70ff3a4400767 (diff)
add support to display and set key aliases in mackie GUI
-rw-r--r--libs/surfaces/mackie/gui.cc82
1 files changed, 62 insertions, 20 deletions
diff --git a/libs/surfaces/mackie/gui.cc b/libs/surfaces/mackie/gui.cc
index 99aeec14d8..d9d473728f 100644
--- a/libs/surfaces/mackie/gui.cc
+++ b/libs/surfaces/mackie/gui.cc
@@ -256,6 +256,22 @@ MackieControlProtocolGUI::build_available_action_menu ()
parent = *(rowp);
parent[available_action_columns.name] = _("Remove Binding");
+ /* Key aliasing */
+
+ rowp = available_action_model->append();
+ parent = *(rowp);
+ parent[available_action_columns.name] = _("Shift");
+ rowp = available_action_model->append();
+ parent = *(rowp);
+ parent[available_action_columns.name] = _("Control");
+ rowp = available_action_model->append();
+ parent = *(rowp);
+ parent[available_action_columns.name] = _("Option");
+ rowp = available_action_model->append();
+ parent = *(rowp);
+ parent[available_action_columns.name] = _("CmdAlt");
+
+
for (l = labels.begin(), k = keys.begin(), p = paths.begin(), t = tooltips.begin(); l != labels.end(); ++k, ++p, ++t, ++l) {
TreeModel::Row row;
@@ -390,11 +406,17 @@ MackieControlProtocolGUI::refresh_function_key_editor ()
if (action.empty()) {
row[function_key_columns.plain] = defstring;
} else {
- act = ActionManager::get_action (action.c_str());
- if (act) {
- row[function_key_columns.plain] = act->get_label();
+ if (action.find ('/') == string::npos) {
+ /* Probably a key alias */
+ row[function_key_columns.plain] = action;
} else {
- row[function_key_columns.plain] = defstring;
+
+ act = ActionManager::get_action (action.c_str());
+ if (act) {
+ row[function_key_columns.plain] = act->get_label();
+ } else {
+ row[function_key_columns.plain] = defstring;
+ }
}
}
@@ -402,11 +424,16 @@ MackieControlProtocolGUI::refresh_function_key_editor ()
if (action.empty()) {
row[function_key_columns.control] = defstring;
} else {
- act = ActionManager::get_action (action.c_str());
- if (act) {
- row[function_key_columns.control] = act->get_label();
+ if (action.find ('/') == string::npos) {
+ /* Probably a key alias */
+ row[function_key_columns.control] = action;
} else {
- row[function_key_columns.control] = defstring;
+ act = ActionManager::get_action (action.c_str());
+ if (act) {
+ row[function_key_columns.control] = act->get_label();
+ } else {
+ row[function_key_columns.control] = defstring;
+ }
}
}
@@ -414,11 +441,16 @@ MackieControlProtocolGUI::refresh_function_key_editor ()
if (action.empty()) {
row[function_key_columns.shift] = defstring;
} else {
- act = ActionManager::get_action (action.c_str());
- if (act) {
- row[function_key_columns.shift] = act->get_label();
+ if (action.find ('/') == string::npos) {
+ /* Probably a key alias */
+ row[function_key_columns.shift] = action;
} else {
- row[function_key_columns.shift] = defstring;
+ act = ActionManager::get_action (action.c_str());
+ if (act) {
+ row[function_key_columns.shift] = act->get_label();
+ } else {
+ row[function_key_columns.shift] = defstring;
+ }
}
}
@@ -426,11 +458,16 @@ MackieControlProtocolGUI::refresh_function_key_editor ()
if (action.empty()) {
row[function_key_columns.option] = defstring;
} else {
- act = ActionManager::get_action (action.c_str());
- if (act) {
- row[function_key_columns.option] = act->get_label();
+ if (action.find ('/') == string::npos) {
+ /* Probably a key alias */
+ row[function_key_columns.option] = action;
} else {
- row[function_key_columns.option] = defstring;
+ act = ActionManager::get_action (action.c_str());
+ if (act) {
+ row[function_key_columns.option] = act->get_label();
+ } else {
+ row[function_key_columns.option] = defstring;
+ }
}
}
@@ -438,11 +475,16 @@ MackieControlProtocolGUI::refresh_function_key_editor ()
if (action.empty()) {
row[function_key_columns.cmdalt] = defstring;
} else {
- act = ActionManager::get_action (action.c_str());
- if (act) {
- row[function_key_columns.cmdalt] = act->get_label();
+ if (action.find ('/') == string::npos) {
+ /* Probably a key alias */
+ row[function_key_columns.cmdalt] = action;
} else {
- row[function_key_columns.cmdalt] = defstring;
+ act = ActionManager::get_action (action.c_str());
+ if (act) {
+ row[function_key_columns.cmdalt] = act->get_label();
+ } else {
+ row[function_key_columns.cmdalt] = defstring;
+ }
}
}