Audacity 3.2.0
Classes | Public Attributes | List of all members
PlaybackSchedule::TimeQueue::Node Struct Referencefinal
Collaboration diagram for PlaybackSchedule::TimeQueue::Node:
[legend]

Classes

struct  Record
 

Public Attributes

std::vector< Recordrecords
 
std::atomic< int > head { 0 }
 
std::atomic< int > tail { 0 }
 
std::atomic< Node * > next {}
 Points to a node which should be used instead of current one when it becomes exhausted by a consumer thread. More...
 
std::atomic_flag active { ATOMIC_FLAG_INIT }
 Flag is set when used by at least consumer thread. Once node is not used by neither it's flag is cleared making it available for recycling. More...
 
size_t offset { 0 }
 Number of samples advanced from the beginning of the current head. Accessed only by consumer thread. More...
 
size_t written { 0 }
 Number of samples counted by producer thread at the current tail. Accessed only by producer thread. More...
 

Detailed Description

Wraps circular buffer that stores time points bound to a specific samples at constant rate (TimeQueueGrainSize). Ideally there should be only one instance with buffer of size enough to not overflow. But in case of large latencies producing thread may try advance far ahead of consumer and that would require a buffer extension.

Definition at line 249 of file PlaybackSchedule.h.

Member Data Documentation

◆ active

std::atomic_flag PlaybackSchedule::TimeQueue::Node::active { ATOMIC_FLAG_INIT }

Flag is set when used by at least consumer thread. Once node is not used by neither it's flag is cleared making it available for recycling.

Definition at line 266 of file PlaybackSchedule.h.

◆ head

std::atomic<int> PlaybackSchedule::TimeQueue::Node::head { 0 }

Definition at line 257 of file PlaybackSchedule.h.

Referenced by PlaybackSchedule::TimeQueue::Producer().

◆ next

std::atomic<Node*> PlaybackSchedule::TimeQueue::Node::next {}

Points to a node which should be used instead of current one when it becomes exhausted by a consumer thread.

Definition at line 261 of file PlaybackSchedule.h.

Referenced by PlaybackSchedule::TimeQueue::Producer().

◆ offset

size_t PlaybackSchedule::TimeQueue::Node::offset { 0 }

Number of samples advanced from the beginning of the current head. Accessed only by consumer thread.

Definition at line 269 of file PlaybackSchedule.h.

◆ records

std::vector<Record> PlaybackSchedule::TimeQueue::Node::records

Definition at line 256 of file PlaybackSchedule.h.

Referenced by PlaybackSchedule::TimeQueue::Producer().

◆ tail

std::atomic<int> PlaybackSchedule::TimeQueue::Node::tail { 0 }

Definition at line 258 of file PlaybackSchedule.h.

Referenced by PlaybackSchedule::TimeQueue::Producer().

◆ written

size_t PlaybackSchedule::TimeQueue::Node::written { 0 }

Number of samples counted by producer thread at the current tail. Accessed only by producer thread.

Definition at line 271 of file PlaybackSchedule.h.


The documentation for this struct was generated from the following file: