This commit is contained in:
Klaus Basan
2019-10-21 23:29:18 +02:00
parent 148824429c
commit 003788c89b
3 changed files with 23 additions and 16 deletions

View File

@@ -27,9 +27,8 @@
* DEALINGS IN THE SOFTWARE.
*/
#ifndef __SIMPLE_COMP_H__
#define __SIMPLE_COMP_H__
#ifndef chunkware_simple_SIMPLE_COMP_H
#define chunkware_simple_SIMPLE_COMP_H
#include "SimpleHeader.h" // common header
#include "SimpleEnvelope.h" // for base class
@@ -41,7 +40,10 @@ namespace chunkware_simple
class SimpleComp : public AttRelEnvelope
{
public:
//! Ctor
SimpleComp();
//! Dtor
virtual ~SimpleComp() {}
//! @{ set parameters
@@ -56,8 +58,8 @@ namespace chunkware_simple
double getMakeUpGain(void) const { return makeUpGain_; }
//! @}
//! init runtime
//! call before runtime (in resume())
//! Init runtime
//! \pre Call before runtime (in resume())
virtual void initRuntime(void);
//! compressor runtime process
@@ -67,14 +69,12 @@ namespace chunkware_simple
void process(double &in1, double &in2, double keyLinked);
private:
// transfer function
double threshdB_; // threshold (dB)
double ratio_; // ratio (compression: < 1 ; expansion: > 1)
// runtime variables
double envdB_; // over-threshold envelope (dB)
double makeUpGain_ = 1.0;
}; // end SimpleComp class
@@ -85,19 +85,26 @@ namespace chunkware_simple
class SimpleCompRms : public SimpleComp
{
public:
//! Ctor
SimpleCompRms();
//! Dtor
virtual ~SimpleCompRms() override {}
// sample rate
//! Sample rate
virtual void setSampleRate(double sampleRate) override;
// RMS window
//! RMS window
//! @{
virtual void setWindow(double ms);
virtual double getWindow(void) const { return ave_.getTc(); }
//! @}
// runtime process
virtual void initRuntime(void) override; // call before runtime (in resume())
void process(double &in1, double &in2); // compressor runtime process
//! Runtime process
//! @{
virtual void initRuntime(void) override; // call before runtime (in resume())
void process(double &in1, double &in2); // compressor runtime process
//! @}
private:
@@ -111,4 +118,4 @@ namespace chunkware_simple
// include inlined process function
#include "SimpleCompProcess.inl"
#endif // end __SIMPLE_COMP_H__
#endif // guard