diff --git a/src/base/RingBuffer.h b/src/base/RingBuffer.h index 393e0c2..cb7c108 100644 --- a/src/base/RingBuffer.h +++ b/src/base/RingBuffer.h @@ -67,7 +67,7 @@ public: int getSize() const; /** - * Return a new ring buffer (allocated with "new" -- called must + * Return a new ring buffer (allocated with "new" -- caller must * delete when no longer needed) of the given size, containing the * same data as this one. If another thread reads from or writes * to this buffer during the call, the results may be incomplete @@ -89,8 +89,7 @@ public: void reset(); /** - * Return the amount of data available for reading by reader R, in - * samples. + * Return the amount of data available for reading, in samples. */ int getReadSpace() const; @@ -100,9 +99,9 @@ public: int getWriteSpace() const; /** - * Read n samples from the buffer, for reader R. If fewer than n - * are available, the remainder will be zeroed out. Returns the - * number of samples actually read. + * Read n samples from the buffer. If fewer than n are available, + * the remainder will be zeroed out. Returns the number of + * samples actually read. * * This is a template function, taking an argument S for the target * sample type, which is permitted to differ from T if the two @@ -112,10 +111,9 @@ public: int read(S *const R__ destination, int n); /** - * Read n samples from the buffer, for reader R, adding them to - * the destination. If fewer than n are available, the remainder - * will be left alone. Returns the number of samples actually - * read. + * Read n samples from the buffer, adding them to the destination. + * If fewer than n are available, the remainder will be left + * alone. Returns the number of samples actually read. * * This is a template function, taking an argument S for the target * sample type, which is permitted to differ from T if the two @@ -125,20 +123,19 @@ public: int readAdding(S *const R__ destination, int n); /** - * Read one sample from the buffer, for reader R. If no sample is - * available, this will silently return zero. Calling this - * repeatedly is obviously slower than calling read once, but it - * may be good enough if you don't want to allocate a buffer to - * read into. + * Read one sample from the buffer. If no sample is available, + * this will silently return zero. Calling this repeatedly is + * obviously slower than calling read once, but it may be good + * enough if you don't want to allocate a buffer to read into. */ T readOne(); /** - * Read n samples from the buffer, if available, for reader R, - * without advancing the read pointer -- i.e. a subsequent read() - * or skip() will be necessary to empty the buffer. If fewer than - * n are available, the remainder will be zeroed out. Returns the - * number of samples actually read. + * Read n samples from the buffer, if available, without advancing + * the read pointer -- i.e. a subsequent read() or skip() will be + * necessary to empty the buffer. If fewer than n are available, + * the remainder will be zeroed out. Returns the number of + * samples actually read. */ int peek(T *const R__ destination, int n) const; @@ -151,10 +148,9 @@ public: T peekOne() const; /** - * Pretend to read n samples from the buffer, for reader R, - * without actually returning them (i.e. discard the next n - * samples). Returns the number of samples actually available for - * discarding. + * Pretend to read n samples from the buffer, without actually + * returning them (i.e. discard the next n samples). Returns the + * number of samples actually available for discarding. */ int skip(int n); diff --git a/src/dsp/FFT.cpp b/src/dsp/FFT.cpp index 82d59e6..f3a7aaa 100644 --- a/src/dsp/FFT.cpp +++ b/src/dsp/FFT.cpp @@ -43,8 +43,7 @@ #endif #ifdef HAVE_VDSP -#include -#include +#include #endif #ifdef HAVE_MEDIALIB diff --git a/src/dsp/SincWindow.h b/src/dsp/SincWindow.h index 7fa8255..f0e953d 100644 --- a/src/dsp/SincWindow.h +++ b/src/dsp/SincWindow.h @@ -85,7 +85,7 @@ public: } inline void add(T *const R__ dst, T scale) const { - v_add_with_gain(dst, m_cache, m_size, scale); + v_add_with_gain(dst, m_cache, scale, m_size); } inline T getArea() const { return m_area; } diff --git a/src/dsp/Window.h b/src/dsp/Window.h index 414b69b..d8b6f82 100644 --- a/src/dsp/Window.h +++ b/src/dsp/Window.h @@ -80,7 +80,7 @@ public: } inline void add(T *const R__ dst, T scale) const { - v_add_with_gain(dst, m_cache, m_size, scale); + v_add_with_gain(dst, m_cache, scale, m_size); } inline T getRMS() const { diff --git a/src/system/VectorOps.h b/src/system/VectorOps.h index 15d7b0c..a1cba4d 100644 --- a/src/system/VectorOps.h +++ b/src/system/VectorOps.h @@ -289,8 +289,8 @@ inline void v_add_channels(T *const R__ *const R__ dst, template inline void v_add_with_gain(T *const R__ dst, const T *const R__ src, - const int count, - const G gain) + const G gain, + const int count) { for (int i = 0; i < count; ++i) { dst[i] += src[i] * gain; @@ -300,12 +300,12 @@ inline void v_add_with_gain(T *const R__ dst, template inline void v_add_channels_with_gain(T *const R__ *const R__ dst, const T *const R__ *const R__ src, + const G gain, const int channels, - const int count, - const G gain) + const int count) { for (int c = 0; c < channels; ++c) { - v_add_with_gain(dst[c], src[c], count, gain); + v_add_with_gain(dst[c], src[c], gain, count); } } diff --git a/src/system/sysutils.cpp b/src/system/sysutils.cpp index 54ea5c7..10aef9e 100644 --- a/src/system/sysutils.cpp +++ b/src/system/sysutils.cpp @@ -52,7 +52,7 @@ #endif #ifdef HAVE_VDSP -#include +#include #include #endif diff --git a/src/system/sysutils.h b/src/system/sysutils.h index cb7facc..452bbe6 100644 --- a/src/system/sysutils.h +++ b/src/system/sysutils.h @@ -58,6 +58,7 @@ #define uint32_t unsigned __int32 #elif defined(__MSVC__) #define ssize_t long +#include #else #include #endif