DSPark 1.9.0
Header-only C++20 DSP for real-time and offline audio
Loading...
Searching...
No Matches
dspark::plugin::BlockEventList Class Reference

The fixed-capacity, allocation-free event list one block of host events is collected into (a member of each backend's plugin object, so nothing large lives on the audio thread's stack). More...

#include <DSParkPlugin.h>

Public Member Functions

void clear () noexcept
 
void add (const BlockEvent &event) noexcept
 
void sort () noexcept
 
int size () const noexcept
 
int dropped () const noexcept
 
BlockEvent & operator[] (int i) noexcept
 
const BlockEvent & operator[] (int i) const noexcept
 

Detailed Description

The fixed-capacity, allocation-free event list one block of host events is collected into (a member of each backend's plugin object, so nothing large lives on the audio thread's stack).

Within capacity every event is kept. Once the list is full it merges instead of dropping blindly: a parameter or bypass point overwrites the newest stored point of the SAME parameter (a later point supersedes it), and any other event takes the slot of a parameter point that a newer point of its own parameter has already superseded. The final value of every parameter and every MIDI event therefore survive whenever the block holds at most kMaxBlockEvents distinct parameters plus MIDI events; what is given up first is intermediate automation, which only loses its exact position inside the block. dropped() counts what still could not fit.

Every operation is O(1) amortised (a small open-addressed table maps a parameter id to its newest slot; the table is invalidated by a generation counter, not cleared). Not thread-safe: one block, one thread.

Definition at line 989 of file DSParkPlugin.h.

Member Function Documentation

◆ add()

void dspark::plugin::BlockEventList::add ( const BlockEvent &  event)
inlinenoexcept

Adds one event (see the class notes for the merge rule).

Definition at line 1007 of file DSParkPlugin.h.

◆ clear()

void dspark::plugin::BlockEventList::clear ( )
inlinenoexcept

Empties the list for the next block.

Definition at line 993 of file DSParkPlugin.h.

◆ dropped()

int dspark::plugin::BlockEventList::dropped ( ) const
inlinenoexcept

Definition at line 1047 of file DSParkPlugin.h.

◆ operator[]() [1/2]

const BlockEvent & dspark::plugin::BlockEventList::operator[] ( int  i) const
inlinenoexcept

Definition at line 1049 of file DSParkPlugin.h.

◆ operator[]() [2/2]

BlockEvent & dspark::plugin::BlockEventList::operator[] ( int  i)
inlinenoexcept

Definition at line 1048 of file DSParkPlugin.h.

◆ size()

int dspark::plugin::BlockEventList::size ( ) const
inlinenoexcept

Definition at line 1046 of file DSParkPlugin.h.

◆ sort()

void dspark::plugin::BlockEventList::sort ( )
inlinenoexcept

Sorts by (offset, arrival order).

Definition at line 1044 of file DSParkPlugin.h.


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