1 #ifndef mackie_surface_h
2 #define mackie_surface_h
10 class MackieButtonHandler;
13 This represents an entire control surface, made up of Groups,
14 Strips and Controls. There are several collections for
15 ease of addressing in different ways, but only one collection
16 has definitive ownership.
18 It handles mapping button ids to press_ and release_ calls.
20 There are various emulations of the Mackie around, so specific
21 emulations will inherit from this to change button mapping, or
22 have 7 fader channels instead of 8, or whatever.
24 Currently there are BcfSurface and MackieSurface.
26 TODO maybe make Group inherit from Control, for ease of ownership.
31 Surface( uint32_t max_strips );
34 /// Calls the virtual initialisation methods. This *must* be called after
35 /// construction, because c++ is too dumb to call virtual methods from
36 /// inside a constructor
39 typedef std::vector<Control*> Controls;
41 /// This collection has ownership of all the controls
45 These are alternative addressing schemes
46 They use maps because the indices aren't always
49 std::map<int,Control*> faders;
50 std::map<int,Control*> pots;
51 std::map<int,Control*> buttons;
52 std::map<int,Control*> leds;
54 /// no strip controls in here because they usually
55 /// have the same names.
56 std::map<std::string,Control*> controls_by_name;
58 /// The collection of all numbered strips. No master
60 typedef std::vector<Strip*> Strips;
63 /// This collection owns the groups
64 typedef std::map<std::string,Group*> Groups;
67 uint32_t max_strips() const
72 /// map button ids to calls to press_ and release_ in mbh
73 virtual void handle_button( MackieButtonHandler & mbh, ButtonState bs, Button & button ) = 0;
76 virtual void init_controls() = 0;
77 virtual void init_strips( uint32_t max_strips, uint32_t unit_strips );