Ardour
9.0-pre0-582-g084a23a80d
surfaces/mackie/button.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2006-2007 John Anderson
3
* Copyright (C) 2012-2015 Paul Davis <paul@linuxaudiosystems.com>
4
* Copyright (C) 2015 Len Ovens <len@ovenwerks.net>
5
*
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
10
*
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License along
17
* with this program; if not, write to the Free Software Foundation, Inc.,
18
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
*/
20
21
#ifndef __ardour_mackie_control_protocol_button_h__
22
#define __ardour_mackie_control_protocol_button_h__
23
24
#include "
ardour/types.h
"
25
26
#include "
controls.h
"
27
#include "
led.h
"
28
29
namespace
ArdourSurface
{
namespace
MACKIE_NAMESPACE
{
30
31
class
Surface
;
32
33
class
Button
:
public
Control
34
{
35
public
:
36
/* These values uniquely identify each possible button that an MCP device may
37
send. Each DeviceInfo object contains its own set of button definitions that
38
define what device ID will be sent for each button, and there is no reason
39
for them to be the same. */
40
41
enum
ID
{
42
/* Global Buttons */
43
44
Track
,
45
Send
,
46
Pan
,
47
Plugin
,
48
Eq
,
49
Dyn
,
50
Left
,
51
Right
,
52
ChannelLeft
,
53
ChannelRight
,
54
Flip
,
55
View
,
56
NameValue
,
57
TimecodeBeats
,
58
F1
,
59
F2
,
60
F3
,
61
F4
,
62
F5
,
63
F6
,
64
F7
,
65
F8
,
66
MidiTracks
,
67
Inputs
,
68
AudioTracks
,
69
AudioInstruments
,
70
Aux
,
71
Busses
,
72
Outputs
,
73
User
,
74
Read
,
75
Write
,
76
Trim
,
77
Touch
,
78
Latch
,
79
Grp
,
80
Save
,
81
Undo
,
82
Cancel
,
83
Enter
,
84
Marker
,
85
Nudge
,
86
Loop
,
87
Drop
,
88
Replace
,
89
Click
,
90
ClearSolo
,
91
Rewind
,
92
Ffwd
,
93
Stop
,
94
Play
,
95
Record
,
96
CursorUp
,
97
CursorDown
,
98
CursorLeft
,
99
CursorRight
,
100
Zoom
,
101
Scrub
,
102
UserA
,
103
UserB
,
104
105
FinalGlobalButton
,
106
107
/* Global buttons that users should not redefine */
108
109
Shift
,
110
Option
,
111
Ctrl
,
112
CmdAlt
,
113
114
/* Strip buttons */
115
116
RecEnable
,
117
Solo
,
118
Mute
,
119
Select
,
120
VSelect
,
121
FaderTouch
,
122
123
/* Master fader */
124
125
MasterFaderTouch
,
126
};
127
128
129
Button
(
Surface
& s,
ID
bid,
int
did, std::string
name
,
Group
& group)
130
:
Control
(did,
name
, group)
131
, _surface (s)
132
, _bid (bid)
133
, _led (did,
name
+
"_led"
, group)
134
, press_time (0) {}
135
136
MidiByteArray
zero
() {
return
_led.zero (); }
137
MidiByteArray
set_state
(
LedState
ls) {
return
_led.set_state (ls); }
138
139
ID
bid
()
const
{
return
_bid; }
140
141
static
Control
*
factory
(
Surface
& surface,
Button::ID
bid,
int
id
,
const
std::string&,
Group
& group);
142
static
int
name_to_id
(
const
std::string&
name
);
143
static
std::string
id_to_name
(
Button::ID
);
144
145
Surface
&
surface
()
const
{
return
_surface; }
146
147
void
pressed
();
148
void
released
();
149
150
int32_t
long_press_count
();
151
152
private
:
153
Surface
&
_surface
;
154
ID
_bid
;
/* device independent button ID */
155
Led
_led
;
156
PBD::microseconds_t
press_time
;
157
};
158
159
}
// Mackie namespace
160
}
// ArdourSurface namespace
161
162
#endif
types.h
ArdourSurface::NS_MCU::Button
Definition:
surfaces/mackie/button.h:34
ArdourSurface::NS_MCU::Button::press_time
PBD::microseconds_t press_time
Definition:
surfaces/mackie/button.h:156
ArdourSurface::NS_MCU::Button::long_press_count
int32_t long_press_count()
ArdourSurface::NS_MCU::Button::factory
static Control * factory(Surface &surface, Button::ID bid, int id, const std::string &, Group &group)
ArdourSurface::NS_MCU::Button::_bid
ID _bid
Definition:
surfaces/mackie/button.h:154
ArdourSurface::NS_MCU::Button::Button
Button(Surface &s, ID bid, int did, std::string name, Group &group)
Definition:
surfaces/mackie/button.h:129
ArdourSurface::NS_MCU::Button::surface
Surface & surface() const
Definition:
surfaces/mackie/button.h:145
ArdourSurface::NS_MCU::Button::name_to_id
static int name_to_id(const std::string &name)
ArdourSurface::NS_MCU::Button::pressed
void pressed()
ArdourSurface::NS_MCU::Button::set_state
MidiByteArray set_state(LedState ls)
Definition:
surfaces/mackie/button.h:137
ArdourSurface::NS_MCU::Button::id_to_name
static std::string id_to_name(Button::ID)
ArdourSurface::NS_MCU::Button::bid
ID bid() const
Definition:
surfaces/mackie/button.h:139
ArdourSurface::NS_MCU::Button::ID
ID
Definition:
surfaces/mackie/button.h:41
ArdourSurface::NS_MCU::Button::Inputs
@ Inputs
Definition:
surfaces/mackie/button.h:67
ArdourSurface::NS_MCU::Button::Shift
@ Shift
Definition:
surfaces/mackie/button.h:109
ArdourSurface::NS_MCU::Button::CursorRight
@ CursorRight
Definition:
surfaces/mackie/button.h:99
ArdourSurface::NS_MCU::Button::UserB
@ UserB
Definition:
surfaces/mackie/button.h:103
ArdourSurface::NS_MCU::Button::UserA
@ UserA
Definition:
surfaces/mackie/button.h:102
ArdourSurface::NS_MCU::Button::CursorUp
@ CursorUp
Definition:
surfaces/mackie/button.h:96
ArdourSurface::NS_MCU::Button::TimecodeBeats
@ TimecodeBeats
Definition:
surfaces/mackie/button.h:57
ArdourSurface::NS_MCU::Button::Option
@ Option
Definition:
surfaces/mackie/button.h:110
ArdourSurface::NS_MCU::Button::CmdAlt
@ CmdAlt
Definition:
surfaces/mackie/button.h:112
ArdourSurface::NS_MCU::Button::Pan
@ Pan
Definition:
surfaces/mackie/button.h:46
ArdourSurface::NS_MCU::Button::Dyn
@ Dyn
Definition:
surfaces/mackie/button.h:49
ArdourSurface::NS_MCU::Button::Plugin
@ Plugin
Definition:
surfaces/mackie/button.h:47
ArdourSurface::NS_MCU::Button::Play
@ Play
Definition:
surfaces/mackie/button.h:94
ArdourSurface::NS_MCU::Button::Busses
@ Busses
Definition:
surfaces/mackie/button.h:71
ArdourSurface::NS_MCU::Button::Trim
@ Trim
Definition:
surfaces/mackie/button.h:76
ArdourSurface::NS_MCU::Button::F8
@ F8
Definition:
surfaces/mackie/button.h:65
ArdourSurface::NS_MCU::Button::Outputs
@ Outputs
Definition:
surfaces/mackie/button.h:72
ArdourSurface::NS_MCU::Button::F7
@ F7
Definition:
surfaces/mackie/button.h:64
ArdourSurface::NS_MCU::Button::Send
@ Send
Definition:
surfaces/mackie/button.h:45
ArdourSurface::NS_MCU::Button::MidiTracks
@ MidiTracks
Definition:
surfaces/mackie/button.h:66
ArdourSurface::NS_MCU::Button::ChannelLeft
@ ChannelLeft
Definition:
surfaces/mackie/button.h:52
ArdourSurface::NS_MCU::Button::Record
@ Record
Definition:
surfaces/mackie/button.h:95
ArdourSurface::NS_MCU::Button::Cancel
@ Cancel
Definition:
surfaces/mackie/button.h:82
ArdourSurface::NS_MCU::Button::Click
@ Click
Definition:
surfaces/mackie/button.h:89
ArdourSurface::NS_MCU::Button::F4
@ F4
Definition:
surfaces/mackie/button.h:61
ArdourSurface::NS_MCU::Button::VSelect
@ VSelect
Definition:
surfaces/mackie/button.h:120
ArdourSurface::NS_MCU::Button::Ffwd
@ Ffwd
Definition:
surfaces/mackie/button.h:92
ArdourSurface::NS_MCU::Button::FinalGlobalButton
@ FinalGlobalButton
Definition:
surfaces/mackie/button.h:105
ArdourSurface::NS_MCU::Button::Replace
@ Replace
Definition:
surfaces/mackie/button.h:88
ArdourSurface::NS_MCU::Button::ChannelRight
@ ChannelRight
Definition:
surfaces/mackie/button.h:53
ArdourSurface::NS_MCU::Button::Zoom
@ Zoom
Definition:
surfaces/mackie/button.h:100
ArdourSurface::NS_MCU::Button::Drop
@ Drop
Definition:
surfaces/mackie/button.h:87
ArdourSurface::NS_MCU::Button::Grp
@ Grp
Definition:
surfaces/mackie/button.h:79
ArdourSurface::NS_MCU::Button::Track
@ Track
Definition:
surfaces/mackie/button.h:44
ArdourSurface::NS_MCU::Button::Loop
@ Loop
Definition:
surfaces/mackie/button.h:86
ArdourSurface::NS_MCU::Button::RecEnable
@ RecEnable
Definition:
surfaces/mackie/button.h:116
ArdourSurface::NS_MCU::Button::User
@ User
Definition:
surfaces/mackie/button.h:73
ArdourSurface::NS_MCU::Button::Select
@ Select
Definition:
surfaces/mackie/button.h:119
ArdourSurface::NS_MCU::Button::FaderTouch
@ FaderTouch
Definition:
surfaces/mackie/button.h:121
ArdourSurface::NS_MCU::Button::AudioTracks
@ AudioTracks
Definition:
surfaces/mackie/button.h:68
ArdourSurface::NS_MCU::Button::F5
@ F5
Definition:
surfaces/mackie/button.h:62
ArdourSurface::NS_MCU::Button::Latch
@ Latch
Definition:
surfaces/mackie/button.h:78
ArdourSurface::NS_MCU::Button::Write
@ Write
Definition:
surfaces/mackie/button.h:75
ArdourSurface::NS_MCU::Button::Left
@ Left
Definition:
surfaces/mackie/button.h:50
ArdourSurface::NS_MCU::Button::Touch
@ Touch
Definition:
surfaces/mackie/button.h:77
ArdourSurface::NS_MCU::Button::Right
@ Right
Definition:
surfaces/mackie/button.h:51
ArdourSurface::NS_MCU::Button::NameValue
@ NameValue
Definition:
surfaces/mackie/button.h:56
ArdourSurface::NS_MCU::Button::CursorDown
@ CursorDown
Definition:
surfaces/mackie/button.h:97
ArdourSurface::NS_MCU::Button::F6
@ F6
Definition:
surfaces/mackie/button.h:63
ArdourSurface::NS_MCU::Button::Solo
@ Solo
Definition:
surfaces/mackie/button.h:117
ArdourSurface::NS_MCU::Button::Mute
@ Mute
Definition:
surfaces/mackie/button.h:118
ArdourSurface::NS_MCU::Button::Save
@ Save
Definition:
surfaces/mackie/button.h:80
ArdourSurface::NS_MCU::Button::Stop
@ Stop
Definition:
surfaces/mackie/button.h:93
ArdourSurface::NS_MCU::Button::F1
@ F1
Definition:
surfaces/mackie/button.h:58
ArdourSurface::NS_MCU::Button::Read
@ Read
Definition:
surfaces/mackie/button.h:74
ArdourSurface::NS_MCU::Button::F3
@ F3
Definition:
surfaces/mackie/button.h:60
ArdourSurface::NS_MCU::Button::Undo
@ Undo
Definition:
surfaces/mackie/button.h:81
ArdourSurface::NS_MCU::Button::AudioInstruments
@ AudioInstruments
Definition:
surfaces/mackie/button.h:69
ArdourSurface::NS_MCU::Button::ClearSolo
@ ClearSolo
Definition:
surfaces/mackie/button.h:90
ArdourSurface::NS_MCU::Button::Nudge
@ Nudge
Definition:
surfaces/mackie/button.h:85
ArdourSurface::NS_MCU::Button::Eq
@ Eq
Definition:
surfaces/mackie/button.h:48
ArdourSurface::NS_MCU::Button::F2
@ F2
Definition:
surfaces/mackie/button.h:59
ArdourSurface::NS_MCU::Button::CursorLeft
@ CursorLeft
Definition:
surfaces/mackie/button.h:98
ArdourSurface::NS_MCU::Button::View
@ View
Definition:
surfaces/mackie/button.h:55
ArdourSurface::NS_MCU::Button::Rewind
@ Rewind
Definition:
surfaces/mackie/button.h:91
ArdourSurface::NS_MCU::Button::Scrub
@ Scrub
Definition:
surfaces/mackie/button.h:101
ArdourSurface::NS_MCU::Button::Ctrl
@ Ctrl
Definition:
surfaces/mackie/button.h:111
ArdourSurface::NS_MCU::Button::Flip
@ Flip
Definition:
surfaces/mackie/button.h:54
ArdourSurface::NS_MCU::Button::MasterFaderTouch
@ MasterFaderTouch
Definition:
surfaces/mackie/button.h:125
ArdourSurface::NS_MCU::Button::Enter
@ Enter
Definition:
surfaces/mackie/button.h:83
ArdourSurface::NS_MCU::Button::Aux
@ Aux
Definition:
surfaces/mackie/button.h:70
ArdourSurface::NS_MCU::Button::Marker
@ Marker
Definition:
surfaces/mackie/button.h:84
ArdourSurface::NS_MCU::Button::released
void released()
ArdourSurface::NS_MCU::Button::_led
Led _led
Definition:
surfaces/mackie/button.h:155
ArdourSurface::NS_MCU::Button::zero
MidiByteArray zero()
Definition:
surfaces/mackie/button.h:136
ArdourSurface::NS_MCU::Button::_surface
Surface & _surface
Definition:
surfaces/mackie/button.h:153
ArdourSurface::NS_MCU::Control
Definition:
mackie/controls.h:48
ArdourSurface::NS_MCU::Group
Definition:
surfaces/mackie/control_group.h:37
ArdourSurface::NS_MCU::LedState
Definition:
surfaces/mackie/types.h:42
ArdourSurface::NS_MCU::Led
Definition:
libs/surfaces/mackie/led.h:30
ArdourSurface::NS_MCU::Surface
Definition:
mackie/surface.h:65
MidiByteArray
Definition:
ctrl-interface/midi_surface/midi_surface/midi_byte_array.h:47
name
GtkImageIconNameData name
Definition:
gtkimage.h:6
led.h
ArdourSurface
Definition:
cc121.h:71
PBD::microseconds_t
int64_t microseconds_t
Definition:
microseconds.h:28
MACKIE_NAMESPACE
#define MACKIE_NAMESPACE
Definition:
surfaces/mackie/types.h:27
controls.h
libs
surfaces
mackie
button.h
Generated on Wed Dec 25 2024 05:43:59 for Ardour by
1.9.1