mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 10:55:32 +08:00
[AFV] Ref T730, CPPCheck (e.g. virtual function call in ctor)
This commit is contained in:
@@ -79,10 +79,10 @@ namespace chunkware_simple
|
|||||||
SimpleGateRms();
|
SimpleGateRms();
|
||||||
|
|
||||||
//! Destructor
|
//! Destructor
|
||||||
virtual ~SimpleGateRms() {}
|
virtual ~SimpleGateRms() override {}
|
||||||
|
|
||||||
//! set sample rate
|
//! set sample rate
|
||||||
virtual void setSampleRate(double sampleRate);
|
virtual void setSampleRate(double sampleRate) override;
|
||||||
|
|
||||||
//! set RMS window
|
//! set RMS window
|
||||||
virtual void setWindow(double ms);
|
virtual void setWindow(double ms);
|
||||||
@@ -91,7 +91,7 @@ namespace chunkware_simple
|
|||||||
virtual double getWindow(void) const { return ave_.getTc(); }
|
virtual double getWindow(void) const { return ave_.getTc(); }
|
||||||
|
|
||||||
//! call before runtime (in resume())
|
//! call before runtime (in resume())
|
||||||
virtual void initRuntime(void);
|
virtual void initRuntime(void) override;
|
||||||
|
|
||||||
//! gate runtime process
|
//! gate runtime process
|
||||||
void process(double &in1, double &in2);
|
void process(double &in1, double &in2);
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ namespace chunkware_simple
|
|||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------
|
//-------------------------------------------------------------
|
||||||
void SimpleLimit::setAttack(double ms)
|
void SimpleLimit::setAttackImpl(double ms)
|
||||||
{
|
{
|
||||||
unsigned int samp = static_cast<unsigned>(0.001 * ms * att_.getSampleRate());
|
unsigned int samp = static_cast<unsigned>(0.001 * ms * att_.getSampleRate());
|
||||||
|
|
||||||
|
|||||||
@@ -42,12 +42,15 @@ namespace chunkware_simple
|
|||||||
class SimpleLimit
|
class SimpleLimit
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
//! Ctor
|
||||||
SimpleLimit();
|
SimpleLimit();
|
||||||
|
|
||||||
|
//! Dtor
|
||||||
virtual ~SimpleLimit() {}
|
virtual ~SimpleLimit() {}
|
||||||
|
|
||||||
//! @{ set parameters
|
//! @{ set parameters
|
||||||
virtual void setThresh(double dB);
|
virtual void setThresh(double dB);
|
||||||
virtual void setAttack(double ms);
|
virtual void setAttack(double ms) { this->setAttackImpl(ms); } // used in ctor
|
||||||
virtual void setRelease(double ms);
|
virtual void setRelease(double ms);
|
||||||
//! @}
|
//! @}
|
||||||
|
|
||||||
@@ -88,6 +91,8 @@ namespace chunkware_simple
|
|||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
//! Impl. function as it is used in ctor, non virtual
|
||||||
|
void setAttackImpl(double ms);
|
||||||
|
|
||||||
// transfer function
|
// transfer function
|
||||||
double threshdB_; // threshold (dB)
|
double threshdB_; // threshold (dB)
|
||||||
|
|||||||
@@ -61,5 +61,12 @@ namespace BlackSound
|
|||||||
{
|
{
|
||||||
m_simpleCompressor.setMakeUpGain(gain);
|
m_simpleCompressor.setMakeUpGain(gain);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CSimpleCompressorEffect::setChannels(int channels)
|
||||||
|
{
|
||||||
|
if (channels < 1) { channels = 1; }
|
||||||
|
else if (channels > 2) { channels = 2; }
|
||||||
|
m_channels = channels;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,11 +40,14 @@ namespace BlackSound
|
|||||||
//! Set gain
|
//! Set gain
|
||||||
void setMakeUpGain(double gain);
|
void setMakeUpGain(double gain);
|
||||||
|
|
||||||
|
//! Set channels 1 or 2
|
||||||
|
void setChannels(int channels);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QTimer *m_timer = nullptr;
|
QTimer *m_timer = nullptr;
|
||||||
ISampleProvider *m_sourceStream = nullptr;
|
ISampleProvider *m_sourceStream = nullptr;
|
||||||
bool m_enabled = true;
|
bool m_enabled = true;
|
||||||
const int m_channels = 1;
|
int m_channels = 1;
|
||||||
chunkware_simple::SimpleComp m_simpleCompressor;
|
chunkware_simple::SimpleComp m_simpleCompressor;
|
||||||
};
|
};
|
||||||
} // ns
|
} // ns
|
||||||
|
|||||||
Reference in New Issue
Block a user