| 218 | } |
| 219 | |
| 220 | void playlistItemDifference::loadFrame(int frameIdx, |
| 221 | bool playing, |
| 222 | bool loadRawData, |
| 223 | bool emitSignals) |
| 224 | { |
| 225 | if (childCount() != 2 || !difference.inputsValid()) |
| 226 | return; |
| 227 | |
| 228 | auto state = difference.needsLoading(frameIdx, loadRawData); |
| 229 | if (state == ItemLoadingState::LoadingNeeded) |
| 230 | { |
| 231 | // Load the requested current frame |
| 232 | DEBUG_DIFF("playlistItemDifference::loadFrame loading difference for frame %d", frameIdx); |
| 233 | isDifferenceLoading = true; |
| 234 | // Since every playlist item can have it's own relative indexing, we need two frame indices |
| 235 | difference.loadFrameDifference(frameIdx); |
| 236 | isDifferenceLoading = false; |
| 237 | if (emitSignals) |
| 238 | emit SignalItemChanged(true, RECACHE_NONE); |
| 239 | } |
| 240 | |
| 241 | if (playing && (state == ItemLoadingState::LoadingNeeded || |
| 242 | state == ItemLoadingState::LoadingNeededDoubleBuffer)) |
| 243 | { |
| 244 | // Load the next frame into the double buffer |
| 245 | int nextFrameIdx = frameIdx + 1; |
| 246 | if (nextFrameIdx <= this->properties().startEndRange.second) |
| 247 | { |
| 248 | DEBUG_DIFF("playlistItemDifference::loadFrame loading difference into double buffer %d %s", |
| 249 | nextFrameIdx, |
| 250 | playing ? "(playing)" : ""); |
| 251 | isDifferenceLoadingToDoubleBuffer = true; |
| 252 | difference.loadFrameDifference(frameIdx, true); |
| 253 | isDifferenceLoadingToDoubleBuffer = false; |
| 254 | if (emitSignals) |
| 255 | emit signalItemDoubleBufferLoaded(); |
| 256 | } |
| 257 | } |
| 258 | } |
| 259 | |
| 260 | bool playlistItemDifference::isLoading() const { return this->isDifferenceLoading; } |
| 261 |
nothing calls this directly
no test coverage detected