VISR  0.11.1
Versatile Interactive Scene Renderer
visr::AudioInputT< DataType > Class Template Reference

#include <audio_input.hpp>

Inheritance diagram for visr::AudioInputT< DataType >:
visr::AudioInputBase visr::AudioPortBase

Public Member Functions

 AudioInputT (char const *name, Component &container, std::size_t width=0)
 
virtual ~AudioInputT () override=default
 
DataType const * data () const
 
DataType const * at (std::size_t idx) const
 
DataType const * operator[] (std::size_t idx) const
 
template<class OutputIterator >
OutputIterator getChannelPointers (OutputIterator outIt)
 
- Public Member Functions inherited from visr::AudioInputBase
 AudioInputBase (char const *name, Component &container, AudioSampleType::Id typeId, std::size_t width)
 
virtual ~AudioInputBase () 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::AudioInputT< DataType >

Class template for concrete audio inputs holding samples of a specific type.

Template Parameters
DataTypeThe sample type used by this audio port type.

Constructor & Destructor Documentation

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

Constructor, construct an audio input port of a specific sample type.

Parameters
nameThe name of the input port. Zer-terminated character array that must be unique among the audio ports of the containing components.
containerThe component to be holding this audio port
widthThe port width, i.e., number of single audio signals, represented by this port. Optional parameter, default value 0.
template<typename DataType>
virtual visr::AudioInputT< DataType >::~AudioInputT ( )
overridevirtualdefault

Destructor (virtual)

Todo:
decide whether the destructor must be virtual, i.e., whether the class is instantiated polymorphically.

Member Function Documentation

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

Return the pointer to element 0 of the idx - th channel of the audio port, with checking

Parameters
idxThe zero-offset index of the requested audio channel.
Exceptions
std::out_of_rangeif idx exceeds the admissible channel indices, i.e., idx >= width()
template<typename DataType>
DataType const* visr::AudioInputT< DataType >::data ( ) const
inline

Return the base pointer of the input sample. This is the pointer to the first (index 0) channel signal.

template<typename DataType>
template<class OutputIterator >
OutputIterator visr::AudioInputT< 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.
template<typename DataType>
DataType const* visr::AudioInputT< DataType >::operator[] ( std::size_t  idx) const
inline

Return the pointer to element 0 of the idx - th channel of the audio port, unchecked version. If the index idx exceeds the admissible range, the result is undefined.

Parameters
idxThe zero-offset index of the requested audio channel.

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