Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
timeline_selections.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: © 2019-2022 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
10#ifndef __GUI_BACKEND_TL_SELECTIONS_H__
11#define __GUI_BACKEND_TL_SELECTIONS_H__
12
13#include "dsp/marker.h"
14#include "dsp/midi_region.h"
15#include "dsp/region.h"
16#include "dsp/scale_object.h"
18
25#define TL_SELECTIONS (PROJECT->timeline_selections)
26
33typedef struct TimelineSelections
34{
37
40 int num_regions;
41 size_t regions_size;
42
43 ScaleObject ** scale_objects;
44 int num_scale_objects;
45 size_t scale_objects_size;
46
47 Marker ** markers;
48 int num_markers;
49 size_t markers_size;
50
53
56
60
72 Position * start_pos,
73 Position * end_pos,
74 bool clone_objs);
75
79Track *
81
85Track *
87
94void
96
106int
109 Position * pos,
110 const int idx);
111
116void
118
124bool
126 TimelineSelections * self,
127 const int vis_at_diff);
128
136bool
138 TimelineSelections * self,
139 const int diff);
140
149bool
151 TimelineSelections * self,
152 const int vis_track_diff);
153
158void
160
161NONNULL bool
162timeline_selections_contains_only_regions (const TimelineSelections * self);
163
164NONNULL bool
165timeline_selections_contains_only_region_types (
166 const TimelineSelections * self,
167 RegionType types);
168
172NONNULL bool
174 const TimelineSelections * self,
175 const char * full_path,
176 int midi_version,
177 const bool export_full_regions,
178 const bool lanes_as_tracks);
179
180#define timeline_selections_move_w_action( \
181 sel, ticks, delta_tracks, delta_lanes, already_moved) \
182 arranger_selections_move_w_action ( \
183 sel, ticks, 0, 0, delta_tracks, delta_lanes, 0, already_moved)
184
185#define timeline_selections_duplicate_w_action( \
186 sel, ticks, delta_tracks, delta_lanes, already_moved) \
187 arranger_selections_duplicate_w_action ( \
188 sel, ticks, 0, 0, delta_tracks, delta_lanes, 0, already_moved)
189
194#endif
Marker related code.
A region in the timeline.
Scale object inside the chord Track in the TimelineArranger.
RegionType
Type of Region.
int timeline_selections_can_be_pasted(TimelineSelections *ts, Position *pos, const int idx)
Returns whether the selections can be pasted.
void timeline_selections_mark_for_bounce(TimelineSelections *ts, bool with_parents)
bool timeline_selections_move_regions_to_new_lanes(TimelineSelections *self, const int diff)
Move the selected Regions to new lanes.
Track * timeline_selections_get_first_track(TimelineSelections *ts)
Gets highest track in the selections.
void timeline_selections_set_index_in_prev_lane(TimelineSelections *self)
Sets the regions' ZRegion::index_in_prev_lane.
NONNULL bool timeline_selections_export_to_midi_file(const TimelineSelections *self, const char *full_path, int midi_version, const bool export_full_regions, const bool lanes_as_tracks)
Exports the selections to the given MIDI file.
Track * timeline_selections_get_last_track(TimelineSelections *ts)
Gets lowest track in the selections.
TimelineSelections * timeline_selections_new_for_range(Position *start_pos, Position *end_pos, bool clone_objs)
Creates a new TimelineSelections instance for the given range.
void timeline_selections_set_vis_track_indices(TimelineSelections *ts)
Replaces the track positions in each object with visible track indices starting from 0.
bool timeline_selections_move_regions_to_new_ats(TimelineSelections *self, const int vis_at_diff)
Move the selected regions to new automation tracks.
bool timeline_selections_move_regions_to_new_tracks(TimelineSelections *self, const int vis_track_diff)
Move the selected Regions to the new Track.
Common data structures and functions for *ArrangerSelections.
API for Region's specific to instrument Track's.
Marker for the MarkerTrack.
Definition marker.h:49
A Position is made up of bars.beats.sixteenths.ticks.
Definition position.h:126
A ScaleObject to be shown in the TimelineArrangerWidget.
Selections to be used for the timeline's current selections, copying, undoing, etc.
int chord_track_vis_index
Visible track index, used during copying.
int marker_track_vis_index
Visible track index, used during copying.
ArrangerSelections base
Base struct.
ZRegion ** regions
Selected TrackLane Region's.
int region_track_vis_index
Visible track index, used during copying.
Track to be inserted into the Project's Tracklist.
Definition track.h:177
A region (clip) is an object on the timeline that contains either MidiNote's or AudioClip's.
Definition region.h:72