[AFV} Ref T730, fixed CPPCheck issues and Artistic style applied

This commit is contained in:
Klaus Basan
2019-10-12 01:26:06 +02:00
parent 886ae4cf68
commit ee1456ba37
4 changed files with 235 additions and 232 deletions

View File

@@ -40,6 +40,7 @@ namespace chunkware_simple
, threshdB_(0.0) , threshdB_(0.0)
, ratio_(1.0) , ratio_(1.0)
, envdB_(DC_OFFSET) , envdB_(DC_OFFSET)
, makeUpGain_(1.0)
{ {
} }

View File

@@ -75,7 +75,7 @@ namespace chunkware_simple
// runtime variables // runtime variables
double envdB_; // over-threshold envelope (dB) double envdB_; // over-threshold envelope (dB)
double makeUpGain_; double makeUpGain_ = 1.0;
}; // end SimpleComp class }; // end SimpleComp class
@@ -86,7 +86,7 @@ namespace chunkware_simple
{ {
public: public:
SimpleCompRms(); SimpleCompRms();
virtual ~SimpleCompRms() {} virtual ~SimpleCompRms() override {}
// sample rate // sample rate
virtual void setSampleRate(double sampleRate) override; virtual void setSampleRate(double sampleRate) override;

View File

@@ -27,7 +27,6 @@
* DEALINGS IN THE SOFTWARE. * DEALINGS IN THE SOFTWARE.
*/ */
#include "SimpleEnvelope.h" #include "SimpleEnvelope.h"
namespace chunkware_simple namespace chunkware_simple
@@ -41,7 +40,10 @@ namespace chunkware_simple
assert(ms > 0.0); assert(ms > 0.0);
sampleRate_ = sampleRate; sampleRate_ = sampleRate;
ms_ = ms; ms_ = ms;
setCoef();
// setCoef();
// TODO: KB avoid virtual function call in ctor
coef_ = exp(-1000.0 / (ms_ * sampleRate_));
} }
//------------------------------------------------------------- //-------------------------------------------------------------

View File

@@ -60,7 +60,7 @@ namespace chunkware_simple
//------------------------------------------------------------- //-------------------------------------------------------------
void SimpleLimit::setAttack(double ms) void SimpleLimit::setAttack(double ms)
{ {
unsigned int samp = int( 0.001 * ms * att_.getSampleRate() ); unsigned int samp = static_cast<unsigned>(0.001 * ms * att_.getSampleRate());
assert(samp < BUFFER_SIZE); assert(samp < BUFFER_SIZE);