From 0fc7bf9e753ef1c969e205536705a9de8b12cd78 Mon Sep 17 00:00:00 2001 From: be_ Date: Thu, 29 Jun 2017 12:19:50 -0500 Subject: [PATCH] Revert "do not clamp out-of-bounds ControlPotmeter parameters when allowed" This reverts commit 9ee2d1c610618387569f298e4893352469af167d, which made it so controllers not mapped using the new relative mode Pot in Components lost control of the tempo fader when sync made it go out of bounds, as reported here: https://github.com/mixxxdj/mixxx/pull/1237#issuecomment-311723887 --- src/control/controlbehavior.cpp | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/control/controlbehavior.cpp b/src/control/controlbehavior.cpp index e00fb5216f1..a435bf7d973 100644 --- a/src/control/controlbehavior.cpp +++ b/src/control/controlbehavior.cpp @@ -56,12 +56,10 @@ double ControlPotmeterBehavior::valueToParameter(double dValue) { if (m_dValueRange == 0.0) { return 0; } - if (!m_bAllowOutOfBounds) { - if (dValue > m_dMaxValue) { - dValue = m_dMaxValue; - } else if (dValue < m_dMinValue) { - dValue = m_dMinValue; - } + if (dValue > m_dMaxValue) { + dValue = m_dMaxValue; + } else if (dValue < m_dMinValue) { + dValue = m_dMinValue; } return (dValue - m_dMinValue) / m_dValueRange; } @@ -118,12 +116,10 @@ double ControlLogPotmeterBehavior::valueToParameter(double dValue) { if (m_dValueRange == 0.0) { return 0; } - if (!m_bAllowOutOfBounds) { - if (dValue > m_dMaxValue) { - dValue = m_dMaxValue; - } else if (dValue < m_dMinValue) { - dValue = m_dMinValue; - } + if (dValue > m_dMaxValue) { + dValue = m_dMaxValue; + } else if (dValue < m_dMinValue) { + dValue = m_dMinValue; } double linPrameter = (dValue - m_dMinValue) / m_dValueRange; double dbParamter = ratio2db(linPrameter + m_minOffset * (1 - linPrameter));