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, deluge::dsp::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"; }
54 [[nodiscard]] NumberStyle getNumberStyle()
const override {
return KNOB; }
59 using CompressorValue::CompressorValue;
60 uint64_t getCompressorValue()
override {
61 return (uint64_t)soundEditor.currentModControllable->compressor.getAttack();
66 float getDisplayValue()
override {
return soundEditor.currentModControllable->compressor.getAttackMS(); }
70 using CompressorValue::CompressorValue;
71 uint64_t getCompressorValue()
final {
72 return (uint64_t)soundEditor.currentModControllable->compressor.getRelease();
77 float getDisplayValue()
override {
return soundEditor.currentModControllable->compressor.getReleaseMS(); }
78 [[nodiscard]] int32_t getNumDecimalPlaces()
const {
return 1; }
82 using CompressorValue::CompressorValue;
83 uint64_t getCompressorValue()
override {
84 return (uint64_t)soundEditor.currentModControllable->compressor.getRatio();
89 float getDisplayValue()
override {
return soundEditor.currentModControllable->compressor.getRatioForDisplay(); }
90 const char* getUnit()
override {
return " : 1"; }
94 using CompressorValue::CompressorValue;
95 uint64_t getCompressorValue()
override {
96 return (uint64_t)soundEditor.currentModControllable->compressor.getSidechain();
101 float getDisplayValue()
override {
return soundEditor.currentModControllable->compressor.getSidechainForDisplay(); }
102 const char* getUnit()
override {
return "HZ"; }
106 using CompressorValue::CompressorValue;
107 uint64_t getCompressorValue()
override {
108 return (uint64_t)soundEditor.currentModControllable->compressor.getBlend().raw();
111 auto value = this->getValue();
114 if (value < kMaxKnobPos) {
115 knobPos.
raw() = lshiftAndSaturate<24>(value);
120 float getDisplayValue()
override {
return soundEditor.currentModControllable->compressor.getBlendForDisplay(); }
121 const char* getUnit()
override {
return " %"; }
122 [[nodiscard]] int32_t getNumDecimalPlaces()
const override {
return 0; }