Deluge Firmware 1.3.0
Build date: 2025.08.12
Loading...
Searching...
No Matches
rate.h
1/*
2 * Copyright (c) 2025 Synthstrom Audible Limited
3 *
4 * This file is part of The Synthstrom Audible Deluge Firmware.
5 *
6 * The Synthstrom Audible Deluge Firmware is free software: you can redistribute it and/or modify it under the
7 * terms of the GNU General Public License as published by the Free Software Foundation,
8 * either version 3 of the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
11 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 * See the GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License along with this program.
15 * If not, see <https://www.gnu.org/licenses/>.
16 */
17#pragma once
18#include "deluge/modulation/params/param.h"
19#include "gui/l10n/l10n.h"
20#include "gui/menu_item/unpatched_param.h"
21
22namespace deluge::gui::menu_item::stutter {
23
24class Rate final : public UnpatchedParam {
25public:
26 Rate(l10n::String newName, l10n::String title)
27 : UnpatchedParam(newName, title, deluge::modulation::params::UNPATCHED_STUTTER_RATE) {}
28
29 void selectEncoderAction(int32_t offset);
30 void drawValue() override;
31 void drawPixelsForOled() override;
32 void renderInHorizontalMenu(int32_t startX, int32_t width, int32_t startY, int32_t height) override;
33 void getNotificationValue(StringBuf& valueBuf) override;
34
35 void getColumnLabel(StringBuf& label) override { label.append(deluge::l10n::get(l10n::String::STRING_FOR_RATE)); }
36
37private:
38 int32_t getClosestQuantizedOptionIndex(int32_t value) const;
39 const char* getQuantizedOptionLabel();
40 bool isStutterQuantized();
41 static std::vector<const char*> optionLabels;
42 static std::vector<int32_t> optionValues;
43};
44
45} // namespace deluge::gui::menu_item::stutter
deluge::l10n::String title
Can get overridden by getTitle(). Actual max num chars for OLED display is 14.
Definition menu_item.h:214
Definition d_stringbuf.h:16
void getNotificationValue(StringBuf &valueBuf) override
Get the parameter value string to show in the popup.
Definition rate.cpp:75
void drawPixelsForOled() override
Paints the pixels below the standard title block.
Definition rate.cpp:53
void selectEncoderAction(int32_t offset)
Handle select encoder movement.
Definition rate.cpp:29