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
49 midi_arranger_selections_fields_schema[] = {
52 base,
53 arranger_selections_fields_schema),
54 YAML_FIELD_INT (MidiArrangerSelections, schema_version),
57 midi_notes,
58 midi_note_schema),
59
60 CYAML_FIELD_END
61 };
62
63static const cyaml_schema_value_t
64 midi_arranger_selections_schema = {
67 midi_arranger_selections_fields_schema),
68 };
69
74midi_arranger_selections_get_highest_note (
76
78midi_arranger_selections_get_lowest_note (
80
86void
90
97int
100 Position * pos,
101 ZRegion * region);
102
103NONNULL void
104midi_arranger_selections_sort_by_pitch (
106 bool desc);
107
112#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:32
#define YAML_FIELD_DYN_ARRAY_VAR_COUNT(owner, member, schema)
Dynamic-width (reallocated) array of structs with variable count.
Definition yaml.h:123
#define YAML_VALUE_PTR(cc, fields_schema)
Schema to be used as a pointer.
Definition yaml.h:221
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:50
A Position is made up of bars.beats.sixteenths.ticks.
Definition position.h:137
A region (clip) is an object on the timeline that contains either MidiNote's or AudioClip's.
Definition region.h:78
YAML utils.