2 #include <msp/core/except.h>
3 #include "controller.h"
10 void Controller::Control::set(float v)
18 else if(type==DISCRETE)
19 value = min_value+floor((v-min_value)/step)*step;
20 else if(type==CONTINUOUS)
24 Controller::Control Controller::Control::binary(const string &n)
26 Controller::Control tc;
37 Controller::Control Controller::Control::discrete(const string &n, float m, float x, float s)
40 throw InvalidParameterValue("Max value must be greater than min value");
42 Controller::Control tc;
46 tc.max_value = m+floor((x-m)/s)*s;
53 Controller::Control Controller::Control::continuous(const string &n, float m, float x)
56 throw InvalidParameterValue("Max value must be greater than min value");
58 Controller::Control tc;