Deluge Firmware 1.3.0
Build date: 2026.03.02
Loading...
Searching...
No Matches
selected_note_row.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 "definitions_cxx.hpp"
19#include "gui/menu_item/selection.h"
20#include "gui/ui/sound_editor.h"
21#include "gui/views/instrument_clip_view.h"
22#include "model/clip/instrument_clip.h"
23#include "model/instrument/kit.h"
24#include "model/model_stack.h"
25#include "model/note/note_row.h"
26#include "model/song/song.h"
27
28namespace deluge::gui::menu_item::note_row {
29class SelectedNoteRow : public Integer {
30public:
31 using Integer::Integer;
32
34 if (!isUIModeActive(UI_MODE_AUDITIONING)) {
35 display->displayPopup("Select Row");
36 return false;
37 }
38 return true;
39 }
40
41 ModelStackWithNoteRow* getIndividualNoteRow(ModelStackWithTimelineCounter* modelStack) {
42 auto* clip = static_cast<InstrumentClip*>(modelStack->getTimelineCounter());
43 ModelStackWithNoteRow* modelStackWithNoteRow =
44 clip->getNoteRowOnScreen(instrumentClipView.lastAuditionedYDisplay,
45 modelStack); // don't create
46
47 bool isKit = clip->output->type == OutputType::KIT;
48
49 if (!isKit) {
50 if (!modelStackWithNoteRow->getNoteRowAllowNull()) { // if note row doesn't exist yet, create it
51 modelStackWithNoteRow =
52 instrumentClipView.createNoteRowForYDisplay(modelStack, instrumentClipView.lastAuditionedYDisplay);
53 }
54 }
55
56 return modelStackWithNoteRow;
57 }
58
59 void updateDisplay() {
60 if (display->haveOLED()) {
61 renderUIsForOled();
62 }
63 else {
64 drawValue();
65 }
66 }
67};
68} // namespace deluge::gui::menu_item::note_row
Definition instrument_clip.h:48
Definition model_stack.h:189
Definition model_stack.h:129
Definition integer.h:24
Definition selected_note_row.h:29
bool shouldEnterSubmenu()
Check if selecting this menu item (with select encoder) should enter a submenu.
Definition selected_note_row.h:33