Deluge Firmware 1.3.0
Build date: 2025.06.24
Loading...
Searching...
No Matches
randomizer.h
1/*
2 * Copyright (c) 2014-2023 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 "gui/menu_item/submenu.h"
19#include "gui/ui/sound_editor.h"
20#include "processing/engines/audio_engine.h"
21
22#include <gui/menu_item/horizontal_menu.h>
23
24namespace deluge::gui::menu_item::arpeggiator {
25class Randomizer final : public HorizontalMenu {
26public:
27 using HorizontalMenu::HorizontalMenu;
28
29 [[nodiscard]] bool showColumnLabel() const override { return false; }
30 [[nodiscard]] int32_t getColumnSpan() const override { return 1; }
31
32 void renderInHorizontalMenu(int32_t startX, int32_t width, int32_t startY, int32_t height) override {
33 using namespace deluge::hid::display;
34 oled_canvas::Canvas& image = OLED::main;
35
36 // Draw dice icon
37 const auto& diceIcon = OLED::diceIcon;
38 const int32_t diceIconWidth = diceIcon.size() / 2;
39 constexpr int32_t diceIconHeight = 16;
40
41 int32_t x = startX + ((width - diceIconWidth) / 2) - 3;
42 int32_t y = startY + ((height - diceIconHeight) / 2) + 1;
43 image.drawGraphicMultiLine(diceIcon.data(), x, y, diceIconWidth, diceIconHeight, 2);
44
45 // Draw arrow
46 const auto& arrowIcon = OLED::submenuArrowIconBold;
47 constexpr int32_t arrowIconWidth = 7;
48 constexpr int32_t arrowIconHeight = 8;
49
50 x += diceIconWidth + 1;
51 y = startY + ((height - arrowIconHeight) / 2);
52 image.drawGraphicMultiLine(arrowIcon, x, y, arrowIconWidth);
53 }
54};
55
56} // namespace deluge::gui::menu_item::arpeggiator
static constexpr size_t size()
Used in combination with operator[] and begin end.
Definition rgb.h:218
bool showColumnLabel() const override
Show a label for the parameter in the horizontal menu.
Definition randomizer.h:29
int32_t getColumnSpan() const override
Get the number of occupied virtual columns in the horizontal menu.
Definition randomizer.h:30