Deluge Firmware 1.3.0
Build date: 2025.06.05
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
34 void getColumnLabel(StringBuf& label) override {
35 label.append(deluge::l10n::get(deluge::l10n::String::STRING_FOR_RATE));
36 }
37
38private:
39 int32_t getClosestQuantizedOptionIndex(int32_t value) const;
40 const char* getQuantizedOptionLabel();
41 bool isStutterQuantized();
42 static std::vector<const char*> optionLabels;
43 static std::vector<int32_t> optionValues;
44};
45
46} // 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:211
Definition d_stringbuf.h:16
void drawPixelsForOled() override
Paints the pixels below the standard title block.
Definition rate.cpp:53
void getColumnLabel(StringBuf &label) override
Get the name for use on horizontal menus.
Definition rate.h:34
void selectEncoderAction(int32_t offset)
Handle select encoder movement.
Definition rate.cpp:29