From: Paul Davis Date: Tue, 17 Apr 2012 21:36:48 +0000 (+0000) Subject: MCP: somewhat functional (?) full keybinding GUI X-Git-Tag: 3.0~1681 X-Git-Url: https://git.carlh.net/gitweb/?a=commitdiff_plain;h=6bd6f58dee3442cb3ab140be3966da2a07564040;p=ardour.git MCP: somewhat functional (?) full keybinding GUI git-svn-id: svn://localhost/ardour2/branches/3.0@11999 d708f5d6-7413-0410-9779-e7cbd77b26cf --- diff --git a/libs/gtkmm2ext/actions.cc b/libs/gtkmm2ext/actions.cc index 3fc9def399..74533f96a4 100644 --- a/libs/gtkmm2ext/actions.cc +++ b/libs/gtkmm2ext/actions.cc @@ -250,23 +250,29 @@ ActionManager::get_action (const char* path) return RefPtr(); } - char copy[strlen(path)+1]; - - if (*path == '/') { - const char* cslash = strchr (path, '/'); - if (!cslash) { - return RefPtr (); - } - strcpy (copy, cslash+1); - } else { - strcpy (copy, path); + /* Skip / in path */ + + int len = strlen (path); + + if (len < 3) { + /* shortest possible path: "a/b" */ + return RefPtr(); } + if (len > 10 && !strncmp (path, "/", 10 )) { + path = path+10; + } else if (path[0] == '/') { + path++; + } + + char copy[len+1]; + strcpy (copy, path); char* slash = strchr (copy, '/'); if (!slash) { return RefPtr (); } *slash = '\0'; + return get_action (copy, ++slash); } diff --git a/libs/surfaces/mackie/gui.cc b/libs/surfaces/mackie/gui.cc index 0ed07276a6..acb4779b7f 100644 --- a/libs/surfaces/mackie/gui.cc +++ b/libs/surfaces/mackie/gui.cc @@ -280,9 +280,7 @@ MackieControlProtocolGUI::refresh_function_key_editor () if (action.empty()) { row[function_key_columns.plain] = defstring; } else { - std::cerr << "action = " << action << '\n'; act = ActionManager::get_action (action.c_str()); - std::cerr << " action = " << act << endl; if (act) { row[function_key_columns.plain] = act->get_label(); } else { @@ -373,6 +371,7 @@ MackieControlProtocolGUI::action_changed (const Glib::ustring &sPath, const Glib if (act) { (*row).set_value (col.index(), text); } + } } diff --git a/libs/surfaces/mackie/surface.cc b/libs/surfaces/mackie/surface.cc index 52323ee8a6..f1f308209c 100644 --- a/libs/surfaces/mackie/surface.cc +++ b/libs/surfaces/mackie/surface.cc @@ -199,8 +199,6 @@ Surface::init_strips (uint32_t n) snprintf (name, sizeof (name), "strip_%d", (8* _number) + i); - std::cerr << "*** Surface " << _number << " Setup strips for index " << i << endl; - Strip* strip = new Strip (*this, name, i, strip_buttons); groups[name] = strip; diff --git a/mcp/paul-nucleus.profile b/mcp/paul-nucleus.profile index 43e6b52284..68fe09bca3 100644 --- a/mcp/paul-nucleus.profile +++ b/mcp/paul-nucleus.profile @@ -4,6 +4,6 @@ -