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]] RenderingStyle getRenderingStyle()
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(); }
67 [[nodiscard]] RenderingStyle getRenderingStyle()
const override {
return ATTACK; }
68 void getColumnLabel(
StringBuf& label)
override { label.append(l10n::get(l10n::String::STRING_FOR_ATTACK_SHORT)); }
72 using CompressorValue::CompressorValue;
73 uint64_t getCompressorValue()
final {
74 return (uint64_t)soundEditor.currentModControllable->compressor.getRelease();
79 float getDisplayValue()
override {
return soundEditor.currentModControllable->compressor.getReleaseMS(); }
80 [[nodiscard]] int32_t getNumDecimalPlaces()
const override {
return 1; }
81 [[nodiscard]] RenderingStyle getRenderingStyle()
const override {
return RELEASE; }
83 void getColumnLabel(
StringBuf& label)
override { label.append(l10n::get(l10n::String::STRING_FOR_RELEASE_SHORT)); }
87 using CompressorValue::CompressorValue;
88 uint64_t getCompressorValue()
override {
89 return (uint64_t)soundEditor.currentModControllable->compressor.getRatio();
94 float getDisplayValue()
override {
return soundEditor.currentModControllable->compressor.getRatioForDisplay(); }
95 const char* getUnit()
override {
return " : 1"; }
99 using CompressorValue::CompressorValue;
100 uint64_t getCompressorValue()
override {
101 return (uint64_t)soundEditor.currentModControllable->compressor.getSidechain();
106 float getDisplayValue()
override {
return soundEditor.currentModControllable->compressor.getSidechainForDisplay(); }
107 const char* getUnit()
override {
return "HZ"; }
108 [[nodiscard]] RenderingStyle getRenderingStyle()
const override {
return HPF; }
112 using CompressorValue::CompressorValue;
113 uint64_t getCompressorValue()
override {
114 return (uint64_t)soundEditor.currentModControllable->compressor.getBlend().raw();
117 auto value = this->getValue();
120 if (value < kMaxKnobPos) {
121 knobPos.
raw() = lshiftAndSaturate<24>(value);
126 float getDisplayValue()
override {
return soundEditor.currentModControllable->compressor.getBlendForDisplay(); }
127 const char* getUnit()
override {
return " %"; }
128 [[nodiscard]] int32_t getNumDecimalPlaces()
const override {
return 0; }