37class [[gnu::hot]] TimeStretcher {
39 TimeStretcher() =
default;
41 int32_t numChannels, int32_t phaseIncrement, int32_t timeStretchRatio, int32_t playDirection,
42 int32_t priorityRating, int32_t fudgingNumSamplesTilLoop, LoopType loopingType);
44 int32_t numChannels, int32_t timeStretchRatio, int32_t phaseIncrement, uint64_t combinedIncrement,
45 int32_t playDirection, LoopType loopingType, int32_t priorityRating);
46 void beenUnassigned();
47 void unassignAllReasonsForPercLookahead();
48 void unassignAllReasonsForPercCacheClusters();
50 int32_t timeStretchRatio, int32_t phaseIncrement, uint64_t combinedIncrement, int32_t playDirection,
51 LoopType loopingType, int32_t priorityRating);
53 void rememberPercCacheCluster(
Cluster* cluster);
54 void updateClustersForPercLookahead(
Sample* sample, uint32_t sourceBytePos, int32_t playDirection);
56 int32_t getSamplePos(int32_t playDirection);
57 bool allocateBuffer(int32_t numChannels);
59 void readFromBuffer(int32_t* oscBufferPos, int32_t numSamples, int32_t numChannels,
60 int32_t numChannelsAfterCondensing, int32_t sourceAmplitudeNow, int32_t amplitudeIncrementNow,
61 int32_t* bufferReadPos);
63 void setupCrossfadeFromCache(
SampleCache* cache, int32_t cacheBytePos, int32_t numChannels);
65#if TIME_STRETCH_ENABLE_BUFFER
66 void reassessWhetherToBeFillingBuffer(int32_t phaseIncrement, int32_t timeStretchRatio,
67 int32_t newBufferFillingMode, int32_t numChannels);
72 uint32_t crossfadeProgress;
73 uint32_t crossfadeIncrement;
75 int32_t samplesTilHopEnd;
80 bool olderHeadReadingFromBuffer;
81 bool hasLoopedBackIntoPreMargin;
82 bool playHeadStillActive[2];
83 uint8_t numTimesMissedHop;
85 int32_t olderBufferReadPos;
87#if TIME_STRETCH_ENABLE_BUFFER
88 bool newerHeadReadingFromBuffer;
89 int32_t newerBufferReadPos;
91 uint8_t bufferFillingMode;
92 int32_t bufferWritePos;
93 uint64_t bufferSamplesWritten;
96 Cluster* clustersForPercLookahead[kNumClustersLoadedAhead];
98 Cluster* percCacheClustersNearby[2];
103 int32_t additionalOscPos, int32_t priorityRating, LoopType loopingType);
bool setupNewPlayHead(Sample *sample, VoiceSample *voiceSample, SamplePlaybackGuide *guide, int32_t newHeadBytePos, int32_t additionalOscPos, int32_t priorityRating, LoopType loopingType)
Definition time_stretcher.cpp:980