LMMS
Loading...
Searching...
No Matches
lmms::PlanarBufferView< T, channelCount > Class Template Reference

#include <AudioBufferView.h>

Inheritance diagram for lmms::PlanarBufferView< T, channelCount >:
lmms::detail::BufferViewData< T *const, DynamicChannelCount >

Public Member Functions

template<typename U = T>
constexpr PlanarBufferView (PlanarBufferView< std::remove_const_t< U >, channelCount > other) noexcept
 Construct const from mutable (static channel count).
template<typename U = T>
constexpr PlanarBufferView (PlanarBufferView< std::remove_const_t< U >, channelCount > other) noexcept
 Construct const from mutable (dynamic channel count).
template<ch_cnt_t otherChannels>
constexpr PlanarBufferView (PlanarBufferView< T, otherChannels > other) noexcept
 Construct dynamic channel count from static.
constexpr auto empty () const noexcept -> bool
constexpr auto buffer (ch_cnt_t channel) const noexcept -> std::span< T >
template<ch_cnt_t channel>
constexpr auto buffer () const noexcept -> std::span< T >
constexpr auto bufferPtr (ch_cnt_t channel) const noexcept -> T *
template<ch_cnt_t channel>
constexpr auto bufferPtr () const noexcept -> T *
constexpr auto operator[] (ch_cnt_t channel) const noexcept -> T *
Public Member Functions inherited from lmms::detail::BufferViewData< T *const, DynamicChannelCount >
constexpr BufferViewData ()=default
constexpr auto data () const noexcept -> T *
constexpr auto frames () const noexcept -> f_cnt_t

Static Public Attributes

static constexpr bool Interleaved = false
 Use to distinguish between InterleavedBufferView and PlanarBufferView when using AudioBufferView.

Private Types

using Base = detail::BufferViewData<T* const, channelCount>

Additional Inherited Members

Static Public Member Functions inherited from lmms::detail::BufferViewData< T *const, DynamicChannelCount >
static constexpr auto channels () noexcept -> ch_cnt_t
Protected Attributes inherited from lmms::detail::BufferViewData< T *const, DynamicChannelCount >
T * m_data
f_cnt_t m_frames

Detailed Description

template<SampleType T, ch_cnt_t channelCount = DynamicChannelCount>
class lmms::PlanarBufferView< T, channelCount >

Non-owning view for multi-channel non-interleaved audio data

The data type is T* const* which is a 2D array accessed as data[channel][frame index] where each channel's buffer contains frames() frames.

TODO C++23: Use std::mdspan?

Member Typedef Documentation

◆ Base

template<SampleType T, ch_cnt_t channelCount = DynamicChannelCount>
using lmms::PlanarBufferView< T, channelCount >::Base = detail::BufferViewData<T* const, channelCount>
private

Constructor & Destructor Documentation

◆ PlanarBufferView() [1/3]

template<SampleType T, ch_cnt_t channelCount = DynamicChannelCount>
template<typename U = T>
lmms::PlanarBufferView< T, channelCount >::PlanarBufferView ( PlanarBufferView< std::remove_const_t< U >, channelCount > other)
inlineconstexprnoexcept

Construct const from mutable (static channel count).

◆ PlanarBufferView() [2/3]

template<SampleType T, ch_cnt_t channelCount = DynamicChannelCount>
template<typename U = T>
lmms::PlanarBufferView< T, channelCount >::PlanarBufferView ( PlanarBufferView< std::remove_const_t< U >, channelCount > other)
inlineconstexprnoexcept

Construct const from mutable (dynamic channel count).

◆ PlanarBufferView() [3/3]

template<SampleType T, ch_cnt_t channelCount = DynamicChannelCount>
template<ch_cnt_t otherChannels>
lmms::PlanarBufferView< T, channelCount >::PlanarBufferView ( PlanarBufferView< T, otherChannels > other)
inlineconstexprnoexcept

Construct dynamic channel count from static.

Member Function Documentation

◆ buffer() [1/2]

template<SampleType T, ch_cnt_t channelCount = DynamicChannelCount>
template<ch_cnt_t channel>
auto lmms::PlanarBufferView< T, channelCount >::buffer ( ) const -> std::span< T >
inlineconstexprnoexcept
Returns
the buffer of the given channel

◆ buffer() [2/2]

template<SampleType T, ch_cnt_t channelCount = DynamicChannelCount>
auto lmms::PlanarBufferView< T, channelCount >::buffer ( ch_cnt_t channel) const -> std::span< T >
inlineconstexprnoexcept
Returns
the buffer of the given channel

◆ bufferPtr() [1/2]

template<SampleType T, ch_cnt_t channelCount = DynamicChannelCount>
template<ch_cnt_t channel>
auto lmms::PlanarBufferView< T, channelCount >::bufferPtr ( ) const -> T *
inlineconstexprnoexcept
Returns
pointer to the buffer of the given channel. The size of the buffer is frames().

◆ bufferPtr() [2/2]

template<SampleType T, ch_cnt_t channelCount = DynamicChannelCount>
auto lmms::PlanarBufferView< T, channelCount >::bufferPtr ( ch_cnt_t channel) const -> T *
inlineconstexprnoexcept
Returns
pointer to the buffer of the given channel. The size of the buffer is frames().

◆ empty()

template<SampleType T, ch_cnt_t channelCount = DynamicChannelCount>
auto lmms::PlanarBufferView< T, channelCount >::empty ( ) const -> bool
inlineconstexprnoexcept

◆ operator[]()

template<SampleType T, ch_cnt_t channelCount = DynamicChannelCount>
auto lmms::PlanarBufferView< T, channelCount >::operator[] ( ch_cnt_t channel) const -> T *
inlineconstexprnoexcept
Returns
pointer to the buffer of a given channel. The size of the buffer is frames().

Member Data Documentation

◆ Interleaved

template<SampleType T, ch_cnt_t channelCount = DynamicChannelCount>
bool lmms::PlanarBufferView< T, channelCount >::Interleaved = false
staticconstexpr

Use to distinguish between InterleavedBufferView and PlanarBufferView when using AudioBufferView.


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