28 "key",
"ControlIntervalMapper",
29 "category",
"Controls",
30 "description",
"Receives a control and maps it using two intervals, the interval of the incoming value and the interval of the new value",
33 static FactoryRegistrator<ProcessingFactory, ControlIntervalMapper>
reg =
metadata;
36 void ControlIntervalMapperConfig::DefaultInit()
48 , _outControl(
"mapped_control", this )
59 , _outControl(
"mapped_control", this )
71 _min = _config.GetInputMin();
72 _max = _config.GetInputMax();
73 _newmin = _config.GetOutputMin();
74 _newmax = _config.GetOutputMax();
79 void ControlIntervalMapper::InControlCallback(
const TControlData & value)
81 TControlData newval = (( value - _min) / (_max - _min)) *
82 ( _newmax - _newmin) + _newmin;