Allow AudioSpan to accept padded AudioBuffer

This commit is contained in:
Jean Pierre Cimalando 2020-06-11 03:05:43 +02:00
parent 50efcfc95a
commit dd5d11f4a3

View file

@ -148,8 +148,8 @@ public:
* @tparam Alignment the alignment block size for the platform
* @param audioBuffer the source AudioBuffer.
*/
template <class U, size_t N, unsigned int Alignment, typename = typename std::enable_if<N <= MaxChannels>::type, typename = typename std::enable_if<std::is_const<U>::value, int>::type>
AudioSpan(AudioBuffer<U, N, Alignment>& audioBuffer)
template <class U, size_t N, unsigned int Alignment, size_t PaddingLeft, size_t PaddingRight, typename = typename std::enable_if<N <= MaxChannels>::type, typename = typename std::enable_if<std::is_const<U>::value, int>::type>
AudioSpan(AudioBuffer<U, N, Alignment, PaddingLeft, PaddingRight>& audioBuffer)
: numFrames(audioBuffer.getNumFrames())
, numChannels(audioBuffer.getNumChannels())
{
@ -169,8 +169,8 @@ public:
* @tparam Alignment the alignment block size for the platform
* @param audioBuffer the source AudioBuffer.
*/
template <class U, size_t N, unsigned int Alignment, typename = std::enable_if<N <= MaxChannels>>
AudioSpan(AudioBuffer<U, N, Alignment>& audioBuffer)
template <class U, size_t N, unsigned int Alignment, size_t PaddingLeft, size_t PaddingRight, typename = std::enable_if<N <= MaxChannels>>
AudioSpan(AudioBuffer<U, N, Alignment, PaddingLeft, PaddingRight>& audioBuffer)
: numFrames(audioBuffer.getNumFrames())
, numChannels(audioBuffer.getNumChannels())
{