Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
midi_arranger_selections.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: © 2019-2021, 2023 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
10#ifndef __GUI_BACKEND_MA_SELECTIONS_H__
11#define __GUI_BACKEND_MA_SELECTIONS_H__
12
13#include "dsp/midi_note.h"
15#include "utils/yaml.h"
16
23#define MA_SELECTIONS_SCHEMA_VERSION 1
24
25#define MA_SELECTIONS (PROJECT->midi_arranger_selections)
26
35{
38
39 int schema_version;
40
43 int num_midi_notes;
44 size_t midi_notes_size;
45
47
48static const cyaml_schema_field_t midi_arranger_selections_fields_schema[] = {
51 base,
52 arranger_selections_fields_schema),
53 YAML_FIELD_INT (MidiArrangerSelections, schema_version),
56 midi_notes,
57 midi_note_schema),
58
59 CYAML_FIELD_END
60};
61
62static const cyaml_schema_value_t midi_arranger_selections_schema = {
63 YAML_VALUE_PTR (MidiArrangerSelections, midi_arranger_selections_fields_schema),
64};
65
70midi_arranger_selections_get_highest_note (MidiArrangerSelections * mas);
71
73midi_arranger_selections_get_lowest_note (MidiArrangerSelections * mas);
74
80void
84
91int
94 Position * pos,
95 ZRegion * region);
96
97NONNULL void
98midi_arranger_selections_sort_by_pitch (MidiArrangerSelections * self, bool desc);
99
104#endif
API for MIDI notes in the PianoRoll.
int midi_arranger_selections_can_be_pasted(MidiArrangerSelections *ts, Position *pos, ZRegion *region)
Returns if the selections can be pasted.
void midi_arranger_selections_unlisten_note_diff(MidiArrangerSelections *prev, MidiArrangerSelections *mas)
Sets the listen status of notes on and off based on changes in the previous selections and the curren...
#define YAML_FIELD_MAPPING_EMBEDDED(owner, member, schema)
Mapping embedded inside the struct.
Definition yaml.h:31
#define YAML_FIELD_DYN_ARRAY_VAR_COUNT(owner, member, schema)
Dynamic-width (reallocated) array of structs with variable count.
Definition yaml.h:112
#define YAML_VALUE_PTR(cc, fields_schema)
Schema to be used as a pointer.
Definition yaml.h:202
Common data structures and functions for *ArrangerSelections.
A collection of selected MidiNote's.
MidiNote ** midi_notes
Selected notes.
ArrangerSelections base
Base struct.
A MIDI note inside a ZRegion shown in the piano roll.
Definition midi_note.h:49
A Position is made up of bars.beats.sixteenths.ticks.
Definition position.h:127
A region (clip) is an object on the timeline that contains either MidiNote's or AudioClip's.
Definition region.h:77
YAML utils.