#include <MIDI_Parsers/MIDI_MessageTypes.hpp>
Definition at line 205 of file MIDI_MessageTypes.hpp.
Public Member Functions | |
ChannelMessage (MIDIMessageType type, Channel channel, uint8_t data1, uint8_t data2=0x00, Cable cable=Cable_1) | |
Constructor. | |
ChannelMessage (const MIDIMessage &msg) | |
MIDIMessageType | getMessageType () const |
Get the MIDI message type. | |
void | setMessageType (MIDIMessageType type) |
Set the MIDI message type. | |
Channel | getChannel () const |
Get the MIDI channel of the message. | |
void | setChannel (Channel channel) |
Set the MIDI channel of the message. | |
MIDIChannelCable | getChannelCable () const |
Get the MIDI channel and cable number. | |
MIDIAddress | getAddress () const |
Get the MIDI address of this message, using data1 as the address. | |
bool | hasTwoDataBytes () const |
Check whether this message has one or two data bytes. | |
MIDIMessage (uint8_t header, uint8_t data1, uint8_t data2, Cable cable=Cable_1) | |
Constructor. | |
MIDIMessage (MIDIMessageType header, uint8_t data1, uint8_t data2, Cable cable=Cable_1) | |
Constructor. | |
bool | operator== (MIDIMessage other) const |
Check for equality. | |
bool | operator!= (MIDIMessage other) const |
Check for inequality. | |
uint8_t | getData1 () const |
Get the first data byte. | |
uint8_t | getData2 () const |
Get the second data byte. | |
void | setData1 (uint8_t data) |
Set the first data byte. | |
void | setData2 (uint8_t data) |
Set the second data byte. | |
Cable | getCable () const |
Get the MIDI USB cable number of the message. | |
void | setCable (Cable cable) |
Set the MIDI USB cable number of the message. | |
bool | hasValidChannelMessageHeader () const |
Check whether the header is a valid header for a channel message. | |
bool | hasValidSystemCommonHeader () const |
Check whether the header is a valid header for a System Common message. | |
uint16_t | getData14bit () const |
If Data 1 and Data 2 represent a single 14-bit number, you can use this method to retrieve that number. | |
void | setData14bit (uint16_t data) |
If Data 1 and Data 2 represent a single 14-bit number, you can use this method to set that number. | |
void | sanitize () |
Make sure that the status byte has the most significant bit set and the data bytes have the most significant bits cleared. | |
Public Attributes | |
uint8_t | header |
MIDI status byte (message type and channel). | |
uint8_t | data1 |
First MIDI data byte. | |
uint8_t | data2 |
First MIDI data byte. | |
Cable | cable |
USB MIDI cable number;. | |
Static Public Attributes | |
static constexpr auto | NoteOff = MIDIMessageType::NoteOff |
static constexpr auto | NoteOn = MIDIMessageType::NoteOn |
static constexpr auto | KeyPressure = MIDIMessageType::KeyPressure |
static constexpr auto | ControlChange = MIDIMessageType::ControlChange |
static constexpr auto | ProgramChange = MIDIMessageType::ProgramChange |
static constexpr auto | ChannelPressure = MIDIMessageType::ChannelPressure |
static constexpr auto | PitchBend = MIDIMessageType::PitchBend |
|
inline |
Constructor.
Definition at line 209 of file MIDI_MessageTypes.hpp.
|
inlineexplicit |
Definition at line 213 of file MIDI_MessageTypes.hpp.
|
inline |
Get the MIDI message type.
Definition at line 216 of file MIDI_MessageTypes.hpp.
|
inline |
Set the MIDI message type.
Definition at line 220 of file MIDI_MessageTypes.hpp.
|
inline |
Get the MIDI channel of the message.
Definition at line 226 of file MIDI_MessageTypes.hpp.
|
inline |
Set the MIDI channel of the message.
Definition at line 228 of file MIDI_MessageTypes.hpp.
|
inline |
Get the MIDI channel and cable number.
Definition at line 236 of file MIDI_MessageTypes.hpp.
|
inline |
Get the MIDI address of this message, using data1
as the address.
data1
will have a different meaning in those cases. Definition at line 240 of file MIDI_MessageTypes.hpp.
|
inline |
Check whether this message has one or two data bytes.
Returns false if the header is a SysEx, Real-Time or System Common byte.
Definition at line 248 of file MIDI_MessageTypes.hpp.
|
inline |
Constructor.
Definition at line 117 of file MIDI_MessageTypes.hpp.
|
inline |
Constructor.
Definition at line 122 of file MIDI_MessageTypes.hpp.
|
inlineinherited |
Check for equality.
Definition at line 133 of file MIDI_MessageTypes.hpp.
|
inlineinherited |
Check for inequality.
Definition at line 138 of file MIDI_MessageTypes.hpp.
|
inlineinherited |
Get the first data byte.
Definition at line 156 of file MIDI_MessageTypes.hpp.
|
inlineinherited |
Get the second data byte.
Definition at line 158 of file MIDI_MessageTypes.hpp.
|
inlineinherited |
Set the first data byte.
Definition at line 160 of file MIDI_MessageTypes.hpp.
|
inlineinherited |
Set the second data byte.
Definition at line 162 of file MIDI_MessageTypes.hpp.
|
inlineinherited |
Get the MIDI USB cable number of the message.
Definition at line 165 of file MIDI_MessageTypes.hpp.
|
inlineinherited |
Set the MIDI USB cable number of the message.
Definition at line 167 of file MIDI_MessageTypes.hpp.
|
inlineinherited |
Check whether the header is a valid header for a channel message.
Definition at line 170 of file MIDI_MessageTypes.hpp.
|
inlineinherited |
Check whether the header is a valid header for a System Common message.
Definition at line 180 of file MIDI_MessageTypes.hpp.
|
inlineinherited |
If Data 1 and Data 2 represent a single 14-bit number, you can use this method to retrieve that number.
Definition at line 186 of file MIDI_MessageTypes.hpp.
|
inlineinherited |
If Data 1 and Data 2 represent a single 14-bit number, you can use this method to set that number.
Definition at line 191 of file MIDI_MessageTypes.hpp.
|
inlineinherited |
Make sure that the status byte has the most significant bit set and the data bytes have the most significant bits cleared.
Definition at line 198 of file MIDI_MessageTypes.hpp.
|
staticconstexpr |
Definition at line 254 of file MIDI_MessageTypes.hpp.
|
staticconstexpr |
Definition at line 255 of file MIDI_MessageTypes.hpp.
|
staticconstexpr |
Definition at line 256 of file MIDI_MessageTypes.hpp.
|
staticconstexpr |
Definition at line 257 of file MIDI_MessageTypes.hpp.
|
staticconstexpr |
Definition at line 258 of file MIDI_MessageTypes.hpp.
|
staticconstexpr |
Definition at line 259 of file MIDI_MessageTypes.hpp.
|
staticconstexpr |
Definition at line 260 of file MIDI_MessageTypes.hpp.
|
inherited |
MIDI status byte (message type and channel).
Definition at line 126 of file MIDI_MessageTypes.hpp.
|
inherited |
First MIDI data byte.
Definition at line 127 of file MIDI_MessageTypes.hpp.
|
inherited |
First MIDI data byte.
Definition at line 128 of file MIDI_MessageTypes.hpp.
|
inherited |
USB MIDI cable number;.
Definition at line 130 of file MIDI_MessageTypes.hpp.