11namespace tracktion {
inline namespace engine
44 void setReadPosition (SampleCount)
noexcept;
45 SampleCount getReadPosition()
const noexcept {
return readPos; }
47 bool readSamples (
int numSamples,
50 int startOffsetInDestBuffer,
54 bool readSamples (
int*
const* destSamples,
56 int startOffsetInDestBuffer,
60 bool getRange (
int numSamples,
61 float& lmax,
float& lmin,
62 float& rmax,
float& rmin,
67 int getNumChannels()
const noexcept;
68 double getSampleRate()
const noexcept;
92 int samplesToBuffer)>&
93 createFallbackReader);
97 int samplesToBuffer)>&
98 createFallbackReader);
101 void setCacheSizeSamples (SampleCount samplesPerFile);
102 SampleCount getCacheSizeSamples()
const {
return cacheSizeSamples; }
104 SampleCount getBytesInUse()
const {
return totalBytesUsed; }
106 bool hasCacheMissed (
bool clearMissedFlag);
112 void nextBlockStarted();
115 bool hasMappedReader (
const AudioFile&, SampleCount)
const;
119 SampleCount totalBytesUsed = 0, cacheSizeSamples = 0;
120 bool cacheMissed =
false;
123 struct ScopedFileRead;
128 int nextFileToService = 0;
131 CachedFile* getOrCreateCachedFile (
const AudioFile&);
132 bool serviceNextReader();
137 class RefresherThread;
144 void purgeOldFiles();
145 void purgeOrphanReaders();
147 friend class AudioFileManager;
148 void releaseFile (
const AudioFile&);
149 void releaseAllFiles();
150 void validateFile (
const AudioFile&);
TimeDuration getCpuUsage() const
Returns the amount of time spent reading files in the last block.
Reader::Ptr createReader(const AudioFile &)
Creates a Reader to read an AudioFile.
The Engine is the central class for all tracktion sessions.
Represents a duration in real-life time.
virtual void setReadTimeout(int timeoutMilliseconds)=0
Subclassed must override this to set the timeout.
FallbackReader()
Constructor.