Deluge Firmware 1.3.0
Build date: 2026.11.28
Loading...
Searching...
No Matches
accidental_rows.h
1/*
2 * Copyright © 2026 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 "definitions_cxx.hpp"
21#include "gui/colour/rgb.h"
22#include <array>
23#include <cstdint>
24#include <optional>
25#include <span>
26
27class InstrumentClip;
28class NoteRow;
31class TimelineView;
32struct EditPadPress;
33
35struct YNoteRange {
36 int32_t first;
37 int32_t last;
38};
39
45public:
48 class Layout {
49 public:
51 Layout();
52
54 [[nodiscard]] bool mayHaveHiddenRows() const { return clip_ != nullptr; }
55
58 [[nodiscard]] std::optional<YNoteRange> hiddenYNotes(int32_t yDisplay) const;
59
60 private:
61 InstrumentClip* clip_ = nullptr;
62 bool flats_ = false;
63 };
64
67 static NoteRow* noteRowForPress(const EditPadPress& press, int32_t* getIndex = nullptr);
69
73 int32_t auditionYNote(bool on, uint8_t yDisplay, int32_t yNoteOfRow, std::span<const EditPadPress> presses);
74
78 static void render(YNoteRange hidden, RGB rowColour, bool allowNoteTails, TimelineView* view, RGB* image,
79 uint8_t* occupancyMask, int32_t renderWidth, int32_t xScroll, uint32_t xZoom);
80
81private:
83 std::array<std::optional<int16_t>, kDisplayHeight> auditionedHiddenYNote_{};
84};
bool mayHaveHiddenRows() const
False if the current clip can't have hidden rows at all (a kit, or not in scale mode).
Definition accidental_rows.h:54
std::optional< YNoteRange > hiddenYNotes(int32_t yDisplay) const
Definition accidental_rows.cpp:40
InstrumentClip * clip_
Null if the clip can't have hidden rows.
Definition accidental_rows.h:61
Layout()
For the current clip.
Definition accidental_rows.cpp:32
Definition accidental_rows.h:44
std::array< std::optional< int16_t >, kDisplayHeight > auditionedHiddenYNote_
Per pad row, the hidden pitch being auditioned on it, if any.
Definition accidental_rows.h:83
static void render(YNoteRange hidden, RGB rowColour, bool allowNoteTails, TimelineView *view, RGB *image, uint8_t *occupancyMask, int32_t renderWidth, int32_t xScroll, uint32_t xZoom)
Definition accidental_rows.cpp:87
static NoteRow * noteRowForPress(const EditPadPress &press, int32_t *getIndex=nullptr)
Definition accidental_rows.cpp:53
int32_t auditionYNote(bool on, uint8_t yDisplay, int32_t yNoteOfRow, std::span< const EditPadPress > presses)
Definition accidental_rows.cpp:68
Definition instrument_clip.h:52
Definition model_stack.h:187
Definition model_stack.h:129
Definition note_row.h:106
This class represents the colour format most used by the Deluge globally.
Definition rgb.h:14
Definition timeline_view.h:27
Definition instrument_clip_view.h:57
An inclusive range of pitches.
Definition accidental_rows.h:35