mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-08 23:25:40 +12:00
HLE DSP: Actually parse InterpolationMode config
This commit is contained in:
parent
b299609a9b
commit
8cfffb8119
2 changed files with 8 additions and 0 deletions
|
@ -88,12 +88,14 @@ namespace Audio {
|
||||||
// Buffer of decoded PCM16 samples. TODO: Are there better alternatives to use over deque?
|
// Buffer of decoded PCM16 samples. TODO: Are there better alternatives to use over deque?
|
||||||
using SampleBuffer = std::deque<std::array<s16, 2>>;
|
using SampleBuffer = std::deque<std::array<s16, 2>>;
|
||||||
using BufferQueue = std::priority_queue<Buffer>;
|
using BufferQueue = std::priority_queue<Buffer>;
|
||||||
|
using InterpolationMode = HLE::SourceConfiguration::Configuration::InterpolationMode;
|
||||||
|
|
||||||
DSPMixer::StereoFrame<s16> currentFrame;
|
DSPMixer::StereoFrame<s16> currentFrame;
|
||||||
BufferQueue buffers;
|
BufferQueue buffers;
|
||||||
|
|
||||||
SampleFormat sampleFormat = SampleFormat::ADPCM;
|
SampleFormat sampleFormat = SampleFormat::ADPCM;
|
||||||
SourceType sourceType = SourceType::Stereo;
|
SourceType sourceType = SourceType::Stereo;
|
||||||
|
InterpolationMode interpolationMode = InterpolationMode::Linear;
|
||||||
|
|
||||||
// There's one gain configuration for each of the 3 intermediate mixing stages
|
// 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
|
// And each gain configuration is composed of 4 gain values, one for each sample in a quad-channel sample
|
||||||
|
|
|
@ -319,6 +319,10 @@ namespace Audio {
|
||||||
source.sourceType = config.monoOrStereo;
|
source.sourceType = config.monoOrStereo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (config.interpolationDirty) {
|
||||||
|
source.interpolationMode = config.interpolationMode;
|
||||||
|
}
|
||||||
|
|
||||||
if (config.rateMultiplierDirty) {
|
if (config.rateMultiplierDirty) {
|
||||||
source.rateMultiplier = (config.rateMultiplier > 0.f) ? config.rateMultiplier : 1.f;
|
source.rateMultiplier = (config.rateMultiplier > 0.f) ? config.rateMultiplier : 1.f;
|
||||||
}
|
}
|
||||||
|
@ -499,6 +503,7 @@ namespace Audio {
|
||||||
|
|
||||||
// Copy samples to current frame buffer
|
// Copy samples to current frame buffer
|
||||||
// TODO: Implement linear/polyphase interpolation
|
// TODO: Implement linear/polyphase interpolation
|
||||||
|
|
||||||
std::copy(
|
std::copy(
|
||||||
source.currentSamples.begin(), std::next(source.currentSamples.begin(), sampleCount), source.currentFrame.begin() + outputCount
|
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
|
// Initialize these to some sane defaults
|
||||||
sampleFormat = SampleFormat::ADPCM;
|
sampleFormat = SampleFormat::ADPCM;
|
||||||
sourceType = SourceType::Stereo;
|
sourceType = SourceType::Stereo;
|
||||||
|
interpolationMode = InterpolationMode::Linear;
|
||||||
|
|
||||||
samplePosition = 0;
|
samplePosition = 0;
|
||||||
previousBufferID = 0;
|
previousBufferID = 0;
|
||||||
|
|
Loading…
Add table
Reference in a new issue