From bb0434dd6ed39716217bee1c18a68f7d568e62a9 Mon Sep 17 00:00:00 2001 From: Vestral <16190165+Vestrel@users.noreply.github.com> Date: Fri, 21 Jan 2022 22:00:38 +0900 Subject: [PATCH] Add 'override' keyword --- include/FIFOSampleBuffer.h | 18 +++++++++--------- include/FIFOSamplePipe.h | 14 +++++++------- include/SoundTouch.h | 10 +++++----- source/SoundTouch/FIRFilter.h | 8 ++++---- source/SoundTouch/InterpolateCubic.h | 8 ++++---- source/SoundTouch/InterpolateLinear.h | 10 +++++----- source/SoundTouch/InterpolateShannon.h | 8 ++++---- source/SoundTouch/RateTransposer.h | 8 ++++---- source/SoundTouch/TDStretch.h | 18 +++++++++--------- 9 files changed, 51 insertions(+), 51 deletions(-) diff --git a/include/FIFOSampleBuffer.h b/include/FIFOSampleBuffer.h index d792e6a..6c5785a 100644 --- a/include/FIFOSampleBuffer.h +++ b/include/FIFOSampleBuffer.h @@ -91,7 +91,7 @@ public: ); /// destructor - ~FIFOSampleBuffer(); + ~FIFOSampleBuffer() override; /// Returns a pointer to the beginning of the output samples. /// This function is provided for accessing the output samples directly. @@ -100,7 +100,7 @@ public: /// When using this function to output samples, also remember to 'remove' the /// output samples from the buffer by calling the /// 'receiveSamples(numSamples)' function - virtual SAMPLETYPE *ptrBegin(); + virtual SAMPLETYPE *ptrBegin() override; /// Returns a pointer to the end of the used part of the sample buffer (i.e. /// where the new samples are to be inserted). This function may be used for @@ -121,7 +121,7 @@ public: /// the sample buffer. virtual void putSamples(const SAMPLETYPE *samples, ///< Pointer to samples. uint numSamples ///< Number of samples to insert. - ); + ) override; /// Adjusts the book-keeping to increase number of samples in the buffer without /// copying any actual samples. @@ -139,7 +139,7 @@ public: /// \return Number of samples returned. virtual uint receiveSamples(SAMPLETYPE *output, ///< Buffer where to copy output samples. uint maxSamples ///< How many samples to receive at max. - ); + ) override; /// Adjusts book-keeping so that given number of samples are removed from beginning of the /// sample buffer without copying them anywhere. @@ -147,10 +147,10 @@ public: /// Used to reduce the number of samples in the buffer when accessing the sample buffer directly /// with 'ptrBegin' function. virtual uint receiveSamples(uint maxSamples ///< Remove this many samples from the beginning of pipe. - ); + ) override; /// Returns number of samples currently available. - virtual uint numSamples() const; + virtual uint numSamples() const override; /// Sets number of channels, 1 = mono, 2 = stereo. void setChannels(int numChannels); @@ -162,14 +162,14 @@ public: } /// Returns nonzero if there aren't any samples available for outputting. - virtual int isEmpty() const; + virtual int isEmpty() const override; /// Clears all the samples. - virtual void clear(); + virtual void clear() override; /// allow trimming (downwards) amount of samples in pipeline. /// Returns adjusted amount of samples - uint adjustAmountOfSamples(uint numSamples); + uint adjustAmountOfSamples(uint numSamples) override; /// Add silence to end of buffer void addSilent(uint nSamples); diff --git a/include/FIFOSamplePipe.h b/include/FIFOSamplePipe.h index 38ef31a..663c5c6 100644 --- a/include/FIFOSamplePipe.h +++ b/include/FIFOSamplePipe.h @@ -164,7 +164,7 @@ protected: } /// Destructor. - virtual ~FIFOProcessor() + virtual ~FIFOProcessor() override { } @@ -175,7 +175,7 @@ protected: /// When using this function to output samples, also remember to 'remove' the /// output samples from the buffer by calling the /// 'receiveSamples(numSamples)' function - virtual SAMPLETYPE *ptrBegin() + virtual SAMPLETYPE *ptrBegin() override { return output->ptrBegin(); } @@ -189,7 +189,7 @@ public: /// \return Number of samples returned. virtual uint receiveSamples(SAMPLETYPE *outBuffer, ///< Buffer where to copy output samples. uint maxSamples ///< How many samples to receive at max. - ) + ) override { return output->receiveSamples(outBuffer, maxSamples); } @@ -200,26 +200,26 @@ public: /// Used to reduce the number of samples in the buffer when accessing the sample buffer directly /// with 'ptrBegin' function. virtual uint receiveSamples(uint maxSamples ///< Remove this many samples from the beginning of pipe. - ) + ) override { return output->receiveSamples(maxSamples); } /// Returns number of samples currently available. - virtual uint numSamples() const + virtual uint numSamples() const override { return output->numSamples(); } /// Returns nonzero if there aren't any samples available for outputting. - virtual int isEmpty() const + virtual int isEmpty() const override { return output->isEmpty(); } /// allow trimming (downwards) amount of samples in pipeline. /// Returns adjusted amount of samples - virtual uint adjustAmountOfSamples(uint numSamples) + virtual uint adjustAmountOfSamples(uint numSamples) override { return output->adjustAmountOfSamples(numSamples); } diff --git a/include/SoundTouch.h b/include/SoundTouch.h index 778fc03..49b0306 100644 --- a/include/SoundTouch.h +++ b/include/SoundTouch.h @@ -209,7 +209,7 @@ protected : public: SoundTouch(); - virtual ~SoundTouch(); + virtual ~SoundTouch() override; /// Get SoundTouch library version string static const char *getVersionString(); @@ -287,7 +287,7 @@ public: uint numSamples ///< Number of samples in buffer. Notice ///< that in case of stereo-sound a single sample ///< contains data for both channels. - ); + ) override; /// Output samples from beginning of the sample buffer. Copies requested samples to /// output buffer and removes them from the sample buffer. If there are less than @@ -296,7 +296,7 @@ public: /// \return Number of samples returned. virtual uint receiveSamples(SAMPLETYPE *output, ///< Buffer where to copy output samples. uint maxSamples ///< How many samples to receive at max. - ); + ) override; /// Adjusts book-keeping so that given number of samples are removed from beginning of the /// sample buffer without copying them anywhere. @@ -304,11 +304,11 @@ public: /// Used to reduce the number of samples in the buffer when accessing the sample buffer directly /// with 'ptrBegin' function. virtual uint receiveSamples(uint maxSamples ///< Remove this many samples from the beginning of pipe. - ); + ) override; /// Clears all the samples in the object's output and internal processing /// buffers. - virtual void clear(); + virtual void clear() override; /// Changes a setting controlling the processing system behaviour. See the /// 'SETTING_...' defines for available setting ID's. diff --git a/source/SoundTouch/FIRFilter.h b/source/SoundTouch/FIRFilter.h index d370e4b..90b730f 100644 --- a/source/SoundTouch/FIRFilter.h +++ b/source/SoundTouch/FIRFilter.h @@ -106,12 +106,12 @@ public: short *filterCoeffsUnalign; short *filterCoeffsAlign; - virtual uint evaluateFilterStereo(short *dest, const short *src, uint numSamples) const; + virtual uint evaluateFilterStereo(short *dest, const short *src, uint numSamples) const override; public: FIRFilterMMX(); ~FIRFilterMMX(); - virtual void setCoefficients(const short *coeffs, uint newLength, uint uResultDivFactor); + virtual void setCoefficients(const short *coeffs, uint newLength, uint uResultDivFactor) override; }; #endif // SOUNDTOUCH_ALLOW_MMX @@ -125,12 +125,12 @@ public: float *filterCoeffsUnalign; float *filterCoeffsAlign; - virtual uint evaluateFilterStereo(float *dest, const float *src, uint numSamples) const; + virtual uint evaluateFilterStereo(float *dest, const float *src, uint numSamples) const override; public: FIRFilterSSE(); ~FIRFilterSSE(); - virtual void setCoefficients(const float *coeffs, uint newLength, uint uResultDivFactor); + virtual void setCoefficients(const float *coeffs, uint newLength, uint uResultDivFactor) override; }; #endif // SOUNDTOUCH_ALLOW_SSE diff --git a/source/SoundTouch/InterpolateCubic.h b/source/SoundTouch/InterpolateCubic.h index aede6aa..251c23f 100644 --- a/source/SoundTouch/InterpolateCubic.h +++ b/source/SoundTouch/InterpolateCubic.h @@ -43,20 +43,20 @@ class InterpolateCubic : public TransposerBase protected: virtual int transposeMono(SAMPLETYPE *dest, const SAMPLETYPE *src, - int &srcSamples); + int &srcSamples) override; virtual int transposeStereo(SAMPLETYPE *dest, const SAMPLETYPE *src, - int &srcSamples); + int &srcSamples) override; virtual int transposeMulti(SAMPLETYPE *dest, const SAMPLETYPE *src, - int &srcSamples); + int &srcSamples) override; double fract; public: InterpolateCubic(); - virtual void resetRegisters(); + virtual void resetRegisters() override; int getLatency() const { diff --git a/source/SoundTouch/InterpolateLinear.h b/source/SoundTouch/InterpolateLinear.h index cc785c3..6104fae 100644 --- a/source/SoundTouch/InterpolateLinear.h +++ b/source/SoundTouch/InterpolateLinear.h @@ -47,19 +47,19 @@ protected: virtual int transposeMono(SAMPLETYPE *dest, const SAMPLETYPE *src, - int &srcSamples); + int &srcSamples) override; virtual int transposeStereo(SAMPLETYPE *dest, const SAMPLETYPE *src, - int &srcSamples); - virtual int transposeMulti(SAMPLETYPE *dest, const SAMPLETYPE *src, int &srcSamples); + int &srcSamples) override; + virtual int transposeMulti(SAMPLETYPE *dest, const SAMPLETYPE *src, int &srcSamples) override; public: InterpolateLinearInteger(); /// Sets new target rate. Normal rate = 1.0, smaller values represent slower /// rate, larger faster rates. - virtual void setRate(double newRate); + virtual void setRate(double newRate) override; - virtual void resetRegisters(); + virtual void resetRegisters() override; int getLatency() const { diff --git a/source/SoundTouch/InterpolateShannon.h b/source/SoundTouch/InterpolateShannon.h index 60191d5..75876e1 100644 --- a/source/SoundTouch/InterpolateShannon.h +++ b/source/SoundTouch/InterpolateShannon.h @@ -48,20 +48,20 @@ class InterpolateShannon : public TransposerBase protected: int transposeMono(SAMPLETYPE *dest, const SAMPLETYPE *src, - int &srcSamples); + int &srcSamples) override; int transposeStereo(SAMPLETYPE *dest, const SAMPLETYPE *src, - int &srcSamples); + int &srcSamples) override; int transposeMulti(SAMPLETYPE *dest, const SAMPLETYPE *src, - int &srcSamples); + int &srcSamples) override; double fract; public: InterpolateShannon(); - void resetRegisters(); + void resetRegisters() override; int getLatency() const { diff --git a/source/SoundTouch/RateTransposer.h b/source/SoundTouch/RateTransposer.h index 9aa5fe7..411f4e8 100644 --- a/source/SoundTouch/RateTransposer.h +++ b/source/SoundTouch/RateTransposer.h @@ -124,7 +124,7 @@ protected: public: RateTransposer(); - virtual ~RateTransposer(); + virtual ~RateTransposer() override; /// Returns the output buffer object FIFOSamplePipe *getOutput() { return &outputBuffer; }; @@ -147,13 +147,13 @@ public: /// Adds 'numSamples' pcs of samples from the 'samples' memory position into /// the input of the object. - void putSamples(const SAMPLETYPE *samples, uint numSamples); + void putSamples(const SAMPLETYPE *samples, uint numSamples) override; /// Clears all the samples in the object - void clear(); + void clear() override; /// Returns nonzero if there aren't any samples available for outputting. - int isEmpty() const; + int isEmpty() const override; /// Return approximate initial input-output latency int getLatency() const; diff --git a/source/SoundTouch/TDStretch.h b/source/SoundTouch/TDStretch.h index 4118f9f..71c0853 100644 --- a/source/SoundTouch/TDStretch.h +++ b/source/SoundTouch/TDStretch.h @@ -165,7 +165,7 @@ protected: public: TDStretch(); - virtual ~TDStretch(); + virtual ~TDStretch() override; /// Operator 'new' is overloaded so that it automatically creates a suitable instance /// depending on if we've a MMX/SSE/etc-capable CPU available or not. @@ -187,7 +187,7 @@ public: void setTempo(double newTempo); /// Returns nonzero if there aren't any samples available for outputting. - virtual void clear(); + virtual void clear() override; /// Clears the input buffer void clearInput(); @@ -227,7 +227,7 @@ public: const SAMPLETYPE *samples, ///< Input sample data uint numSamples ///< Number of samples in 'samples' so that one sample ///< contains both channels if stereo - ); + ) override; /// return nominal input sample requirement for triggering a processing batch int getInputSampleReq() const @@ -256,10 +256,10 @@ public: class TDStretchMMX : public TDStretch { protected: - double calcCrossCorr(const short *mixingPos, const short *compare, double &norm); - double calcCrossCorrAccumulate(const short *mixingPos, const short *compare, double &norm); - virtual void overlapStereo(short *output, const short *input) const; - virtual void clearCrossCorrState(); + double calcCrossCorr(const short *mixingPos, const short *compare, double &norm) override; + double calcCrossCorrAccumulate(const short *mixingPos, const short *compare, double &norm) override; + virtual void overlapStereo(short *output, const short *input) const override; + virtual void clearCrossCorrState() override; }; #endif /// SOUNDTOUCH_ALLOW_MMX @@ -269,8 +269,8 @@ public: class TDStretchSSE : public TDStretch { protected: - double calcCrossCorr(const float *mixingPos, const float *compare, double &norm); - double calcCrossCorrAccumulate(const float *mixingPos, const float *compare, double &norm); + double calcCrossCorr(const float *mixingPos, const float *compare, double &norm) override; + double calcCrossCorrAccumulate(const float *mixingPos, const float *compare, double &norm) override; }; #endif /// SOUNDTOUCH_ALLOW_SSE