ardour
Public Member Functions | Private Attributes | List of all members
ARDOUR::AudioBuffer Class Reference

#include <audio_buffer.h>

Inheritance diagram for ARDOUR::AudioBuffer:
ARDOUR::Buffer

Public Member Functions

 AudioBuffer (size_t capacity)
 
 ~AudioBuffer ()
 
void silence (framecnt_t len, framecnt_t offset=0)
 
void read_from (const Sample *src, framecnt_t len, framecnt_t dst_offset=0, framecnt_t src_offset=0)
 
void read_from_with_gain (const Sample *src, framecnt_t len, gain_t gain, framecnt_t dst_offset=0, framecnt_t src_offset=0)
 
void read_from (const Buffer &src, framecnt_t len, framecnt_t dst_offset=0, framecnt_t src_offset=0)
 
void merge_from (const Buffer &src, framecnt_t len, framecnt_t dst_offset=0, framecnt_t src_offset=0)
 
void accumulate_from (const AudioBuffer &src, framecnt_t len, framecnt_t dst_offset=0, framecnt_t src_offset=0)
 
void accumulate_from (const Sample *src, framecnt_t len, framecnt_t dst_offset=0, framecnt_t src_offset=0)
 
void accumulate_with_gain_from (const AudioBuffer &src, framecnt_t len, gain_t gain_coeff, framecnt_t dst_offset=0, framecnt_t src_offset=0)
 
void accumulate_with_gain_from (const Sample *src_raw, framecnt_t len, gain_t gain_coeff, framecnt_t dst_offset=0)
 
void accumulate_with_ramped_gain_from (const Sample *src, framecnt_t len, gain_t initial, gain_t target, framecnt_t dst_offset=0)
 
void apply_gain (gain_t gain, framecnt_t len)
 
void set_data (Sample *data, size_t size)
 
void resize (size_t nframes)
 
const Sampledata (framecnt_t offset=0) const
 
Sampledata (framecnt_t offset=0)
 
bool check_silence (pframes_t, pframes_t &) const
 
void prepare ()
 
bool written () const
 
void set_written (bool w)
 
- Public Member Functions inherited from ARDOUR::Buffer
virtual ~Buffer ()
 
size_t capacity () const
 
DataType type () const
 
bool silent () const
 
virtual void clear ()
 

Private Attributes

bool _owns_data
 
bool _written
 
Sample_data
 Actual buffer contents. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ARDOUR::Buffer
static Buffercreate (DataType type, size_t capacity)
 
- Protected Member Functions inherited from ARDOUR::Buffer
 Buffer (DataType type)
 
- Protected Attributes inherited from ARDOUR::Buffer
DataType _type
 
pframes_t _capacity
 
bool _silent
 

Detailed Description

Buffer containing audio data.

Definition at line 30 of file audio_buffer.h.

Constructor & Destructor Documentation

AudioBuffer::AudioBuffer ( size_t  capacity)

Definition at line 30 of file audio_buffer.cc.

AudioBuffer::~AudioBuffer ( )

Definition at line 43 of file audio_buffer.cc.

Member Function Documentation

void ARDOUR::AudioBuffer::accumulate_from ( const AudioBuffer src,
framecnt_t  len,
framecnt_t  dst_offset = 0,
framecnt_t  src_offset = 0 
)
inline

Acumulate (add) len frames src starting at src_offset into self starting at dst_offset

Definition at line 84 of file audio_buffer.h.

void ARDOUR::AudioBuffer::accumulate_from ( const Sample src,
framecnt_t  len,
framecnt_t  dst_offset = 0,
framecnt_t  src_offset = 0 
)
inline

Acumulate (add) len frames src starting at src_offset into self starting at dst_offset

Definition at line 98 of file audio_buffer.h.

void ARDOUR::AudioBuffer::accumulate_with_gain_from ( const AudioBuffer src,
framecnt_t  len,
gain_t  gain_coeff,
framecnt_t  dst_offset = 0,
framecnt_t  src_offset = 0 
)
inline

Acumulate (add) len frames src starting at src_offset into self starting at scaling by gain_coeff

Definition at line 113 of file audio_buffer.h.

