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

Method getStreamTime

src/backends/RtAudio/RtAudio.cpp:487–506  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

485}
486
487double RtApi ::getStreamTime(void)
488{
489 verifyStream();
490
491#if defined(HAVE_GETTIMEOFDAY)
492 // Return a very accurate estimate of the stream time by
493 // adding in the elapsed time since the last tick.
494 struct timeval then;
495 struct timeval now;
496
497 if (stream_.state != STREAM_RUNNING || stream_.streamTime == 0.0)
498 return stream_.streamTime;
499
500 gettimeofday(&now, NULL);
501 then = stream_.lastTickTimestamp;
502 return stream_.streamTime + ((now.tv_sec + 0.000001 * now.tv_usec) - (then.tv_sec + 0.000001 * then.tv_usec));
503#else
504 return stream_.streamTime;
505#endif
506}
507
508void RtApi ::setStreamTime(double time)
509{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected