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
-
| InputBufferFormat | A BufferFormat object specifying the PCM format of the input buffers that will be bound to this converter. See BufferFormat in dsputilities.h |
| OutputBufferFormat | A BufferFormat object specifying the PCM format of the output buffers that will be written to by this converter. See BufferFormat in dsputilities.h |
| AudioConvertOptions | A struct containing configuration options for audio conversion. See audioconvertoptions.h for details. If void is passed for this parameter, all default options are selected. |
template<typename InputBufferFormat , typename OutputBufferFormat , typename AudioConvertOptions = void>
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.
template<typename InputBufferFormat , typename OutputBufferFormat , typename AudioConvertOptions = void>
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
-
| buffer | The output buffer to transfer data into. |
| range | The 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.