summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Holthuis <jan.holthuis@ruhr-uni-bochum.de>2020-09-25 11:01:12 +0200
committerJan Holthuis <jan.holthuis@ruhr-uni-bochum.de>2020-09-25 11:01:12 +0200
commit504e238eceb187f57dfc8a6d88ba9a3e51a7115f (patch)
tree2a769c889adde335f046a97babfc2eda8425128d
parent6b94d27ff23d47a96ec880e5420f435856dfcb19 (diff)
engine/filters/enginefilterpansingle: Use CSAMPLE_GAIN for coefficients
-rw-r--r--src/engine/filters/enginefilterpansingle.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/engine/filters/enginefilterpansingle.h b/src/engine/filters/enginefilterpansingle.h
index 9a28298a98..3a91f1cf78 100644
--- a/src/engine/filters/enginefilterpansingle.h
+++ b/src/engine/filters/enginefilterpansingle.h
@@ -53,23 +53,23 @@ class EngineFilterPanSingle {
m_delayFrame = (m_delayFrame + 1) % SIZE;
// prepare coefficients for linear interpolation using a linear stretching
- double timeBetweenFullSamplesLeft = fmod(delayLeftSourceFrame, 1);
- double timeBetweenFullSamplesRight = fmod(delayRightSourceFrame, 1);
+ CSAMPLE_GAIN timeBetweenFullSamplesLeft = fmod(delayLeftSourceFrame, 1);
+ CSAMPLE_GAIN timeBetweenFullSamplesRight = fmod(delayRightSourceFrame, 1);
// applying the delay on left channel with linear interpolation between each sample
- pOutput[0] = static_cast<CSAMPLE>(
+ pOutput[0] =
m_buf[(static_cast<int>(floor(delayLeftSourceFrame)) % SIZE) * 2] *
- (1 - timeBetweenFullSamplesLeft));
- pOutput[0] += static_cast<CSAMPLE>(
+ (1 - timeBetweenFullSamplesLeft);
+ pOutput[0] +=
m_buf[(static_cast<int>(ceil(delayLeftSourceFrame)) % SIZE) * 2] *
- timeBetweenFullSamplesLeft);
+ timeBetweenFullSamplesLeft;
// then on right channel
- pOutput[1] = static_cast<CSAMPLE>(
+ pOutput[1] =
m_buf[(static_cast<int>(floor(delayRightSourceFrame)) % SIZE) * 2 + 1] *
- (1 - timeBetweenFullSamplesRight));
- pOutput[1] += static_cast<CSAMPLE>(
+ (1 - timeBetweenFullSamplesRight);
+ pOutput[1] +=
m_buf[(static_cast<int>(ceil(delayRightSourceFrame)) % SIZE) * 2 + 1] *
- timeBetweenFullSamplesRight);
+ timeBetweenFullSamplesRight;
m_doStart = false;
}