Audacity 3.2.0
|
#include <ScrubState.h>
Public Member Functions | |
ScrubbingPlaybackPolicy (const ScrubbingOptions &) | |
~ScrubbingPlaybackPolicy () override | |
void | Initialize (PlaybackSchedule &schedule, double rate) override |
Called before starting an audio stream. More... | |
void | Finalize (PlaybackSchedule &schedule) override |
Called after stopping of an audio stream or an unsuccessful start. More... | |
Mixer::WarpOptions | MixerWarpOptions (PlaybackSchedule &schedule) override |
Options to use when constructing mixers for each playback track. More... | |
BufferTimes | SuggestedBufferTimes (PlaybackSchedule &schedule) override |
Provide hints for construction of playback RingBuffer objects. More... | |
bool | AllowSeek (PlaybackSchedule &) override |
Whether repositioning commands are allowed during playback. More... | |
std::chrono::milliseconds | SleepInterval (PlaybackSchedule &) override |
How long to wait between calls to AudioIO::SequenceBufferExchange. More... | |
bool | Done (PlaybackSchedule &schedule, unsigned long) override |
Returns true if schedule.GetSequenceTime() 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... | |
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 Attributes | |
sampleCount | mScrubDuration { 0 } |
sampleCount | mStartSample { 0 } |
sampleCount | mEndSample { 0 } |
double | mOldEndTime { 0 } |
double | mNewStartTime { 0 } |
double | mScrubSpeed { 0 } |
bool | mSilentScrub { false } |
bool | mReplenish { false } |
size_t | mUntilDiscontinuity { 0 } |
const ScrubbingOptions | mOptions |
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 48 of file ScrubState.h.
|
explicit |
Definition at line 293 of file ScrubState.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 402 of file ScrubState.cpp.
References min(), mNewStartTime, mOldEndTime, PlaybackPolicy::mRate, mScrubSpeed, and mUntilDiscontinuity.
|
overridevirtual |
Whether repositioning commands are allowed during playback.
Reimplemented from PlaybackPolicy.
Definition at line 346 of file ScrubState.cpp.
|
overridevirtual |
Returns true if schedule.GetSequenceTime() has reached the end of playback.
outputFrames | how many playback frames were taken from RingBuffers |
Reimplemented from PlaybackPolicy.
Definition at line 352 of file ScrubState.cpp.
|
overridevirtual |
Called after stopping of an audio stream or an unsuccessful start.
Reimplemented from PlaybackPolicy.
Definition at line 312 of file ScrubState.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 364 of file ScrubState.cpp.
References sampleCount::as_long_long(), AudioIO::Get(), limitSampleBufferSize(), mEndSample, mNewStartTime, mOldEndTime, PlaybackPolicy::mRate, mReplenish, mScrubDuration, mSilentScrub, mStartSample, and mUntilDiscontinuity.
|
overridevirtual |
Called before starting an audio stream.
Reimplemented from PlaybackPolicy.
Definition at line 300 of file ScrubState.cpp.
References PlaybackPolicy::Initialize(), mEndSample, mNewStartTime, mOldEndTime, mOptions, mReplenish, mScrubDuration, mScrubSpeed, mSilentScrub, mStartSample, PlaybackSchedule::mT0, and mUntilDiscontinuity.
|
overridevirtual |
Options to use when constructing mixers for each playback track.
Reimplemented from PlaybackPolicy.
Definition at line 317 of file ScrubState.cpp.
References ScrubbingOptions::MaxAllowedScrubSpeed(), and ScrubbingOptions::MinAllowedScrubSpeed().
|
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 416 of file ScrubState.cpp.
References sampleCount::as_double(), AudioIO::Get(), ScrubbingOptions::isKeyboardScrubbing, mEndSample, mOptions, PlaybackPolicy::mRate, mReplenish, mScrubDuration, mScrubSpeed, mSilentScrub, and mStartSample.
|
overridevirtual |
How long to wait between calls to AudioIO::SequenceBufferExchange.
Reimplemented from PlaybackPolicy.
Definition at line 359 of file ScrubState.cpp.
References ScrubPollInterval.
|
overridevirtual |
Provide hints for construction of playback RingBuffer objects.
Reimplemented from PlaybackPolicy.
Definition at line 325 of file ScrubState.cpp.
References ScrubbingOptions::delay, ScrubbingOptions::minStutterTime, and mOptions.
|
private |
Definition at line 81 of file ScrubState.h.
Referenced by GetPlaybackSlice(), Initialize(), and RepositionPlayback().
|
private |
Definition at line 82 of file ScrubState.h.
Referenced by AdvancedTrackTime(), GetPlaybackSlice(), and Initialize().
|
private |
Definition at line 82 of file ScrubState.h.
Referenced by AdvancedTrackTime(), GetPlaybackSlice(), and Initialize().
|
private |
Definition at line 88 of file ScrubState.h.
Referenced by Initialize(), RepositionPlayback(), and SuggestedBufferTimes().
|
private |
Definition at line 85 of file ScrubState.h.
Referenced by GetPlaybackSlice(), Initialize(), and RepositionPlayback().
|
private |
Definition at line 81 of file ScrubState.h.
Referenced by GetPlaybackSlice(), Initialize(), and RepositionPlayback().
|
private |
Definition at line 83 of file ScrubState.h.
Referenced by AdvancedTrackTime(), Initialize(), and RepositionPlayback().
|
private |
Definition at line 84 of file ScrubState.h.
Referenced by GetPlaybackSlice(), Initialize(), and RepositionPlayback().
|
private |
Definition at line 81 of file ScrubState.h.
Referenced by GetPlaybackSlice(), Initialize(), and RepositionPlayback().
|
private |
Definition at line 86 of file ScrubState.h.
Referenced by AdvancedTrackTime(), GetPlaybackSlice(), and Initialize().