MCPcopy Create free account
hub / github.com/awawa-dev/HyperHDR / run

Method run

sources/effects/Effect.cpp:126–169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

124}
125
126void Effect::run()
127{
128 int left = (_timeout >= 0) ? std::max(static_cast<int>(_endTime - InternalClock::now()), 0) : -1;
129
130 if (_interrupt || (left == 0 && _timeout > 0) || _effect->isStop())
131 {
132 stop();
133 return;
134 }
135
136 if (_visiblePriority < _priority)
137 return;
138
139 bool hasLedData = false;
140
141 if (!_effect->hasOwnImage())
142 {
143 _effect->Play(_image);
144
145 hasLedData = _effect->hasLedData(_ledBuffer);
146 }
147
148 if (_effect->hasOwnImage())
149 {
150 Image<ColorRgb> image(80, 45);
151
152 if (_effect->getImage(image))
153 emit SignalSetImage(_priority, image, left, false);
154 }
155 else if (hasLedData)
156 {
157 ledShow(left);
158 }
159 else
160 {
161 imageShow(left);
162 }
163
164 int sleepTime = std::min(_effect->GetSleepTime(), 100);
165 if (sleepTime != _timer.interval())
166 {
167 _timer.setInterval(sleepTime);
168 }
169}
170
171void Effect::stop()
172{

Callers 2

uFunction · 0.45
ltFunction · 0.45

Calls 6

isStopMethod · 0.80
GetSleepTimeMethod · 0.80
hasOwnImageMethod · 0.45
PlayMethod · 0.45
hasLedDataMethod · 0.45
getImageMethod · 0.45

Tested by

no test coverage detected