RavEngine
Loading...
Searching...
No Matches
RavEngine::PlanarSampleBufferInlineView Class Reference

#include <AudioTypes.hpp>

Inheritance diagram for RavEngine::PlanarSampleBufferInlineView:
[legend]
Collaboration diagram for RavEngine::PlanarSampleBufferInlineView:
[legend]

Public Types

using value_type = decltype(combined_buffers)::value_type
 

Public Member Functions

 PlanarSampleBufferInlineView (const decltype(combined_buffers)&buf, decltype(sizeOfOneChannelInFrames) sizeOfOneChannelInFrames)
 
 PlanarSampleBufferInlineView (decltype(combined_buffers)::value_type *data, const decltype(combined_buffers)::size_type nframestotal, decltype(sizeOfOneChannelInFrames) sizeOfOneChannelInFrames)
 
auto operator[] (size_t i)
 
const auto operator[] (size_t i) const
 
uint8_t GetNChannels () const
 
auto size () const
 
auto GetNumSamples () const
 
auto data ()
 
const auto data () const
 
auto sizeOneChannel () const
 
auto bytesOneChannel () const
 
void ImportInterleavedData (InterleavedSampleBufferView interleaved, uint8_t nchannels)
 

Protected Types

using data_t = float
 

Protected Member Functions

auto channel_at (size_t i) const
 

Protected Attributes

std::span< data_t, std::dynamic_extent > combined_buffers
 
size_t sizeOfOneChannelInFrames = 0
 

Detailed Description

Represents planar audio by abstracting a single linear buffer. Expected that the single buffer is organized with one channel succeeding the next (with 2 channels: LLLLLLLL....LLRRRR...RR). Does not own the data.

Member Function Documentation

◆ GetNumSamples()

auto RavEngine::PlanarSampleBufferInlineView::GetNumSamples ( ) const
inline

Gets the number of samples, regardless of the number of channels. For example, a 4-channel view and a 1-channel view will return the same number.

◆ ImportInterleavedData()

void RavEngine::PlanarSampleBufferInlineView::ImportInterleavedData ( InterleavedSampleBufferView  interleaved,
uint8_t  nchannels 
)
inline

Copy interleaved data into a planar representation

Parameters
interleavedthe source buffer

◆ size()

auto RavEngine::PlanarSampleBufferInlineView::size ( ) const
inline
Returns
the size of the total storage, NOT the size of a single channel

◆ sizeOneChannel()

auto RavEngine::PlanarSampleBufferInlineView::sizeOneChannel ( ) const
inline
Returns
the size of a single channel, in frames

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