HLE DSP: Actually parse InterpolationMode config

This commit is contained in:
wheremyfoodat 2024-11-07 22:08:28 +02:00
parent b299609a9b
commit 8cfffb8119
2 changed files with 8 additions and 0 deletions

View file

@ -88,12 +88,14 @@ namespace Audio {
// Buffer of decoded PCM16 samples. TODO: Are there better alternatives to use over deque?
using SampleBuffer = std::deque<std::array<s16, 2>>;
using BufferQueue = std::priority_queue<Buffer>;
using InterpolationMode = HLE::SourceConfiguration::Configuration::InterpolationMode;
DSPMixer::StereoFrame<s16> currentFrame;
BufferQueue buffers;
SampleFormat sampleFormat = SampleFormat::ADPCM;
SourceType sourceType = SourceType::Stereo;
InterpolationMode interpolationMode = InterpolationMode::Linear;
// There's one gain configuration for each of the 3 intermediate mixing stages
// And each gain configuration is composed of 4 gain values, one for each sample in a quad-channel sample

View file

@ -319,6 +319,10 @@ namespace Audio {
source.sourceType = config.monoOrStereo;
}
if (config.interpolationDirty) {
source.interpolationMode = config.interpolationMode;
}
if (config.rateMultiplierDirty) {
source.rateMultiplier = (config.rateMultiplier > 0.f) ? config.rateMultiplier : 1.f;
}
@ -499,6 +503,7 @@ namespace Audio {
// Copy samples to current frame buffer
// TODO: Implement linear/polyphase interpolation
std::copy(
source.currentSamples.begin(), std::next(source.currentSamples.begin(), sampleCount), source.currentFrame.begin() + outputCount
);
@ -718,6 +723,7 @@ namespace Audio {
// Initialize these to some sane defaults
sampleFormat = SampleFormat::ADPCM;
sourceType = SourceType::Stereo;
interpolationMode = InterpolationMode::Linear;
samplePosition = 0;
previousBufferID = 0;