ASPiK SDK
AUMIDIEventQueue Class Reference

The AUMIDIEventQueue interface queues incoming MIDI messages and blasts them out during the buffer processing phase. More...

#include <aufxplugin.h>

Inheritance diagram for AUMIDIEventQueue:
IMidiEventQueue

Public Member Functions

 AUMIDIEventQueue (PluginCore *_pluginCore)
 
virtual ~AUMIDIEventQueue ()
 
void clearEvents ()
 
void clearQueueAEvents ()
 
void clearQueueBEvents ()
 
void toggleQueue ()
 
void addEvent (midiEvent event)
 
virtual unsigned int getEventCount ()
 
virtual bool fireMidiEvents (unsigned int sampleOffset)
 
- Public Member Functions inherited from IMidiEventQueue
virtual bool fireMidiEvents (uint32_t uSampleOffset)=0
 

Protected Attributes

PluginCorepluginCore = nullptr
 the core object to send MIDI messages to
 
std::queue< midiEventmidiEventQueueA
 queue A
 
std::queue< midiEventmidiEventQueueB
 queue B
 
std::atomic< bool > writingQueueA
 atomic flag for toggling buffers
 

Detailed Description

The AUMIDIEventQueue interface queues incoming MIDI messages and blasts them out during the buffer processing phase.

NOTES:

  • the current version uses a pair of queues and an atomic boolean flag to implement a double-buffer scheme
  • this will be updated later to use a lock-free ring buffer but the operation will remain transparemt
Author
Will Pirkle http://www.willpirkle.com
Remarks
This object is included in Designing Audio Effects Plugins in C++ 2nd Ed. by Will Pirkle
Version
Revision : 1.0
Date
Date : 2018 / 09 / 7

Constructor & Destructor Documentation

◆ AUMIDIEventQueue()

AUMIDIEventQueue::AUMIDIEventQueue ( PluginCore _pluginCore)
inline

consruct with a core pointer

◆ ~AUMIDIEventQueue()

virtual AUMIDIEventQueue::~AUMIDIEventQueue ( )
inlinevirtual

just clear out the events that may remain

Member Function Documentation

◆ addEvent()

void AUMIDIEventQueue::addEvent ( midiEvent  event)
inline

add a MIDI event to the currently active writing queue

◆ clearEvents()

void AUMIDIEventQueue::clearEvents ( )
inline

clear both A and B queues

◆ clearQueueAEvents()

void AUMIDIEventQueue::clearQueueAEvents ( )
inline

clear queue A

◆ clearQueueBEvents()

void AUMIDIEventQueue::clearQueueBEvents ( )
inline

clear queue B

◆ fireMidiEvents()

virtual bool AUMIDIEventQueue::fireMidiEvents ( unsigned int  sampleOffset)
inlinevirtual

send MIDI event with this sample offset to the core for processing

◆ getEventCount()

virtual unsigned int AUMIDIEventQueue::getEventCount ( )
inlinevirtual

get a MIDI event from the currently active reading queue

Implements IMidiEventQueue.

◆ toggleQueue()

void AUMIDIEventQueue::toggleQueue ( )
inline

atomic flag toggle


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