summaryrefslogtreecommitdiff
path: root/libs/surfaces/mackie/button.h
blob: 4e624aba75470dcfe1e6f7410a901fab22fbe037 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/*
	Copyright (C) 2006,2007 John Anderson
	Copyright (C) 2012 Paul Davis

	This program is free software; you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation; either version 2 of the License, or
	(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program; if not, write to the Free Software
	Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#ifndef __ardour_mackie_control_protocol_button_h__
#define __ardour_mackie_control_protocol_button_h__

#include "controls.h"
#include "led.h"

namespace Mackie {

class Surface;

class Button : public Control
{
public:
	enum ButtonID {
		Io = 0x28,
		Sends = 0x29,
		Pan = 0x2a,
		Plugin = 0x2b,
		Eq = 0x2c,
		Dyn = 0x2d,
		Left = 0x2e,
		Right = 0x2f,
		ChannelLeft = 0x30,
		ChannelRight = 0x31,
		Flip = 0x32,
		Edit = 0x33,
		NameValue = 0x34,
		TimecodeBeats = 0x35,
		F1 = 0x36,
		F2 = 0x37,
		F3 = 0x38,
		F4 = 0x39,
		F5 = 0x3a,
		F6 = 0x3b,
		F7 = 0x3c,
		F8 = 0x3d,
		F9 = 0x3e,
		F10 = 0x3f,
		F11 = 0x40,
		F12 = 0x41,
		F13 = 0x42,
		F14 = 0x43,
		F15 = 0x44,
		F16 = 0x45,
		Shift = 0x46,
		Option = 0x47,
		Ctrl = 0x48,
		CmdAlt = 0x49,
		On = 0x4a,
		RecReady = 0x4b,
		Undo = 0x4c,
		Save = 0x4d,
		Touch = 0x4e,
		Redo = 0x4f,
		Marker = 0x50,
		Enter = 0x51,
		Cancel = 0x52,
		Mixer = 0x53,
		FrmLeft = 0x54,
		FrmRight = 0x55,
		Loop = 0x56,
		PunchIn = 0x57,
		PunchOut = 0x58,
		Home = 0x59,
		End = 0x5a,
		Rewind = 0x5b,
		Ffwd = 0x5c,
		Stop = 0x5d,
		Play = 0x5e,
		Record = 0x5f,
		CursorUp = 0x60,
		CursorDown = 0x61,
		CursorLeft = 0x62,
		CursorRight = 0x63,
		Zoom = 0x64,
		Scrub = 0x65,
		UserA = 0x66,
		UserB = 0x67,
	};

	Button (int id, std::string name, Group & group)
		: Control (id, name, group)
		, _led  (id, name + "_led", group) {}
	
	virtual Led & led() { return _led; }
	
	virtual type_t type() const { return type_button; };

	MidiByteArray update_message () const;

	static Control* factory (Surface&, int id, const char*, Group&);
	
private:
	Led _led;
};

}

#endif