Ardour
9.0-pre0-427-gd2a3450e2f
surfaces/us2400/button.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2017 Ben Loftis <ben@harrisonconsoles.com>
3
*
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 2 of the License, or
7
* (at your option) any later version.
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License along
15
* with this program; if not, write to the Free Software Foundation, Inc.,
16
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
*/
18
19
#ifndef __ardour_us2400_control_protocol_button_h__
20
#define __ardour_us2400_control_protocol_button_h__
21
22
#include "
ardour/types.h
"
23
24
#include "
controls.h
"
25
#include "
led.h
"
26
27
namespace
ArdourSurface
{
28
29
namespace
US2400
{
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
Scrub
,
45
F1
,
46
F2
,
47
F3
,
48
F4
,
49
F5
,
50
F6
,
51
Rewind
,
52
Ffwd
,
53
Stop
,
54
Play
,
55
Record
,
56
Left
,
57
Right
,
58
Flip
,
59
MstrSelect
,
60
61
FinalGlobalButton
,
62
63
64
/* Global buttons that users should not redefine */
65
66
Drop
,
67
Send
,
68
Pan
,
69
ClearSolo
,
70
Shift
,
71
Option
,
72
Ctrl
,
73
CmdAlt
,
74
75
/* Strip buttons */
76
77
Solo
,
78
Mute
,
79
Select
,
80
FaderTouch
,
81
82
/* Master fader */
83
84
MasterFaderTouch
,
85
};
86
87
88
Button
(
Surface
& s,
ID
bid
,
int
did, std::string
name
,
Group
&
group
)
89
:
Control
(did,
name
,
group
)
90
,
_surface
(s)
91
,
_bid
(
bid
)
92
,
_led
(did,
name
+
"_led"
,
group
)
93
,
press_time
(0) {}
94
95
MidiByteArray
zero
() {
return
_led
.
zero
(); }
96
MidiByteArray
set_state
(
LedState
ls) {
return
_led
.
set_state
(ls); }
97
98
ID
bid
()
const
{
return
_bid
; }
99
100
static
Control
*
factory
(
Surface
&
surface
,
Button::ID
bid
,
int
id
,
const
std::string&,
Group
&
group
);
101
static
int
name_to_id
(
const
std::string&
name
);
102
static
std::string
id_to_name
(
Button::ID
);
103
104
Surface
&
surface
()
const
{
return
_surface
; }
105
106
void
mark_dirty
() {
_led
.
mark_dirty
(); }
107
108
void
pressed
();
109
void
released
();
110
111
int32_t
long_press_count
();
112
113
private
:
114
Surface
&
_surface
;
115
ID
_bid
;
/* device independent button ID */
116
Led
_led
;
117
PBD::microseconds_t
press_time
;
118
};
119
120
}
// US2400 namespace
121
}
// ArdourSurface namespace
122
123
#endif
types.h
ArdourSurface::US2400::Button
Definition:
surfaces/us2400/button.h:34
ArdourSurface::US2400::Button::surface
Surface & surface() const
Definition:
surfaces/us2400/button.h:104
ArdourSurface::US2400::Button::pressed
void pressed()
ArdourSurface::US2400::Button::long_press_count
int32_t long_press_count()
ArdourSurface::US2400::Button::Button
Button(Surface &s, ID bid, int did, std::string name, Group &group)
Definition:
surfaces/us2400/button.h:88
ArdourSurface::US2400::Button::mark_dirty
void mark_dirty()
Definition:
surfaces/us2400/button.h:106
ArdourSurface::US2400::Button::ID
ID
Definition:
surfaces/us2400/button.h:41
ArdourSurface::US2400::Button::Solo
@ Solo
Definition:
surfaces/us2400/button.h:77
ArdourSurface::US2400::Button::Rewind
@ Rewind
Definition:
surfaces/us2400/button.h:51
ArdourSurface::US2400::Button::ClearSolo
@ ClearSolo
Definition:
surfaces/us2400/button.h:69
ArdourSurface::US2400::Button::F4
@ F4
Definition:
surfaces/us2400/button.h:48
ArdourSurface::US2400::Button::F2
@ F2
Definition:
surfaces/us2400/button.h:46
ArdourSurface::US2400::Button::Select
@ Select
Definition:
surfaces/us2400/button.h:79
ArdourSurface::US2400::Button::Send
@ Send
Definition:
surfaces/us2400/button.h:67
ArdourSurface::US2400::Button::F1
@ F1
Definition:
surfaces/us2400/button.h:45
ArdourSurface::US2400::Button::F5
@ F5
Definition:
surfaces/us2400/button.h:49
ArdourSurface::US2400::Button::Play
@ Play
Definition:
surfaces/us2400/button.h:54
ArdourSurface::US2400::Button::Flip
@ Flip
Definition:
surfaces/us2400/button.h:58
ArdourSurface::US2400::Button::Right
@ Right
Definition:
surfaces/us2400/button.h:57
ArdourSurface::US2400::Button::Scrub
@ Scrub
Definition:
surfaces/us2400/button.h:44
ArdourSurface::US2400::Button::Record
@ Record
Definition:
surfaces/us2400/button.h:55
ArdourSurface::US2400::Button::CmdAlt
@ CmdAlt
Definition:
surfaces/us2400/button.h:73
ArdourSurface::US2400::Button::Option
@ Option
Definition:
surfaces/us2400/button.h:71
ArdourSurface::US2400::Button::MstrSelect
@ MstrSelect
Definition:
surfaces/us2400/button.h:59
ArdourSurface::US2400::Button::Pan
@ Pan
Definition:
surfaces/us2400/button.h:68
ArdourSurface::US2400::Button::Left
@ Left
Definition:
surfaces/us2400/button.h:56
ArdourSurface::US2400::Button::Ffwd
@ Ffwd
Definition:
surfaces/us2400/button.h:52
ArdourSurface::US2400::Button::F6
@ F6
Definition:
surfaces/us2400/button.h:50
ArdourSurface::US2400::Button::Mute
@ Mute
Definition:
surfaces/us2400/button.h:78
ArdourSurface::US2400::Button::FinalGlobalButton
@ FinalGlobalButton
Definition:
surfaces/us2400/button.h:61
ArdourSurface::US2400::Button::FaderTouch
@ FaderTouch
Definition:
surfaces/us2400/button.h:80
ArdourSurface::US2400::Button::Shift
@ Shift
Definition:
surfaces/us2400/button.h:70
ArdourSurface::US2400::Button::MasterFaderTouch
@ MasterFaderTouch
Definition:
surfaces/us2400/button.h:84
ArdourSurface::US2400::Button::Stop
@ Stop
Definition:
surfaces/us2400/button.h:53
ArdourSurface::US2400::Button::F3
@ F3
Definition:
surfaces/us2400/button.h:47
ArdourSurface::US2400::Button::Drop
@ Drop
Definition:
surfaces/us2400/button.h:66
ArdourSurface::US2400::Button::Ctrl
@ Ctrl
Definition:
surfaces/us2400/button.h:72
ArdourSurface::US2400::Button::id_to_name
static std::string id_to_name(Button::ID)
ArdourSurface::US2400::Button::factory
static Control * factory(Surface &surface, Button::ID bid, int id, const std::string &, Group &group)
ArdourSurface::US2400::Button::_bid
ID _bid
Definition:
surfaces/us2400/button.h:115
ArdourSurface::US2400::Button::press_time
PBD::microseconds_t press_time
Definition:
surfaces/us2400/button.h:117
ArdourSurface::US2400::Button::name_to_id
static int name_to_id(const std::string &name)
ArdourSurface::US2400::Button::_surface
Surface & _surface
Definition:
surfaces/us2400/button.h:114
ArdourSurface::US2400::Button::released
void released()
ArdourSurface::US2400::Button::bid
ID bid() const
Definition:
surfaces/us2400/button.h:98
ArdourSurface::US2400::Button::_led
Led _led
Definition:
surfaces/us2400/button.h:116
ArdourSurface::US2400::Button::zero
MidiByteArray zero()
Definition:
surfaces/us2400/button.h:95
ArdourSurface::US2400::Button::set_state
MidiByteArray set_state(LedState ls)
Definition:
surfaces/us2400/button.h:96
ArdourSurface::US2400::Control
Definition:
us2400/controls.h:49
ArdourSurface::US2400::Control::name
const std::string & name() const
Definition:
us2400/controls.h:55
ArdourSurface::US2400::Control::group
Group & group() const
Definition:
us2400/controls.h:56
ArdourSurface::US2400::Group
Definition:
surfaces/us2400/control_group.h:35
ArdourSurface::US2400::LedState
Definition:
surfaces/us2400/types.h:38
ArdourSurface::US2400::Led
Definition:
libs/surfaces/us2400/led.h:31
ArdourSurface::US2400::Led::set_state
MidiByteArray set_state(LedState)
ArdourSurface::US2400::Led::zero
MidiByteArray zero()
Definition:
libs/surfaces/us2400/led.h:51
ArdourSurface::US2400::Led::mark_dirty
void mark_dirty()
Definition:
libs/surfaces/us2400/led.h:46
ArdourSurface::US2400::Surface
Definition:
us2400/surface.h:67
MidiByteArray
Definition:
ctrl-interface/midi_surface/midi_surface/midi_byte_array.h:47
led.h
ArdourSurface
Definition:
cc121.h:71
PBD::DEBUG::US2400
DebugBits US2400
PBD::microseconds_t
int64_t microseconds_t
Definition:
microseconds.h:28
controls.h
libs
surfaces
us2400
button.h
Generated on Mon Nov 11 2024 08:48:51 for Ardour by
1.9.1