Audacity
3.0.3
|
#include <PlaybackSchedule.h>
Public Member Functions | |
~LoopingPlaybackPolicy () override | |
BufferTimes | SuggestedBufferTimes (PlaybackSchedule &schedule) override |
Provide hints for construction of playback RingBuffer objects. More... | |
bool | Done (PlaybackSchedule &schedule, unsigned long) override |
Returns true if schedule.GetTrackTime() has reached the end of playback. More... | |
PlaybackSlice | GetPlaybackSlice (PlaybackSchedule &schedule, size_t available) override |
Choose length of one fetch of samples from tracks in a call to AudioIO::FillPlayBuffers. More... | |
std::pair< double, double > | AdvancedTrackTime (PlaybackSchedule &schedule, double trackTime, size_t nSamples) override |
Compute a new point in a track's timeline from an old point and a real duration. More... | |
void | MessageConsumer (PlaybackSchedule &schedule) override |
May be called between AdvancedTrackTime() and RepositionPlayback() More... | |
bool | RepositionPlayback (PlaybackSchedule &schedule, const Mixers &playbackMixers, size_t frames, size_t available) override |
AudioIO::FillPlayBuffers calls this to update its cursors into tracks for changes of position or speed. More... | |
bool | Looping (const PlaybackSchedule &) const override |
Public Member Functions inherited from PlaybackPolicy | |
virtual | ~PlaybackPolicy ()=0 |
virtual void | Initialize (PlaybackSchedule &schedule, double rate) |
Called before starting an audio stream. More... | |
virtual void | Finalize (PlaybackSchedule &schedule) |
Called after stopping of an audio stream or an unsuccessful start. More... | |
virtual Mixer::WarpOptions | MixerWarpOptions (PlaybackSchedule &schedule) |
Options to use when constructing mixers for each playback track. More... | |
virtual bool | AllowSeek (PlaybackSchedule &schedule) |
Whether repositioning commands are allowed during playback. More... | |
virtual double | OffsetTrackTime (PlaybackSchedule &schedule, double offset) |
Called when the play head needs to jump a certain distance. More... | |
virtual std::chrono::milliseconds | SleepInterval (PlaybackSchedule &schedule) |
How long to wait between calls to AudioIO::TrackBufferExchange. More... | |
Private Attributes | |
size_t | mRemaining { 0 } |
bool | mProgress { true } |
bool | mKicked { false } |
Additional Inherited Members | |
Public Types inherited from PlaybackPolicy | |
using | Mixers = std::vector< std::unique_ptr< Mixer > > |
Protected Attributes inherited from PlaybackPolicy | |
double | mRate = 0 |
Definition at line 451 of file PlaybackSchedule.h.
|
overridedefault |
|
overridevirtual |
Compute a new point in a track's timeline from an old point and a real duration.
Needed because playback might be at non-unit speed.
Called one or more times between GetPlaybackSlice and RepositionPlayback, until the sum of the nSamples values equals the most recent playback slice (including any trailing silence).
Reimplemented from PlaybackPolicy.
Definition at line 195 of file PlaybackSchedule.cpp.
References PlaybackSchedule::mEnvelope, min(), PlaybackPolicy::mRate, PlaybackSchedule::mT0, PlaybackSchedule::mT1, PlaybackSchedule::ReversedTime(), and PlaybackSchedule::SolveWarpedLength().
|
overridevirtual |
Returns true if schedule.GetTrackTime() has reached the end of playback.
outputFrames | how many playback frames were taken from RingBuffers |
Reimplemented from PlaybackPolicy.
Definition at line 160 of file PlaybackSchedule.cpp.
|
overridevirtual |
Choose length of one fetch of samples from tracks in a call to AudioIO::FillPlayBuffers.
available | upper bound for the length of the fetch |
Reimplemented from PlaybackPolicy.
Definition at line 166 of file PlaybackSchedule.cpp.
References PlaybackPolicy::mRate, PlaybackSchedule::mWarpedTime, PlaybackSchedule::RealTimeAdvance(), and PlaybackSchedule::RealTimeRemaining().
|
overridevirtual |
|
overridevirtual |
May be called between AdvancedTrackTime() and RepositionPlayback()
Receive notifications from the main thread of changes of parameters affecting the policy
Default implementation ignores all messages
Reimplemented from PlaybackPolicy.
Definition at line 220 of file PlaybackSchedule.cpp.
References PlaybackSchedule::TimeQueue::GetLastTime(), PlaybackSchedule::mMessageChannel, PlaybackPolicy::mRate, PlaybackSchedule::mT0, PlaybackSchedule::mT1, PlaybackSchedule::mTimeQueue, PlaybackSchedule::mWarpedLength, PlaybackSchedule::RealDuration(), PlaybackSchedule::RealTimeInit(), PlaybackSchedule::RealTimeRemaining(), and PlaybackSchedule::TimeQueue::SetLastTime().
|
overridevirtual |
AudioIO::FillPlayBuffers calls this to update its cursors into tracks for changes of position or speed.
frames | how many samples were just now buffered for play |
available | how many more samples may be buffered |
Reimplemented from PlaybackPolicy.
Definition at line 249 of file PlaybackSchedule.cpp.
References PlaybackSchedule::TimeQueue::GetLastTime(), PlaybackSchedule::mT0, PlaybackSchedule::mT1, PlaybackSchedule::mTimeQueue, and PlaybackSchedule::RealTimeRestart().
|
overridevirtual |
Provide hints for construction of playback RingBuffer objects.
Reimplemented from PlaybackPolicy.
Definition at line 153 of file PlaybackSchedule.cpp.
|
private |
Definition at line 476 of file PlaybackSchedule.h.
|
private |
Definition at line 475 of file PlaybackSchedule.h.
|
private |
Definition at line 474 of file PlaybackSchedule.h.