diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2006-04-24 22:45:19 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2006-04-24 22:45:19 +0000 |
commit | 028e1ebc4a392572cae586d0e9044a32b867cba4 (patch) | |
tree | 36d3a748486feb3f41575708bef8b153fef2cad4 /gtk2_ardour/ardour_ui_ed.cc | |
parent | 484debb45c5ea45bccf0f9cb05b1239a9c2244a3 (diff) |
a) completely refactor abstract UI code
b) single-thread Tranzport implementation
c) implement BasicUI to share functionality across multiple
controllers
d) various minor fixes here and there
git-svn-id: svn://localhost/trunk/ardour2@468 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/ardour_ui_ed.cc')
-rw-r--r-- | gtk2_ardour/ardour_ui_ed.cc | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/gtk2_ardour/ardour_ui_ed.cc b/gtk2_ardour/ardour_ui_ed.cc index 2a6bccf227..3944d3180a 100644 --- a/gtk2_ardour/ardour_ui_ed.cc +++ b/gtk2_ardour/ardour_ui_ed.cc @@ -446,6 +446,14 @@ ARDOUR_UI::install_actions () void ARDOUR_UI::toggle_control_protocol (ControlProtocolInfo* cpi) { + if (!session) { + /* this happens when we build the menu bar when control protocol support + has been used in the past for some given protocol - the item needs + to be made active, but there is no session yet. + */ + return; + } + if (cpi->protocol == 0) { ControlProtocolManager::instance().instantiate (*cpi); } else { @@ -465,13 +473,19 @@ ARDOUR_UI::build_control_surface_menu () for (i = ControlProtocolManager::instance().control_protocol_info.begin(); i != ControlProtocolManager::instance().control_protocol_info.end(); ++i) { string action_name = "Toggle"; - action_name += (*i)->name; + action_name += legalize_for_path ((*i)->name); action_name += "Surface"; string action_label = (*i)->name; + + Glib::RefPtr<Action> act = ActionManager::register_toggle_action (editor->editor_actions, action_name.c_str(), action_label.c_str(), + (bind (mem_fun (*this, &ARDOUR_UI::toggle_control_protocol), *i))); - ActionManager::register_toggle_action (editor->editor_actions, action_name.c_str(), action_label.c_str(), - (bind (mem_fun (*this, &ARDOUR_UI::toggle_control_protocol), *i))); + Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act); + + if ((*i)->protocol || (*i)->requested) { + tact->set_active (); + } ui += "<menuitem action='"; ui += action_name; |