Ardour  9.0-pre0-582-g084a23a80d
ARDOUR::Buffer Class Referenceabstract

#include <buffer.h>

Inheritance diagram for ARDOUR::Buffer:
[legend]

Public Member Functions

 Buffer (const Buffer &)=delete
 
Bufferoperator= (const Buffer &)=delete
 
virtual ~Buffer ()
 
size_t capacity () const
 
DataType type () const
 
bool silent () const
 
virtual void resize (size_t)=0
 
virtual void silence (samplecnt_t len, samplecnt_t offset=0)=0
 
virtual bool silent_data () const =0
 
virtual void clear ()
 
virtual void read_from (const Buffer &src, samplecnt_t len, sampleoffset_t dst_offset=0, sampleoffset_t src_offset=0)=0
 
virtual void merge_from (const Buffer &src, samplecnt_t len, sampleoffset_t dst_offset=0, sampleoffset_t src_offset=0)=0
 

Static Public Member Functions

static Buffercreate (DataType type, size_t capacity)
 

Protected Member Functions

 Buffer (DataType type)
 

Protected Attributes

DataType _type
 
pframes_t _capacity
 
bool _silent
 

Detailed Description

A buffer of recordable/playable data.

This is a datatype-agnostic base class for all buffers (there are no methods to actually access the data). This provides a way for code that doesn't care about the data type to still deal with buffers (which is why the base class can't be a template).

To actually read/write buffer contents, use the appropriate derived class.

Definition at line 42 of file buffer.h.

Constructor & Destructor Documentation

◆ Buffer() [1/2]

ARDOUR::Buffer::Buffer ( const Buffer )
delete

◆ ~Buffer()

virtual ARDOUR::Buffer::~Buffer ( )
inlinevirtual

Definition at line 47 of file buffer.h.

◆ Buffer() [2/2]

ARDOUR::Buffer::Buffer ( DataType  type)
inlineprotected

Definition at line 81 of file buffer.h.

Member Function Documentation

◆ capacity()

size_t ARDOUR::Buffer::capacity ( ) const
inline

Maximum capacity of buffer.

Definition at line 53 of file buffer.h.

◆ clear()

virtual void ARDOUR::Buffer::clear ( )
inlinevirtual

Clear the entire buffer

Reimplemented in ARDOUR::MidiBuffer.

Definition at line 75 of file buffer.h.

◆ create()

static Buffer* ARDOUR::Buffer::create ( DataType  type,
size_t  capacity 
)
static

Factory function

◆ merge_from()

virtual void ARDOUR::Buffer::merge_from ( const Buffer src,
samplecnt_t  len,
sampleoffset_t  dst_offset = 0,
sampleoffset_t  src_offset = 0 
)
pure virtual

◆ operator=()

Buffer& ARDOUR::Buffer::operator= ( const Buffer )
delete

◆ read_from()

virtual void ARDOUR::Buffer::read_from ( const Buffer src,
samplecnt_t  len,
sampleoffset_t  dst_offset = 0,
sampleoffset_t  src_offset = 0 
)
pure virtual

◆ resize()

virtual void ARDOUR::Buffer::resize ( size_t  )
pure virtual

Reallocate the buffer used internally to handle at least size_t units of data.

The buffer is not silent after this operation. the capacity argument passed to the constructor must have been non-zero.

Implemented in ARDOUR::MidiBuffer, and ARDOUR::AudioBuffer.

◆ silence()

virtual void ARDOUR::Buffer::silence ( samplecnt_t  len,
samplecnt_t  offset = 0 
)
pure virtual

Clear (eg zero, or empty) buffer

Implemented in ARDOUR::MidiBuffer, and ARDOUR::AudioBuffer.

◆ silent()

bool ARDOUR::Buffer::silent ( ) const
inline

Definition at line 59 of file buffer.h.

◆ silent_data()

virtual bool ARDOUR::Buffer::silent_data ( ) const
pure virtual

◆ type()

DataType ARDOUR::Buffer::type ( ) const
inline

Type of this buffer. Based on this you can static cast a Buffer* to the desired type.

Definition at line 57 of file buffer.h.

Member Data Documentation

◆ _capacity

pframes_t ARDOUR::Buffer::_capacity
protected

Definition at line 86 of file buffer.h.

◆ _silent

bool ARDOUR::Buffer::_silent
protected

Definition at line 87 of file buffer.h.

◆ _type

DataType ARDOUR::Buffer::_type
protected

Definition at line 85 of file buffer.h.


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