Style, Doxygen

This commit is contained in:
Klaus Basan
2019-10-22 14:01:41 +02:00
parent 6e42889ecb
commit 767aab6592
13 changed files with 61 additions and 36 deletions

View File

@@ -55,7 +55,7 @@ namespace chunkware_simple
//! @{ get parameters
virtual double getThresh(void) const { return threshdB_; }
virtual double getRatio(void) const { return ratio_; }
double getMakeUpGain(void) const { return makeUpGain_; }
double getMakeUpGain(void) const { return makeUpGain_; }
//! @}
//! Init runtime
@@ -79,9 +79,7 @@ namespace chunkware_simple
}; // end SimpleComp class
//-------------------------------------------------------------
// simple compressor with RMS detection
//-------------------------------------------------------------
//! Simple compressor with RMS detection
class SimpleCompRms : public SimpleComp
{
public:

View File

@@ -42,13 +42,16 @@ namespace chunkware_simple
// USE:
// 1. init envelope state to DC_OFFSET before processing
// 2. add to input before envelope runtime function
static const double DC_OFFSET = 1.0E-25;
static constexpr double DC_OFFSET = 1.0E-25;
//! envelope detector
//! Envelope detector
class EnvelopeDetector
{
public:
//! Ctor
EnvelopeDetector(double ms = 1.0, double sampleRate = 44100.0);
//! Dtor
virtual ~EnvelopeDetector() {}
//! set time constant
@@ -70,34 +73,40 @@ namespace chunkware_simple
}
protected:
//! Set coefficients
virtual void setCoef(void); //!< coef calculation
double sampleRate_; //!< sample rate
double ms_; //!< time constant in ms
double coef_; //!< runtime coefficient
virtual void setCoef(void); //!< coef calculation
}; // end SimpleComp class
//! attack/release envelope
class AttRelEnvelope
{
public:
//! Ctor
AttRelEnvelope(double att_ms = 10.0, double rel_ms = 100.0, double sampleRate = 44100.0);
//! Dtor
virtual ~AttRelEnvelope() {}
// attack time constant
//! Attack time constant @{
virtual void setAttack(double ms);
virtual double getAttack(void) const { return att_.getTc(); }
//! @}
// release time constant
//! Release time constant @{
virtual void setRelease(double ms);
virtual double getRelease(void) const { return rel_.getTc(); }
//! @}
// sample rate dependencies
//! Sample rate dependencies @{
virtual void setSampleRate(double sampleRate);
virtual double getSampleRate(void) const { return att_.getSampleRate(); }
//! @}
// runtime function
//! Runtime function
INLINE void run(double in, double &state)
{
@@ -114,7 +123,6 @@ namespace chunkware_simple
}
private:
EnvelopeDetector att_;
EnvelopeDetector rel_;

View File

@@ -28,8 +28,8 @@
*/
#ifndef __SIMPLE_GATE_H__
#define __SIMPLE_GATE_H__
#ifndef chunkware__SIMPLE_GATE_H
#define chunkware__SIMPLE_GATE_H
#include "SimpleHeader.h" // common header
#include "SimpleEnvelope.h" // for base class
@@ -53,11 +53,13 @@ namespace chunkware_simple
//! get threshold
virtual double getThresh(void) const { return threshdB_; }
// init runtime
virtual void initRuntime(void); // call before runtime (in resume())
//! Init runtime
//! \remark call before runtime (in resume())
virtual void initRuntime(void);
//! Process audio
void process(double &in1, double &in2); // gate runtime process
//! \remark gate runtime process
void process(double &in1, double &in2);
//! Process audio stereo-linked
void process(double &in1, double &in2, double keyLinked); // with stereo-linked key in
@@ -71,7 +73,7 @@ namespace chunkware_simple
double env_; //!< over-threshold envelope (linear)
};
//! simple gate with RMS detection
//! Simple gate with RMS detection
class SimpleGateRms : public SimpleGate
{
public:

View File

@@ -28,8 +28,8 @@
*/
#ifndef __SIMPLE_LIMIT_H__
#define __SIMPLE_LIMIT_H__
#ifndef chunkware_SIMPLE_LIMIT_H
#define chunkware_SIMPLE_LIMIT_H
#include "SimpleHeader.h" // common header
#include "SimpleEnvelope.h" // for base class of FastEnvelope
@@ -76,18 +76,21 @@ namespace chunkware_simple
protected:
//! class for faster attack/release
//! Class for faster attack/release
class FastEnvelope : public EnvelopeDetector
{
public:
//! Ctor
FastEnvelope(double ms = 1.0, double sampleRate = 44100.0)
: EnvelopeDetector(ms, sampleRate)
{}
virtual ~FastEnvelope() {}
//! Dtor
virtual ~FastEnvelope() override {}
protected:
// override setCoef() - coefficient calculation
virtual void setCoef(void);
//! Override setCoef() - coefficient calculation
virtual void setCoef(void) override;
};
private:
@@ -123,4 +126,4 @@ namespace chunkware_simple
// include inlined process function
#include "SimpleLimitProcess.inl"
#endif // end __SIMPLE_LIMIT_H__
#endif // guard