Control Surface  1.2.0
MIDI Control Surface library for Arduino
Public Member Functions | Public Attributes | List of all members
ChannelMessage Struct Reference

#include <MIDI_Parsers/MIDI_MessageTypes.hpp>

+ Collaboration diagram for ChannelMessage:

Public Member Functions

 ChannelMessage (uint8_t header, uint8_t data1, uint8_t data2, uint8_t CN)
 Constructor. More...
 
 ChannelMessage (MIDIMessageType type, Channel channel, uint8_t data1, uint8_t data2=0x00, Cable cable=CABLE_1)
 Constructor. More...
 
bool operator== (ChannelMessage other) const
 Check for equality. More...
 
bool operator!= (ChannelMessage other) const
 Check for inequality. More...
 
Channel getChannel () const
 Get the MIDI channel of the message. More...
 
void setChannel (Channel channel)
 Set the MIDI channel of the message. 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...
 
MIDIMessageType getMessageType () const
 Get the MIDI message type. More...
 
void setMessageType (MIDIMessageType type)
 Set the MIDI message type. More...
 
bool hasTwoDataBytes () const
 Check whether this message has one or two data bytes. More...
 
bool hasValidHeader () const
 Check whether the header is a valid header for a channel message. 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...
 
uint8_t CN
 USB MIDI cable number;. More...
 

Detailed Description

Examples
Mackie-Control-Universal-Reverse-Engineering.ino, MIDI-Input-Callback.ino, and MIDI-Input.ino.

Definition at line 72 of file MIDI_MessageTypes.hpp.

Constructor & Destructor Documentation

◆ ChannelMessage() [1/2]

ChannelMessage ( uint8_t  header,
uint8_t  data1,
uint8_t  data2,
uint8_t  CN 
)
inline

Constructor.

Definition at line 74 of file MIDI_MessageTypes.hpp.

◆ ChannelMessage() [2/2]

ChannelMessage ( MIDIMessageType  type,
Channel  channel,
uint8_t  data1,
uint8_t  data2 = 0x00,
Cable  cable = CABLE_1 
)
inline

Constructor.

Definition at line 78 of file MIDI_MessageTypes.hpp.

Member Function Documentation

◆ operator==()

bool operator== ( ChannelMessage  other) const
inline

Check for equality.

Definition at line 90 of file MIDI_MessageTypes.hpp.

◆ operator!=()

bool operator!= ( ChannelMessage  other) const
inline

Check for inequality.

Definition at line 95 of file MIDI_MessageTypes.hpp.

◆ getChannel()

Channel getChannel ( ) const
inline

Get the MIDI channel of the message.

Definition at line 98 of file MIDI_MessageTypes.hpp.

◆ setChannel()

void setChannel ( Channel  channel)
inline

Set the MIDI channel of the message.

Definition at line 100 of file MIDI_MessageTypes.hpp.

◆ getCable()

Cable getCable ( ) const
inline

Get the MIDI USB cable number of the message.

Definition at line 106 of file MIDI_MessageTypes.hpp.

◆ setCable()

void setCable ( Cable  cable)
inline

Set the MIDI USB cable number of the message.

Definition at line 108 of file MIDI_MessageTypes.hpp.

◆ getMessageType()

MIDIMessageType getMessageType ( ) const
inline

Get the MIDI message type.

Definition at line 111 of file MIDI_MessageTypes.hpp.

◆ setMessageType()

void setMessageType ( MIDIMessageType  type)
inline

Set the MIDI message type.

Definition at line 115 of file MIDI_MessageTypes.hpp.

◆ hasTwoDataBytes()

bool hasTwoDataBytes ( ) const
inline

Check whether this message has one or two data bytes.

  • 2 data bytes: Note On/Off, Aftertouch, Control Change or Pitch Bend
  • 1 data byte: Program Change or Channel Pressure

Definition at line 124 of file MIDI_MessageTypes.hpp.

◆ hasValidHeader()

bool hasValidHeader ( ) const
inline

Check whether the header is a valid header for a channel message.

Definition at line 131 of file MIDI_MessageTypes.hpp.

Member Data Documentation

◆ header

uint8_t header

MIDI status byte (message type and channel).

Examples
Mackie-Control-Universal-Reverse-Engineering.ino, MIDI-Input-Callback.ino, and MIDI-Input.ino.

Definition at line 83 of file MIDI_MessageTypes.hpp.

◆ data1

uint8_t data1

◆ data2

uint8_t data2

◆ CN

uint8_t CN

USB MIDI cable number;.

Examples
MIDI-Input-Callback.ino, and MIDI-Input.ino.

Definition at line 87 of file MIDI_MessageTypes.hpp.


The documentation for this struct was generated from the following file: