1 #ifndef ardour_control_protocol_manager_h
2 #define ardour_control_protocol_manager_h
7 #include <sigc++/sigc++.h>
9 #include <pbd/lockmonitor.h>
11 #include <ardour/stateful.h>
15 class ControlProtocol;
16 class ControlProtocolDescriptor;
19 struct ControlProtocolInfo {
20 ControlProtocolDescriptor* descriptor;
21 ControlProtocol* protocol;
27 class ControlProtocolManager : public sigc::trackable, public Stateful
30 ControlProtocolManager ();
31 ~ControlProtocolManager ();
33 static ControlProtocolManager& instance() { return *_instance; }
35 void set_session (Session&);
36 void discover_control_protocols (std::string search_path);
37 void foreach_known_protocol (sigc::slot<void,const ControlProtocolInfo*>);
39 ControlProtocol* instantiate (ControlProtocolInfo&);
40 int teardown (ControlProtocolInfo&);
42 std::list<ControlProtocolInfo*> control_protocol_info;
44 static const std::string state_node_name;
46 int set_state (const XMLNode&);
47 XMLNode& get_state (void);
50 static ControlProtocolManager* _instance;
53 PBD::Lock protocols_lock;
54 std::list<ControlProtocol*> control_protocols;
58 int control_protocol_discover (std::string path);
59 ControlProtocolDescriptor* get_descriptor (std::string path);
60 ControlProtocolInfo* cpi_by_name (std::string);
65 #endif // ardour_control_protocol_manager_h