Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix issue #3339 by not clearing filter history on control change
Do not clear the filter histories when the crossover control has changed,
e.g. via automation.

Add a new method CrossoverEQEffect::clearFilterHistories that's called
whenever the filter histories need to be cleared, e.g. after loading a
crossover EQ. It would be beneficial to also call this method when the
effect is enabled again after being disabled but it seems there is no
was to find out that this event has happened. One could implement it in
the process method by storing the current state in a member and
comparing it to the state at the time of the last process call but this
is something that should be provided by the framework.
  • Loading branch information
michaelgregorius committed Feb 10, 2017
commit b4829b4fe75c3e197b5111f38d304e7b9c674dfa
16 changes: 10 additions & 6 deletions plugins/CrossoverEQ/CrossoverEQ.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,23 +95,17 @@ bool CrossoverEQEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames
if( m_needsUpdate || m_controls.m_xover12.isValueChanged() )
{
m_lp1.setLowpass( m_controls.m_xover12.value() );
m_lp1.clearHistory();
m_hp2.setHighpass( m_controls.m_xover12.value() );
m_hp2.clearHistory();
}
if( m_needsUpdate || m_controls.m_xover23.isValueChanged() )
{
m_lp2.setLowpass( m_controls.m_xover23.value() );
m_lp2.clearHistory();
m_hp3.setHighpass( m_controls.m_xover23.value() );
m_hp3.clearHistory();
}
if( m_needsUpdate || m_controls.m_xover34.isValueChanged() )
{
m_lp3.setLowpass( m_controls.m_xover34.value() );
m_lp3.clearHistory();
m_hp4.setHighpass( m_controls.m_xover34.value() );
m_hp4.clearHistory();
}

// gain values update
Expand Down Expand Up @@ -206,6 +200,16 @@ bool CrossoverEQEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames
return isRunning();
}

void CrossoverEQEffect::clearFilterHistories()
{
m_lp1.clearHistory();
m_lp2.clearHistory();
m_lp3.clearHistory();
m_hp2.clearHistory();
m_hp3.clearHistory();
m_hp4.clearHistory();
}


extern "C"
{
Expand Down
2 changes: 2 additions & 0 deletions plugins/CrossoverEQ/CrossoverEQ.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ class CrossoverEQEffect : public Effect
{
return &m_controls;
}

void clearFilterHistories();

private:
CrossoverEQControls m_controls;
Expand Down
1 change: 1 addition & 0 deletions plugins/CrossoverEQ/CrossoverEQControls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ void CrossoverEQControls::loadSettings( const QDomElement & elem )
m_mute4.loadSettings( elem, "mute4" );

m_effect->m_needsUpdate = true;
m_effect->clearFilterHistories();
}

void CrossoverEQControls::xover12Changed()
Expand Down