![]() |
Deluge Firmware 1.3.0
Build date: 2026.10.14
|
#include <midi_queue.h>
Public Member Functions | |
| bool | push (MIDIMessage message, int32_t filter, bool usb, bool din, uint32_t due, uint32_t now) |
| bool | popDue (QueuedMIDI &out, uint32_t now, bool all=false) |
| bool | popOldest (QueuedMIDI &out) |
| bool | nextDue (uint32_t &due) |
| Consumer only. Get the due time of the oldest queued MIDI. Returns false if nothing's queued. | |
| bool | empty () const |
| bool | full () const |
| size_t | size () const |
Private Attributes | |
| etl::queue_spsc_atomic< QueuedMIDI, kCapacity > | queue_ |
MIDI waiting to be sent at its due time. Lock free for a single producer (the audio routine) and a single consumer (the MIDI/gate output timer ISR)
| bool MIDIQueue::popDue | ( | QueuedMIDI & | out, |
| uint32_t | now, | ||
| bool | all = false ) |
Consumer only. Take the oldest queued MIDI if it's due by now, or regardless if all. MIDI comes out in the order it was queued, so anything due behind something which isn't yet waits for it
| bool MIDIQueue::popOldest | ( | QueuedMIDI & | out | ) |
Consumer only (or the producer, with the consumer locked out). Take the oldest queued MIDI whether it's due or not, e.g. to make room when the queue's full. Returns false if nothing's queued
| bool MIDIQueue::push | ( | MIDIMessage | message, |
| int32_t | filter, | ||
| bool | usb, | ||
| bool | din, | ||
| uint32_t | due, | ||
| uint32_t | now ) |
Producer only. A due time in the past or more than kMaxTicksAhead after now is stale (e.g. the audio routine hasn't run for a while) and is replaced with now, rather than letting the wrap make it look far in the future and hold up the queue. Returns false if the queue's full