|
marvin 0.0.1
Pure C++ audio helper library
|
Trivially copyable view into a preallocated SampleType**. More...
#include <marvin_BufferView.h>
Public Member Functions | |
| BufferView (SampleType *const *samples, size_t nChannels, size_t nSamples) | |
| size_t | getNumChannels () const noexcept |
| size_t | getNumSamples () const noexcept |
| const SampleType *const * | getArrayOfReadPointers () const noexcept |
| SampleType *const * | getArrayOfWritePointers () noexcept |
| std::span< SampleType > | operator[] (size_t channel) noexcept |
| std::span< const SampleType > | operator[] (size_t channel) const noexcept |
Trivially copyable view into a preallocated SampleType**.
Useful as a lightweight and framework agnostic alternative to xframework::AudioBuffer.
| marvin::containers::BufferView< SampleType >::BufferView | ( | SampleType *const * | samples, |
| size_t | nChannels, | ||
| size_t | nSamples ) |
BufferView wraps around an already allocated SampleType**, and doesn't take ownership.
| samples | A pointer to the md array of samples to wrap around. |
| nChannels | The number of channels allocated (the size of the outermost array) |
| nSamples | The number of samples allocated per channel (the size of the innermost array) |
|
noexcept |
Returns a read only pointer to the underlying buffer
|
noexcept |
Returns a mutable pointer to the underlying buffer
|
nodiscardnoexcept |
Returns the number of channels allocated in the underlying buffer
|
nodiscardnoexcept |
Returns the number of samples per channel allocated in the underlying buffer
|
nodiscardnoexcept |
Returns an immutable view into a specific channel of the underlying buffer. In debug, bounds checks with an assert
| channel | The channel to construct a view into. |
|
nodiscardnoexcept |
Returns a mutable view into a specific channel of the underlying buffer. In debug, bounds checks with an assert
| channel | The channel to construct a view into. |