Audacity 3.2.0
|
Public Member Functions | |
CutPreviewPlaybackPolicy (double gapLeft, double gapLength) | |
~CutPreviewPlaybackPolicy () override | |
void | Initialize (PlaybackSchedule &schedule, double rate) override |
Called before starting an audio stream. More... | |
bool | Done (PlaybackSchedule &schedule, unsigned long) override |
Returns true if schedule.GetSequenceTime() has reached the end of playback. More... | |
double | OffsetSequenceTime (PlaybackSchedule &schedule, double offset) override |
Called when the play head needs to jump a certain distance. 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... | |
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... | |
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 BufferTimes | SuggestedBufferTimes (PlaybackSchedule &schedule) |
Provide hints for construction of playback RingBuffer objects. More... | |
virtual bool | AllowSeek (PlaybackSchedule &schedule) |
Whether repositioning commands are allowed during playback. More... | |
virtual bool | Done (PlaybackSchedule &schedule, unsigned long outputFrames) |
Returns true if schedule.GetSequenceTime() has reached the end of playback. More... | |
virtual double | OffsetSequenceTime (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::SequenceBufferExchange. More... | |
virtual PlaybackSlice | GetPlaybackSlice (PlaybackSchedule &schedule, size_t available) |
Choose length of one fetch of samples from tracks in a call to AudioIO::FillPlayBuffers. More... | |
virtual std::pair< double, double > | AdvancedTrackTime (PlaybackSchedule &schedule, double trackTime, size_t nSamples) |
Compute a new point in a track's timeline from an old point and a real duration. More... | |
virtual bool | RepositionPlayback (PlaybackSchedule &schedule, const Mixers &playbackMixers, size_t frames, size_t available) |
AudioIO::FillPlayBuffers calls this to update its cursors into tracks for changes of position or speed. More... | |
virtual bool | Looping (const PlaybackSchedule &schedule) const |
Private Member Functions | |
double | GapStart () const |
double | GapEnd () const |
bool | AtOrBefore (double trackTime1, double trackTime2) const |
Private Attributes | |
const double | mGapLeft |
Fixed at construction time; these are a track time and duration. More... | |
const double | mGapLength |
double | mStart = 0 |
Starting and ending track times set in Initialize() More... | |
double | mEnd = 0 |
double | mDuration1 = 0 |
double | mDuration2 = 0 |
double | mInitDuration1 = 0 |
double | mInitDuration2 = 0 |
bool | mDiscontinuity { false } |
bool | mReversed { false } |
Additional Inherited Members | |
Public Types inherited from PlaybackPolicy | |
using | Duration = std::chrono::duration< double > |
using | Mixers = std::vector< std::unique_ptr< Mixer > > |
Protected Attributes inherited from PlaybackPolicy | |
double | mRate = 0 |
Definition at line 107 of file ProjectAudioManager.cpp.
anonymous_namespace{ProjectAudioManager.cpp}::CutPreviewPlaybackPolicy::CutPreviewPlaybackPolicy | ( | double | gapLeft, |
double | gapLength | ||
) |
gapLeft | Lower bound track time of of elision |
gapLength | Non-negative track duration |
Definition at line 153 of file ProjectAudioManager.cpp.
|
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 254 of file ProjectAudioManager.cpp.
References GapEnd(), GapStart(), mDiscontinuity, mDuration1, mDuration2, mEnd, PlaybackPolicy::mRate, mReversed, and PlaybackSchedule::SolveWarpedLength().
|
inlineprivate |
Definition at line 136 of file ProjectAudioManager.cpp.
|
overridevirtual |
Returns true if schedule.GetSequenceTime() has reached the end of playback.
Called in the PortAudio thread
outputFrames | how many playback frames were taken from RingBuffers |
Reimplemented from PlaybackPolicy.
Definition at line 187 of file ProjectAudioManager.cpp.
References PlaybackSchedule::GetSequenceTime(), mEnd, PlaybackPolicy::mRate, and mReversed.
|
inlineprivate |
Definition at line 134 of file ProjectAudioManager.cpp.
Referenced by AdvancedTrackTime(), and RepositionPlayback().
|
inlineprivate |
Definition at line 132 of file ProjectAudioManager.cpp.
Referenced by AdvancedTrackTime().
|
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 233 of file ProjectAudioManager.cpp.
References sampleCount::as_size_t(), mDuration1, mDuration2, min(), PlaybackPolicy::mRate, and TimeQueueGrainSize.
|
overridevirtual |
Called before starting an audio stream.
Reimplemented from PlaybackPolicy.
Definition at line 162 of file ProjectAudioManager.cpp.
References PlaybackSchedule::ComputeWarpedLength(), PlaybackPolicy::Initialize(), mDuration1, mDuration2, mEnd, mGapLeft, mGapLength, mInitDuration1, mInitDuration2, mReversed, mStart, PlaybackSchedule::mT0, PlaybackSchedule::mT1, and anonymous_namespace{NoteTrack.cpp}::swap().
|
overridevirtual |
Called when the play head needs to jump a certain distance.
offset | signed amount requested to be added to schedule::GetSequenceTime() |
Reimplemented from PlaybackPolicy.
|
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 278 of file ProjectAudioManager.cpp.
References GapEnd(), and mDiscontinuity.
|
private |
Definition at line 149 of file ProjectAudioManager.cpp.
Referenced by AdvancedTrackTime(), and RepositionPlayback().
|
private |
Definition at line 146 of file ProjectAudioManager.cpp.
Referenced by AdvancedTrackTime(), GetPlaybackSlice(), and Initialize().
|
private |
Definition at line 146 of file ProjectAudioManager.cpp.
Referenced by AdvancedTrackTime(), GetPlaybackSlice(), and Initialize().
|
private |
Definition at line 143 of file ProjectAudioManager.cpp.
Referenced by AdvancedTrackTime(), Done(), and Initialize().
|
private |
Fixed at construction time; these are a track time and duration.
Definition at line 140 of file ProjectAudioManager.cpp.
Referenced by Initialize().
|
private |
Definition at line 140 of file ProjectAudioManager.cpp.
Referenced by Initialize().
|
private |
Definition at line 147 of file ProjectAudioManager.cpp.
Referenced by Initialize().
|
private |
Definition at line 147 of file ProjectAudioManager.cpp.
Referenced by Initialize().
|
private |
Definition at line 150 of file ProjectAudioManager.cpp.
Referenced by AdvancedTrackTime(), Done(), and Initialize().
|
private |
Starting and ending track times set in Initialize()
Definition at line 143 of file ProjectAudioManager.cpp.
Referenced by Initialize().