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

#include <AudioBufferView.h>

Inheritance diagram for lmms::InterleavedBufferView< T, channelCount >:
lmms::detail::BufferViewData< T, DynamicChannelCount >

Public Member Functions

template<typename U = T>
constexpr InterleavedBufferView (InterleavedBufferView< std::remove_const_t< U >, channelCount > other) noexcept
 Construct const from mutable (static channel count).
template<typename U = T>
constexpr InterleavedBufferView (InterleavedBufferView< std::remove_const_t< U >, channelCount > other) noexcept
 Construct const from mutable (dynamic channel count).
template<ch_cnt_t otherChannels>
constexpr InterleavedBufferView (InterleavedBufferView< T, otherChannels > other) noexcept
 Construct dynamic channel count from static.
 InterleavedBufferView (SampleFrame *data, f_cnt_t frames) noexcept
 Construct from SampleFrame*.
 InterleavedBufferView (const SampleFrame *data, f_cnt_t frames) noexcept
 Construct from const SampleFrame*.
constexpr auto empty () const noexcept -> bool
constexpr auto dataSizeBytes () const noexcept -> std::size_t
constexpr auto dataView () noexcept -> std::span< T >
constexpr auto frame (f_cnt_t index) const noexcept
constexpr auto framePtr (f_cnt_t index) const noexcept -> T *
constexpr auto operator[] (f_cnt_t index) const noexcept -> T *
constexpr auto subspan (f_cnt_t offset, f_cnt_t frames) const -> InterleavedBufferView< T, channelCount >
constexpr auto framesView () const noexcept -> std::ranges::subrange< ConstFrameIter, const T * >
constexpr auto framesView () noexcept -> std::ranges::subrange< FrameIter, T * >
auto sampleFrameAt (f_cnt_t index) noexcept -> SampleFrame &
auto sampleFrameAt (f_cnt_t index) const noexcept -> const SampleFrame &
auto asSampleFrames () noexcept -> std::span< SampleFrame >
auto asSampleFrames () const noexcept -> std::span< const SampleFrame >
Public Member Functions inherited from lmms::detail::BufferViewData< T, DynamicChannelCount >
constexpr BufferViewData ()=default
constexpr BufferViewData (const BufferViewData &)=default
constexpr BufferViewData (T *data, ch_cnt_t channels, f_cnt_t frames) noexcept
constexpr auto data () const noexcept -> T *
constexpr auto channels () const noexcept -> ch_cnt_t
constexpr auto frames () const noexcept -> f_cnt_t

Static Public Attributes

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

Private Types

using Base = detail::BufferViewData<T, channelCount>
using FrameIter = detail::InterleavedFrameIterator<T, channelCount>
using ConstFrameIter = detail::InterleavedFrameIterator<const T, channelCount>

Additional Inherited Members

Protected Attributes inherited from lmms::detail::BufferViewData< T, DynamicChannelCount >
T * m_data = nullptr
ch_cnt_t m_channels = 0
f_cnt_t m_frames = 0

Detailed Description

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

Non-owning view for multi-channel interleaved audio data

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

Member Typedef Documentation

◆ Base

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

◆ ConstFrameIter

template<SampleType T, ch_cnt_t channelCount = DynamicChannelCount>
using lmms::InterleavedBufferView< T, channelCount >::ConstFrameIter = detail::InterleavedFrameIterator<const T, channelCount>
private

◆ FrameIter

template<SampleType T, ch_cnt_t channelCount = DynamicChannelCount>
using lmms::InterleavedBufferView< T, channelCount >::FrameIter = detail::InterleavedFrameIterator<T, channelCount>
private

Constructor & Destructor Documentation

◆ InterleavedBufferView() [1/5]

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

Construct const from mutable (static channel count).

◆ InterleavedBufferView() [2/5]

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

Construct const from mutable (dynamic channel count).

◆ InterleavedBufferView() [3/5]

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

Construct dynamic channel count from static.

◆ InterleavedBufferView() [4/5]

template<SampleType T, ch_cnt_t channelCount = DynamicChannelCount>
lmms::InterleavedBufferView< T, channelCount >::InterleavedBufferView ( SampleFrame * data,
f_cnt_t frames )
inlinenoexcept

Construct from SampleFrame*.

