|
| | BufferView ()=default |
| | BufferView (SampleType *const *channel_ptrs, std::size_t num_channels, std::size_t num_samples) |
| | Construct from an array of per-channel pointers.
|
| BufferView | slice (std::size_t start, std::size_t length) const |
| | Create a non-owning slice over this view.
|
| std::span< SampleType > | channel (std::size_t index) |
| | Get a span over all samples in one channel.
|
| std::span< const SampleType > | channel (std::size_t index) const |
| | Get a span over all samples in one channel.
|
| SampleType * | channel_ptr (std::size_t index) |
| | Raw pointer to one channel's sample data.
|
| const SampleType * | channel_ptr (std::size_t index) const |
| | Raw pointer to one channel's sample data.
|
| bool | has_valid_channels () const noexcept |
| | Check channel storage before a caller dereferences a borrowed host view.
|
| std::size_t | num_channels () const |
| std::size_t | num_samples () const |
| bool | empty () const |
| | True if the buffer has zero channels or zero samples.
|
| void | clear () |
| | Zero-fill all channels.
|
template<typename SampleType = float>
class pulp::audio::BufferView< SampleType >
Non-owning view over multi-channel audio sample data.
This is the primary type passed into Processor::process(). It wraps an array of channel pointers provided by the host or format adapter and does not allocate or own any memory.
- Template Parameters
-
| SampleType | Sample format — typically float or const float. |
float* ptrs[2] = {left_ptr, right_ptr};
for (auto& s : buf.channel(0)) s *= 0.5f;
Non-owning view over multi-channel audio sample data.
Definition buffer.hpp:30