|
Zrythm v2.0.0-alpha.1+31.4967fd053471
a highly automated and intuitive digital audio workstation
|
MIDI editor serializable backend. More...
#include <src/structure/project/midi_editor.h>


Public Types | |
| enum class | Highlighting : std::uint8_t { None , Chord , Scale , Both } |
| Highlighting for the piano roll. More... | |
Public Member Functions | |
| MidiEditor (QObject *parent=nullptr) | |
| int | keyHeight () 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_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 MidiEditor. | |
| Public Member Functions inherited from zrythm::structure::project::EditorSettings | |
| EditorSettings (QObject *parent=nullptr) | |
| double | getX () const |
| void | setX (double x) |
| Q_SIGNAL void | xChanged (double x) |
| double | getY () const |
| void | setY (double y) |
| Q_SIGNAL void | yChanged (double y) |
| double | getHorizontalZoomLevel () const |
| void | setHorizontalZoomLevel (double hzoom_level) |
| Q_SIGNAL void | horizontalZoomLevelChanged (double hzoom_level) |
| double | clamp_scroll_start_x (double x) |
| double | clamp_scroll_start_y (double y) |
| void | append_scroll (double dx, double dy, bool validate) |
| Appends the given deltas to the scroll x/y values. | |
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 | |
| 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. | |
| std::vector< MidiNoteDescriptor > | drum_descriptors_ |
| Drum mode descriptors. | |
Properties | |
| QML_ELEMENT int | keyHeight |
| Properties inherited from zrythm::structure::project::EditorSettings | |
| QML_ELEMENT double | x |
| double | y |
| double | horizontalZoomLevel |
Friends | |
| void | init_from (MidiEditor &obj, const MidiEditor &other, utils::ObjectCloneType clone_type) |
| void | to_json (nlohmann::json &j, const MidiEditor &midi_editor) |
| void | from_json (const nlohmann::json &j, MidiEditor &midi_editor) |
MIDI editor serializable backend.
The actual widgets should reflect the information here.
Definition at line 79 of file midi_editor.h.
|
strong |
Highlighting for the piano roll.
Definition at line 90 of file midi_editor.h.
|
inline |
Gets the visible notes.
Definition at line 181 of file midi_editor.h.
|
inlinestaticconstexpr |
Returns if the key is black.
Definition at line 120 of file midi_editor.h.
|
inlinestaticconstexpr |
Definition at line 130 of file midi_editor.h.
|
inlinestaticconstexpr |
Definition at line 134 of file midi_editor.h.
|
inlinestaticconstexpr |
Definition at line 139 of file midi_editor.h.
|
inlinestaticconstexpr |
Definition at line 143 of file midi_editor.h.
|
inlinestaticconstexpr |
Definition at line 125 of file midi_editor.h.
|
inline |
Definition at line 112 of file midi_editor.h.
| std::vector<int> zrythm::structure::project::MidiEditor::current_notes_ |
Currently pressed notes (used only at runtime).
Definition at line 236 of file midi_editor.h.
| std::vector<MidiNoteDescriptor> zrythm::structure::project::MidiEditor::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 255 of file midi_editor.h.
| MidiModifier zrythm::structure::project::MidiEditor::midi_modifier_ = MidiModifier::Velocity |
Selected MidiModifier.
Definition at line 233 of file midi_editor.h.
| int zrythm::structure::project::MidiEditor::note_height_ { 16 } |
Visual height per key in pixels.
Definition at line 230 of file midi_editor.h.
| float zrythm::structure::project::MidiEditor::notes_zoom_ = 1.0f |
Notes zoom level.
Definition at line 227 of file midi_editor.h.
| std::vector<MidiNoteDescriptor> zrythm::structure::project::MidiEditor::piano_descriptors_ |
Piano roll mode descriptors.
For performance purposes, invisible notes must be sorted at the end of the array.
Definition at line 244 of file midi_editor.h.
|
read |
Definition at line 83 of file midi_editor.h.