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

Backend for the chord editor. More...

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

Inheritance diagram for ChordEditor:
Collaboration diagram for ChordEditor:

Public Types

using ChordDescriptor = dsp::ChordDescriptor
 
using ChordAccent = dsp::ChordAccent
 
using ChordType = dsp::ChordType
 
using MusicalScale = dsp::MusicalScale
 
using MusicalNote = dsp::MusicalNote
 

Public Member Functions

 ChordEditor (QObject *parent=nullptr)
 
void init ()
 Initializes the ChordEditor.
 
void apply_single_chord (const ChordDescriptor &chord, int idx, bool undoable)
 
void apply_chords (const std::vector< ChordDescriptor > &chords, bool undoable)
 
void apply_preset (const ChordPreset &pset, bool undoable)
 
void apply_preset_from_scale (MusicalScale::Type scale, MusicalNote root_note, bool undoable)
 
void transpose_chords (bool up, bool undoable)
 
ChordDescriptorget_chord_from_note_number (midi_byte_t note_number)
 Returns the ChordDescriptor for the given note number, otherwise NULL if the given note number is not in the proper range.
 
int get_chord_index (const ChordDescriptor &chord) const
 
auto & get_chord_at_index (size_t index)
 
auto & get_chord_at_index (size_t index) const
 
void add_chord_descriptor (ChordDescriptor &&chord_descr)
 
void replace_chord_descriptor (const auto index, ChordDescriptor &&chord_descr)
 
auto & get_selected_object_ids ()
 
- Public Member Functions inherited from EditorSettings
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.
 

Data Fields

std::vector< ChordDescriptorchords_
 The chords to show on the left.
 
- Data Fields inherited from EditorSettings
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.
 

Friends

void init_from (ChordEditor &obj, const ChordEditor &other, utils::ObjectCloneType clone_type)
 
void to_json (nlohmann::json &j, const ChordEditor &editor)
 
void from_json (const nlohmann::json &j, ChordEditor &editor)
 

Detailed Description

Backend for the chord editor.

Definition at line 35 of file chord_editor.h.

Member Typedef Documentation

◆ ChordAccent

using ChordEditor::ChordAccent = dsp::ChordAccent

Definition at line 42 of file chord_editor.h.

◆ ChordDescriptor

◆ ChordType

using ChordEditor::ChordType = dsp::ChordType

Definition at line 43 of file chord_editor.h.

◆ MusicalNote

using ChordEditor::MusicalNote = dsp::MusicalNote

Definition at line 45 of file chord_editor.h.

◆ MusicalScale

Definition at line 44 of file chord_editor.h.

Constructor & Destructor Documentation

◆ ChordEditor()

ChordEditor::ChordEditor ( QObject * parent = nullptr)
inline

Definition at line 47 of file chord_editor.h.

Member Function Documentation

◆ add_chord_descriptor()

void ChordEditor::add_chord_descriptor ( ChordDescriptor && chord_descr)
inline

Definition at line 90 of file chord_editor.h.

◆ get_chord_at_index() [1/2]

auto & ChordEditor::get_chord_at_index ( size_t index)
inline

Definition at line 76 of file chord_editor.h.

◆ get_chord_at_index() [2/2]

auto & ChordEditor::get_chord_at_index ( size_t index) const
inline

Definition at line 77 of file chord_editor.h.

◆ get_selected_object_ids()

auto & ChordEditor::get_selected_object_ids ( )
inline

Definition at line 104 of file chord_editor.h.

◆ replace_chord_descriptor()

void ChordEditor::replace_chord_descriptor ( const auto index,
ChordDescriptor && chord_descr )
inline

Definition at line 97 of file chord_editor.h.

Friends And Related Symbol Documentation

◆ from_json

void from_json ( const nlohmann::json & j,
ChordEditor & editor )
friend

Definition at line 113 of file chord_editor.h.

◆ init_from

void init_from ( ChordEditor & obj,
const ChordEditor & other,
utils::ObjectCloneType clone_type )
friend

Definition at line 79 of file chord_editor.h.

◆ to_json

void to_json ( nlohmann::json & j,
const ChordEditor & editor )
friend

Definition at line 108 of file chord_editor.h.

Field Documentation

◆ chords_

std::vector<ChordDescriptor> ChordEditor::chords_

The chords to show on the left.

Currently fixed to 12 chords whose order cannot be edited. Chords cannot be added or removed.

Definition at line 126 of file chord_editor.h.


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