MCP: zoom button toggles led
[ardour.git] / libs / surfaces / mackie / strip.h
1 #ifndef __ardour_mackie_control_protocol_strip_h__
2 #define __ardour_mackie_control_protocol_strip_h__
3
4 #include <string>
5 #include <iostream>
6
7 #include "control_group.h"
8
9 namespace Mackie {
10
11 class Control;
12 class Surface;
13 class Button;
14 class Pot;
15 class Fader;
16 class Meter;
17
18 struct StripControlDefinition {
19     const char* name;
20     uint32_t base_id;
21     Control* (*factory)(Surface&, int index, int ordinal, const char* name, Group&);
22 };
23
24 struct GlobalControlDefinition {
25     const char* name;
26     uint32_t id;
27     Control* (*factory)(Surface&, int index, int ordinal, const char* name, Group&);
28     const char* group_name;
29 };
30
31 /**
32         This is the set of controls that make up a strip.
33 */
34 class Strip : public Group
35 {
36 public:
37         Strip (const std::string& name, int index); /* master strip only */
38         Strip (Surface&, const std::string & name, int index, int unit_index, StripControlDefinition* ctls);
39
40         virtual bool is_strip() const { return true; }
41         virtual void add (Control & control);
42         int index() const { return _index; } // zero based
43         
44         Button & solo();
45         Button & recenable();
46         Button & mute();
47         Button & select();
48         Button & vselect();
49         Button & fader_touch();
50         Pot & vpot();
51         Fader & gain();
52         Meter& meter ();
53
54         bool has_solo() const { return _solo != 0; }
55         bool has_recenable() const { return _recenable != 0; }
56         bool has_mute() const { return _mute != 0; }
57         bool has_select() const { return _select != 0; }
58         bool has_vselect() const { return _vselect != 0; }
59         bool has_fader_touch() const { return _fader_touch != 0; }
60         bool has_vpot() const { return _vpot != 0; }
61         bool has_gain() const { return _gain != 0; }
62         bool has_meter() const { return _meter != 0; }
63 private:
64         Button* _solo;
65         Button* _recenable;
66         Button* _mute;
67         Button* _select;
68         Button* _vselect;
69         Button* _fader_touch;
70         Pot*    _vpot;
71         Fader*  _gain;
72         Meter*  _meter;
73         int     _index;
74 };
75
76 std::ostream & operator <<  (std::ostream &, const Strip &);
77
78 class MasterStrip : public Strip
79 {
80 public:
81         MasterStrip (const std::string & name, int index)
82                 : Strip (name, index) {}
83         
84         virtual bool is_master() const  { return true; }
85 };
86
87 }
88
89 #endif /* __ardour_mackie_control_protocol_strip_h__ */