36 template <
typename ContextType,
typename InputBufferFormat,
typename OutputBufferFormat,
size_t SelectedChannelIndex>
43 template <
typename ScalarType,
typename Enable =
void>
49 template <
typename ScalarType>
52 using Type = std::make_signed_t<ScalarType>;
55 template <
typename ScalarType>
66 template <
typename T =
void>
69 static constexpr
size_t SampleRate = InputBufferFormat::SampleRate;
70 using SampleType =
typename InputBufferFormat::SampleType;
73 template <
typename InputSource>
76 template <
typename T =
void>
79 static constexpr
size_t SampleRate = InputSource::SampleRate;
83 template <
typename InputSource>
86 template <
typename T =
void>
89 static constexpr
size_t SampleRate = InputSource::SampleRate;
90 using SampleType = std::make_unsigned_t<typename InputSource::SampleType>;
93 template <
typename InputSource,
typename OutputSampleType>
96 template <
typename T =
void>
99 static constexpr
size_t SampleRate = InputSource::SampleRate;
103 template <
typename InputSource,
typename OutputSampleType>
106 template <
typename T =
void>
109 static constexpr
size_t SampleRate = InputSource::SampleRate;
113 template <
typename InputSource,
typename OutputSampleType>
116 template <
typename T =
void>
119 static constexpr
size_t SampleRate = InputSource::SampleRate;
123 template <
typename InputSource,
typename OutputSampleType>
126 template <
typename T =
void>
129 static constexpr
size_t SampleRate = InputSource::SampleRate;
133 template <
typename InputSource,
typename OutputSampleType>
136 template <
typename T =
void>
139 static constexpr
size_t SampleRate = InputSource::SampleRate;
144 template <
typename InputSource,
size_t SampleRateArg>
147 template <
typename T =
void>
150 static constexpr
size_t SampleRate = SampleRateArg;
155 template <
typename Input>
157 std::is_unsigned<typename Input::SampleType>::value,
162 template <
typename Input>
164 std::is_signed<typename Input::SampleType>::value,
166 ConvertToSignedWrapper<Input>
169 template <
typename Input,
typename OutputSampleType>
171 std::is_signed<typename Input::SampleType>::value == std::is_signed<OutputSampleType>::value,
176 template <
typename Input,
typename OutputSampleType>
178 std::is_floating_point<OutputSampleType>::value,
183 template <
typename Input,
typename OutputSampleType>
185 sizeof(
typename Input::SampleType) <
sizeof(OutputSampleType),
190 template <
typename Input,
typename OutputSampleType>
192 sizeof(
typename Input::SampleType) ==
sizeof(OutputSampleType),
197 template <
typename Input,
typename OutputSampleType>
199 std::is_floating_point<OutputSampleType>::value,
204 template <
typename Input,
typename OutputSampleType>
206 std::is_floating_point<typename Input::SampleType>::value,
211 template <
typename Input,
typename OutputSampleType>
213 std::is_same<typename Input::SampleType, OutputSampleType>::value,
220 template <
typename Input,
typename Output>
222 (
sizeof(
typename Input::SampleType) <
sizeof(
typename Output::SampleType)),
227 template <
typename Input,
typename Output>
229 Input::SampleRate == Output::SampleRate,
236 using Type =
typename WrappedType::template Unwrap<>;
238 static_assert(std::is_same<typename OutputBufferFormat::SampleType, typename Type::SampleType>::value,
"Sample type mismatch after building operator chain.");
239 static_assert(OutputBufferFormat::SampleRate == Type::SampleRate,
"Sample rate mismatch after building operator chain.");
243 template <
typename ContextType,
typename InputBufferFormat,
typename OutputBufferFormat,
size_t SelectedChannelIndex>
247 template <
typename ContextType,
typename InputBufferFormat,
typename OutputBufferFormat,
size_t RemainingChannelCount,
typename ...CurrentChannels>
255 template <
typename ContextType,
typename InputBufferFormat,
typename OutputBufferFormat,
typename ...CurrentChannels>
258 using Type = std::tuple<CurrentChannels...>;
262 template <
typename ContextType,
typename InputBufferFormat,
typename OutputBufferFormat>
266 template <
typename TupleType,
typename ContextType,
typename ...Args>
267 std::enable_if_t<
sizeof...(Args) < std::tuple_size<TupleType>::value, TupleType> PopulateTupleArgs(ContextType& context, Args&... args)
269 return PopulateTupleArgs<TupleType>(context, context, args...);
273 template <
typename TupleType,
typename ContextType,
typename ...Args>
274 std::enable_if_t<
sizeof...(Args) == std::tuple_size<TupleType>::value, TupleType> PopulateTupleArgs(ContextType& context, Args&... args)
276 return TupleType{args...};
279 template <
typename TupleType,
typename ContextType>
280 TupleType MakeOperatorTuple(ContextType& context)
282 return PopulateTupleArgs<TupleType>(context);
OutputSampleType SampleType
Definition: operatorchainbuilder.h:100
Definition: increasebitdepthoperator.h:32
std::conditional_t< std::is_floating_point< OutputSampleType >::value, ChangeFloatingPointDepthWrapper< Input, OutputSampleType >, MatchSignedness< ConvertToIntegralTypeWrapper< Input, MakeSignedIfIntegral< OutputSampleType > >, OutputSampleType > > ConvertFloatingToSampleType
Definition: operatorchainbuilder.h:181
typename MakeSignedIfIntegralSelector< ScalarType >::Type MakeSignedIfIntegral
Definition: operatorchainbuilder.h:56
typename OperatorChainTupleBuilder< ContextType, InputBufferFormat, OutputBufferFormat, InputBufferFormat::ChannelCount >::Type BuildOperatorChainTuple
Definition: operatorchainbuilder.h:263
Definition: converttointegraltypeoperator.h:33
Definition: resampleoperator.h:34
std::make_unsigned_t< typename InputSource::SampleType > SampleType
Definition: operatorchainbuilder.h:90
std::conditional_t< std::is_floating_point< typename Input::SampleType >::value, ConvertFloatingToSampleType< Input, OutputSampleType >, ConvertIntegralToSampleType< Input, OutputSampleType > > ConvertSampleType
Definition: operatorchainbuilder.h:209
OutputSampleType SampleType
Definition: operatorchainbuilder.h:120
typename WrappedType::template Unwrap<> Type
Definition: operatorchainbuilder.h:236
std::conditional_t< std::is_same< typename Input::SampleType, OutputSampleType >::value, Input, ConvertSampleType< Input, OutputSampleType > > MatchSampleType
Definition: operatorchainbuilder.h:216
BuildOperatorChain< ContextType, InputBufferFormat, OutputBufferFormat, RemainingChannelCount - 1 > AppendedOperatorChain
Definition: operatorchainbuilder.h:250
Definition: operatorchainbuilder.h:134
Definition: operatorchainbuilder.h:94
typename OperatorChainBuilder< ContextType, InputBufferFormat, OutputBufferFormat, SelectedChannelIndex >::Type BuildOperatorChain
Definition: operatorchainbuilder.h:244
Definition: operatorchainbuilder.h:44
Definition: cpp11transition.h:22
Definition: operatorchainbuilder.h:37
typename InputSource::SampleType SampleType
Definition: operatorchainbuilder.h:151
std::conditional_t<(sizeof(typename Input::SampleType)< sizeof(typename Output::SampleType)), MatchSignedness< ResampleWrapper< MatchSampleType< Input, MakeSignedIfIntegral< typename Output::SampleType > >, Output::SampleRate >, typename Output::SampleType >, MatchSampleType< ResampleWrapper< MakeSigned< Input >, Output::SampleRate >, typename Output::SampleType > > ConvertSampleRateAndType
Definition: operatorchainbuilder.h:225
Definition: converttosignedoperator.h:31
MakeSignedIfIntegral< typename InputSource::SampleType > SampleType
Definition: operatorchainbuilder.h:80
Definition: pcmbufferaudiosource.h:26
OutputSampleType SampleType
Definition: operatorchainbuilder.h:140
JSON (JavaScript Object Notation).
Definition: adsapi.h:16
Definition: operatorchainbuilder.h:248
std::conditional_t< sizeof(typename Input::SampleType)< sizeof(OutputSampleType), IncreaseBitDepthWrapper< Input, OutputSampleType >, DecreaseBitDepthWrapper< Input, OutputSampleType > > ConvertIntegralDepth
Definition: operatorchainbuilder.h:188
Definition: converttounsignedoperator.h:31
ScalarType Type
Definition: operatorchainbuilder.h:46
typename OperatorChainTupleBuilder< ContextType, InputBufferFormat, OutputBufferFormat, RemainingChannelCount - 1, AppendedOperatorChain, CurrentChannels... >::Type Type
Definition: operatorchainbuilder.h:251
Definition: operatorchainbuilder.h:84
std::conditional_t< std::is_unsigned< typename Input::SampleType >::value, ConvertToSignedWrapper< Input >, Input > MakeSigned
Definition: operatorchainbuilder.h:160
Definition: operatorchainbuilder.h:74
Definition: decreasebitdepthoperator.h:32
Definition: converttofloatingpointoperator.h:32
std::conditional_t< std::is_signed< typename Input::SampleType >::value, ConvertToUnsignedWrapper< Input >, ConvertToSignedWrapper< Input > > FlipSignedness
Definition: operatorchainbuilder.h:167
ConvertFormat< InputSourceWrapper, OutputBufferFormat > WrappedType
Definition: operatorchainbuilder.h:234
Definition: changefloatingpointdepthoperator.h:32
std::tuple< CurrentChannels... > Type
Definition: operatorchainbuilder.h:258
std::conditional_t< Input::SampleRate==Output::SampleRate, MatchSampleType< Input, typename Output::SampleType >, ConvertSampleRateAndType< Input, Output > > ConvertFormat
Definition: operatorchainbuilder.h:232
Definition: operatorchainbuilder.h:124
OutputSampleType SampleType
Definition: operatorchainbuilder.h:130
Definition: operatorchainbuilder.h:145
std::conditional_t< std::is_signed< typename Input::SampleType >::value==std::is_signed< OutputSampleType >::value, Input, FlipSignedness< Input > > MatchSignedness
Definition: operatorchainbuilder.h:174
Definition: operatorchainbuilder.h:114
Definition: operatorchainbuilder.h:104
std::conditional_t< sizeof(typename Input::SampleType)==sizeof(OutputSampleType), Input, ConvertIntegralDepth< Input, OutputSampleType > > MatchIntegralDepth
Definition: operatorchainbuilder.h:195
std::make_signed_t< ScalarType > Type
Definition: operatorchainbuilder.h:52
OutputSampleType SampleType
Definition: operatorchainbuilder.h:110
std::conditional_t< std::is_floating_point< OutputSampleType >::value, ConvertToFloatingTypeWrapper< MatchSignedness< Input, OutputSampleType >, OutputSampleType >, MatchIntegralDepth< MatchSignedness< Input, OutputSampleType >, OutputSampleType > > ConvertIntegralToSampleType
Definition: operatorchainbuilder.h:202
std::enable_if_t< std::is_void< T >::value, ConvertToIntegralTypeOperator< typename InputSource::template Unwrap<>, OutputSampleType, ContextType > > Unwrap
Definition: operatorchainbuilder.h:107