1 #ifndef ardour_control_protocol_manager_h
2 #define ardour_control_protocol_manager_h
7 #include <sigc++/sigc++.h>
9 #include <glibmm/thread.h>
11 #include <pbd/stateful.h>
15 class ControlProtocol;
16 class ControlProtocolDescriptor;
19 struct ControlProtocolInfo {
20 ControlProtocolDescriptor* descriptor;
21 ControlProtocol* protocol;
29 class ControlProtocolManager : public sigc::trackable, public Stateful
32 ControlProtocolManager ();
33 ~ControlProtocolManager ();
35 static ControlProtocolManager& instance() { return *_instance; }
37 void set_session (Session&);
38 void discover_control_protocols (std::string search_path);
39 void foreach_known_protocol (sigc::slot<void,const ControlProtocolInfo*>);
40 void load_mandatory_protocols ();
42 ControlProtocol* instantiate (ControlProtocolInfo&);
43 int teardown (ControlProtocolInfo&);
45 std::list<ControlProtocolInfo*> control_protocol_info;
47 static const std::string state_node_name;
49 int set_state (const XMLNode&);
50 XMLNode& get_state (void);
53 static ControlProtocolManager* _instance;
56 Glib::Mutex protocols_lock;
57 std::list<ControlProtocol*> control_protocols;
61 int control_protocol_discover (std::string path);
62 ControlProtocolDescriptor* get_descriptor (std::string path);
63 ControlProtocolInfo* cpi_by_name (std::string);
68 #endif // ardour_control_protocol_manager_h