Deluge Firmware
1.3.0
Build date: 2026.08.23
Toggle main menu visibility
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
22
namespace
deluge::gui::menu_item::stutter {
23
24
class
Rate final :
public
UnpatchedParam {
25
public
:
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)
override
;
30
void
drawValue()
override
;
31
void
drawPixelsForOled
()
override
;
32
void
renderInHorizontalMenu(
const
SlotPosition
& slot)
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
37
private
:
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
MenuItem::title
deluge::l10n::String title
Can get overridden by getTitle(). Actual max num chars for OLED display is 14.
Definition
menu_item.h:222
StringBuf
Definition
d_stringbuf.h:16
deluge::gui::menu_item::stutter::Rate::selectEncoderAction
void selectEncoderAction(int32_t offset) override
Handle select encoder movement.
Definition
rate.cpp:29
deluge::gui::menu_item::stutter::Rate::getNotificationValue
void getNotificationValue(StringBuf &valueBuf) override
Get the parameter value string to show in the popup.
Definition
rate.cpp:73
deluge::gui::menu_item::stutter::Rate::drawPixelsForOled
void drawPixelsForOled() override
Paints the pixels below the standard title block.
Definition
rate.cpp:53
SlotPosition
Definition
menu_item.h:33