1 #ifndef ardour_control_protocols_h
2 #define ardour_control_protocols_h
6 #include <sigc++/sigc++.h>
13 class ControlProtocol : sigc::trackable {
15 ControlProtocol (Session&, std::string name);
16 virtual ~ControlProtocol();
18 virtual int init () { return 0; }
20 sigc::signal<void> ActiveChanged;
27 std::string name() const { return _name; }
29 void set_send (SendWhat);
30 void set_active (bool yn);
31 bool get_active() const { return active_thread > 0; }
34 bool send() const { return _send != 0; }
35 bool send_route_feedback () const { return _send & SendRoute; }
36 bool send_global_feedback () const { return _send & SendGlobal; }
38 virtual void send_route_feedback (std::list<Route*>&) {}
39 virtual void send_global_feedback () {}
43 ARDOUR::Session& session;
47 int thread_request_pipe[2];
50 static void* _thread_work (void *);
53 struct ThreadRequest {
64 void terminate_thread ();
65 int poke_thread (ThreadRequest::Type);
69 struct ControlProtocolDescriptor {
73 ControlProtocol* (*initialize)(ControlProtocolDescriptor*,Session*);
74 void (*destroy)(ControlProtocolDescriptor*,ControlProtocol*);
81 #endif // ardour_control_protocols_h