Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
clipboard.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: © 2020-2022 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
10#ifndef __GUI_BACKEND_CLIPBOARD_H__
11#define __GUI_BACKEND_CLIPBOARD_H__
12
20#include "utils/yaml.h"
21
22#include <gtk/gtk.h>
23
31typedef enum ClipboardType
32{
33 CLIPBOARD_TYPE_TIMELINE_SELECTIONS,
34 CLIPBOARD_TYPE_MIDI_SELECTIONS,
35 CLIPBOARD_TYPE_AUTOMATION_SELECTIONS,
36 CLIPBOARD_TYPE_CHORD_SELECTIONS,
37 CLIPBOARD_TYPE_AUDIO_SELECTIONS,
38 CLIPBOARD_TYPE_MIXER_SELECTIONS,
39 CLIPBOARD_TYPE_TRACKLIST_SELECTIONS,
41
42static const cyaml_strval_t clipboard_type_strings[] = {
43 {"Timeline selections", CLIPBOARD_TYPE_TIMELINE_SELECTIONS },
44 { "MIDI selections", CLIPBOARD_TYPE_MIDI_SELECTIONS },
45 { "Automation selections", CLIPBOARD_TYPE_AUTOMATION_SELECTIONS},
46 { "Chord selections", CLIPBOARD_TYPE_CHORD_SELECTIONS },
47 { "Audio selections", CLIPBOARD_TYPE_AUDIO_SELECTIONS },
48 { "Mixer selections", CLIPBOARD_TYPE_MIXER_SELECTIONS },
49 { "Tracklist selections", CLIPBOARD_TYPE_TRACKLIST_SELECTIONS },
50};
51
55typedef struct Clipboard
56{
57 ClipboardType type;
58 TimelineSelections * timeline_sel;
60 ChordSelections * chord_sel;
61 AutomationSelections * automation_sel;
62 AudioSelections * audio_sel;
63 MixerSelections * mixer_sel;
64 TracklistSelections * tracklist_sel;
65} Clipboard;
66
67static const cyaml_schema_field_t clipboard_fields_schema[] = {
68 YAML_FIELD_ENUM (Clipboard, type, clipboard_type_strings),
71 timeline_sel,
72 timeline_selections_fields_schema),
75 ma_sel,
76 midi_arranger_selections_fields_schema),
79 chord_sel,
80 chord_selections_fields_schema),
83 automation_sel,
84 automation_selections_fields_schema),
87 audio_sel,
88 audio_selections_fields_schema),
91 mixer_sel,
92 mixer_selections_fields_schema),
95 tracklist_sel,
96 tracklist_selections_fields_schema),
97
98 CYAML_FIELD_END
99};
100
101static const cyaml_schema_value_t clipboard_schema = {
102 YAML_VALUE_PTR (Clipboard, clipboard_fields_schema),
103};
104
109Clipboard *
111
112Clipboard *
113clipboard_new_for_mixer_selections (MixerSelections * sel, bool clone);
114
115Clipboard *
116clipboard_new_for_tracklist_selections (TracklistSelections * sel, bool clone);
117
124
128void
130
135#endif
API for selections in the AudioArrangerWidget.
API for selections in the AutomationArrangerWidget.
API for selections in the piano roll.
Clipboard * clipboard_new_for_arranger_selections(ArrangerSelections *sel, bool clone)
Creates a new Clipboard instance for the given arranger selections.
ClipboardType
Clipboard type.
Definition clipboard.h:32
void clipboard_free(Clipboard *self)
Frees the clipboard and all associated data.
ArrangerSelections * clipboard_get_selections(Clipboard *self)
Gets the ArrangerSelections, if this clipboard contains arranger selections.
#define YAML_VALUE_PTR(cc, fields_schema)
Schema to be used as a pointer.
Definition yaml.h:202
#define YAML_FIELD_MAPPING_PTR_OPTIONAL(owner, member, schema)
Mapping pointer to a struct.
Definition yaml.h:43
Tracklist selections.
API for selections in the piano roll.
Mixer selections.
Selections to be used for the AudioArrangerWidget's current selections, copying, undoing,...
Selections to be used for the AutomationArrangerWidget's current selections, copying,...
Selections to be used for the ChordArrangerWidget's current selections, copying, undoing,...
Clipboard struct.
Definition clipboard.h:56
A collection of selected MidiNote's.
Selections to be used for the timeline's current selections, copying, undoing, etc.
Selections to be used for the timeline's current selections, copying, undoing, etc.
Selections to be used for the tracklist's current selections, copying, undoing, etc.
Current TimelineArranger selections.
YAML utils.