26 using Integer::Integer;
27 void readCurrentValue()
override { this->setValue(AudioEngine::reverbSidechainVolume / 21474836); }
28 void writeCurrentValue()
override {
29 AudioEngine::reverbSidechainVolume = this->getValue() * 21474836;
30 AudioEngine::mustUpdateReverbParamsBeforeNextRender =
true;
32 [[nodiscard]] int32_t getMaxValue()
const override {
return kMaxMenuValue; }
33 [[nodiscard]] int32_t getMinValue()
const override {
return -1; }
35 void drawValue()
override {
36 if (this->getValue() < 0) {
37 display->setText(l10n::get(l10n::String::STRING_FOR_AUTO));
46 if (this->getValue() < 0) {
47 canvas.
drawStringCentred(l10n::get(l10n::String::STRING_FOR_AUTO), 18 + OLED_MAIN_TOPMOST_PIXEL,
48 kTextHugeSpacingX, kTextHugeSizeY);
55 void renderInHorizontalMenu(int32_t startX, int32_t width, int32_t startY, int32_t height)
override {
57 if (this->getValue() < 0) {
58 const char* stringForAuto = l10n::get(l10n::String::STRING_FOR_AUTO);
59 canvas.
drawStringCentered(stringForAuto, startX, startY + 3, kTextSpacingX, kTextSpacingY, width);
62 Integer::renderInHorizontalMenu(startX, width, startY, height);
66 void getColumnLabel(
StringBuf& label)
override {
67 label.append(deluge::l10n::get(l10n::String::STRING_FOR_VOLUME_DUCKING_SHORT));
71 if (
const int32_t value = this->getValue(); value < 0) {
72 valueBuf.append(l10n::get(l10n::String::STRING_FOR_AUTO));
75 valueBuf.appendInt(value);
void drawStringCentered(char const *string, int32_t startX, int32_t startY, int32_t textSpacingX, int32_t textSpacingY, int32_t totalWidth)
Definition canvas.cpp:254
void drawStringCentred(char const *string, int32_t pixelY, int32_t textWidth, int32_t textHeight, int32_t centrePos=OLED_MAIN_WIDTH_PIXELS/2)
Definition canvas.cpp:246