19 using DecimalWithoutScrolling::DecimalWithoutScrolling;
21 uint64_t value = getCompressorValue();
22 this->setValue(value >> 24);
24 void writeCurrentValue() final {
25 auto value = this->getValue();
26 if (value >= kMaxKnobPos) {
27 value = kMaxKnobPos - 1;
29 q31_t knobPos = lshiftAndSaturate<24>(value);
32 if (currentUIMode == UI_MODE_HOLDING_AFFECT_ENTIRE_IN_SOUND_EDITOR && soundEditor.editingKitRow()) {
34 Kit* kit = getCurrentKit();
36 for (
Drum* thisDrum = kit->firstDrum; thisDrum !=
nullptr; thisDrum = thisDrum->next) {
37 if (thisDrum->type == DrumType::SOUND) {
38 auto* soundDrum =
static_cast<SoundDrum*
>(thisDrum);
40 setCompressorValue(knobPos, &soundDrum->compressor);
46 setCompressorValue(knobPos, &soundEditor.currentModControllable->compressor);
49 virtual uint64_t getCompressorValue() = 0;
50 virtual void setCompressorValue(q31_t value, RMSFeedbackCompressor* compressor) = 0;
51 [[nodiscard]] int32_t getMaxValue() const final {
return kMaxKnobPos; }
52 [[nodiscard]] int32_t getNumDecimalPlaces()
const override {
return 2; }
53 const char* getUnit()
override {
return "MS"; }
58 using CompressorValue::CompressorValue;
59 uint64_t getCompressorValue()
final {
return (uint64_t)soundEditor.currentModControllable->compressor.getAttack(); }
61 float getDisplayValue()
final {
return soundEditor.currentModControllable->compressor.getAttackMS(); }
65 using CompressorValue::CompressorValue;
66 uint64_t getCompressorValue()
final {
67 return (uint64_t)soundEditor.currentModControllable->compressor.getRelease();
70 float getDisplayValue()
final {
return soundEditor.currentModControllable->compressor.getReleaseMS(); }
71 [[nodiscard]] int32_t getNumDecimalPlaces()
const final {
return 1; }
75 using CompressorValue::CompressorValue;
76 uint64_t getCompressorValue()
final {
return (uint64_t)soundEditor.currentModControllable->compressor.getRatio(); }
78 float getDisplayValue()
final {
return soundEditor.currentModControllable->compressor.getRatioForDisplay(); }
79 const char* getUnit()
final {
return " : 1"; }
83 using CompressorValue::CompressorValue;
84 uint64_t getCompressorValue()
final {
85 return (uint64_t)soundEditor.currentModControllable->compressor.getSidechain();
88 float getDisplayValue()
final {
return soundEditor.currentModControllable->compressor.getSidechainForDisplay(); }
89 const char* getUnit()
final {
return "HZ"; }
93 using Integer::Integer;
95 auto value = (uint64_t)soundEditor.currentModControllable->compressor.getBlend();
96 this->setValue(value >> 24);
99 void writeCurrentValue()
override {
100 auto value = this->getValue();
103 if (value < kMaxKnobPos) {
104 knobPos = lshiftAndSaturate<24>(value);
111 if (currentUIMode == UI_MODE_HOLDING_AFFECT_ENTIRE_IN_SOUND_EDITOR && soundEditor.editingKitRow()) {
113 Kit* kit = getCurrentKit();
115 for (
Drum* thisDrum = kit->firstDrum; thisDrum !=
nullptr; thisDrum = thisDrum->next) {
116 if (thisDrum->type == DrumType::SOUND) {
117 auto* soundDrum =
static_cast<SoundDrum*
>(thisDrum);
119 soundDrum->compressor.
setBlend(knobPos);
125 soundEditor.currentModControllable->compressor.
setBlend(knobPos);
128 int32_t getDisplayValue()
override {
return soundEditor.currentModControllable->compressor.
getBlendForDisplay(); }
129 const char* getUnit()
override {
return "%"; }
130 [[nodiscard]] int32_t getMaxValue()
const override {
return kMaxKnobPos; }