void ARDOUR::AudioBuffer::accumulate_with_gain_from ( const Sample src_raw,
framecnt_t  len,
gain_t  gain_coeff,
framecnt_t  dst_offset = 0 
)
inline

Accumulate (add) len frames FROM THE START OF src into self scaling by gain_coeff

Definition at line 133 of file audio_buffer.h.

void ARDOUR::AudioBuffer::accumulate_with_ramped_gain_from ( const Sample src,
framecnt_t  len,
gain_t  initial,
gain_t  target,
framecnt_t  dst_offset = 0 
)
inline

Accumulate (add) len frames FROM THE START OF src into self scaling by gain_coeff

Definition at line 148 of file audio_buffer.h.

void ARDOUR::AudioBuffer::apply_gain ( gain_t  gain,
framecnt_t  len 
)
inline

Definition at line 165 of file audio_buffer.h.

bool AudioBuffer::check_silence ( pframes_t  nframes,
pframes_t n 
) const

Definition at line 72 of file audio_buffer.cc.

const Sample* ARDOUR::AudioBuffer::data ( framecnt_t  offset = 0) const
inline

Definition at line 187 of file audio_buffer.h.

Sample* ARDOUR::AudioBuffer::data ( framecnt_t  offset = 0)
inline

Definition at line 192 of file audio_buffer.h.

void ARDOUR::AudioBuffer::merge_from ( const Buffer src,
framecnt_t  len,
framecnt_t  dst_offset = 0,
framecnt_t  src_offset = 0 
)
inlinevirtual

Acumulate (add) len frames src starting at src_offset into self starting at dst_offset

Implements ARDOUR::Buffer.

Definition at line 77 of file audio_buffer.h.

void ARDOUR::AudioBuffer::prepare ( )
inline

Definition at line 200 of file audio_buffer.h.

void ARDOUR::AudioBuffer::read_from ( const Sample src,
framecnt_t  len,
framecnt_t  dst_offset = 0,
framecnt_t  src_offset = 0 
)
inline

Read len frames src starting at src_offset into self starting at @ dst_offset

Definition at line 39 of file audio_buffer.h.

void ARDOUR::AudioBuffer::read_from ( const Buffer src,
framecnt_t  len,
framecnt_t  dst_offset = 0,
framecnt_t  src_offset = 0 
)
inlinevirtual

Read len frames src starting at src_offset into self starting at @ dst_offset

Implements ARDOUR::Buffer.

Definition at line 61 of file audio_buffer.h.

void ARDOUR::AudioBuffer::read_from_with_gain ( const Sample src,
framecnt_t  len,
gain_t  gain,
framecnt_t  dst_offset = 0,
framecnt_t  src_offset = 0 
)
inline

Definition at line 48 of file audio_buffer.h.

void AudioBuffer::resize ( size_t  nframes)
virtual

Reallocate the buffer used internally to handle at least of data

Constructor MUST have been passed capacity!=0 or this will die (to prevent mem leaks).

Implements ARDOUR::Buffer.

Definition at line 50 of file audio_buffer.cc.

void ARDOUR::AudioBuffer::set_data ( Sample data,
size_t  size 
)
inline

Set the data contained by this buffer manually (for setting directly to jack buffer).

Constructor MUST have been passed capacity=0 or this will die (to prevent mem leaks).

Definition at line 173 of file audio_buffer.h.

void ARDOUR::AudioBuffer::set_written ( bool  w)
inline

Definition at line 202 of file audio_buffer.h.

void AudioBuffer::silence ( framecnt_t  len,
framecnt_t  offset = 0 
)
virtual

Clear (eg zero, or empty) buffer

Implements ARDOUR::Buffer.

Definition at line 83 of file audio_buffer.cc.

bool ARDOUR::AudioBuffer::written ( ) const
inline

Definition at line 201 of file audio_buffer.h.

Member Data Documentation

Sample* ARDOUR::AudioBuffer::_data
private

Actual buffer contents.

Definition at line 207 of file audio_buffer.h.

bool ARDOUR::AudioBuffer::_owns_data
private

Definition at line 205 of file audio_buffer.h.

bool ARDOUR::AudioBuffer::_written
private

Definition at line 206 of file audio_buffer.h.


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