2022-09-16 03:16:58 +02:00
|
|
|
#include <cmath>
|
2022-08-30 00:39:15 +02:00
|
|
|
#include "ViPERBass.h"
|
2022-09-06 17:57:23 +02:00
|
|
|
|
|
|
|
ViPERBass::ViPERBass() {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
ViPERBass::~ViPERBass() {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void ViPERBass::Process(float *samples, uint32_t size) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void ViPERBass::Reset() {
|
2022-09-16 03:16:58 +02:00
|
|
|
this->polyphase->SetSamplingRate(this->samplingRate);
|
|
|
|
this->polyphase->Reset();
|
|
|
|
this->waveBuffer->Reset();
|
|
|
|
this->waveBuffer->PushZeros(this->polyphase->GetLatency());
|
|
|
|
this->subwoofer->SetBassGain(this->samplingRate, this->bassFactor * 2.5f);
|
|
|
|
this->fixedBiquad->SetLowPassParameter(this->speaker, this->samplingRate, 0.53);
|
|
|
|
this->unknown1 = 0.0f;
|
2022-09-06 17:57:23 +02:00
|
|
|
}
|
|
|
|
|
2022-09-16 03:16:58 +02:00
|
|
|
void ViPERBass::SetBassFactor(float bassFactor) {
|
|
|
|
if (abs(this->bassFactor - bassFactor) <= 0.01) {
|
|
|
|
return;
|
|
|
|
}
|
2022-09-06 17:57:23 +02:00
|
|
|
|
2022-09-16 03:16:58 +02:00
|
|
|
this->bassFactor = bassFactor;
|
|
|
|
this->subwoofer->SetBassGain(this->samplingRate, bassFactor * 2.5f);
|
2022-09-06 17:57:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void ViPERBass::SetEnable(bool enable) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2022-09-16 03:16:58 +02:00
|
|
|
void ViPERBass::SetProcessMode(int processMode) {
|
2022-09-06 17:57:23 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void ViPERBass::SetSamplingRate(uint32_t samplingRate) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2022-09-16 03:16:58 +02:00
|
|
|
void ViPERBass::SetSpeaker(float speaker) {
|
|
|
|
if (this->speaker != speaker) {
|
|
|
|
this->speaker = speaker;
|
|
|
|
Reset();
|
|
|
|
}
|
2022-09-06 17:57:23 +02:00
|
|
|
|
|
|
|
}
|