Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
PianoRoll Class Reference

Piano roll serializable backend. More...

#include <src/gui/backend/backend/piano_roll.h>

Inheritance diagram for PianoRoll:
Collaboration diagram for PianoRoll:

Public Types

enum class  Highlighting : std::uint8_t { None , Chord , Scale , Both }
 Highlighting for the piano roll. More...

Public Member Functions

 PianoRoll (const structure::arrangement::ArrangerObjectRegistry &registry, QObject *parent=nullptr)
gui::backend::EditorSettingsgetEditorSettings () const
gui::backend::ArrangerObjectSelectionManagerselectionManager () 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_.
structure::tracks::Trackget_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 MidiNoteDescriptorfind_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< gui::backend::EditorSettingseditor_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< MidiNoteDescriptorpiano_descriptors_
 Piano roll mode descriptors.
Highlighting highlighting_ = Highlighting::None
 Highlighting notes depending on the current chord or scale.
std::vector< MidiNoteDescriptordrum_descriptors_
 Drum mode descriptors.
utils::QObjectUniquePtr< gui::backend::ArrangerObjectSelectionManagerselection_manager_

Properties

QML_ELEMENT zrythm::gui::backend::EditorSettingseditorSettings
zrythm::gui::backend::ArrangerObjectSelectionManagerselectionManager
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)

Detailed Description

Piano roll serializable backend.

The actual widgets should reflect the information here.

Definition at line 87 of file piano_roll.h.


The documentation for this class was generated from the following file: