not completely tested new structure for VST/FST build
[ardour.git] / libs / pbd / pbd / controllable.h
1 #ifndef __pbd_controllable_h__
2 #define __pbd_controllable_h__
3
4 #include <string>
5
6 #include <sigc++/trackable.h>
7 #include <sigc++/signal.h>
8
9 #include <pbd/statefuldestructible.h>
10
11 class XMLNode;
12
13 namespace PBD {
14
15 class Controllable : public PBD::StatefulDestructible {
16   public:
17         Controllable (std::string name);
18         virtual ~Controllable() { Destroyed (this); }
19
20         virtual void set_value (float) = 0;
21         virtual float get_value (void) const = 0;
22
23         virtual bool can_send_feedback() const { return true; }
24
25         sigc::signal<void> LearningFinished;
26
27         static sigc::signal<bool,PBD::Controllable*> StartLearning;
28         static sigc::signal<void,PBD::Controllable*> StopLearning;
29
30         static sigc::signal<void,Controllable*> Destroyed;
31
32         sigc::signal<void> Changed;
33
34         int set_state (const XMLNode&);
35         XMLNode& get_state ();
36
37         std::string name() const { return _name; }
38
39   private:
40         std::string _name;
41 };
42
43 }
44
45 #endif /* __pbd_controllable_h__ */