![]() |
Audacity 3.2.0
|
A circular buffer. More...
#include <PlaybackSchedule.h>
Classes | |
struct | Cursor |
struct | Record |
Public Member Functions | |
void | Clear () |
void | Resize (size_t size) |
void | Producer (PlaybackSchedule &schedule, PlaybackSlice slice) |
Enqueue track time value advanced by the slice according to schedule 's PlaybackPolicy. More... | |
double | GetLastTime () const |
Return the last time saved by Producer. More... | |
void | SetLastTime (double time) |
double | Consumer (size_t nSamples, double rate) |
Find the track time value nSamples after the last consumed sample. More... | |
void | Prime (double time) |
Empty the queue and reassign the last produced time. More... | |
Private Types | |
using | Records = std::vector< Record > |
Private Attributes | |
Records | mData |
double | mLastTime {} |
NonInterfering< Cursor > | mHead |
Aligned to avoid false sharing. More... | |
NonInterfering< Cursor > | mTail |
A circular buffer.
Definition at line 209 of file PlaybackSchedule.h.
|
private |
Definition at line 243 of file PlaybackSchedule.h.
void PlaybackSchedule::TimeQueue::Clear | ( | ) |
Definition at line 267 of file PlaybackSchedule.cpp.
References mData, mHead, and mTail.
Referenced by AudioIO::StartStream(), AudioIO::StartStreamCleanup(), and AudioIO::StopStream().
double PlaybackSchedule::TimeQueue::Consumer | ( | size_t | nSamples, |
double | rate | ||
) |
Find the track time value nSamples
after the last consumed sample.
Definition at line 344 of file PlaybackSchedule.cpp.
References size, and TimeQueueGrainSize.
Referenced by AudioIoCallback::UpdateTimePosition().
double PlaybackSchedule::TimeQueue::GetLastTime | ( | ) | const |
Return the last time saved by Producer.
Definition at line 334 of file PlaybackSchedule.cpp.
Referenced by DefaultPlaybackPolicy::RepositionPlayback(), and DefaultPlaybackPolicy::RevertToOldDefault().
void PlaybackSchedule::TimeQueue::Prime | ( | double | time | ) |
Empty the queue and reassign the last produced time.
Assumes producer and consumer are suspended
Definition at line 369 of file PlaybackSchedule.cpp.
Referenced by AudioIoCallback::CallbackDoSeek(), and AudioIO::StartStream().
void PlaybackSchedule::TimeQueue::Producer | ( | PlaybackSchedule & | schedule, |
PlaybackSlice | slice | ||
) |
Enqueue track time value advanced by the slice according to schedule
's PlaybackPolicy.
Definition at line 279 of file PlaybackSchedule.cpp.
References PlaybackSlice::frames, PlaybackSchedule::GetPolicy(), size, TimeQueueGrainSize, and PlaybackSlice::toProduce.
Referenced by AudioIO::ProcessPlaybackSlices().
void PlaybackSchedule::TimeQueue::Resize | ( | size_t | size | ) |
Definition at line 274 of file PlaybackSchedule.cpp.
References size.
Referenced by AudioIO::AllocateBuffers().
void PlaybackSchedule::TimeQueue::SetLastTime | ( | double | time | ) |
Definition at line 339 of file PlaybackSchedule.cpp.
Referenced by DefaultPlaybackPolicy::RepositionPlayback().
|
private |
Definition at line 244 of file PlaybackSchedule.h.
Referenced by Clear().
|
private |
Aligned to avoid false sharing.
Definition at line 251 of file PlaybackSchedule.h.
Referenced by Clear().
|
private |
Definition at line 245 of file PlaybackSchedule.h.
|
private |
Definition at line 251 of file PlaybackSchedule.h.
Referenced by Clear().