mackie: add "clean" method to invoke GUI actions from button events, in code
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user