Deluge Firmware 1.3.0
Build date: 2025.04.16
Loading...
Searching...
No Matches
slicer.h
1/*
2 * Copyright © 2017-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
18#pragma once
19
20#include "gui/ui/ui.h"
21#include "hid/button.h"
22
23#define SLICER_MODE_REGION 0
24#define SLICER_MODE_MANUAL 1
25#define MAX_MANUAL_SLICES 64
26
27struct SliceItem {
28 int32_t startPos;
29 int32_t transpose;
30};
31
32class Slicer final : public UI {
33public:
34 Slicer() { oledShowsUIUnderneath = true; }
35
36 void focusRegained() override;
37 bool canSeeViewUnderneath() override { return false; }
38 void selectEncoderAction(int8_t offset) override;
39 ActionResult buttonAction(deluge::hid::Button b, bool on, bool inCardRoutine) override;
40 ActionResult padAction(int32_t x, int32_t y, int32_t velocity) override;
41
42 bool renderMainPads(uint32_t whichRows, RGB image[][kDisplayWidth + kSideBarWidth],
43 uint8_t occupancyMask[][kDisplayWidth + kSideBarWidth], bool drawUndefinedArea) override;
44 void graphicsRoutine() override;
45 ActionResult horizontalEncoderAction(int32_t offset) override;
46 ActionResult verticalEncoderAction(int32_t offset, bool inCardRoutine) override;
47
48 void stopAnyPreviewing();
49 void preview(int64_t startPoint, int64_t endPoint, int32_t transpose, int32_t on);
50
51 int32_t numManualSlice;
52 int32_t currentSlice;
53 int32_t slicerMode;
54 SliceItem manualSlicePoints[MAX_MANUAL_SLICES];
55
56 void renderOLED(deluge::hid::display::oled_canvas::Canvas& canvas) override;
57
58 int16_t numClips;
59
60 // ui
61 UIType getUIType() override { return UIType::SLICER; }
62
63private:
64 // 7SEG Only
65 void redraw();
66
67 void doSlice();
68};
69
70extern Slicer slicer;
This class represents the colour format most used by the Deluge globally.
Definition rgb.h:14
Definition slicer.h:32
Definition slicer.h:27