summaryrefslogtreecommitdiffstats
path: root/src/control/controllinpotmeter.cpp
blob: c3ab24cca53729eaca233dc58e78d10dca6eb1f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include "control/controllinpotmeter.h"

ControlLinPotmeter::ControlLinPotmeter(ConfigKey key,
                                       double dMinValue, double dMaxValue,
                                       double dStep, double dSmallStep,
                                       bool allowOutOfBounds)
        : ControlPotmeter(key, dMinValue, dMaxValue, allowOutOfBounds) {
    if (m_pControl) {
        m_pControl->setBehavior(
            new ControlLinPotmeterBehavior(dMinValue, dMaxValue, allowOutOfBounds));
    }
    if (dStep != 0) {
        setStepCount(static_cast<int>((dMaxValue - dMinValue) / dStep));
    }
    if (dSmallStep != 0) {
        setSmallStepCount(static_cast<int>((dMaxValue - dMinValue) / dSmallStep));
    }
}