Deluge Firmware 1.3.0
Build date: 2026.11.28
Loading...
Searching...
No Matches
velocity.h
1/*
2 * Copyright (c) 2023 Sean Ditny
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/views/automation/editor_layout/note.h"
21#include "gui/views/automation/editor_layout/note/velocity_fold.h"
22
23// namespace deluge::gui::views::automation::editor_layout::note {
24
25class AutomationEditorLayoutNoteVelocity : public AutomationEditorLayoutNote {
26public:
27 AutomationEditorLayoutNoteVelocity() = default;
28
29 // edit pad action
30 void velocityEditPadAction(ModelStackWithNoteRow* modelStackWithNoteRow, NoteRow* noteRow, InstrumentClip* clip,
31 int32_t x, int32_t y, int32_t velocity, int32_t effectiveLength, SquareInfo& squareInfo);
32
33 // folded velocity editor, toggled with affect entire
34 VelocityFold fold;
35
36private:
37 void addNoteWithNewVelocity(int32_t x, int32_t velocity, int32_t newVelocity);
38 void adjustNoteVelocity(ModelStackWithNoteRow* modelStackWithNoteRow, NoteRow* noteRow, int32_t x, int32_t velocity,
39 int32_t newVelocity, uint8_t squareType);
40 void setVelocity(ModelStackWithNoteRow* modelStackWithNoteRow, NoteRow* noteRow, int32_t x, int32_t newVelocity);
41 void setVelocityRamp(ModelStackWithNoteRow* modelStackWithNoteRow, NoteRow* noteRow,
42 SquareInfo rowSquareInfo[kDisplayWidth]);
43
45
46public:
47 // Automation View Render Functions
48 void renderNoteColumn(ModelStackWithNoteRow* modelStackWithNoteRow, InstrumentClip* clip,
49 RGB image[][kDisplayWidth + kSideBarWidth],
50 uint8_t occupancyMask[][kDisplayWidth + kSideBarWidth], int32_t xDisplay, int32_t xScroll,
51 int32_t xZoom, SquareInfo& squareInfo);
52
53private:
54 void renderNoteSquare(RGB image[][kDisplayWidth + kSideBarWidth],
55 uint8_t occupancyMask[][kDisplayWidth + kSideBarWidth], int32_t xDisplay, int32_t yDisplay,
56 uint8_t squareType, int32_t value);
57
58public:
59 void displayParameterValueOLED(deluge::hid::display::oled_canvas::Canvas& canvas, int32_t yPos, int32_t knobPosLeft,
60 int32_t knobPosRight);
61};
62
63// }; // namespace deluge::gui::views::automation::editor_layout::note
64
65// extern deluge::gui::views::automation::editor_layout::AutomationEditorLayoutNoteVelocity
66// automationEditorLayoutNoteVelocity;
67
68extern AutomationEditorLayoutNoteVelocity automationEditorLayoutNoteVelocity;
Definition velocity.h:25
void renderNoteColumn(ModelStackWithNoteRow *modelStackWithNoteRow, InstrumentClip *clip, RGB image[][kDisplayWidth+kSideBarWidth], uint8_t occupancyMask[][kDisplayWidth+kSideBarWidth], int32_t xDisplay, int32_t xScroll, int32_t xZoom, SquareInfo &squareInfo)
render each square in each column of the note editor grid
Definition velocity.cpp:71
void renderNoteSquare(RGB image[][kDisplayWidth+kSideBarWidth], uint8_t occupancyMask[][kDisplayWidth+kSideBarWidth], int32_t xDisplay, int32_t yDisplay, uint8_t squareType, int32_t value)
render column for note parameter
Definition velocity.cpp:84
void displayParameterValueOLED(deluge::hid::display::oled_canvas::Canvas &canvas, int32_t yPos, int32_t knobPosLeft, int32_t knobPosRight)
updates OLED display to display the current velocity
Definition velocity.cpp:116
Definition instrument_clip.h:52
Definition model_stack.h:187
Definition note_row.h:106
This class represents the colour format most used by the Deluge globally.
Definition rgb.h:14
Definition velocity_fold.h:26
Definition velocity_edit.h:84
Definition note_row.h:61