MCP: breakout Led class code; remove builder code for Led changes and put it into...
[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 ButtonID {
34                 Io = 0x28,
35                 Sends = 0x29,
36                 Pan = 0x2a,
37                 Plugin = 0x2b,
38                 Eq = 0x2c,
39                 Dyn = 0x2d,
40                 Left = 0x2e,
41                 Right = 0x2f,
42                 ChannelLeft = 0x30,
43                 ChannelRight = 0x31,
44                 Flip = 0x32,
45                 Edit = 0x33,
46                 NameValue = 0x34,
47                 TimecodeBeats = 0x35,
48                 F1 = 0x36,
49                 F2 = 0x37,
50                 F3 = 0x38,
51                 F4 = 0x39,
52                 F5 = 0x3a,
53                 F6 = 0x3b,
54                 F7 = 0x3c,
55                 F8 = 0x3d,
56                 F9 = 0x3e,
57                 F10 = 0x3f,
58                 F11 = 0x40,
59                 F12 = 0x41,
60                 F13 = 0x42,
61                 F14 = 0x43,
62                 F15 = 0x44,
63                 F16 = 0x45,
64                 Shift = 0x46,
65                 Option = 0x47,
66                 Ctrl = 0x48,
67                 CmdAlt = 0x49,
68                 On = 0x4a,
69                 RecReady = 0x4b,
70                 Undo = 0x4c,
71                 Save = 0x4d,
72                 Touch = 0x4e,
73                 Redo = 0x4f,
74                 Marker = 0x50,
75                 Enter = 0x51,
76                 Cancel = 0x52,
77                 Mixer = 0x53,
78                 FrmLeft = 0x54,
79                 FrmRight = 0x55,
80                 Loop = 0x56,
81                 PunchIn = 0x57,
82                 PunchOut = 0x58,
83                 Home = 0x59,
84                 End = 0x5a,
85                 Rewind = 0x5b,
86                 Ffwd = 0x5c,
87                 Stop = 0x5d,
88                 Play = 0x5e,
89                 Record = 0x5f,
90                 CursorUp = 0x60,
91                 CursorDown = 0x61,
92                 CursorLeft = 0x62,
93                 CursorRight = 0x63,
94                 Zoom = 0x64,
95                 Scrub = 0x65,
96                 UserA = 0x66,
97                 UserB = 0x67,
98         };
99
100         Button (int id, std::string name, Group & group)
101                 : Control (id, name, group)
102                 , _led  (id, name + "_led", group) {}
103         
104         virtual Led & led() { return _led; }
105         
106         virtual type_t type() const { return type_button; };
107
108         MidiByteArray update_message () const;
109
110         static Control* factory (Surface&, int id, const char*, Group&);
111         
112 private:
113         Led _led;
114 };
115
116 }
117
118 #endif