Fix bassbooster

This commit is contained in:
Vesa
2014-11-16 17:08:39 +02:00
parent f83b0957f4
commit bf7b5a5d9d
3 changed files with 11 additions and 3 deletions

View File

@@ -49,6 +49,7 @@ Plugin::Descriptor PLUGIN_EXPORT bassbooster_plugin_descriptor =
BassBoosterEffect::BassBoosterEffect( Model* parent, const Descriptor::SubPluginFeatures::Key* key ) :
Effect( &bassbooster_plugin_descriptor, parent, key ),
m_frequencyChangeNeeded( false ),
m_bbFX( DspEffectLibrary::FastBassBoost( 70.0f, 1.0f, 2.8f ) ),
m_bbControls( this )
{
@@ -74,7 +75,11 @@ bool BassBoosterEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames
return( false );
}
// check out changed controls
if( m_bbControls.m_freqModel.isValueChanged() ) { changeFrequency(); }
if( m_frequencyChangeNeeded || m_bbControls.m_freqModel.isValueChanged() )
{
changeFrequency();
m_frequencyChangeNeeded = false;
}
if( m_bbControls.m_gainModel.isValueChanged() ) { changeGain(); }
if( m_bbControls.m_ratioModel.isValueChanged() ) { changeRatio(); }

View File

@@ -44,11 +44,14 @@ public:
}
private:
protected:
void changeFrequency();
void changeGain();
void changeRatio();
bool m_frequencyChangeNeeded;
private:
DspEffectLibrary::MonoToStereoAdaptor<DspEffectLibrary::FastBassBoost> m_bbFX;
BassBoosterControls m_bbControls;

View File

@@ -43,7 +43,7 @@ BassBoosterControls::BassBoosterControls( BassBoosterEffect* effect ) :
void BassBoosterControls::changeFrequency()
{
m_effect->changeFrequency();
m_effect->m_frequencyChangeNeeded = true;
}