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

#include <audioconvertpipeline.h>

Classes

struct  Binder
 
struct  Binder< Operator, VoidType< decltype(std::declval< Operator >().Bind(nullptr, {}))> >
 
struct  RecursiveBinder
 
struct  RecursiveBinder< Operator, VoidType< decltype(std::declval< Operator >().GetInputSource())> >
 
struct  RecursiveUnbinder
 
struct  RecursiveUnbinder< Operator, VoidType< decltype(std::declval< Operator >().GetInputSource())> >
 
struct  Unbinder< Operator, std::enable_if_t< std::is_void< decltype(std::declval< Operator >().Unbind())>::value > >
 

Public Types

using InputSampleType = typename InputBufferFormat::SampleType
 
using OutputSampleType = typename OutputBufferFormat::SampleType
 

Public Member Functions

 AudioConvertPipeline (ContextType &context)
 
void BindInputBuffer (const InputSampleType *buffer, SampleRange range)
 
SampleRange GetOutputSampleRange () const
 
SampleRange TransferToOutputBuffer (OutputSampleType *buffer, SampleRange range)
 
void UnbindInputBuffer ()
 

Static Public Attributes

static constexpr size_t InputChannelCount = InputBufferFormat::ChannelCount
 
static constexpr size_t OutputChannelCount = OutputBufferFormat::ChannelCount
 

Private Types

using OperatorChainTuple = BuildOperatorChainTuple< ContextType, InputBufferFormat, OutputBufferFormat >
 

Private Member Functions

template<size_t Index = 0>
std::enable_if_t< Index< std::tuple_size< OperatorChainTuple >::value > BindOperatorChains(const InputSampleType *buffer, SampleRange range) { using OperatorChainToBind=std::tuple_element_t< Index, OperatorChainTuple >;RecursiveBinder< OperatorChainToBind >::RecurseAndBind(std::get< Index >mOperatorChains), buffer, range);BindOperatorChains< Index+1 >buffer, range);} template< size_t Index=0 > std::enable_if_t< Index >=std::tuple_size< OperatorChainTuple >::value > BindOperatorChains (const InputSampleType *buffer, SampleRange range)
 
template<size_t Index = 0>
std::enable_if_t<(Index< std::tuple_size< OperatorChainTuple >::value) &&(std::tuple_size< OperatorChainTuple >::value==1)> TransferSamples (OutputSampleType *buffer, size_t inputIndex)
 
template<size_t Index = 0>
std::enable_if_t<(Index< std::tuple_size< OperatorChainTuple >::value) &&(std::tuple_size< OperatorChainTuple >::value > 1)> TransferSamples (OutputSampleType *buffer, size_t inputIndex)
 

Private Attributes

OperatorChainTuple mOperatorChains
 
template<size_t Index = 0>
 Enable
 

Detailed Description

template<typename InputBufferFormat, typename OutputBufferFormat, typename ContextType>
class ttv::AudioConvertPipeline< InputBufferFormat, OutputBufferFormat, ContextType >

A class providing a high level interface for translating between different audio formats. Note that this can either support inputs and outputs having the same number of channels, or a single input channel with multiple outputs (in which case the single channel is duplicated across all output channels).

Template Parameters
InputBufferFormatThe input audio format. See BufferFormat in dsputilities.h
OutputBufferFormatThe output audio format. See BufferFormat in dsputilities.h
ContextTypeThe audio context to be used with this pipeline.

Member Typedef Documentation

◆ InputSampleType

template<typename InputBufferFormat, typename OutputBufferFormat, typename ContextType>
using ttv::AudioConvertPipeline< InputBufferFormat, OutputBufferFormat, ContextType >::InputSampleType = typename InputBufferFormat::SampleType

◆ OperatorChainTuple

template<typename InputBufferFormat, typename OutputBufferFormat, typename ContextType>
using ttv::AudioConvertPipeline< InputBufferFormat, OutputBufferFormat, ContextType >::OperatorChainTuple = BuildOperatorChainTuple<ContextType, InputBufferFormat, OutputBufferFormat>
private

◆ OutputSampleType

template<typename InputBufferFormat, typename OutputBufferFormat, typename ContextType>
using ttv::AudioConvertPipeline< InputBufferFormat, OutputBufferFormat, ContextType >::OutputSampleType = typename OutputBufferFormat::SampleType

Constructor & Destructor Documentation

◆ AudioConvertPipeline()

