36class VoiceSample final :
public SampleLowLevelReader {
38 VoiceSample() =
default;
39 explicit VoiceSample(VoiceSample& other) =
default;
44 explicit VoiceSample(SampleLowLevelReader&& other) : SampleLowLevelReader{std::move(other)} {}
45 ~VoiceSample()
override { endTimeStretching(); }
46 VoiceSample& operator=(
const VoiceSample& other) =
delete;
50 VoiceSample& operator=(VoiceSample&& other) =
delete;
57 int64_t rawSamplesLate, int32_t numSamples = 0);
58 void endTimeStretching();
60 LoopType loopingType, int32_t phaseIncrement, int32_t timeStretchRatio, int32_t amplitude,
61 int32_t amplitudeIncrement, int32_t bufferSize, InterpolationMode desiredInterpolationMode,
62 int32_t priorityRating);
63 void beenUnassigned(
bool wontBeUsedAgain);
68 [[nodiscard]]
bool shouldObeyMarkers()
const override {
69 return (cache ==
nullptr && timeStretcher ==
nullptr && !forAudioClip);
72 void readSamplesResampledPossiblyCaching(int32_t** oscBufferPos, int32_t** oscBufferRPos, int32_t numSamples,
73 Sample* sample, int32_t jumpAmount, int32_t numChannels,
74 int32_t numChannelsAfterCondensing, int32_t phaseIncrement,
75 int32_t* sourceAmplitudeNow, int32_t amplitudeIncrement,
76 int32_t bufferSize, int32_t reduceMagnitudeBy = 1);
79 LoopType loopingType, int32_t priorityRating,
bool forAudioClip =
false);
83 int32_t timeStretchRatio, int32_t priorityRating, LoopType loopingType);
85 int32_t numSamplesTilLoop, int32_t playDirection, int32_t priorityRating);
87 uint32_t pendingSamplesLate = 0;
92 bool doneFirstRenderYet =
false;
94 bool forAudioClip =
false;
95 bool writingToCache =
false;
99 int32_t phaseIncrement, int32_t timeStretchRatio, int32_t playDirection,
100 int32_t priorityRating, LoopType loopingType);
101 void switchToReadingCacheFromWriting();
102 bool stopReadingFromCache();
104 int32_t cacheBytePos = 0;
105 uint32_t cacheLoopLengthBytes = 0;
106 int32_t cacheLoopEndPointBytes = 0;
108 int32_t cacheEndPointBytes = 0;