ardour
|
#include <buffer_set.h>
Classes | |
class | iterator_base |
Public Types | |
typedef iterator_base < BufferSet, Buffer > | iterator |
typedef iterator_base< const BufferSet, const Buffer > | const_iterator |
typedef iterator_base < BufferSet, AudioBuffer > | audio_iterator |
typedef iterator_base < BufferSet, MidiBuffer > | midi_iterator |
Private Types | |
typedef std::vector< Buffer * > | BufferVec |
Private Attributes | |
std::vector< BufferVec > | _buffers |
Vector of vectors, indexed by DataType. More... | |
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... | |
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 65 of file buffer_set.h.
Definition at line 172 of file buffer_set.h.
|
private |
Definition at line 181 of file buffer_set.h.
typedef iterator_base<const BufferSet, const Buffer> ARDOUR::BufferSet::const_iterator |
Definition at line 168 of file buffer_set.h.
Definition at line 164 of file buffer_set.h.
Definition at line 176 of file buffer_set.h.
ARDOUR::BufferSet::BufferSet | ( | ) |
Create a new, empty BufferSet
Definition at line 49 of file buffer_set.cc.
ARDOUR::BufferSet::~BufferSet | ( | ) |
Definition at line 60 of file buffer_set.cc.
void ARDOUR::BufferSet::attach_buffers | ( | PortSet & | ports | ) |
Set up this BufferSet so that its data structures mirror a PortSet's buffers. This is quite expensive and not RT-safe, so it should not be called in a process context; get_backend_port_addresses() will fill in a structure set up by this method.
XXX: this is called in a process context; I'm not sure quite what `should not' means above.
Definition at line 99 of file buffer_set.cc.
|
inline |
Definition at line 173 of file buffer_set.h.
|
inline |
Definition at line 174 of file buffer_set.h.
|
inline |
Definition at line 84 of file buffer_set.h.
|
inline |
Definition at line 85 of file buffer_set.h.
Definition at line 165 of file buffer_set.h.
|
inline |
Definition at line 169 of file buffer_set.h.
size_t ARDOUR::BufferSet::buffer_capacity | ( | DataType | type | ) | const |
Get the capacity (size) of the available buffers of the given type.
All buffers of a certain type always have the same capacity.
Definition at line 234 of file buffer_set.cc.
void ARDOUR::BufferSet::clear | ( | ) |
Destroy all contained buffers.
Definition at line 68 of file buffer_set.cc.
|
inline |
Definition at line 87 of file buffer_set.h.
|
inline |
Definition at line 88 of file buffer_set.h.
Definition at line 166 of file buffer_set.h.
|
inline |
Definition at line 170 of file buffer_set.h.
void ARDOUR::BufferSet::ensure_buffers | ( | DataType | type, |
size_t | num_buffers, | ||
size_t | buffer_capacity | ||
) |
Ensure that there are num_buffers buffers of type type available, each of size at least buffer_size
Definition at line 149 of file buffer_set.cc.
void ARDOUR::BufferSet::ensure_buffers | ( | const ChanCount & | chns, |
size_t | buffer_capacity | ||
) |
Ensure that the number of buffers of each type type matches chns and each buffer is of size at least buffer_capacity
Definition at line 222 of file buffer_set.cc.
Definition at line 241 of file buffer_set.cc.
Definition at line 248 of file buffer_set.cc.
|
inline |
Definition at line 100 of file buffer_set.h.
|
inline |
Definition at line 103 of file buffer_set.h.
void ARDOUR::BufferSet::get_backend_port_addresses | ( | PortSet & | ports, |
framecnt_t | nframes | ||
) |
Write the backend port addresses from a PortSet into our data structures. This call assumes that attach_buffers() has already been called for the same PortSet. Does not allocate, so RT-safe BUT you can only call Port::get_buffer() from the process() callback tree anyway, so this has to be called in RT context.
Definition at line 124 of file buffer_set.cc.
|
inline |
Definition at line 107 of file buffer_set.h.
|
inline |
Definition at line 110 of file buffer_set.h.
|
inline |
Definition at line 91 of file buffer_set.h.
void ARDOUR::BufferSet::merge_from | ( | const BufferSet & | in, |
framecnt_t | nframes | ||
) |
Definition at line 445 of file buffer_set.cc.
|
inline |
Definition at line 177 of file buffer_set.h.
|
inline |
Definition at line 178 of file buffer_set.h.
void ARDOUR::BufferSet::read_from | ( | const BufferSet & | in, |
framecnt_t | nframes | ||
) |
Copy buffers of all types from `in' to this BufferSet
Definition at line 434 of file buffer_set.cc.
void ARDOUR::BufferSet::read_from | ( | const BufferSet & | in, |
framecnt_t | nframes, | ||
DataType | type | ||
) |
Copy buffers of one type from `in' to this BufferSet
Definition at line 420 of file buffer_set.cc.
|
inline |
Definition at line 93 of file buffer_set.h.
void ARDOUR::BufferSet::silence | ( | framecnt_t | nframes, |
framecnt_t | offset | ||
) |
Definition at line 463 of file buffer_set.cc.
|
private |
Available counts (number of buffers actually allocated)
Definition at line 221 of file buffer_set.h.
|
private |
Vector of vectors, indexed by DataType.
Definition at line 184 of file buffer_set.h.
|
private |
Use counts (there may be more actual buffers than this)
Definition at line 218 of file buffer_set.h.
|
private |
False if we 'own' the contained buffers, if true we mirror a PortSet)
Definition at line 224 of file buffer_set.h.