1f7d6d2fe780d233ac2a0a0025dfa1af4bd71b6d
[ardour.git] / libs / surfaces / mackie / button.h
1 /*
2         Copyright (C) 2006,2007 John Anderson
3         Copyright (C) 2012 Paul Davis
4
5         This program is free software; you can redistribute it and/or modify
6         it under the terms of the GNU General Public License as published by
7         the Free Software Foundation; either version 2 of the License, or
8         (at your option) any later version.
9
10         This program is distributed in the hope that it will be useful,
11         but WITHOUT ANY WARRANTY; without even the implied warranty of
12         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13         GNU General Public License for more details.
14
15         You should have received a copy of the GNU General Public License
16         along with this program; if not, write to the Free Software
17         Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 */
19
20 #ifndef __ardour_mackie_control_protocol_button_h__
21 #define __ardour_mackie_control_protocol_button_h__
22
23 #include "controls.h"
24 #include "led.h"
25
26 namespace Mackie {
27
28 class Surface;
29
30 class Button : public Control
31 {
32 public:
33         enum base_id_t {
34                 recenable_base_id = 0x0,
35                 solo_base_id = 0x08,
36                 mute_base_id = 0x10,
37                 select_base_id = 0x18,
38                 vselect_base_id = 0x20,
39                 fader_touch_base_id = 0xe0,
40         };
41
42         enum ButtonID {
43                 Io = 0x28,
44                 Sends = 0x29,
45                 Pan = 0x2a,
46                 Plugin = 0x2b,
47                 Eq = 0x2c,
48                 Dyn = 0x2d,
49                 Left = 0x2e,
50                 Right = 0x2f,
51                 ChannelLeft = 0x30,
52                 ChannelRight = 0x31,
53                 Flip = 0x32,
54                 Edit = 0x33,
55                 NameValue = 0x34,
56                 TimecodeBeats = 0x35,
57                 F1 = 0x36,
58                 F2 = 0x37,
59                 F3 = 0x38,
60                 F4 = 0x39,
61                 F5 = 0x3a,
62                 F6 = 0x3b,
63                 F7 = 0x3c,
64                 F8 = 0x3d,
65                 F9 = 0x3e,
66                 F10 = 0x3f,
67                 F11 = 0x40,
68                 F12 = 0x41,
69                 F13 = 0x42,
70                 F14 = 0x43,
71                 F15 = 0x44,
72                 F16 = 0x45,
73                 Shift = 0x46,
74                 Option = 0x47,
75                 Ctrl = 0x48,
76                 CmdAlt = 0x49,
77                 On = 0x4a,
78                 RecReady = 0x4b,
79                 Undo = 0x4c,
80                 Save = 0x4d,
81                 Touch = 0x4e,
82                 Redo = 0x4f,
83                 Marker = 0x50,
84                 Enter = 0x51,
85                 Cancel = 0x52,
86                 Mixer = 0x53,
87                 FrmLeft = 0x54,
88                 FrmRight = 0x55,
89                 Loop = 0x56,
90                 PunchIn = 0x57,
91                 PunchOut = 0x58,
92                 Home = 0x59,
93                 End = 0x5a,
94                 Rewind = 0x5b,
95                 Ffwd = 0x5c,
96                 Stop = 0x5d,
97                 Play = 0x5e,
98                 Record = 0x5f,
99                 CursorUp = 0x60,
100                 CursorDown = 0x61,
101                 CursorLeft = 0x62,
102                 CursorRight = 0x63,
103                 Zoom = 0x64,
104                 Scrub = 0x65,
105                 UserA = 0x66,
106                 UserB = 0x67,
107         };
108
109         Button (int id, std::string name, Group & group)
110                 : Control (id, name, group)
111                 , _led  (id, name + "_led", group) {}
112         
113         MidiByteArray zero() { return _led.zero (); }
114         MidiByteArray set_state (LedState ls) { return _led.set_state (ls); }
115
116         static Control* factory (Surface&, int id, const char*, Group&);
117         
118 private:
119         Led _led;
120 };
121
122 }
123
124 #endif