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"; }
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();
64 float getDisplayValue()
override {
return soundEditor.currentModControllable->compressor.getAttackMS(); }
65 [[nodiscard]] RenderingStyle getRenderingStyle()
const override {
return ATTACK; }
66 void getColumnLabel(
StringBuf& label)
override { label.append(l10n::get(l10n::String::STRING_FOR_ATTACK_SHORT)); }
70 using CompressorValue::CompressorValue;
71 uint64_t getCompressorValue()
final {
72 return (uint64_t)soundEditor.currentModControllable->compressor.getRelease();
75 float getDisplayValue()
override {
return soundEditor.currentModControllable->compressor.getReleaseMS(); }
76 [[nodiscard]] int32_t getNumDecimalPlaces()
const override {
return 1; }
77 [[nodiscard]] RenderingStyle getRenderingStyle()
const override {
return RELEASE; }
79 void getColumnLabel(
StringBuf& label)
override { label.append(l10n::get(l10n::String::STRING_FOR_RELEASE_SHORT)); }
83 using CompressorValue::CompressorValue;
84 uint64_t getCompressorValue()
override {
85 return (uint64_t)soundEditor.currentModControllable->compressor.getRatio();
88 float getDisplayValue()
override {
return soundEditor.currentModControllable->compressor.getRatioForDisplay(); }
89 const char* getUnit()
override {
return " : 1"; }
93 using CompressorValue::CompressorValue;
94 uint64_t getCompressorValue()
override {
95 return (uint64_t)soundEditor.currentModControllable->compressor.getSidechain();
100 float getDisplayValue()
override {
return soundEditor.currentModControllable->compressor.getSidechainForDisplay(); }
101 const char* getUnit()
override {
return "HZ"; }
102 [[nodiscard]] RenderingStyle getRenderingStyle()
const override {
return HPF; }
106 using CompressorValue::CompressorValue;
107 uint64_t getCompressorValue()
final {
return (uint64_t)soundEditor.currentModControllable->compressor.getBlend(); }
109 auto value = this->getValue();
112 if (value < kMaxKnobPos) {
113 knobPos = lshiftAndSaturate<24>(value);
121 float getDisplayValue()
override {
return soundEditor.currentModControllable->compressor.getBlendForDisplay(); }
122 const char* getUnit()
override {
return " %"; }
123 [[nodiscard]] int32_t getNumDecimalPlaces()
const override {
return 0; }