MCPcopy Create free account
hub / github.com/LabSound/LabSound / start

Method start

src/core/AudioNode.cpp:210–236  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

208}
209
210void AudioNodeScheduler::start(double when)
211{
212 // irrespective of start state, onStart will be called if possible
213 // to allow a node to use subsequent starts as a hint
214 if (_onStart)
215 _onStart(when);
216
217 // if already scheduled or playing, nothing to do
218 if (_playbackState == SchedulingState::SCHEDULED || _playbackState == SchedulingState::PLAYING)
219 return;
220
221 // start cancels stop
222 _stopWhen = std::numeric_limits<uint64_t>::max();
223
224 // treat non finite, or max values as a cancellation of stopping or resetting
225 if (!isfinite(when) || when == std::numeric_limits<double>::max())
226 {
227 if (_playbackState == SchedulingState::STOPPING || _playbackState == SchedulingState::RESETTING)
228 {
229 _playbackState = SchedulingState::PLAYING;
230 }
231 return;
232 }
233
234 _startWhen = _epoch + static_cast<uint64_t>(when * _sampleRate);
235 _playbackState = SchedulingState::SCHEDULED;
236}
237
238void AudioNodeScheduler::stop(double when)
239{

Callers 15

updateMethod · 0.45
lazyInitializeMethod · 0.45
handlePreRenderTasksMethod · 0.45
addAutomaticPullNodeMethod · 0.45
startOfflineRenderingMethod · 0.45
resumeMethod · 0.45
playMethod · 0.45
playMethod · 0.45
playMethod · 0.45
playMethod · 0.45
playMethod · 0.45
playMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected