#include <message_collector.hpp>
|
| static constexpr std::size_t | capacity () |
| | Compile-time capacity of the producer queue.
|
| static constexpr std::size_t | pending_capacity () |
| | Compile-time size of the consumer-owned pending ring.
|
◆ MidiMessageCollector()
template<std::size_t Capacity = 256>
◆ capacity()
template<std::size_t Capacity = 256>
Compile-time capacity of the producer queue.
◆ drain_into()
template<std::size_t Capacity = 256>
Audio / consumer thread — drain queued events into out at the correct sample offsets within the current processing block.
Events whose timestamps are <= block_start_seconds land at sample 0 (catch-up). Events between block_start and block_end land at the sample offset that matches their timestamp. Events strictly after block_end_seconds stay queued for the next block.
block_size_samples and sample_rate together define the block length: block_end_seconds = block_start_seconds + block_size_samples / sample_rate.
Returns the number of events drained into out this call.
◆ dropped_future()
template<std::size_t Capacity = 256>
Number of FUTURE events the consumer dropped because the pending ring was saturated at the moment they were popped.
Monotonic, atomic, never reset. A non-zero value means producers buffered more events than pending_capacity() can carry across drains; either reduce producer-side look-ahead or pick a larger Capacity so the producer SPSC queue itself absorbs more in-flight events.
◆ pending_capacity()
template<std::size_t Capacity = 256>
Compile-time size of the consumer-owned pending ring.
Sized to absorb realistic Pulp producer bursts (UI input + scripting look-ahead + MIDI file playback) within a single drain. A workload that exceeds this in one drain will see drops counted via dropped_future(); raising Capacity lets the producer queue itself absorb more in-flight events before they reach the consumer ring.
◆ push_now() [1/2]
template<std::size_t Capacity = 256>
◆ push_now() [2/2]
template<std::size_t Capacity = 256>
UI / producer thread — push a MidiEvent timestamped at now_seconds.
Returns false when the queue is full (caller decides whether to drop, log, or back off — push_now never blocks).
◆ queue_overflow_count()
template<std::size_t Capacity = 256>
Producer-side queue overflow count from failed push_now() attempts.
Monotonic until reset explicitly by a non-audio observer.
◆ reset_queue_overflow_count()
template<std::size_t Capacity = 256>
Reset only the producer queue overflow counter.
This deliberately does not reset dropped_future(), whose existing contract is monotonic for consumer-side future-event loss.
◆ size_approx()
template<std::size_t Capacity = 256>
Approximate number of events currently queued (does NOT count the deferred-future entries in the pending ring or the consumer-side overflow slot).
◆ telemetry()
template<std::size_t Capacity = 256>
Cheap snapshot for UI, validation, and inspector polling.
Counts the producer queue, consumer-owned pending ring, queue overflow, and future-event drops without allocating.
The documentation for this class was generated from the following file: