10 "category",
"Controls",
11 "description",
"ControlFade",
14 static FactoryRegistrator<ProcessingFactory, ControlFade>
reg =
metadata;
17 void ControlFadeConfig::DefaultInit()
21 SetFadeTimeInMs( 0.0 );
24 : _inControlValue(
"Input Value", this , &
ControlFade::InControlValueCallback )
25 , _inControlDelay(
"Delay Time in Ms", this , &
ControlFade::InControlDelayCallback )
26 , _outControlValue(
"Output Value", this )
37 : _inControlValue(
"Input Values", this , &
ControlFade::InControlValueCallback )
38 , _inControlDelay(
"Delay Time in Ms", this , &
ControlFade::InControlDelayCallback )
39 , _outControlValue(
"Output Value", this )
52 _inControlDelay.
DoControl(_config.GetFadeTimeInMs());
54 _initValue=_lastValue=0;
60 void ControlFade::InControlDelayCallback(
const TControlData & value)
64 void ControlFade::InControlValueCallback(
const TControlData & value)
67 _initValue=_lastValue;
73 if (_initValue==_lastValue)
75 double a=(_inControlValue.
GetLastValue() - _initValue)/_delayTime;
76 float newValue=a * _counterTime + _initValue;
77 _counterTime += _bufferTime;
78 if (((newValue <= _lastValue) and (_lastValue > _initValue)) or ((newValue>=_lastValue) and (_lastValue<_initValue)))
83 if (((newValue >= _lastValue) and (_lastValue > _initValue)) or ((newValue<=_lastValue) and (_lastValue<_initValue)))
85 _initValue = _lastValue;