mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 11:55:35 +08:00
Style
This commit is contained in:
committed by
Mat Sutcliffe
parent
8367559713
commit
30d764d72c
@@ -37,59 +37,68 @@
|
||||
|
||||
namespace chunkware_simple
|
||||
{
|
||||
//-------------------------------------------------------------
|
||||
// simple gate
|
||||
//-------------------------------------------------------------
|
||||
//! simple gate
|
||||
class SimpleGate : public AttRelEnvelope
|
||||
{
|
||||
public:
|
||||
//! Constructor
|
||||
SimpleGate();
|
||||
|
||||
//! Destructor
|
||||
virtual ~SimpleGate() {}
|
||||
|
||||
// parameters
|
||||
virtual void setThresh( double dB );
|
||||
virtual double getThresh( void ) const { return threshdB_; }
|
||||
//! set threshold
|
||||
virtual void setThresh(double dB);
|
||||
|
||||
// runtime
|
||||
virtual void initRuntime( void ); // call before runtime (in resume())
|
||||
void process( double &in1, double &in2 ); // gate runtime process
|
||||
void process( double &in1, double &in2, double keyLinked ); // with stereo-linked key in
|
||||
//! get threshold
|
||||
virtual double getThresh(void) const { return threshdB_; }
|
||||
|
||||
// init runtime
|
||||
virtual void initRuntime(void); // call before runtime (in resume())
|
||||
|
||||
//! Process audio
|
||||
void process(double &in1, double &in2); // gate runtime process
|
||||
|
||||
//! Process audio stereo-linked
|
||||
void process(double &in1, double &in2, double keyLinked); // with stereo-linked key in
|
||||
|
||||
private:
|
||||
|
||||
// transfer function
|
||||
double threshdB_; // threshold (dB)
|
||||
double thresh_; // threshold (linear)
|
||||
double threshdB_; //!< threshold (dB)
|
||||
double thresh_; //!< threshold (linear)
|
||||
|
||||
// runtime variables
|
||||
double env_; // over-threshold envelope (linear)
|
||||
double env_; //!< over-threshold envelope (linear)
|
||||
};
|
||||
|
||||
}; // end SimpleGate class
|
||||
|
||||
//-------------------------------------------------------------
|
||||
// simple gate with RMS detection
|
||||
//-------------------------------------------------------------
|
||||
//! simple gate with RMS detection
|
||||
class SimpleGateRms : public SimpleGate
|
||||
{
|
||||
public:
|
||||
//! Constructor
|
||||
SimpleGateRms();
|
||||
|
||||
//! Destructor
|
||||
virtual ~SimpleGateRms() {}
|
||||
|
||||
// sample rate
|
||||
virtual void setSampleRate( double sampleRate );
|
||||
//! set sample rate
|
||||
virtual void setSampleRate(double sampleRate);
|
||||
|
||||
// RMS window
|
||||
virtual void setWindow( double ms );
|
||||
virtual double getWindow( void ) const { return ave_.getTc(); }
|
||||
//! set RMS window
|
||||
virtual void setWindow(double ms);
|
||||
|
||||
// runtime process
|
||||
virtual void initRuntime( void ); // call before runtime (in resume())
|
||||
void process( double &in1, double &in2 ); // gate runtime process
|
||||
//! get RMS window
|
||||
virtual double getWindow(void) const { return ave_.getTc(); }
|
||||
|
||||
//! \copydoc SimpleGate::initRuntime
|
||||
virtual void initRuntime(void); // call before runtime (in resume())
|
||||
|
||||
//! \copydoc SimpleGate::process
|
||||
void process(double &in1, double &in2); // gate runtime process
|
||||
|
||||
private:
|
||||
|
||||
EnvelopeDetector ave_; // averager
|
||||
double aveOfSqrs_; // average of squares
|
||||
EnvelopeDetector ave_; //!< averager
|
||||
double aveOfSqrs_; //!< average of squares
|
||||
|
||||
}; // end SimpleGateRms class
|
||||
|
||||
|
||||
Reference in New Issue
Block a user