Classes | Static Public Member Functions | List of all members
universal_midi_packets::Utils Struct Reference

Helpful types and functions for interacting with Universal MIDI Packets. More...

Classes

struct  U16
 Helper functions for setting/getting 16-bit ranges inside a 32-bit word. More...
 
struct  U4
 Helper functions for setting/getting 4-bit ranges inside a 32-bit word. More...
 
struct  U8
 Helper functions for setting/getting 8-bit ranges inside a 32-bit word. More...
 

Static Public Member Functions

static constexpr uint32_t bytesToWord (uint8_t a, uint8_t b, uint8_t c, uint8_t d)
 Joins 4 bytes into a single 32-bit word. More...
 
static uint32_t getNumWordsForMessageType (uint32_t)
 Returns the expected number of 32-bit words in a Universal MIDI Packet, given the first word of the packet. More...
 
static constexpr uint8_t getMessageType (uint32_t w) noexcept
 
static constexpr uint8_t getGroup (uint32_t w) noexcept
 
static constexpr uint8_t getStatus (uint32_t w) noexcept
 
static constexpr uint8_t getChannel (uint32_t w) noexcept
 

Detailed Description

Helpful types and functions for interacting with Universal MIDI Packets.

Member Function Documentation

◆ bytesToWord()

static constexpr uint32_t universal_midi_packets::Utils::bytesToWord ( uint8_t  a,
uint8_t  b,
uint8_t  c,
uint8_t  d 
)
staticconstexpr

◆ getNumWordsForMessageType()

static uint32_t universal_midi_packets::Utils::getNumWordsForMessageType ( uint32_t  )
static

Returns the expected number of 32-bit words in a Universal MIDI Packet, given the first word of the packet.

The result will be between 1 and 4 inclusive. A result of 1 means that the word is itself a complete packet.

Referenced by universal_midi_packets::Dispatcher::dispatch(), and universal_midi_packets::Packet< numWords >::Packet().

◆ getMessageType()

static constexpr uint8_t universal_midi_packets::Utils::getMessageType ( uint32_t  w)
staticconstexprnoexcept

◆ getGroup()

static constexpr uint8_t universal_midi_packets::Utils::getGroup ( uint32_t  w)
staticconstexprnoexcept

◆ getStatus()

static constexpr uint8_t universal_midi_packets::Utils::getStatus ( uint32_t  w)
staticconstexprnoexcept

◆ getChannel()

static constexpr uint8_t universal_midi_packets::Utils::getChannel ( uint32_t  w)
staticconstexprnoexcept

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