Ardour
9.0-pre0-582-g084a23a80d
|
#include <midi_ring_buffer.h>
Public Member Functions | |
MidiRingBuffer (size_t size) | |
bool | read_prefix (T *time, Evoral::EventType *type, uint32_t *size) |
bool | read_contents (uint32_t size, uint8_t *buf) |
size_t | read (MidiBuffer &dst, samplepos_t start, samplepos_t end, samplecnt_t offset=0, bool stop_on_overflow_in_destination=false) |
size_t | skip_to (samplepos_t start) |
void | dump (std::ostream &dst) |
void | flush (samplepos_t start, samplepos_t end) |
void | reset_tracker () |
void | resolve_tracker (MidiBuffer &dst, samplepos_t) |
void | resolve_tracker (Evoral::EventSink< samplepos_t > &dst, samplepos_t) |
Public Member Functions inherited from ARDOUR::EventRingBuffer< T > | |
EventRingBuffer (size_t capacity) | |
size_t | capacity () const |
bool | peek (uint8_t *, size_t size) |
uint32_t | write (T time, Evoral::EventType type, uint32_t size, const uint8_t *buf) |
bool | read (T *time, Evoral::EventType *type, uint32_t *size, uint8_t *buf) |
Public Member Functions inherited from PBD::RingBufferNPT< uint8_t > | |
RingBufferNPT (size_t sz) | |
virtual | ~RingBufferNPT () |
void | reset () |
void | set (size_t r, size_t w) |
size_t | read (uint8_t *dest, size_t cnt) |
size_t | write (const uint8_t *src, size_t cnt) |
size_t | write_one (const uint8_t src) |
void | get_read_vector (rw_vector *) |
void | get_write_vector (rw_vector *) |
void | decrement_read_ptr (size_t cnt) |
void | increment_read_ptr (size_t cnt) |
void | increment_write_ptr (size_t cnt) |
size_t | write_space () |
size_t | read_space () |
uint8_t * | buffer () |
size_t | get_write_ptr () const |
size_t | get_read_ptr () const |
size_t | bufsize () const |
Public Member Functions inherited from Evoral::EventSink< Time > | |
virtual | ~EventSink () |
Private Attributes | |
MidiNoteTracker | _tracker |
Additional Inherited Members | |
Protected Attributes inherited from PBD::RingBufferNPT< uint8_t > | |
uint8_t * | buf |
size_t | size |
std::atomic< int > | write_ptr |
std::atomic< int > | read_ptr |
A RingBuffer for (MIDI) events.
This is simply a wrapper around a raw ringbuffer which writes/reads events as flat placked blobs. The buffer looks like this:
[timestamp][type][size][size bytes of raw MIDI][timestamp][type]size
Definition at line 44 of file midi_ring_buffer.h.
|
inline |
size | Size in bytes. |
Definition at line 47 of file midi_ring_buffer.h.
void ARDOUR::MidiRingBuffer< T >::dump | ( | std::ostream & | dst | ) |
void ARDOUR::MidiRingBuffer< T >::flush | ( | samplepos_t | start, |
samplepos_t | end | ||
) |
size_t ARDOUR::MidiRingBuffer< T >::read | ( | MidiBuffer & | dst, |
samplepos_t | start, | ||
samplepos_t | end, | ||
samplecnt_t | offset = 0 , |
||
bool | stop_on_overflow_in_destination = false |
||
) |
|
inline |
Read the content of an event. This call MUST be immediately preceded by a call to read_prefix (or the returned even will be garbage).
Definition at line 95 of file midi_ring_buffer.h.
|
inline |
Read the time and size of an event. This call MUST be immediately proceeded by a call to read_contents (or the read pointer will be garbage).
Definition at line 72 of file midi_ring_buffer.h.
void ARDOUR::MidiRingBuffer< T >::reset_tracker | ( | ) |
void ARDOUR::MidiRingBuffer< T >::resolve_tracker | ( | Evoral::EventSink< samplepos_t > & | dst, |
samplepos_t | |||
) |
void ARDOUR::MidiRingBuffer< T >::resolve_tracker | ( | MidiBuffer & | dst, |
samplepos_t | |||
) |
size_t ARDOUR::MidiRingBuffer< T >::skip_to | ( | samplepos_t | start | ) |
|
private |
Definition at line 63 of file midi_ring_buffer.h.