not completely tested new structure for VST/FST build
[ardour.git] / libs / pbd / pbd / base_ui.h
1 #ifndef __pbd_base_ui_h__
2 #define __pbd_base_ui_h__
3
4 #include <string>
5 #include <stdint.h>
6
7 #include <sigc++/slot.h>
8 #include <sigc++/trackable.h>
9
10 class BaseUI : virtual public sigc::trackable {
11   public:
12         BaseUI (std::string name, bool with_signal_pipes);
13         virtual ~BaseUI();
14
15         BaseUI* base_instance() { return base_ui_instance; }
16
17         std::string name() const { return _name; }
18
19         bool ok() const { return _ok; }
20
21         enum RequestType {
22                 range_guarantee = ~0
23         };
24
25         struct BaseRequestObject {
26             RequestType type;
27             sigc::slot<void> the_slot;
28         };
29
30         static RequestType new_request_type();
31         static RequestType CallSlot;
32
33   protected:
34         int signal_pipe[2];
35         bool _ok; 
36
37   private:
38         std::string _name; 
39         BaseUI* base_ui_instance;
40
41         static uint32_t rt_bit;
42
43         int setup_signal_pipe ();
44 };
45
46 #endif /* __pbd_base_ui_h__ */