Ardour  9.0-pre0-582-g084a23a80d
ARDOUR::BufferSet Class Reference

#include <buffer_set.h>

Classes

class  iterator_base
 
class  VSTBuffer
 

Public Types

typedef iterator_base< BufferSet, Bufferiterator
 
typedef iterator_base< const BufferSet, const Bufferconst_iterator
 
typedef iterator_base< BufferSet, AudioBufferaudio_iterator
 
typedef iterator_base< BufferSet, MidiBuffermidi_iterator
 

Public Member Functions

 BufferSet ()
 
 ~BufferSet ()
 
void clear ()
 
void attach_buffers (PortSet const &ports)
 
void get_backend_port_addresses (PortSet &, samplecnt_t)
 
void ensure_buffers (DataType type, size_t num_buffers, size_t buffer_capacity)
 
void ensure_buffers (const ChanCount &chns, size_t buffer_capacity)
 
bool silent_data () const
 
const ChanCountavailable () const
 
ChanCountavailable ()
 
const ChanCountcount () const
 
ChanCountcount ()
 
void silence (samplecnt_t nframes, samplecnt_t offset)
 
bool is_mirror () const
 
void set_count (const ChanCount &count)
 
size_t buffer_capacity (DataType type) const
 
AudioBufferget_audio (size_t i)
 
const AudioBufferget_audio (size_t i) const
 
MidiBufferget_midi (size_t i)
 
const MidiBufferget_midi (size_t i) const
 
Bufferget_available (DataType type, size_t i)
 
const Bufferget_available (DataType type, size_t i) const
 
LV2_Evbuf * get_lv2_midi (bool input, size_t i)
 
void ensure_lv2_bufsize (bool input, size_t i, size_t buffer_capacity)
 
void flush_lv2_midi (bool input, size_t i, pframes_t, samplecnt_t)
 
void forward_lv2_midi (LV2_Evbuf *, size_t, pframes_t, samplecnt_t)
 
VstEventsget_vst_midi (size_t)
 
void read_from (const BufferSet &in, samplecnt_t nframes)
 
void read_from (const BufferSet &in, samplecnt_t nframes, DataType)
 
void merge_from (const BufferSet &in, samplecnt_t nframes)
 
iterator begin (DataType type)
 
iterator end (DataType type)
 
const_iterator begin (DataType type) const
 
const_iterator end (DataType type) const
 
audio_iterator audio_begin ()
 
audio_iterator audio_end ()
 
midi_iterator midi_begin ()
 
midi_iterator midi_end ()
 

Private Types

typedef std::vector< Buffer * > BufferVec
 
typedef std::vector< std::pair< bool, LV2_Evbuf * > > LV2Buffers
 LV2 MIDI buffers (for conversion to/from MIDI buffers) More...
 
typedef std::vector< VSTBuffer * > VSTBuffers
 

Private Attributes

std::vector< BufferVec_buffers
 Vector of vectors, indexed by DataType. More...
 
LV2Buffers _lv2_buffers
 
VSTBuffers _vst_buffers
 
ChanCount _count
 Use counts (there may be more actual buffers than this) More...
 
ChanCount _available
 Available counts (number of buffers actually allocated) More...
 
bool _is_mirror
 False if we 'own' the contained buffers, if true we mirror a PortSet) More...
 

Detailed Description

A set of buffers of various types.

These are mainly accessed from Session and passed around as scratch buffers (eg as parameters to run() methods) to do in-place signal processing.

There are two types of counts associated with a BufferSet - available, and the 'use count'. Available is the actual number of allocated buffers (and so is the maximum acceptable value for the use counts).

The use counts are how things determine the form of their input and inform others the form of their output (eg what they did to the BufferSet). Setting the use counts is realtime safe.

Definition at line 66 of file buffer_set.h.

Member Typedef Documentation

◆ audio_iterator

◆ BufferVec

typedef std::vector<Buffer*> ARDOUR::BufferSet::BufferVec
private

Definition at line 184 of file buffer_set.h.

◆ const_iterator

Definition at line 171 of file buffer_set.h.

◆ iterator

◆ LV2Buffers

typedef std::vector< std::pair<bool, LV2_Evbuf*> > ARDOUR::BufferSet::LV2Buffers
private

LV2 MIDI buffers (for conversion to/from MIDI buffers)

Definition at line 190 of file buffer_set.h.

◆ midi_iterator

◆ VSTBuffers

typedef std::vector<VSTBuffer*> ARDOUR::BufferSet::VSTBuffers
private

Definition at line 214 of file buffer_set.h.

Constructor & Destructor Documentation

◆ BufferSet()

ARDOUR::BufferSet::BufferSet ( )

◆ ~BufferSet()

ARDOUR::BufferSet::~BufferSet ( )

Member Function Documentation

◆ attach_buffers()

void ARDOUR::BufferSet::attach_buffers ( PortSet const &  ports)

◆ audio_begin()

audio_iterator ARDOUR::BufferSet::audio_begin ( )
inline

Definition at line 176 of file buffer_set.h.

◆ audio_end()

audio_iterator ARDOUR::BufferSet::audio_end ( )
inline

Definition at line 177 of file buffer_set.h.

◆ available() [1/2]

ChanCount& ARDOUR::BufferSet::available ( )
inline

Definition at line 89 of file buffer_set.h.

◆ available() [2/2]

const ChanCount& ARDOUR::BufferSet::available ( ) const
inline

Definition at line 88 of file buffer_set.h.

◆ begin() [1/2]

iterator ARDOUR::BufferSet::begin ( DataType  type)
inline

Definition at line 168 of file buffer_set.h.

◆ begin() [2/2]

const_iterator ARDOUR::BufferSet::begin ( DataType  type) const
inline

