summaryrefslogtreecommitdiff
path: root/libs/surfaces/mackie
diff options
context:
space:
mode:
Diffstat (limited to 'libs/surfaces/mackie')
-rw-r--r--libs/surfaces/mackie/gui.cc35
-rw-r--r--libs/surfaces/mackie/mackie_control_protocol.cc4
-rw-r--r--libs/surfaces/mackie/mackie_control_protocol.h7
3 files changed, 40 insertions, 6 deletions
diff --git a/libs/surfaces/mackie/gui.cc b/libs/surfaces/mackie/gui.cc
index 105bac060c..0df0935f56 100644
--- a/libs/surfaces/mackie/gui.cc
+++ b/libs/surfaces/mackie/gui.cc
@@ -242,6 +242,15 @@ MackieControlProtocolGUI::build_available_action_menu ()
available_action_model->clear ();
+ /* Because there are button bindings built in that are not
+ in the key binding map, there needs to be a way to undo
+ a profile edit. */
+ TreeIter rowp;
+ TreeModel::Row parent;
+ rowp = available_action_model->append();
+ parent = *(rowp);
+ parent[available_action_columns.name] = _("Remove Binding");
+
for (l = labels.begin(), k = keys.begin(), p = paths.begin(), t = tooltips.begin(); l != labels.end(); ++k, ++p, ++t, ++l) {
TreeModel::Row row;
@@ -451,6 +460,11 @@ MackieControlProtocolGUI::refresh_function_key_editor ()
void
MackieControlProtocolGUI::action_changed (const Glib::ustring &sPath, const Glib::ustring &text, TreeModelColumnBase col)
{
+ // Remove Binding is not in the action map but still valid
+ bool remove (false);
+ if ( text == "Remove Binding") {
+ remove = true;
+ }
Gtk::TreePath path(sPath);
Gtk::TreeModel::iterator row = function_key_model->get_iter(path);
@@ -459,17 +473,23 @@ MackieControlProtocolGUI::action_changed (const Glib::ustring &sPath, const Glib
std::map<std::string,std::string>::iterator i = action_map.find (text);
if (i == action_map.end()) {
- return;
+ if (!remove) {
+ return;
+ }
}
-
Glib::RefPtr<Gtk::Action> act = ActionManager::get_action (i->second.c_str());
- if (act) {
+ if (act || remove) {
/* update visible text, using string supplied by
available action model so that it matches and is found
within the model.
*/
- (*row).set_value (col.index(), text);
+ if (remove) {
+ Glib::ustring dot = "\u2022";
+ (*row).set_value (col.index(), dot);
+ } else {
+ (*row).set_value (col.index(), text);
+ }
/* update the current DeviceProfile, using the full
* path
@@ -497,7 +517,12 @@ MackieControlProtocolGUI::action_changed (const Glib::ustring &sPath, const Glib
modifier = 0;
}
- _cp.device_profile().set_button_action ((*row)[function_key_columns.id], modifier, i->second);
+ if (remove) {
+ _cp.device_profile().set_button_action ((*row)[function_key_columns.id], modifier, "");
+ } else {
+ _cp.device_profile().set_button_action ((*row)[function_key_columns.id], modifier, i->second);
+ }
+
} else {
std::cerr << "no such action\n";
}
diff --git a/libs/surfaces/mackie/mackie_control_protocol.cc b/libs/surfaces/mackie/mackie_control_protocol.cc
index fc036513cc..5d6e55e742 100644
--- a/libs/surfaces/mackie/mackie_control_protocol.cc
+++ b/libs/surfaces/mackie/mackie_control_protocol.cc
@@ -827,6 +827,10 @@ MackieControlProtocol::set_state (const XMLNode & node, int version)
const XMLProperty* prop;
uint32_t bank = 0;
+ if (ControlProtocol::set_state (node, version)) {
+ return -1;
+ }
+
if ((prop = node.property (X_("ipmidi-base"))) != 0) {
set_ipmidi_base (atoi (prop->value()));
}
diff --git a/libs/surfaces/mackie/mackie_control_protocol.h b/libs/surfaces/mackie/mackie_control_protocol.h
index 510cbf11ba..f521684a80 100644
--- a/libs/surfaces/mackie/mackie_control_protocol.h
+++ b/libs/surfaces/mackie/mackie_control_protocol.h
@@ -140,7 +140,12 @@ class MackieControlProtocol
XMLNode& get_state ();
int set_state (const XMLNode&, int version);
-
+
+ /* Note: because Mackie control is inherently a duplex protocol,
+ we do not implement get/set_feedback() since this aspect of
+ support for the protocol is not optional.
+ */
+
static bool probe();
Glib::Threads::Mutex surfaces_lock;