32 int32_t userDelayRate;
33 int32_t delayFeedbackAmount;
34 int32_t analog_saturation = 8;
38 Delay(
const Delay& other) =
delete;
41 Delay& operator=(
const Delay& rhs) {
42 pingPong = rhs.pingPong;
44 syncLevel = rhs.syncLevel;
48 [[nodiscard]]
constexpr bool isActive()
const {
return (primaryBuffer.isActive() || secondaryBuffer.isActive()); }
50 void informWhetherActive(
bool newActive, int32_t userDelayRate = 0);
51 void copySecondaryToPrimary();
52 void copyPrimaryToSecondary();
53 void initializeSecondaryBuffer(int32_t newNativeRate,
bool makeNativeRatePreciseRelativeToOtherBuffer);
54 void setupWorkingState(
State& workingState, uint32_t timePerInternalTickInverse,
bool anySoundComingIn =
true);
55 void discardBuffers();
56 void setTimeToAbandon(
const State& workingState);
59 DelayBuffer primaryBuffer;
60 DelayBuffer secondaryBuffer;
61 ImpulseResponseProcessor ir_processor;
63 uint32_t countCyclesWithoutChange;
64 int32_t userRateLastTime;
68 SyncType syncType = SYNC_TYPE_EVEN;
71 SyncLevel syncLevel = SYNC_LEVEL_16TH;
73 int32_t sizeLeftUntilBufferSwap;
78 int32_t prevFeedback = 0;
80 uint8_t repeatsUntilAbandon = 0;
82 void process(std::span<StereoSample> buffer,
const State& delayWorkingState);
85 void prepareToBeginWriting();
86 [[nodiscard]]
constexpr int32_t getAmountToWriteBeforeReadingBegins()
const {
return secondaryBuffer.size(); }