|
RAVENNAKIT
|
A non-owning view of a non-interleaved audio buffer. More...
#include <audio_buffer_view.hpp>
Public Member Functions | |
| AudioBufferView (T *const *channels, const size_t num_channels, const size_t num_frames) | |
| Constructs an audio buffer view with the given channels, number of channels, and number of frames. | |
| size_t | num_channels () const |
| size_t | num_frames () const |
| const T * | operator[] (size_t channel_index) const |
| Accesses the channel at the given index. | |
| T * | operator[] (size_t channel_index) |
| Accesses the channel at the given index Does not perform bounds checking. | |
| const T *const * | data () const |
| T *const * | data () |
| void | set_sample (size_t channel_index, size_t frame_index, T value) |
| Sets the value of an individual sample. | |
| void | clear () const |
| Clears the buffer by setting all samples to zero. | |
| void | clear (T value) const |
| Clears the buffer by setting all samples to the given value. | |
| void | clear (const size_t channel_index, const size_t start_sample, const size_t num_samples_to_clear) |
| Clear a range of samples in a channel, without bounds checking. | |
| void | copy_from (const size_t dst_start_frame, const size_t num_frames_to_copy, const T *const *src, const size_t src_num_channels, const size_t src_start_frame=0) |
| Copies data from all channels of src into all channels of this buffer. | |
| void | copy_from (const size_t dst_channel_index, const size_t dst_start_sample, const size_t num_samples_to_copy, const T *src) |
| Copies data from src into this buffer, without bounds checking. | |
| void | copy_to (const size_t src_start_frame, const size_t num_frames, T *const *dst, const size_t dst_num_channels, const size_t dst_start_frame=0) |
| Copies data from all channels of this buffer into dst. | |
| void | copy_to (const size_t src_channel_index, const size_t src_start_sample, const size_t num_samples_to_copy, T *dst) |
| Copies data from this buffer into dst. | |
| bool | add (const AudioBufferView &other) |
| Adds the samples of another audio buffer view to this audio buffer view. | |
| bool | is_valid () const |
| T | find_max_abs () const |
| T | find_max_abs (const size_t channel_index) const |
| @channel_index The index of the channel to find the maximum value for. | |
| AudioBufferView | with_num_channels (const size_t num_channels) |
| Returns a copy of this view with given number of channels. | |
| AudioBufferView | with_num_frames (const size_t num_frames) |
| Returns a copy of this view with given number of frames. | |
| AudioBufferView< std::add_const_t< T > > | const_view () const |
Protected Member Functions | |
| void | update (T *const *channels, const size_t num_channels, const size_t num_frames) |
| Updates the channel pointers, number of channels and number of frames. | |
Friends | |
| bool | operator== (const AudioBufferView &lhs, const AudioBufferView &rhs) |
| Compares two audio buffers for equality. | |
| bool | operator!= (const AudioBufferView &lhs, const AudioBufferView &rhs) |
| Compares two audio buffers for inequality. | |
A non-owning view of a non-interleaved audio buffer.
| T |
Definition at line 35 of file audio_buffer_view.hpp.
|
inline |
Constructs an audio buffer view with the given channels, number of channels, and number of frames.
The view does not take ownership or take copies of the data.
| channels | The channels. |
| num_channels | The number of channels. |
| num_frames | The number of frames. |
Definition at line 44 of file audio_buffer_view.hpp.
|
inlinenodiscard |
Adds the samples of another audio buffer view to this audio buffer view.
| other | The other audio buffer view. |
Definition at line 253 of file audio_buffer_view.hpp.
|
inline |
Clears the buffer by setting all samples to zero.
Definition at line 144 of file audio_buffer_view.hpp.
|
inline |
Clear a range of samples in a channel, without bounds checking.
| channel_index | The index of the channel. |
| start_sample | The index of the first frame to clear. |
| num_samples_to_clear | The number of samples to clear. |
Definition at line 169 of file audio_buffer_view.hpp.
|
inline |
Clears the buffer by setting all samples to the given value.
| value | The value to fill the buffer with. |
Definition at line 154 of file audio_buffer_view.hpp.
|
inline |
Definition at line 326 of file audio_buffer_view.hpp.
|
inline |
Copies data from src into this buffer, without bounds checking.
| dst_channel_index | The index of the destination channel. |
| dst_start_sample | The index of the start frame in the destination channel. |
| num_samples_to_copy | The number of samples to copy. |
| src | The source data to copy from. |
Definition at line 201 of file audio_buffer_view.hpp.
|
inline |
Copies data from all channels of src into all channels of this buffer.
Make sure the number of channels and frames match.
| dst_start_frame | The index of the start frame. |
| num_frames_to_copy | The number of frames to copy. |
| src | The source data to copy from. |
| src_num_channels | The number of channels in the source data. |
| src_start_frame | The index of the start frame in the source data. |
Definition at line 184 of file audio_buffer_view.hpp.
|
inline |
Copies data from this buffer into dst.
| src_channel_index | The index of the source channel. |
| src_start_sample | The index of the start frame in the source channel. |
| num_samples_to_copy | The number of samples to copy. |
| dst | The destination data to copy to. |
Definition at line 237 of file audio_buffer_view.hpp.
|
inline |
Copies data from all channels of this buffer into dst.
| num_frames | The number of frames. |
| src_start_frame | The index of the start frame in the source data. |
| dst | The destination data to copy to. |
| dst_num_channels | The number of channels. |
| dst_start_frame | The index of the start frame in the destination data. |
Definition at line 220 of file audio_buffer_view.hpp.
|
inline |
Definition at line 124 of file audio_buffer_view.hpp.
|
inline |
Definition at line 116 of file audio_buffer_view.hpp.
|
inline |
Definition at line 280 of file audio_buffer_view.hpp.
|
inline |
@channel_index The index of the channel to find the maximum value for.
Definition at line 294 of file audio_buffer_view.hpp.
|
inlinenodiscard |
Definition at line 273 of file audio_buffer_view.hpp.
|
inlinenodiscard |
Definition at line 80 of file audio_buffer_view.hpp.
|
inlinenodiscard |
Definition at line 87 of file audio_buffer_view.hpp.
|
inline |
Accesses the channel at the given index Does not perform bounds checking.
| channel_index | The index of the channel to get. |
Definition at line 108 of file audio_buffer_view.hpp.
|
inline |
Accesses the channel at the given index.
Does not perform bounds checking.
| channel_index | The index of the channel to get. |
Definition at line 97 of file audio_buffer_view.hpp.
|
inline |
Sets the value of an individual sample.
This method does no bounds checking.
| channel_index | The index of the channel. |
| frame_index | The index of the sample. |
| value | The value to set. |
Definition at line 135 of file audio_buffer_view.hpp.
|
inlineprotected |
Updates the channel pointers, number of channels and number of frames.
| channels | The channels. |
| num_channels | The number of channels. |
| num_frames | The number of frames. |
Definition at line 337 of file audio_buffer_view.hpp.
|
inline |
Returns a copy of this view with given number of channels.
| num_channels | The number of channels. Limited to the current amount of channels. |
Definition at line 310 of file audio_buffer_view.hpp.
|
inline |
Returns a copy of this view with given number of frames.
| num_frames | The number of frames, limited by the current amount of frames. |
Definition at line 319 of file audio_buffer_view.hpp.
|
friend |
Compares two audio buffers for inequality.
It does this by comparing the actual contents. If both audio buffers are empty, they are considered equal.
| lhs | Left hand side audio buffer. |
| rhs | Right hand side audio buffer. |
Definition at line 73 of file audio_buffer_view.hpp.
|
friend |
Compares two audio buffers for equality.
It does this by comparing the actual contents. If both audio buffers are empty, they are considered equal.
| lhs | Left hand side audio buffer. |
| rhs | Right hand side audio buffer. |
Definition at line 54 of file audio_buffer_view.hpp.