◆ InterleavedBufferView() [5/5]

template<SampleType T, ch_cnt_t channelCount = DynamicChannelCount>
lmms::InterleavedBufferView< T, channelCount >::InterleavedBufferView ( const SampleFrame * data,
f_cnt_t frames )
inlinenoexcept

Construct from const SampleFrame*.

Member Function Documentation

◆ asSampleFrames() [1/2]

template<SampleType T, ch_cnt_t channelCount = DynamicChannelCount>
auto lmms::InterleavedBufferView< T, channelCount >::asSampleFrames ( ) const -> std::span< const SampleFrame >
inlinenoexcept

◆ asSampleFrames() [2/2]

template<SampleType T, ch_cnt_t channelCount = DynamicChannelCount>
auto lmms::InterleavedBufferView< T, channelCount >::asSampleFrames ( ) -> std::span< SampleFrame >
inlinenoexcept

◆ dataSizeBytes()

template<SampleType T, ch_cnt_t channelCount = DynamicChannelCount>
auto lmms::InterleavedBufferView< T, channelCount >::dataSizeBytes ( ) const -> std::size_t
inlineconstexprnoexcept

◆ dataView()

template<SampleType T, ch_cnt_t channelCount = DynamicChannelCount>
auto lmms::InterleavedBufferView< T, channelCount >::dataView ( ) -> std::span< T >
inlineconstexprnoexcept

◆ empty()

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

◆ frame()

template<SampleType T, ch_cnt_t channelCount = DynamicChannelCount>
auto lmms::InterleavedBufferView< T, channelCount >::frame ( f_cnt_t index) const
inlineconstexprnoexcept
Returns
the frame at the given index

◆ framePtr()

template<SampleType T, ch_cnt_t channelCount = DynamicChannelCount>
auto lmms::InterleavedBufferView< T, channelCount >::framePtr ( f_cnt_t index) const -> T *
inlineconstexprnoexcept
Returns
pointer to the frame at the given index. The size of the frame is channels().

◆ framesView() [1/2]

template<SampleType T, ch_cnt_t channelCount = DynamicChannelCount>
auto lmms::InterleavedBufferView< T, channelCount >::framesView ( ) const -> std::ranges::subrange< ConstFrameIter, const T * >
inlineconstexprnoexcept
Returns
a const view over the frames. Iterates in chunks containing channels() elements.

◆ framesView() [2/2]

template<SampleType T, ch_cnt_t channelCount = DynamicChannelCount>
auto lmms::InterleavedBufferView< T, channelCount >::framesView ( ) -> std::ranges::subrange< FrameIter, T * >
inlineconstexprnoexcept
Returns
a view over the frames. Iterates in chunks containing channels() elements.

◆ operator[]()

template<SampleType T, ch_cnt_t channelCount = DynamicChannelCount>
auto lmms::InterleavedBufferView< T, channelCount >::operator[] ( f_cnt_t index) const -> T *
inlineconstexprnoexcept
Returns
pointer to the frame at the given index. The size of the frame is channels().

◆ sampleFrameAt() [1/2]

template<SampleType T, ch_cnt_t channelCount = DynamicChannelCount>
auto lmms::InterleavedBufferView< T, channelCount >::sampleFrameAt ( f_cnt_t index) const -> const SampleFrame &
inlinenoexcept

◆ sampleFrameAt() [2/2]

template<SampleType T, ch_cnt_t channelCount = DynamicChannelCount>
auto lmms::InterleavedBufferView< T, channelCount >::sampleFrameAt ( f_cnt_t index) -> SampleFrame &
inlinenoexcept

◆ subspan()

template<SampleType T, ch_cnt_t channelCount = DynamicChannelCount>
auto lmms::InterleavedBufferView< T, channelCount >::subspan ( f_cnt_t offset,
f_cnt_t frames ) const -> InterleavedBufferView< T, channelCount >
inlineconstexpr
Returns
a subview at the given frame offset offset with a frame count of frames

Member Data Documentation

◆ Interleaved

template<SampleType T, ch_cnt_t channelCount = DynamicChannelCount>
bool lmms::InterleavedBufferView< T, channelCount >::Interleaved = true
staticconstexpr

Use to distinguish between InterleavedBufferView and PlanarBufferView when using AudioBufferView.


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