Ardour  9.0-pre0-582-g084a23a80d
ARDOUR::EventRingBuffer< Time > Class Template Reference

#include <event_ring_buffer.h>

Inheritance diagram for ARDOUR::EventRingBuffer< Time >:
[legend]

Public Member Functions

 EventRingBuffer (size_t capacity)
 
size_t capacity () const
 
bool peek (uint8_t *, size_t size)
 
uint32_t write (Time time, Evoral::EventType type, uint32_t size, const uint8_t *buf)
 
bool read (Time *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 ()
 

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
 

Detailed Description

template<typename Time>
class ARDOUR::EventRingBuffer< Time >

A RingBuffer of events (generic time-stamped binary "blobs").

This packs a timestamp, size, and size bytes of data flat into the buffer. Useful for MIDI events, OSC messages, etc.

Note: the uint8_t template argument to RingBufferNPT<> indicates "byte oriented data", not anything particular linked to MIDI or any other possible interpretation of uint8_t.

Definition at line 42 of file event_ring_buffer.h.

Constructor & Destructor Documentation

◆ EventRingBuffer()

template<typename Time >
ARDOUR::EventRingBuffer< Time >::EventRingBuffer ( size_t  capacity)
inline
Parameters
capacityRingbuffer capacity in bytes.

Definition at line 48 of file event_ring_buffer.h.

Member Function Documentation

◆ capacity()

template<typename Time >
size_t ARDOUR::EventRingBuffer< Time >::capacity ( ) const
inline

Definition at line 51 of file event_ring_buffer.h.

◆ peek()

template<typename Time >
bool ARDOUR::EventRingBuffer< Time >::peek ( uint8_t *  buf,
size_t  size 
)
inline

Peek at the ringbuffer (read w/o advancing read pointer).

Returns
how much has been peeked (wraps around if read exceeds the end of the buffer):
|===========--------------R=============================|
           read-pointer---^

Definition at line 69 of file event_ring_buffer.h.

◆ read()

template<typename Time >
bool ARDOUR::EventRingBuffer< Time >::read ( Time *  time,
Evoral::EventType type,
uint32_t *  size,
uint8_t *  buf 
)
inline

Definition at line 96 of file event_ring_buffer.h.

◆ write()

template<typename Time >
uint32_t ARDOUR::EventRingBuffer< Time >::write ( Time  time,
Evoral::EventType  type,
uint32_t  size,
const uint8_t *  buf 
)
inlinevirtual

Implements Evoral::EventSink< Time >.

Definition at line 119 of file event_ring_buffer.h.


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