Public Member Functions | List of all members
universal_midi_packets::Packets Class Reference

Holds a collection of Universal MIDI Packets. More...

Public Member Functions

void add (const View &v)
 Adds a single packet to the collection. More...
 
void add (const PacketX1 &p)
 
void add (const PacketX2 &p)
 
void add (const PacketX3 &p)
 
void add (const PacketX4 &p)
 
void reserve (size_t numWords)
 Pre-allocates space for at least numWords 32-bit words in this collection. More...
 
void clear ()
 Removes all previously-added packets from this collection. More...
 
Iterator cbegin () const noexcept
 Gets an iterator pointing to the first packet in this collection. More...
 
Iterator begin () const noexcept
 
Iterator cend () const noexcept
 Gets an iterator pointing one-past the last packet in this collection. More...
 
Iterator end () const noexcept
 
const uint32_t * data () const noexcept
 Gets a pointer to the contents of the collection as a range of raw 32-bit words. More...
 
size_t size () const noexcept
 Returns the number of uint32_t words in storage. More...
 

Detailed Description

Holds a collection of Universal MIDI Packets.

Unlike MidiBuffer, this collection does not store any additional information (e.g. timestamps) alongside the raw messages.

If timestamps are required, these can be added to the container in UMP format, as Jitter Reduction Utility messages.

Member Function Documentation

◆ add() [1/5]

void universal_midi_packets::Packets::add ( const View v)

Adds a single packet to the collection.

The View must be valid for this to work. If the view points to a malformed message, or if the view points to a region too short for the contained message, this call will result in undefined behaviour.

References gl::v.

Referenced by universal_midi_packets::Conversion::toMidi1().

◆ add() [2/5]

void universal_midi_packets::Packets::add ( const PacketX1 p)

References gl::p.

◆ add() [3/5]

void universal_midi_packets::Packets::add ( const PacketX2 p)

References gl::p.

◆ add() [4/5]

void universal_midi_packets::Packets::add ( const PacketX3 p)

References gl::p.

◆ add() [5/5]

void universal_midi_packets::Packets::add ( const PacketX4 p)

References gl::p.

◆ reserve()

void universal_midi_packets::Packets::reserve ( size_t  numWords)

Pre-allocates space for at least numWords 32-bit words in this collection.

◆ clear()

void universal_midi_packets::Packets::clear ( )

Removes all previously-added packets from this collection.

◆ cbegin()

Iterator universal_midi_packets::Packets::cbegin ( ) const
noexcept

Gets an iterator pointing to the first packet in this collection.

References data(), and size().

Referenced by begin().

◆ begin()

Iterator universal_midi_packets::Packets::begin ( ) const
noexcept

References cbegin().

◆ cend()

Iterator universal_midi_packets::Packets::cend ( ) const
noexcept

Gets an iterator pointing one-past the last packet in this collection.

References data(), and size().

Referenced by end().

◆ end()

Iterator universal_midi_packets::Packets::end ( ) const
noexcept

References cend().

◆ data()

const uint32_t* universal_midi_packets::Packets::data ( ) const
noexcept

Gets a pointer to the contents of the collection as a range of raw 32-bit words.

Referenced by cbegin(), and cend().

◆ size()

size_t universal_midi_packets::Packets::size ( ) const
noexcept

Returns the number of uint32_t words in storage.

Note that this is likely to be larger than the number of packets currently being stored, as some packets span multiple words.

Referenced by cbegin(), and cend().


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