Move method definitions to .cpp

This commit is contained in:
Erik Präntare
2022-04-09 03:40:16 +02:00
committed by Kai Blaschke
parent 8be7f4589c
commit 0d8bb362bc
2 changed files with 26 additions and 17 deletions

View File

@ -58,6 +58,12 @@ void BeatDetect::Reset()
}
float BeatDetect::GetPCMScale()
{
return beatSensitivity;
}
void BeatDetect::CalculateBeatStatistics()
{
volOld = vol;
@ -97,3 +103,20 @@ void BeatDetect::CalculateBeatStatistics()
float const volIntensity = bassIntensity + midIntensity + trebIntensity;
updateBand(vol, volAtt, volSmoothed, volIntensity);
}
auto BeatDetect::LowPassFilter::Update(float nextValue) noexcept -> void
{
m_current -= m_buffer[m_bufferPos] / bufferLength;
m_current += nextValue / bufferLength;
m_buffer[m_bufferPos] = nextValue;
++m_bufferPos;
m_bufferPos %= bufferLength;
}
auto BeatDetect::LowPassFilter::Get() const noexcept -> float
{
return m_current;
}