36class VoiceSample final :
public SampleLowLevelReader {
38 VoiceSample() =
default;
39 explicit VoiceSample(VoiceSample& other) =
default;
40 VoiceSample(SampleLowLevelReader&& other) : SampleLowLevelReader{std::move(other)} {}
41 ~VoiceSample()
override { endTimeStretching(); }
42 VoiceSample& operator=(
const VoiceSample& other) =
delete;
43 VoiceSample& operator=(VoiceSample&& other) =
default;
50 int64_t rawSamplesLate, int32_t numSamples = 0);
51 void endTimeStretching();
53 LoopType loopingType, int32_t phaseIncrement, int32_t timeStretchRatio, int32_t amplitude,
54 int32_t amplitudeIncrement, int32_t bufferSize, InterpolationMode desiredInterpolationMode,
55 int32_t priorityRating);
56 void beenUnassigned(
bool wontBeUsedAgain);
61 [[nodiscard]]
bool shouldObeyMarkers()
const override {
62 return (cache ==
nullptr && timeStretcher ==
nullptr && !forAudioClip);
65 void readSamplesResampledPossiblyCaching(int32_t** oscBufferPos, int32_t** oscBufferRPos, int32_t numSamples,
66 Sample* sample, int32_t jumpAmount, int32_t numChannels,
67 int32_t numChannelsAfterCondensing, int32_t phaseIncrement,
68 int32_t* sourceAmplitudeNow, int32_t amplitudeIncrement,
69 int32_t bufferSize, int32_t reduceMagnitudeBy = 1);
72 LoopType loopingType, int32_t priorityRating,
bool forAudioClip =
false);
76 int32_t timeStretchRatio, int32_t priorityRating, LoopType loopingType);
78 int32_t numSamplesTilLoop, int32_t playDirection, int32_t priorityRating);
80 uint32_t pendingSamplesLate = 0;
85 bool doneFirstRenderYet =
false;
87 bool forAudioClip =
false;
88 bool writingToCache =
false;
92 int32_t phaseIncrement, int32_t timeStretchRatio, int32_t playDirection,
93 int32_t priorityRating, LoopType loopingType);
94 void switchToReadingCacheFromWriting();
95 bool stopReadingFromCache();
97 int32_t cacheBytePos = 0;
98 uint32_t cacheLoopLengthBytes = 0;
99 int32_t cacheLoopEndPointBytes = 0;
101 int32_t cacheEndPointBytes = 0;