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;
28 class ControlProtocolManager : public sigc::trackable, public Stateful
31 ControlProtocolManager ();
32 ~ControlProtocolManager ();
34 static ControlProtocolManager& instance() { return *_instance; }
36 void set_session (Session&);
37 void discover_control_protocols (std::string search_path);
38 void foreach_known_protocol (sigc::slot<void,const ControlProtocolInfo*>);
39 void load_mandatory_protocols ();
41 ControlProtocol* instantiate (ControlProtocolInfo&);
42 int teardown (ControlProtocolInfo&);
44 std::list<ControlProtocolInfo*> control_protocol_info;
46 static const std::string state_node_name;
48 int set_state (const XMLNode&);
49 XMLNode& get_state (void);
52 static ControlProtocolManager* _instance;
55 PBD::Lock protocols_lock;
56 std::list<ControlProtocol*> control_protocols;
60 int control_protocol_discover (std::string path);
61 ControlProtocolDescriptor* get_descriptor (std::string path);
62 ControlProtocolInfo* cpi_by_name (std::string);
67 #endif // ardour_control_protocol_manager_h