Twitch SDK (Internal)
Public Member Functions | Private Types | Private Attributes | List of all members
ttv::AudioConverter< InputBufferFormat, OutputBufferFormat, AudioConvertOptions > Class Template Reference

#include <audioconverter.h>

Inheritance diagram for ttv::AudioConverter< InputBufferFormat, OutputBufferFormat, AudioConvertOptions >:
ttv::IAudioConverter

Public Member Functions

 AudioConverter ()
 
virtual void BindInputBuffer (const void *buffer, SampleRange range) override
 
virtual SampleRange GetOutputSampleRange () const override
 
virtual SampleRange TransferToOutputBuffer (void *buffer, SampleRange range) override
 
virtual void UnbindInputBuffer () override
 

Private Types

using ContextType = AudioConvertContext< AudioConvertOptions >
 

Private Attributes

ContextType mContext
 
AudioConvertPipeline< InputBufferFormat, OutputBufferFormat, ContextTypemPipeline
 

Detailed Description

template<typename InputBufferFormat, typename OutputBufferFormat, typename AudioConvertOptions = void>
class ttv::AudioConverter< InputBufferFormat, OutputBufferFormat, AudioConvertOptions >

The concrete implementation of the IAudioConverter interface.

This class is responsible for type-erasure of configuration data for the audio converter. Options and input/output formats are passed in as template parameters, but the virtual interface this this class implements can be utilized without the need to keep this type information.

Template Parameters
InputBufferFormatA BufferFormat object specifying the PCM format of the input buffers that will be bound to this converter. See BufferFormat in dsputilities.h
OutputBufferFormatA BufferFormat object specifying the PCM format of the output buffers that will be written to by this converter. See BufferFormat in dsputilities.h
AudioConvertOptionsA struct containing configuration options for audio conversion. See audioconvertoptions.h for details. If void is passed for this parameter, all default options are selected.

Member Typedef Documentation

◆ ContextType

template<typename InputBufferFormat , typename OutputBufferFormat , typename AudioConvertOptions = void>
using ttv::AudioConverter< InputBufferFormat, OutputBufferFormat, AudioConvertOptions >::ContextType = AudioConvertContext<AudioConvertOptions>
private

Constructor & Destructor Documentation

◆ AudioConverter()

template<typename InputBufferFormat , typename OutputBufferFormat , typename AudioConvertOptions = void>
ttv::AudioConverter< InputBufferFormat, OutputBufferFormat, AudioConvertOptions >::AudioConverter ( )
inline

Member Function Documentation

◆ BindInputBuffer()

template<typename InputBufferFormat , typename OutputBufferFormat , typename AudioConvertOptions = void>
virtual void ttv::AudioConverter< InputBufferFormat, OutputBufferFormat, AudioConvertOptions >::BindInputBuffer ( const void *  buffer,
SampleRange  range 
)
inlineoverridevirtual

Binds a buffer of input data to converter. Calling this function when an input buffer is already bound to the converter is undefined behavior.

Parameters
bufferThe input buffer to bind.
rangeThe range of values, in the input buffer format's domain, that is represented by the input buffer.

Implements ttv::IAudioConverter.

◆ GetOutputSampleRange()

template<typename InputBufferFormat , typename OutputBufferFormat , typename AudioConvertOptions = void>
virtual SampleRange ttv::AudioConverter< InputBufferFormat, OutputBufferFormat, AudioConvertOptions >::GetOutputSampleRange ( ) const
inlineoverridevirtual

Returns the range, in the output buffer format's domain, that is currently available in the converter. Calling this function when an input buffer is not bound is undefined behavior.

Returns
The range of values that can be transferred.

Implements ttv::IAudioConverter.

◆ TransferToOutputBuffer()

template<typename InputBufferFormat , typename OutputBufferFormat , typename AudioConvertOptions = void>
virtual SampleRange ttv::AudioConverter< InputBufferFormat, OutputBufferFormat, AudioConvertOptions >::TransferToOutputBuffer ( void *  buffer,
SampleRange  range 
)
inlineoverridevirtual

Transfers data to the passed output buffer. Calling this function when an input buffer is not bound to the converter is undefined behavior. This function will transfer data in a range that is available for reading (from the converter) and writing (the passed sample range), i.e. the intersection of the two ranges. If no data was transferred, this function will return a range of {0, 0}

Parameters
bufferThe output buffer to transfer data into.
rangeThe range of values, in the output buffer format's domain, that is represented by the output buffer.
Returns
The range of values that was written.

Implements ttv::IAudioConverter.

◆ UnbindInputBuffer()

template<typename InputBufferFormat , typename OutputBufferFormat , typename AudioConvertOptions = void>
virtual void ttv::AudioConverter< InputBufferFormat, OutputBufferFormat, AudioConvertOptions >::UnbindInputBuffer ( )
inlineoverridevirtual

Unbinds the currently bound buffer of input data. Calling this function when an input buffer is not bound to the converter is undefined behavior.

Implements ttv::IAudioConverter.

Member Data Documentation

◆ mContext

template<typename InputBufferFormat , typename OutputBufferFormat , typename AudioConvertOptions = void>
ContextType ttv::AudioConverter< InputBufferFormat, OutputBufferFormat, AudioConvertOptions >::mContext
private

◆ mPipeline

template<typename InputBufferFormat , typename OutputBufferFormat , typename AudioConvertOptions = void>
AudioConvertPipeline<InputBufferFormat, OutputBufferFormat, ContextType> ttv::AudioConverter< InputBufferFormat, OutputBufferFormat, AudioConvertOptions >::mPipeline
private

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