From 1eff721f091f37777f3c8c645bf2b62cd2518c80 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Thu, 14 Apr 2016 00:46:48 -0400 Subject: [PATCH] Define some useful type aliases for arrays of floats and doubles --- src/MemoryX.h | 12 +++++++++++- src/SampleFormat.h | 7 +++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/MemoryX.h b/src/MemoryX.h index f60eea480..205555cf8 100644 --- a/src/MemoryX.h +++ b/src/MemoryX.h @@ -513,7 +513,17 @@ public: return *this; } - using ArrayOf>::reinit; + template< typename Integral > + void reinit(Integral count) + { + ArrayOf>::reinit( count ); + } + + template< typename Integral > + void reinit(Integral count, bool initialize) + { + ArrayOf>::reinit( count, initialize ); + } template void reinit(Integral1 countN, Integral2 countM, bool initialize = false) diff --git a/src/SampleFormat.h b/src/SampleFormat.h index 67f312fec..f41d881d0 100644 --- a/src/SampleFormat.h +++ b/src/SampleFormat.h @@ -12,6 +12,7 @@ #define __AUDACITY_SAMPLE_FORMAT__ #include "Audacity.h" +#include "MemoryX.h" #include #include "audacity/Types.h" @@ -151,4 +152,10 @@ void ReverseSamples(samplePtr buffer, sampleFormat format, void InitDitherers(); +// These are so commonly done for processing samples in floating point form in memory, +// let's have abbeviations. +using Floats = ArrayOf; +using FloatBuffers = ArraysOf; +using Doubles = ArrayOf; + #endif