#include <MIDI_Parsers/MIDI_MessageTypes.hpp>
Definition at line 175 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. More... | |
ChannelMessage (const MIDIMessage &msg) | |
MIDIMessageType | getMessageType () const |
Get the MIDI message type. More... | |
void | setMessageType (MIDIMessageType type) |
Set the MIDI message type. More... | |
Channel | getChannel () const |
Get the MIDI channel of the message. More... | |
void | setChannel (Channel channel) |
Set the MIDI channel of the message. More... | |
MIDIChannelCable | getChannelCable () const |
Get the MIDI channel and cable number. More... | |
MIDIAddress | getAddress () const |
Get the MIDI address of this message, using data1 as the address. More... | |
bool | hasTwoDataBytes () const |
Check whether this message has one or two data bytes. More... | |
MIDIMessage (uint8_t header, uint8_t data1, uint8_t data2, Cable cable=CABLE_1) | |
Constructor. More... | |
MIDIMessage (MIDIMessageType header, uint8_t data1, uint8_t data2, Cable cable=CABLE_1) | |
Constructor. More... | |
bool | operator== (MIDIMessage other) const |
Check for equality. More... | |
bool | operator!= (MIDIMessage other) const |
Check for inequality. More... | |
uint8_t | getData1 () const |
Get the first data byte. More... | |
uint8_t | getData2 () const |
Get the second data byte. More... | |
void | setData1 (uint8_t data) |
Set the first data byte. More... | |
void | setData2 (uint8_t data) |
Set the second data byte. More... | |
Cable | getCable () const |
Get the MIDI USB cable number of the message. More... | |
void | setCable (Cable cable) |
Set the MIDI USB cable number of the message. More... | |
bool | hasValidChannelMessageHeader () const |
Check whether the header is a valid header for a channel message. More... | |
bool | hasValidSystemCommonHeader () const |
Check whether the header is a valid header for a System Common message. More... | |
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. More... | |
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. More... | |
void | sanitize () |
Make sure that the status byte has the most significant bit set and the data bytes have the most significant bits cleared. More... | |
Public Attributes | |
uint8_t | header |
MIDI status byte (message type and channel). More... | |
uint8_t | data1 |
First MIDI data byte. More... | |
uint8_t | data2 |
First MIDI data byte. More... | |
Cable | cable |
USB MIDI cable number;. More... | |
Static Public Attributes | |
static constexpr auto | NOTE_OFF = MIDIMessageType::NOTE_OFF |
static constexpr auto | NOTE_ON = MIDIMessageType::NOTE_ON |
static constexpr auto | KEY_PRESSURE = MIDIMessageType::KEY_PRESSURE |
static constexpr auto | CC = MIDIMessageType::CC |
static constexpr auto | CONTROL_CHANGE = MIDIMessageType::CONTROL_CHANGE |
static constexpr auto | PROGRAM_CHANGE = MIDIMessageType::PROGRAM_CHANGE |
static constexpr auto | CHANNEL_PRESSURE = MIDIMessageType::CHANNEL_PRESSURE |
static constexpr auto | PITCH_BEND = MIDIMessageType::PITCH_BEND |
|
inline |
Constructor.
Definition at line 179 of file MIDI_MessageTypes.hpp.
|
inlineexplicit |
Definition at line 183 of file MIDI_MessageTypes.hpp.
|
inline |
Get the MIDI message type.
Definition at line 186 of file MIDI_MessageTypes.hpp.
|
inline |
Set the MIDI message type.
Definition at line 190 of file MIDI_MessageTypes.hpp.
|
inline |
Get the MIDI channel of the message.
Definition at line 196 of file MIDI_MessageTypes.hpp.
|
inline |
Set the MIDI channel of the message.
Definition at line 198 of file MIDI_MessageTypes.hpp.
|
inline |
Get the MIDI channel and cable number.
Definition at line 206 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 210 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 218 of file MIDI_MessageTypes.hpp.
|
inline |
Constructor.
Definition at line 87 of file MIDI_MessageTypes.hpp.
|
inline |
Constructor.
Definition at line 92 of file MIDI_MessageTypes.hpp.
|
inlineinherited |
Check for equality.
Definition at line 103 of file MIDI_MessageTypes.hpp.
|
inlineinherited |
Check for inequality.
Definition at line 108 of file MIDI_MessageTypes.hpp.
|
inlineinherited |
Get the first data byte.
Definition at line 126 of file MIDI_MessageTypes.hpp.
|
inlineinherited |
Get the second data byte.
Definition at line 128 of file MIDI_MessageTypes.hpp.
|
inlineinherited |
Set the first data byte.
Definition at line 130 of file MIDI_MessageTypes.hpp.
|
inlineinherited |
Set the second data byte.
Definition at line 132 of file MIDI_MessageTypes.hpp.
|
inlineinherited |
Get the MIDI USB cable number of the message.
Definition at line 135 of file MIDI_MessageTypes.hpp.
|
inlineinherited |
Set the MIDI USB cable number of the message.
Definition at line 137 of file MIDI_MessageTypes.hpp.
|
inlineinherited |
Check whether the header is a valid header for a channel message.
Definition at line 140 of file MIDI_MessageTypes.hpp.
|
inlineinherited |
Check whether the header is a valid header for a System Common message.
Definition at line 150 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 156 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 161 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 168 of file MIDI_MessageTypes.hpp.
|
staticconstexpr |
Definition at line 224 of file MIDI_MessageTypes.hpp.
|
staticconstexpr |
Definition at line 225 of file MIDI_MessageTypes.hpp.
|
staticconstexpr |
Definition at line 226 of file MIDI_MessageTypes.hpp.
|
staticconstexpr |
Definition at line 227 of file MIDI_MessageTypes.hpp.
|
staticconstexpr |
Definition at line 228 of file MIDI_MessageTypes.hpp.
|
staticconstexpr |
Definition at line 229 of file MIDI_MessageTypes.hpp.
|
staticconstexpr |
Definition at line 230 of file MIDI_MessageTypes.hpp.
|
staticconstexpr |
Definition at line 231 of file MIDI_MessageTypes.hpp.
|
inherited |
MIDI status byte (message type and channel).
Definition at line 96 of file MIDI_MessageTypes.hpp.
|
inherited |
First MIDI data byte.
Definition at line 97 of file MIDI_MessageTypes.hpp.
|
inherited |
First MIDI data byte.
Definition at line 98 of file MIDI_MessageTypes.hpp.
|
inherited |
USB MIDI cable number;.
Definition at line 100 of file MIDI_MessageTypes.hpp.