template<typename InputBufferFormat, typename OutputBufferFormat, typename ContextType>
ttv::AudioConvertPipeline< InputBufferFormat, OutputBufferFormat, ContextType >::AudioConvertPipeline ( ContextType &  context)
inline

Member Function Documentation

◆ BindInputBuffer()

template<typename InputBufferFormat, typename OutputBufferFormat, typename ContextType>
void ttv::AudioConvertPipeline< InputBufferFormat, OutputBufferFormat, ContextType >::BindInputBuffer ( const InputSampleType buffer,
SampleRange  range 
)
inline

◆ BindOperatorChains()

template<typename InputBufferFormat, typename OutputBufferFormat, typename ContextType>
template<size_t Index = 0>
std::enable_if_t<Index < std::tuple_size<OperatorChainTuple>::value> BindOperatorChains(const InputSampleType* buffer, SampleRange range) { using OperatorChainToBind = std::tuple_element_t<Index, OperatorChainTuple>; RecursiveBinder<OperatorChainToBind>::RecurseAndBind(std::get<Index>mOperatorChains), buffer, range); BindOperatorChains<Index + 1>buffer, range); } template <size_t Index = 0> std::enable_if_t<Index >= std::tuple_size<OperatorChainTuple>::value> ttv::AudioConvertPipeline< InputBufferFormat, OutputBufferFormat, ContextType >::BindOperatorChains ( const InputSampleType buffer,
SampleRange  range 
)
inlineprivate

◆ GetOutputSampleRange()

template<typename InputBufferFormat, typename OutputBufferFormat, typename ContextType>
SampleRange ttv::AudioConvertPipeline< InputBufferFormat, OutputBufferFormat, ContextType >::GetOutputSampleRange ( ) const
inline

◆ TransferSamples() [1/2]

template<typename InputBufferFormat, typename OutputBufferFormat, typename ContextType>
template<size_t Index = 0>
std::enable_if_t<(Index < std::tuple_size<OperatorChainTuple>::value) && (std::tuple_size<OperatorChainTuple>::value == 1)> ttv::AudioConvertPipeline< InputBufferFormat, OutputBufferFormat, ContextType >::TransferSamples ( OutputSampleType buffer,
size_t  inputIndex 
)
inlineprivate

◆ TransferSamples() [2/2]

template<typename InputBufferFormat, typename OutputBufferFormat, typename ContextType>
template<size_t Index = 0>
std::enable_if_t<(Index < std::tuple_size<OperatorChainTuple>::value) && (std::tuple_size<OperatorChainTuple>::value > 1)> ttv::AudioConvertPipeline< InputBufferFormat, OutputBufferFormat, ContextType >::TransferSamples ( OutputSampleType buffer,
size_t  inputIndex 
)
inlineprivate

◆ TransferToOutputBuffer()

template<typename InputBufferFormat, typename OutputBufferFormat, typename ContextType>
SampleRange ttv::AudioConvertPipeline< InputBufferFormat, OutputBufferFormat, ContextType >::TransferToOutputBuffer ( OutputSampleType buffer,
SampleRange  range 
)
inline

◆ UnbindInputBuffer()

template<typename InputBufferFormat, typename OutputBufferFormat, typename ContextType>
void ttv::AudioConvertPipeline< InputBufferFormat, OutputBufferFormat, ContextType >::UnbindInputBuffer ( )
inline

Member Data Documentation

◆ Enable

template<typename InputBufferFormat, typename OutputBufferFormat, typename ContextType>
template<size_t Index = 0>
ttv::AudioConvertPipeline< InputBufferFormat, OutputBufferFormat, ContextType >::Enable
private
Initial value:
= void>
struct Unbinder
{
static void UnbindOperator(Operator& op)
{
}
}

◆ InputChannelCount

template<typename InputBufferFormat, typename OutputBufferFormat, typename ContextType>
constexpr size_t ttv::AudioConvertPipeline< InputBufferFormat, OutputBufferFormat, ContextType >::InputChannelCount = InputBufferFormat::ChannelCount
static

◆ mOperatorChains

template<typename InputBufferFormat, typename OutputBufferFormat, typename ContextType>
OperatorChainTuple ttv::AudioConvertPipeline< InputBufferFormat, OutputBufferFormat, ContextType >::mOperatorChains
private

◆ OutputChannelCount

template<typename InputBufferFormat, typename OutputBufferFormat, typename ContextType>
constexpr size_t ttv::AudioConvertPipeline< InputBufferFormat, OutputBufferFormat, ContextType >::OutputChannelCount = OutputBufferFormat::ChannelCount
static

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