Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
|
Piano roll serializable backend. More...
#include <src/gui/backend/backend/piano_roll.h>
Public Types | |
enum class | Highlighting { None , Chord , Scale , Both } |
Highlighting for the piano roll. More... | |
Public Member Functions | |
PianoRoll (QObject *parent=nullptr) | |
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_. | |
structure::tracks::Track * | get_current_track () const |
Returns the current track whose regions are being shown in the piano roll. | |
void | set_notes_zoom (float notes_zoom, bool fire_events) |
void | init_loaded () |
Inits the PianoRoll after a Project has been loaded. | |
const MidiNoteDescriptor * | find_midi_note_descriptor_by_val (bool drum_mode, const 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. | |
auto & | get_selected_object_ids () |
![]() | |
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. | |
Highlighting | highlighting_ = Highlighting::None |
Highlighting notes depending on the current chord or scale. | |
std::vector< MidiNoteDescriptor > | drum_descriptors_ |
Drum mode descriptors. | |
structure::arrangement::ArrangerObjectSelectionManager::UuidSet | selected_objects_ |
![]() | |
double | scroll_start_x_ = 0 |
Horizontal scroll start position. | |
double | scroll_start_y_ = 0 |
Vertical scroll start position. | |
double | hzoom_level_ = 1.0 |
Horizontal zoom level. | |
Properties | |
DEFINE_EDITOR_SETTINGS_QML_PROPERTIES 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 86 of file piano_roll.h.