wavelength 1.0.0
Loading...
Searching...
No Matches
MidiEventQueue Class Reference

Ring buffers of MIDI messages stamped with the system clock time they fall due. More...

#include <midieventqueue.h>

Public Types

enum  Queue { kPrimaryQueue = 0 , kSecondaryQueue = 1 }
 The queues Push() selects. More...

Static Public Member Functions

static void Push (MidiEvent event, unsigned int timeLow, unsigned int timeHigh, int queue)
 Append a message.
static bool Pop (MidiEvent *event, unsigned int timeLow, unsigned int timeHigh)
 Remove the oldest message of the primary queue when it is due.

Static Public Attributes

static constexpr int kCapacity = 500

Detailed Description

Ring buffers of MIDI messages stamped with the system clock time they fall due.

The class has no RTTI, and its name is inferred from its role. Every member is static. There are two queues, but only the first is ever filled or drained. A push that would fill a queue empties it first.

Member Enumeration Documentation

◆ Queue

The queues Push() selects.

Enumerator
kPrimaryQueue 

The queue Pop() drains.

kSecondaryQueue 

Any other value; never drained.

Member Function Documentation

◆ Push()

void MidiEventQueue::Push ( MidiEvent event,
unsigned int timeLow,
unsigned int timeHigh,
int queue )
static

Append a message.

Parameters
eventThe message.
timeLowLow word of the due time.
timeHighHigh word of the due time.
queuekPrimaryQueue, or any other value for the secondary queue.
Ghidra address:
NTSC-U/C: 0x00000d7c
Ghidra address:
PAL: 0x00000d7c

◆ Pop()

bool MidiEventQueue::Pop ( MidiEvent * event,
unsigned int timeLow,
unsigned int timeHigh )
static

Remove the oldest message of the primary queue when it is due.

A message counts as due when its high word is below the current one, or when the current low word has reached its low word whatever the high words.

Parameters
eventReceives the message.
timeLowLow word of the current time.
timeHighHigh word of the current time.
Returns
True when a message was removed.
Ghidra address:
NTSC-U/C: 0x00000ef0
Ghidra address:
PAL: 0x00000ef0

Member Data Documentation

◆ kCapacity

int MidiEventQueue::kCapacity = 500
staticconstexpr

Slots of each queue.


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