Om  1.0.0
A universal framework for multimedia simulation
Public Member Functions | List of all members
om::sound::base::MIDIBuffer Class Reference

A class that represents a sequence of MIDI events. More...

#include <omSoundMIDIBuffer.h>

Public Member Functions

 MIDIBuffer ()
 Create an empty MIDI buffer with the default initial capacity. More...
 
 ~MIDIBuffer ()
 Destroy a MIDI buffer, deallocating its internal array of events. More...
 
MIDIBufferoperator= (const MIDIBuffer &other)
 Assign the contents of the specified MIDI buffer to this one. More...
 
Size getEventCount () const
 Return the total number of valid events that are part of this MIDI buffer. More...
 
MIDIEventgetEvent (Index eventIndex)
 Return a reference to the MIDI event at the specified index in this MIDI buffer. More...
 
const MIDIEventgetEvent (Index eventIndex) const
 Return a const reference to the MIDI event at the specified index in this MIDI buffer. More...
 
void addEvent (const MIDIEvent &newEvent)
 Add a new MIDI event to the end of this MIDI buffer. More...
 
void clearEvents ()
 Remove all events from this MIDI buffer. More...
 
const MIDITimegetTime () const
 Return the musical time within the MIDI sequence for the start of this frame. More...
 
void setTime (const MIDITime &newTime)
 Set the musical time within the MIDI sequence for the start of this frame. More...
 
void copyTo (MIDIBuffer &other) const
 Copy the entire contents of this buffer to another MIDI buffer, including the MIDI time. More...
 

Detailed Description

A class that represents a sequence of MIDI events.

A MIDI buffer keeps a small local storage space for events which avoids allocating any extra memory when the total number of events in a buffer small (less than a few).

Constructor & Destructor Documentation

om::sound::base::MIDIBuffer::MIDIBuffer ( )

Create an empty MIDI buffer with the default initial capacity.

om::sound::base::MIDIBuffer::~MIDIBuffer ( )

Destroy a MIDI buffer, deallocating its internal array of events.

Member Function Documentation

MIDIBuffer& om::sound::base::MIDIBuffer::operator= ( const MIDIBuffer other)

Assign the contents of the specified MIDI buffer to this one.

Size om::sound::base::MIDIBuffer::getEventCount ( ) const
inline

Return the total number of valid events that are part of this MIDI buffer.

MIDIEvent& om::sound::base::MIDIBuffer::getEvent ( Index  eventIndex)
inline

Return a reference to the MIDI event at the specified index in this MIDI buffer.

const MIDIEvent& om::sound::base::MIDIBuffer::getEvent ( Index  eventIndex) const
inline

Return a const reference to the MIDI event at the specified index in this MIDI buffer.

void om::sound::base::MIDIBuffer::addEvent ( const MIDIEvent newEvent)
inline

Add a new MIDI event to the end of this MIDI buffer.

void om::sound::base::MIDIBuffer::clearEvents ( )
inline

Remove all events from this MIDI buffer.

const MIDITime& om::sound::base::MIDIBuffer::getTime ( ) const
inline

Return the musical time within the MIDI sequence for the start of this frame.

void om::sound::base::MIDIBuffer::setTime ( const MIDITime newTime)
inline

Set the musical time within the MIDI sequence for the start of this frame.

void om::sound::base::MIDIBuffer::copyTo ( MIDIBuffer other) const

Copy the entire contents of this buffer to another MIDI buffer, including the MIDI time.


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