Definition at line 172 of file buffer_set.h.

◆ buffer_capacity()

size_t ARDOUR::BufferSet::buffer_capacity ( DataType  type) const

◆ clear()

void ARDOUR::BufferSet::clear ( )

◆ count() [1/2]

ChanCount& ARDOUR::BufferSet::count ( )
inline

Definition at line 92 of file buffer_set.h.

◆ count() [2/2]

const ChanCount& ARDOUR::BufferSet::count ( ) const
inline

Definition at line 91 of file buffer_set.h.

◆ end() [1/2]

iterator ARDOUR::BufferSet::end ( DataType  type)
inline

Definition at line 169 of file buffer_set.h.

◆ end() [2/2]

const_iterator ARDOUR::BufferSet::end ( DataType  type) const
inline

Definition at line 173 of file buffer_set.h.

◆ ensure_buffers() [1/2]

void ARDOUR::BufferSet::ensure_buffers ( const ChanCount chns,
size_t  buffer_capacity 
)

◆ ensure_buffers() [2/2]

void ARDOUR::BufferSet::ensure_buffers ( DataType  type,
size_t  num_buffers,
size_t  buffer_capacity 
)

◆ ensure_lv2_bufsize()

void ARDOUR::BufferSet::ensure_lv2_bufsize ( bool  input,
size_t  i,
size_t  buffer_capacity 
)

ensure minimum size of LV2 Atom port buffer

◆ flush_lv2_midi()

void ARDOUR::BufferSet::flush_lv2_midi ( bool  input,
size_t  i,
pframes_t  ,
samplecnt_t   
)

Flush modified LV2 event output buffers back to Ardour buffers

◆ forward_lv2_midi()

void ARDOUR::BufferSet::forward_lv2_midi ( LV2_Evbuf *  ,
size_t  ,
pframes_t  ,
samplecnt_t   
)

Forward plugin MIDI output to to Ardour buffers

◆ get_audio() [1/2]

AudioBuffer& ARDOUR::BufferSet::get_audio ( size_t  i)
inline

Definition at line 101 of file buffer_set.h.

◆ get_audio() [2/2]

const AudioBuffer& ARDOUR::BufferSet::get_audio ( size_t  i) const
inline

Definition at line 104 of file buffer_set.h.

◆ get_available() [1/2]

Buffer& ARDOUR::BufferSet::get_available ( DataType  type,
size_t  i 
)

◆ get_available() [2/2]

const Buffer& ARDOUR::BufferSet::get_available ( DataType  type,
size_t  i 
) const

◆ get_backend_port_addresses()

void ARDOUR::BufferSet::get_backend_port_addresses ( PortSet ,
samplecnt_t   
)

◆ get_lv2_midi()

LV2_Evbuf* ARDOUR::BufferSet::get_lv2_midi ( bool  input,
size_t  i 
)

Get a MIDI buffer translated into an LV2 MIDI buffer for use with plugins. The index here corresponds directly to MIDI buffer numbers (i.e. the index passed to get_midi), translation back and forth will happen as needed.

◆ get_midi() [1/2]

MidiBuffer& ARDOUR::BufferSet::get_midi ( size_t  i)
inline

Definition at line 108 of file buffer_set.h.

◆ get_midi() [2/2]

const MidiBuffer& ARDOUR::BufferSet::get_midi ( size_t  i) const
inline

Definition at line 111 of file buffer_set.h.

◆ get_vst_midi()

VstEvents* ARDOUR::BufferSet::get_vst_midi ( size_t  )

◆ is_mirror()

bool ARDOUR::BufferSet::is_mirror ( ) const
inline

Definition at line 95 of file buffer_set.h.

◆ merge_from()

void ARDOUR::BufferSet::merge_from ( const BufferSet in,
samplecnt_t  nframes 
)

◆ midi_begin()

midi_iterator ARDOUR::BufferSet::midi_begin ( )
inline

Definition at line 180 of file buffer_set.h.

◆ midi_end()

midi_iterator ARDOUR::BufferSet::midi_end ( )
inline

Definition at line 181 of file buffer_set.h.

◆ read_from() [1/2]

void ARDOUR::BufferSet::read_from ( const BufferSet in,
samplecnt_t  nframes 
)

◆ read_from() [2/2]

void ARDOUR::BufferSet::read_from ( const BufferSet in,
samplecnt_t  nframes,
DataType   
)

◆ set_count()

void ARDOUR::BufferSet::set_count ( const ChanCount count)
inline

Definition at line 97 of file buffer_set.h.

◆ silence()

void ARDOUR::BufferSet::silence ( samplecnt_t  nframes,
samplecnt_t  offset 
)

◆ silent_data()

bool ARDOUR::BufferSet::silent_data ( ) const

Member Data Documentation

◆ _available

ChanCount ARDOUR::BufferSet::_available
private

Available counts (number of buffers actually allocated)

Definition at line 222 of file buffer_set.h.

◆ _buffers

std::vector<BufferVec> ARDOUR::BufferSet::_buffers
private

Vector of vectors, indexed by DataType.

Definition at line 187 of file buffer_set.h.

◆ _count

ChanCount ARDOUR::BufferSet::_count
private

Use counts (there may be more actual buffers than this)

Definition at line 219 of file buffer_set.h.

◆ _is_mirror

bool ARDOUR::BufferSet::_is_mirror
private

False if we 'own' the contained buffers, if true we mirror a PortSet)

Definition at line 225 of file buffer_set.h.

◆ _lv2_buffers

LV2Buffers ARDOUR::BufferSet::_lv2_buffers
private

Definition at line 191 of file buffer_set.h.

◆ _vst_buffers

VSTBuffers ARDOUR::BufferSet::_vst_buffers
private

Definition at line 215 of file buffer_set.h.


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