Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

do not clamp out-of-bounds ControlPotmeter parameters when they are allowed #1237

Merged
merged 1 commit into from
Apr 17, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions src/control/controlbehavior.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,12 @@ double ControlPotmeterBehavior::valueToParameter(double dValue) {
if (m_dValueRange == 0.0) {
return 0;
}
if (dValue > m_dMaxValue) {
dValue = m_dMaxValue;
} else if (dValue < m_dMinValue) {
dValue = m_dMinValue;
if (!m_bAllowOutOfBounds) {
if (dValue > m_dMaxValue) {
dValue = m_dMaxValue;
} else if (dValue < m_dMinValue) {
dValue = m_dMinValue;
}
}
return (dValue - m_dMinValue) / m_dValueRange;
}
Expand Down Expand Up @@ -116,10 +118,12 @@ double ControlLogPotmeterBehavior::valueToParameter(double dValue) {
if (m_dValueRange == 0.0) {
return 0;
}
if (dValue > m_dMaxValue) {
dValue = m_dMaxValue;
} else if (dValue < m_dMinValue) {
dValue = m_dMinValue;
if (!m_bAllowOutOfBounds) {
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));
Expand Down