11#ifndef __AUDACITY_PLAYBACK_SCHEDULE__
12#define __AUDACITY_PLAYBACK_SCHEDULE__
58 size_t available,
size_t frames_,
size_t toProduce_)
73 using Duration = std::chrono::duration<double>;
104 unsigned long outputFrames
111 virtual double OffsetTrackTime(
PlaybackSchedule &schedule,
double offset );
116 virtual std::chrono::milliseconds
135 virtual std::pair<double, double>
137 double trackTime,
size_t nSamples );
139 using Mixers = std::vector<std::unique_ptr<Mixer>>;
145 virtual bool RepositionPlayback(
223 double GetLastTime()
const;
225 void SetLastTime(
double time);
230 double Consumer(
size_t nSamples,
double rate );
236 void Prime(
double time );
248 size_t mRemainder {};
258 double t0,
double t1,
271 double ComputeWarpedLength(
double t0,
double t1)
const;
280 double SolveWarpedLength(
double t0,
double length)
const;
293 {
return mTime.load(std::memory_order_relaxed); }
298 { mTime.store(time, std::memory_order_relaxed); }
301 mPolicyValid.store(
false, std::memory_order_release);
306 double RealDuration(
double trackTime1)
const;
310 double RealDurationSigned(
double trackTime1)
const;
313 double RealTimeRemaining()
const;
316 void RealTimeAdvance(
double increment );
320 void RealTimeInit(
double trackTime );
322 void RealTimeRestart();
326 std::atomic<bool> mPolicyValid{
false };
std::vector< std::vector< float > > PRCrossfadeData
constexpr size_t TimeQueueGrainSize
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Functions for doing the mixdown of the tracks.
Directs which parts of tracks to fetch for playback.
std::vector< std::unique_ptr< Mixer > > Mixers
virtual ~PlaybackPolicy()=0
std::chrono::duration< double > Duration
NonInterfering< Cursor > mHead
Aligned to avoid false sharing.
std::vector< Record > Records
struct holding stream options, including a pointer to the time warp info and AudioIOListener and whet...
Immutable structure is an argument to Mixer's constructor.
Duration latency
Try not to let ring buffer contents fall below this.
Duration ringBufferDelay
Length of ring buffer.
Duration batchSize
Try to put at least this much into the ring buffer in each pass.
std::unique_ptr< PlaybackPolicy > mpPlaybackPolicy
double GetTrackTime() const
Get current track time value, unadjusted.
double mT0
Playback starts at offset of mT0, which is measured in seconds.
double mT1
Playback ends at offset of mT1, which is measured in seconds. Note that mT1 may be less than mT0 duri...
bool ReversedTime() const
True if the end time is before the start time.
const BoundedEnvelope * mEnvelope
void SetTrackTime(double time)
Set current track time value, unadjusted.
std::atomic< double > mTime
Describes an amount of contiguous (but maybe time-warped) data to be extracted from tracks to play.
const size_t toProduce
Not more than frames; the difference will be trailing silence.
PlaybackSlice(size_t available, size_t frames_, size_t toProduce_)
Constructor enforces some invariants.
const size_t frames
Total number of frames to be buffered.
double TotalCorrection() const
double mLatencyCorrection
PRCrossfadeData mCrossfadeData