Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
chord_object.h
Go to the documentation of this file.
1// clang-format off
2// SPDX-FileCopyrightText: © 2018-2022 Alexandros Theodotou <alex@zrythm.org>
3// SPDX-License-Identifier: LicenseRef-ZrythmLicense
4// clang-format on
5
12#ifndef __AUDIO_CHORD_OBJECT_H__
13#define __AUDIO_CHORD_OBJECT_H__
14
15#include <stdint.h>
16
18#include "dsp/position.h"
21#include "utils/yaml.h"
22
29#define CHORD_OBJECT_MAGIC 4181694
30#define IS_CHORD_OBJECT(x) (((ChordObject *) x)->magic == CHORD_OBJECT_MAGIC)
31#define IS_CHORD_OBJECT_AND_NONNULL(x) (x && IS_CHORD_OBJECT (x))
32
33#define CHORD_OBJECT_WIDGET_TRIANGLE_W 10
34
35#define chord_object_is_selected(r) \
36 arranger_object_is_selected ((ArrangerObject *) r)
37
38typedef struct ChordDescriptor ChordDescriptor;
39
45typedef struct ChordObject
46{
49
51 int index;
52
55
56 int magic;
57
59 PangoLayout * layout;
61
66chord_object_new (RegionIdentifier * region_id, int chord_index, int index);
67
68int
69chord_object_is_equal (ChordObject * a, ChordObject * b);
70
74void
76
83
90
91ZRegion *
92chord_object_get_region (ChordObject * self);
93
98#endif
Macros for arranger object backends.
Descriptors for chords.
ChordObject * chord_object_new(RegionIdentifier *region_id, int chord_index, int index)
Creates a ChordObject.
void chord_object_set_region_and_index(ChordObject *self, ZRegion *region, int idx)
Sets the region and index of the chord.
ChordDescriptor * chord_object_get_chord_descriptor(const ChordObject *self)
Returns the ChordDescriptor associated with this ChordObject.
ChordObject * chord_object_find_by_pos(ChordObject *clone)
Finds the ChordObject in the project corresponding to the given one's position.
Position struct and API.
Region identifier.
Base struct for arranger objects.
A ChordDescriptor describes a chord and is not linked to any specific object by itself.
A ChordObject to be shown in the TimelineArrangerWidget.
int index
The index inside the region.
int chord_index
The index of the chord it belongs to (0 topmost).
PangoLayout * layout
Cache layout for drawing the name.
ArrangerObject base
Base struct.
Index/identifier for a Region, so we can get Region objects quickly with it without searching by name...
A region (clip) is an object on the timeline that contains either MidiNote's or AudioClip's.
Definition region.h:72
YAML utils.