Control Surface main
MIDI Control Surface library for Arduino
Loading...
Searching...
No Matches
Protected Member Functions | 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)
 
static constexpr MIDIChannelCable invalid ()
 

Member access

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

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.
 
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.
 
constexpr bool isValid () const
 Check if the MIDI address is valid.
 
constexpr operator bool () const
 Check if the MIDI address is valid.
 

Base functions for address pattern matching.

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

Protected Member Functions

constexpr MIDIChannelCable (RawMIDIAddress addresses)
 

Private Attributes

RawMIDIAddress addresses
 

Constructor & Destructor Documentation

◆ MIDIChannelCable() [1/3]

constexpr MIDIChannelCable ( )
inlineconstexpr

Definition at line 31 of file MIDIAddress.hpp.

◆ MIDIChannelCable() [2/3]

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

Definition at line 32 of file MIDIAddress.hpp.

◆ MIDIChannelCable() [3/3]

constexpr MIDIChannelCable ( RawMIDIAddress addresses)
inlineconstexprprotected

Definition at line 104 of file MIDIAddress.hpp.

Member Function Documentation

◆ invalid()

static constexpr 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 108 of file MIDIAddress.hpp.


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