Control Surface master
MIDI Control Surface library for Arduino
Private Attributes | List of all members
MIDIChannelCable Class Reference

#include <Def/MIDIAddress.hpp>

Detailed Description

A class for saving a MIDI channel and cable number.

A MIDI channel and cable number can be marked "invalid". The MIDI sending functions (MIDI_Sender) will never send messages addressed to invalid channels or cables.

Definition at line 24 of file MIDIAddress.hpp.

+ Collaboration diagram for MIDIChannelCable:

Constructors

constexpr MIDIChannelCable ()
 
constexpr MIDIChannelCable (Channel channel, Cable cableNumber=CABLE_1)
 
constexpr static MIDIChannelCable invalid ()
 

Member access

constexpr Channel getChannel () const
 Get the channel [1, 16]. More...
 
constexpr uint8_t getRawChannel () const
 Get the channel as an integer [0, 15]. More...
 
constexpr Cable getCableNumber () const
 Get the cable number [CABLE_1, CABLE_16]. More...
 
constexpr uint8_t getRawCableNumber () const
 Get the cable number as an integer [0, 15]. More...
 

Checks

constexpr bool operator== (MIDIChannelCable rhs) const
 Check for equality: two addresses are equal if and only if they are both valid addresses and the MIDI channel and MIDI USB cable number are equal. More...
 
constexpr bool operator!= (MIDIChannelCable rhs) const
 Check for inequality: two addresses are not equal if and only if they are both valid addresses and have a MIDI channel or MIDI USB cable number that differs. More...
 
constexpr bool isValid () const
 Check if the MIDI address is valid. More...
 
constexpr operator bool () const
 Check if the MIDI address is valid. More...
 

Base functions for address pattern matching.

static bool matchSingle (MIDIChannelCable toMatch, MIDIChannelCable base)
 Check if two addresses match (are equal). More...
 

Private Attributes

RawMIDIAddress addresses
 

Constructor & Destructor Documentation

◆ MIDIChannelCable() [1/2]

constexpr MIDIChannelCable ( )
inlineconstexpr

Definition at line 31 of file MIDIAddress.hpp.

◆ MIDIChannelCable() [2/2]

constexpr MIDIChannelCable ( Channel  channel,
Cable  cableNumber = CABLE_1 
)
inlineconstexpr

Definition at line 32 of file MIDIAddress.hpp.

Member Function Documentation

◆ invalid()

constexpr static MIDIChannelCable invalid ( )
inlinestaticconstexpr
Examples
One-Pot-Both-PB-and-CC.ino.

Definition at line 35 of file MIDIAddress.hpp.

◆ getChannel()

constexpr Channel getChannel ( ) const
inlineconstexpr

Get the channel [1, 16].

Definition at line 44 of file MIDIAddress.hpp.

◆ getRawChannel()

constexpr uint8_t getRawChannel ( ) const
inlineconstexpr

Get the channel as an integer [0, 15].

Definition at line 46 of file MIDIAddress.hpp.

◆ getCableNumber()

constexpr Cable getCableNumber ( ) const
inlineconstexpr

Get the cable number [CABLE_1, CABLE_16].

Definition at line 49 of file MIDIAddress.hpp.

◆ getRawCableNumber()

constexpr uint8_t getRawCableNumber ( ) const
inlineconstexpr

Get the cable number as an integer [0, 15].

Definition at line 53 of file MIDIAddress.hpp.

◆ operator==()

constexpr bool operator== ( MIDIChannelCable  rhs) const
inlineconstexpr

Check for equality: two addresses are equal if and only if they are both valid addresses and the MIDI channel and MIDI USB cable number are equal.

Note
Invalid addresses are not equal nor inequal.

Definition at line 67 of file MIDIAddress.hpp.

◆ operator!=()

constexpr bool operator!= ( MIDIChannelCable  rhs) const
inlineconstexpr

Check for inequality: two addresses are not equal if and only if they are both valid addresses and have a MIDI channel or MIDI USB cable number that differs.

Note
Invalid addresses are not equal nor inequal.

Definition at line 77 of file MIDIAddress.hpp.

◆ isValid()

constexpr bool isValid ( ) const
inlineconstexpr

Check if the MIDI address is valid.

Definition at line 84 of file MIDIAddress.hpp.

◆ operator bool()

constexpr operator bool ( ) const
inlineexplicitconstexpr

Check if the MIDI address is valid.

See also
isValid

Definition at line 88 of file MIDIAddress.hpp.

◆ matchSingle()

static bool matchSingle ( MIDIChannelCable  toMatch,
MIDIChannelCable  base 
)
inlinestatic

Check if two addresses match (are equal).

Definition at line 97 of file MIDIAddress.hpp.

Member Data Documentation

◆ addresses

RawMIDIAddress addresses
private

Definition at line 104 of file MIDIAddress.hpp.


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