mackie: add "clean" method to invoke GUI actions from button events, in code

This commit is contained in:
Paul Davis 2016-01-31 11:00:16 -05:00
parent ef793d3762
commit 2b56dc17e3
2 changed files with 18 additions and 0 deletions

View file

@ -915,3 +915,16 @@ MackieControlProtocolGUI::active_port_changed (Gtk::ComboBox* combo, boost::weak
}
}
}
/* special case: MackieControlProtocol object method that requires GUI headers */
void
MackieControlProtocol::gui_invoke (string const& action_name)
{
Glib::RefPtr<Gtk::Action> act = ActionManager::get_action (action_name.c_str());
if (act) {
act->activate ();
} else {
std::cerr << "no such action: " << action_name << std::endl;
}
}

View file

@ -388,6 +388,11 @@ class MackieControlProtocol
int set_device_info (const std::string& device_name);
void update_configuration_state ();
/* accepts an Action name from the application GUI definitions, and
invokes it
*/
void gui_invoke (std::string const &);
/* MIDI port connection management */
PBD::ScopedConnection port_connection;