summaryrefslogtreecommitdiffstats
path: root/src/vinylcontrol/vinylcontrolxwax.cpp
diff options
context:
space:
mode:
authorUwe Klotz <uwe_klotz@web.de>2014-11-12 14:08:00 +0100
committerUwe Klotz <uwe_klotz@web.de>2014-11-15 19:42:51 +0100
commit6d5c64a511da6141fbda8d3e4a04b5ee0d593309 (patch)
tree4f3dc40b78e0647c91c9e72fd439b82079f676ff /src/vinylcontrol/vinylcontrolxwax.cpp
parent0f598f779920436279458632be2955bdc1241ba6 (diff)
New types/constants/functions for sample and gain values
Diffstat (limited to 'src/vinylcontrol/vinylcontrolxwax.cpp')
-rw-r--r--src/vinylcontrol/vinylcontrolxwax.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/vinylcontrol/vinylcontrolxwax.cpp b/src/vinylcontrol/vinylcontrolxwax.cpp
index 0e12c22247..8741714f9b 100644
--- a/src/vinylcontrol/vinylcontrolxwax.cpp
+++ b/src/vinylcontrol/vinylcontrolxwax.cpp
@@ -40,7 +40,7 @@
********************/
// Sample threshold below which we consider there to be no signal.
-const double kMinSignal = 75.0 / SHRT_MAX;
+const double kMinSignal = 75.0 / SAMPLE_MAX;
bool VinylControlXwax::s_bLUTInitialized = false;
QMutex VinylControlXwax::s_xwaxLUTMutex;
@@ -217,12 +217,12 @@ void VinylControlXwax::analyzeSamples(CSAMPLE* pSamples, size_t nFrames) {
// Convert CSAMPLE samples to shorts, preventing overflow.
for (int i = 0; i < static_cast<int>(samplesSize); ++i) {
- CSAMPLE sample = pSamples[i] * gain * SHRT_MAX;
+ CSAMPLE sample = pSamples[i] * gain * SAMPLE_MAX;
- if (sample > SHRT_MAX) {
- m_pWorkBuffer[i] = SHRT_MAX;
- } else if (sample < SHRT_MIN) {
- m_pWorkBuffer[i] = SHRT_MIN;
+ if (sample > SAMPLE_MAX) {
+ m_pWorkBuffer[i] = SAMPLE_MAX;
+ } else if (sample < SAMPLE_MIN) {
+ m_pWorkBuffer[i] = SAMPLE_MIN;
} else {
m_pWorkBuffer[i] = static_cast<short>(sample);
}