| 
   
    MIDI Control Surface library for Arduino 
   | 
 
 
 
 
Go to the documentation of this file.
   11 struct __attribute__((packed)) RawMIDICNChannelAddress {
 
   15     uint8_t cableNumber : 4;
 
   48     constexpr 
explicit operator bool()
 const { 
return isValid(); }
 
   65                                            int deltaCableNumber = 0)
 
   68               (uint8_t)deltaAddress,
 
   69               (uint8_t)deltaChannel,
 
   70               (uint8_t)deltaCableNumber,
 
   76     static_assert(((-1) & 0x7F) == 0x7F,
 
   77                   "Negative numbers must be two's complement");
 
   99                                    int cableNumber = 0x0)
 
  103               (uint8_t)channel.getRaw(),
 
  104               (uint8_t)cableNumber,
 
  110               (uint8_t)channel.
getRaw(),
 
  111               (uint8_t)cableNumber,
 
  127         return this->addresses.valid && rhs.
addresses.valid &&
 
  128                this->addresses.address == rhs.
addresses.address &&
 
  129                this->addresses.channel == rhs.
addresses.channel &&
 
  130                this->addresses.cableNumber == rhs.
addresses.cableNumber;
 
  134         return this->addresses.valid && rhs.
addresses.valid &&
 
  135                !(this->addresses.address == rhs.
addresses.address &&
 
  136                  this->addresses.channel == rhs.
addresses.channel &&
 
  137                  this->addresses.cableNumber == rhs.
addresses.cableNumber);
 
  158     constexpr 
explicit operator bool()
 const { 
return isValid(); }
 
  
constexpr uint8_t getRawChannel() const
Get the channel as an integer [0, 15].
 
constexpr MIDICNChannel(Channel channel, int cableNumber=0)
 
A type-safe class for MIDI channels.
 
constexpr uint8_t getCableNumber() const
Get the cable number [0, 15].
 
RawMIDICNChannelAddress addresses
 
constexpr MIDICNChannelAddress(Channel channel, int cableNumber=0x0)
 
constexpr bool isValid() const
Check if the MIDI address is valid.
 
constexpr bool operator==(const MIDICNChannelAddress &rhs) const
 
MIDICNChannelAddress operator+(const RelativeMIDICNChannelAddress &rhs) const
 
constexpr bool isValid() const
Check if the MIDI address is valid.
 
constexpr bool isValid() const
 
#define BEGIN_CS_NAMESPACE
 
constexpr RelativeMIDICNChannelAddress()
 
A class for saving an offset to a MIDI address.
 
MIDICNChannelAddress operator-(const RelativeMIDICNChannelAddress &rhs) const
 
MIDICNChannelAddress & operator+=(const RelativeMIDICNChannelAddress &rhs)
 
MIDICNChannelAddress & operator-=(const RelativeMIDICNChannelAddress &rhs)
 
constexpr MIDICNChannelAddress()
 
constexpr Channel getChannel() const
Get the channel [1, 16].
 
A type-safe utility class for saving a MIDI address consisting of a 7-bit address,...
 
constexpr MIDICNChannel()
 
constexpr int8_t getRaw() const
Get the channel as an integer.
 
constexpr bool operator!=(const MIDICNChannelAddress &rhs) const
 
A class for saving a MIDI channel and cable number.
 
constexpr uint8_t getAddress() const
Get the address [0, 127].
 
constexpr MIDICNChannelAddress(int address, MIDICNChannel channelCN)
 
constexpr MIDICNChannelAddress(int address, Channel channel=CHANNEL_1, int cableNumber=0x0)
 
static bool matchSingle(const MIDICNChannelAddress &toMatch, const MIDICNChannelAddress &base)
Check if two addresses match.
 
constexpr static MIDICNChannel invalid()
 
constexpr uint8_t getRawChannel() const
Get the channel [0, 15].
 
RawMIDICNChannelAddress addresses
 
constexpr uint8_t getCableNumber() const
Get the cable number [0, 15].
 
constexpr Channel getChannel() const
Get the channel [CHANNEL_1, CHANNEL_16].
 
constexpr Channel CHANNEL_1
 
constexpr RelativeMIDICNChannelAddress(int deltaAddress, int deltaChannel=0, int deltaCableNumber=0)
 
static bool matchAddressInRange(const MIDICNChannelAddress &toMatch, const MIDICNChannelAddress &base, uint8_t length)
Check if an address falls within a range of addresses, starting with address base,...
 
constexpr MIDICNChannelAddress(const MIDICNChannel &address)
 
constexpr static MIDICNChannelAddress invalid()
 
RawMIDICNChannelAddress addresses