|
Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
|
Piano roll serializable backend. More...
#include <src/structure/arrangement/piano_roll.h>


Public Types | |
| enum class | Highlighting : std::uint8_t { None , Chord , Scale , Both } |
| Highlighting for the piano roll. More... | |
Public Member Functions | |
| PianoRoll (QObject *parent=nullptr) | |
| auto | getEditorSettings () const |
| int | getKeyHeight () const |
| Q_SIGNAL void | keyHeightChanged () |
| Q_INVOKABLE int | getKeyAtY (double y) const |
| void | add_current_note (int note) |
| Adds the note if it doesn't exist in current_notes_. | |
| void | remove_current_note (int note) |
| Removes the note if it exists in current_notes_. | |
| bool | contains_current_note (int note) |
| Returns whether the note exists in current_notes_. | |
| void | set_notes_zoom (float notes_zoom, bool fire_events) |
| const MidiNoteDescriptor * | find_midi_note_descriptor_by_val (bool drum_mode, uint8_t val) |
| Returns the MidiNoteDescriptor matching the value (0-127). | |
| void | set_highlighting (Highlighting highlighting) |
| Updates the highlighting and notifies the UI. | |
| void | set_midi_modifier (MidiModifier modifier) |
| Sets the MIDI modifier. | |
| void | get_visible_notes (bool drum_mode, std::vector< MidiNoteDescriptor > &vec) |
| Gets the visible notes. | |
| void | init () |
| Initializes the PianoRoll. | |
Static Public Member Functions | |
| static Q_INVOKABLE constexpr bool | isBlackKey (int note) |
| Returns if the key is black. | |
| static Q_INVOKABLE constexpr bool | isWhiteKey (int note) |
| static Q_INVOKABLE constexpr bool | isNextKeyBlack (int note) |
| static Q_INVOKABLE constexpr bool | isNextKeyWhite (int note) |
| static Q_INVOKABLE constexpr bool | isPrevKeyBlack (int note) |
| static Q_INVOKABLE constexpr bool | isPrevKeyWhite (int note) |
Data Fields | |
| utils::QObjectUniquePtr< EditorSettings > | editor_settings_ |
| float | notes_zoom_ = 1.0f |
| Notes zoom level. | |
| int | note_height_ { 16 } |
| Visual height per key in pixels. | |
| MidiModifier | midi_modifier_ = MidiModifier::Velocity |
| Selected MidiModifier. | |
| std::vector< int > | current_notes_ |
| Currently pressed notes (used only at runtime). | |
| std::vector< MidiNoteDescriptor > | piano_descriptors_ |
| Piano roll mode descriptors. | |
| Highlighting | highlighting_ = Highlighting::None |
| Highlighting notes depending on the current chord or scale. | |
| std::vector< MidiNoteDescriptor > | drum_descriptors_ |
| Drum mode descriptors. | |
Properties | |
| QML_ELEMENT zrythm::structure::arrangement::EditorSettings * | editorSettings |
| int | keyHeight |
Friends | |
| void | init_from (PianoRoll &obj, const PianoRoll &other, utils::ObjectCloneType clone_type) |
| void | to_json (nlohmann::json &j, const PianoRoll &piano_roll) |
| void | from_json (const nlohmann::json &j, PianoRoll &piano_roll) |
Piano roll serializable backend.
The actual widgets should reflect the information here.
Definition at line 74 of file piano_roll.h.
|
strong |
Highlighting for the piano roll.
Definition at line 86 of file piano_roll.h.
|
inline |
Gets the visible notes.
Definition at line 183 of file piano_roll.h.
|
inline |
Definition at line 107 of file piano_roll.h.
|
inline |
Definition at line 109 of file piano_roll.h.
|
inlinestaticconstexpr |
Returns if the key is black.
Definition at line 117 of file piano_roll.h.
|
inlinestaticconstexpr |
Definition at line 127 of file piano_roll.h.
|
inlinestaticconstexpr |
Definition at line 131 of file piano_roll.h.
|
inlinestaticconstexpr |
Definition at line 136 of file piano_roll.h.
|
inlinestaticconstexpr |
Definition at line 140 of file piano_roll.h.
|
inlinestaticconstexpr |
Definition at line 122 of file piano_roll.h.
|
friend |
Definition at line 207 of file piano_roll.h.
| std::vector<int> zrythm::structure::arrangement::PianoRoll::current_notes_ |
Currently pressed notes (used only at runtime).
Definition at line 244 of file piano_roll.h.
| std::vector<MidiNoteDescriptor> zrythm::structure::arrangement::PianoRoll::drum_descriptors_ |
Drum mode descriptors.
These must be sorted by index at all times.
For performance purposes, invisible notes must be sorted at the end of the array.
Definition at line 268 of file piano_roll.h.
| utils::QObjectUniquePtr<EditorSettings> zrythm::structure::arrangement::PianoRoll::editor_settings_ |
Definition at line 232 of file piano_roll.h.
| Highlighting zrythm::structure::arrangement::PianoRoll::highlighting_ = Highlighting::None |
Highlighting notes depending on the current chord or scale.
Definition at line 258 of file piano_roll.h.
| MidiModifier zrythm::structure::arrangement::PianoRoll::midi_modifier_ = MidiModifier::Velocity |
Selected MidiModifier.
Definition at line 241 of file piano_roll.h.
| int zrythm::structure::arrangement::PianoRoll::note_height_ { 16 } |
Visual height per key in pixels.
Definition at line 238 of file piano_roll.h.
| float zrythm::structure::arrangement::PianoRoll::notes_zoom_ = 1.0f |
Notes zoom level.
Definition at line 235 of file piano_roll.h.
| std::vector<MidiNoteDescriptor> zrythm::structure::arrangement::PianoRoll::piano_descriptors_ |
Piano roll mode descriptors.
For performance purposes, invisible notes must be sorted at the end of the array.
Definition at line 252 of file piano_roll.h.
|
read |
Definition at line 78 of file piano_roll.h.
|
read |
Definition at line 79 of file piano_roll.h.