VISR  0.11.8
Versatile Interactive Scene Renderer
visr::AudioOutputT< DataType > Class Template Reference

#include <audio_output.hpp>

Inheritance diagram for visr::AudioOutputT< DataType >:
visr::AudioOutputBase visr::AudioPortBase

Public Member Functions

 AudioOutputT (char const *name, Component &container, std::size_t width=0)
 
virtual ~AudioOutputT () override=default
 
DataType * data ()
 
DataType * at (std::size_t idx)
 
DataType * operator[] (std::size_t idx)
 
template<class OutputIterator >
OutputIterator getChannelPointers (OutputIterator outIt)
 
- Public Member Functions inherited from visr::AudioOutputBase
 AudioOutputBase (char const *name, Component &container, AudioSampleType::Id typeId, std::size_t width)
 
virtual ~AudioOutputBase () override
 
- Public Member Functions inherited from visr::AudioPortBase
 AudioPortBase (char const *name, Component &container, AudioSampleType::Id sampleType, PortBase::Direction direction)
 
 AudioPortBase (char const *name, Component &container, AudioSampleType::Id sampleType, PortBase::Direction direction, std::size_t width)
 
virtual ~AudioPortBase ()
 
void setWidth (std::size_t newWidth)
 
std::size_t width () const noexcept
 
std::size_t alignmentBytes () noexcept
 
std::size_t alignmentSamples () noexcept
 
std::size_t channelStrideSamples () const noexcept
 
std::size_t channelStrideBytes () const noexcept
 
AudioSampleType::Id sampleType () const noexcept
 
std::size_t sampleSize () const noexcept
 
impl::AudioPortBaseImplementationimplementation ()
 
impl::AudioPortBaseImplementation const & implementation () const
 

Additional Inherited Members

- Protected Member Functions inherited from visr::AudioPortBase
void * basePointer ()
 
void const * basePointer () const
 

Detailed Description

template<typename DataType>
class visr::AudioOutputT< DataType >

Class template for concrete output port types holding a specific sample type.

Template Parameters
DataTypeThe sample data type used by this port.

Constructor & Destructor Documentation

◆ AudioOutputT()

template<typename DataType>
visr::AudioOutputT< DataType >::AudioOutputT ( char const *  name,
Component container,
std::size_t  width = 0 
)
inline

Constructor.

Parameters
nameThe name of the port as a null-terminated character array. Must be unique among the audio ports of the containing component.
containerThe containing component (composite or atomic).
widthThe width, i.e., number of elementary audio signals provided by this class. Optional parameter, default is zero. The width can be set or modified during the initialisation phase of the containing component.

◆ ~AudioOutputT()

template<typename DataType>
virtual visr::AudioOutputT< DataType >::~AudioOutputT ( )
overridevirtualdefault

Destructor (virtual)

Member Function Documentation

◆ at()

template<typename DataType>
DataType* visr::AudioOutputT< DataType >::at ( std::size_t  idx)
inline

Return the first sample of a given signal, checked version.

Parameters
idxThe signal index (zero-offset).
Exceptions
std::out_of_rangeIf idx exceeds the width of the port.

◆ data()

template<typename DataType>
DataType* visr::AudioOutputT< DataType >::data ( )
inline

Return a non-constant pointer to the first sample of the first (technically zeroth) signal of this port. Samples for each channel are stored contiguously, and the pointer addresses of subsequent audio signals can be calculated by adding multiples of channelStrideSamples() to the data() pointer.

◆ getChannelPointers()

template<typename DataType>
template<class OutputIterator >
OutputIterator visr::AudioOutputT< DataType >::getChannelPointers ( OutputIterator  outIt)
inline

Write the channel pointers of all contained elements to an output iterator. The container that is pointed to by outIt must provide space for at least width() elements.

Template Parameters
OutputIteratora type fulfilling the OutputIterator concept that accepts assignement of DataType const * values.
Parameters
outItthe output iterator to be written to.
Returns
An output iterator pointing to the element behind the last inserted element.

◆ operator[]()

template<typename DataType>
DataType* visr::AudioOutputT< DataType >::operator[] ( std::size_t  idx)
inline

Return the first sample of a given signal, unchecked version.

Parameters
idxThe signal index (zero-offset).

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