id_t becomes a fully-fledged object, UUID's used for IDs, generic MIDI now owns bindi...
[ardour.git] / libs / pbd / pbd / controllable.h
1 #ifndef __pbd_controllable_h__
2 #define __pbd_controllable_h__
3
4 #include <sigc++/trackable.h>
5 #include <sigc++/signal.h>
6
7 #include <pbd/stateful.h>
8 #include <pbd/id.h>
9
10 class XMLNode;
11
12 namespace PBD {
13
14 class Controllable : public virtual sigc::trackable, public Stateful {
15   public:
16         Controllable ();
17         virtual ~Controllable() { GoingAway (this); }
18
19         virtual void set_value (float) = 0;
20         virtual float get_value (void) const = 0;
21
22         virtual bool can_send_feedback() const { return true; }
23
24         static sigc::signal<void,Controllable*> Created;
25         static sigc::signal<void,Controllable*> GoingAway;
26
27
28         static sigc::signal<bool,PBD::Controllable*> StartLearning;
29         static sigc::signal<void,PBD::Controllable*> StopLearning;
30
31         sigc::signal<void> Changed;
32
33         const PBD::ID& id() const { return _id; }
34
35         int set_state (const XMLNode&) { return 0; }
36         XMLNode& get_state ();
37
38   private:
39         PBD::ID _id;
40 };
41
42 }
43
44 #endif /* __pbd_controllable_h__ */