Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
track.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: © 2018-2022 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
10#ifndef __AUDIO_TRACK_H__
11#define __AUDIO_TRACK_H__
12
14#include "dsp/channel.h"
15#include "dsp/chord_object.h"
16#include "dsp/marker.h"
18#include "dsp/region.h"
19#include "dsp/scale.h"
20#include "dsp/scale_object.h"
21#include "dsp/track_lane.h"
22#include "dsp/track_processor.h"
23#include "plugins/plugin.h"
24#include "utils/yaml.h"
25
26#include <glib/gi18n.h>
27
29typedef struct ZRegion ZRegion;
30typedef struct Position Position;
31typedef struct _TrackWidget TrackWidget;
32typedef struct _FolderChannelWidget FolderChannelWidget;
33typedef struct Channel Channel;
34typedef struct MidiEvents MidiEvents;
35typedef struct AutomationTrack AutomationTrack;
36typedef struct Automatable Automatable;
37typedef struct AutomationPoint AutomationPoint;
38typedef struct ChordObject ChordObject;
39typedef struct MusicalScale MusicalScale;
40typedef struct Modulator Modulator;
41typedef struct Marker Marker;
43typedef struct Tracklist Tracklist;
44typedef struct SupportedFile SupportedFile;
46typedef enum PassthroughProcessorType PassthroughProcessorType;
47typedef enum FaderType FaderType;
48typedef void MIDI_FILE;
49typedef struct _WrappedObjectWithChangeSignal WrappedObjectWithChangeSignal;
50
51TYPEDEF_STRUCT_UNDERSCORED (FileImportInfo);
52
59#define TRACK_MIN_HEIGHT 24
60#define TRACK_DEF_HEIGHT 48
61
62#define TRACK_MAGIC 21890135
63#define IS_TRACK(x) (((Track *) x)->magic == TRACK_MAGIC)
64#define IS_TRACK_AND_NONNULL(x) (x && IS_TRACK (x))
65
66#define TRACK_MAX_MODULATOR_MACROS 128
67
68#define TRACK_DND_PREFIX Z_DND_STRING_PREFIX "Track::"
69
70#define track_is_in_active_project(self) \
71 (self->tracklist && tracklist_is_in_active_project (self->tracklist))
72
75#define track_is_auditioner(self) \
76 (self->tracklist && tracklist_is_auditioner (self->tracklist))
77
161
162static const char * track_type_strings[] = {
163 N_ ("Instrument"), N_ ("Audio"), N_ ("Master"), N_ ("Chord"),
164 N_ ("Marker"), N_ ("Tempo"), N_ ("Modulator"), N_ ("Audio FX"),
165 N_ ("Audio Group"), N_ ("MIDI"), N_ ("MIDI FX"), N_ ("MIDI Group"),
166 N_ ("Folder"),
167};
168
176typedef struct Track
177{
184 int pos;
185
188
190 char * name;
191
193 unsigned int name_hash;
194
196 char * icon_name;
197
203
208
211
214
217
221
224
227
237
245
251 GdkRGBA color;
252
253 /* ==== INSTRUMENT/MIDI/AUDIO TRACK ==== */
254
257 int num_lanes;
258 size_t lanes_size;
259
262 int num_lane_snapshots;
263
265 uint8_t midi_ch;
266
274
283
292
302
312
322
326
327 /* ==== INSTRUMENT/MIDI/AUDIO TRACK END ==== */
328
329 /* ==== AUDIO TRACK ==== */
330
333
334 /* ==== AUDIO TRACK END ==== */
335
336 /* ==== CHORD TRACK ==== */
337
344 int num_chord_regions;
345 size_t chord_regions_size;
346
349 int num_chord_region_snapshots;
350
357 int num_scales;
358 size_t scales_size;
359
362 int num_scale_snapshots;
363
364 /* ==== CHORD TRACK END ==== */
365
366 /* ==== MARKER TRACK ==== */
367
368 Marker ** markers;
369 int num_markers;
370 size_t markers_size;
371
374 int num_marker_snapshots;
375
376 /* ==== MARKER TRACK END ==== */
377
378 /* ==== TEMPO TRACK ==== */
379
382
385
388
389 /* ==== TEMPO TRACK END ==== */
390
391 /* ==== FOLDABLE TRACK ==== */
392
398 int size;
399
401 bool folded;
402
403 /* ==== FOLDABLE TRACK END ==== */
404
405 /* ==== MODULATOR TRACK ==== */
406
409 int num_modulators;
410 size_t modulators_size;
411
413 ModulatorMacroProcessor * modulator_macros[TRACK_MAX_MODULATOR_MACROS];
414 int num_modulator_macros;
415 int num_visible_modulator_macros;
416
417 /* ==== MODULATOR TRACK END ==== */
418
419 /* ==== CHANNEL TRACK ==== */
420
423
424 /* ==== CHANNEL TRACK END ==== */
425
433
434 AutomationTracklist automation_tracklist;
435
445
451
457
459 char * comment;
460
467 bool bounce;
468
474
481 unsigned int * children;
482 int num_children;
483 size_t children_size;
484
486 bool frozen;
487
490
491 int magic;
492
495
498
501
514
517
520} Track;
521
522COLD NONNULL_ARGS (1) void track_init_loaded (
523 Track * self,
524 Tracklist * tracklist,
526
535void
536track_init (Track * self, const int add_lane);
537
548Track *
549track_new (TrackType type, int pos, const char * label, const int with_lane);
550
556NONNULL_ARGS (1) Track * track_clone (Track * track, GError ** error);
557
562bool
564
565static inline bool
566track_type_can_have_direct_out (TrackType type)
567{
568 return type != TRACK_TYPE_MASTER;
569}
570
571static inline bool
572track_type_can_have_region_type (TrackType type, RegionType region_type)
573{
574 switch (region_type)
575 {
576 case REGION_TYPE_AUDIO:
577 return type == TRACK_TYPE_AUDIO;
578 case REGION_TYPE_MIDI:
579 return type == TRACK_TYPE_MIDI || type == TRACK_TYPE_INSTRUMENT;
580 case REGION_TYPE_CHORD:
581 return type == TRACK_TYPE_CHORD;
582 case REGION_TYPE_AUTOMATION:
583 return true;
584 }
585
586 g_return_val_if_reached (false);
587}
588
589static inline bool
590track_type_is_foldable (TrackType type)
591{
592 return type == TRACK_TYPE_FOLDER || type == TRACK_TYPE_MIDI_GROUP
593 || type == TRACK_TYPE_AUDIO_GROUP;
594}
595
596static inline bool
597track_type_is_copyable (TrackType type)
598{
599 return type != TRACK_TYPE_MASTER && type != TRACK_TYPE_TEMPO
600 && type != TRACK_TYPE_CHORD && type != TRACK_TYPE_MODULATOR
601 && type != TRACK_TYPE_MARKER;
602}
603
607NONNULL void
609
610#define track_get_name_hash(self) g_str_hash (self->name)
611
616NONNULL void
618 Track * track,
619 bool mute,
620 bool trigger_undo,
621 bool auto_select,
622 bool fire_events);
623
628NONNULL void
630 Track * self,
631 bool folded,
632 bool trigger_undo,
633 bool auto_select,
634 bool fire_events);
635
636NONNULL TrackType
637track_get_type_from_plugin_descriptor (PluginDescriptor * descr);
638
643NONNULL bool
645
646NONNULL Tracklist *
647track_get_tracklist (Track * self);
648
655NONNULL bool
657
665NONNULL double
667
668bool
669track_multiply_heights (
670 Track * self,
671 double multiplier,
672 bool visible_only,
673 bool check_only);
674
678HOT NONNULL bool
680
686NONNULL bool
688
692NONNULL bool
694
698NONNULL bool
700
704NONNULL bool
706
710NONNULL void
712 Track * self,
713 bool monitor,
714 bool auto_select,
715 bool fire_events);
716
728NONNULL void
730 Track * self,
731 bool listen,
732 bool trigger_undo,
733 bool auto_select,
734 bool fire_events);
735
736HOT NONNULL bool
737track_get_recording (const Track * const track);
738
743NONNULL void
744track_set_recording (Track * track, bool recording, bool fire_events);
745
757NONNULL void
759 Track * self,
760 bool solo,
761 bool trigger_undo,
762 bool auto_select,
763 bool fire_events);
764
768NONNULL bool
769track_has_soloed_lanes (const Track * const self);
770
774NONNULL int
776
780#define track_is_pinned(x) (x->pos < TRACKLIST->pinned_tracks_cutoff)
781
797#define track_add_region( \
798 self, region, at, lane_pos, gen_name, fire_events, error) \
799 track_insert_region ( \
800 self, region, at, lane_pos, -1, gen_name, fire_events, error)
801
822bool
824 Track * track,
825 ZRegion * region,
826 AutomationTrack * at,
827 int lane_pos,
828 int idx,
829 int gen_name,
830 int fire_events,
831 GError ** error);
832
843NONNULL_ARGS (1, 2)
845 const Track * self,
846 MIDI_FILE * mf,
847 MidiEvents * events,
848 const Position * start,
849 const Position * end,
850 bool lanes_as_tracks,
851 bool use_track_pos);
852
860NONNULL void
861track_select (Track * self, bool select, bool exclusive, bool fire_events);
862
866NONNULL void
868
869NONNULL bool
870track_contains_uninstantiated_plugin (const Track * const self);
871
875NONNULL void
877
883NONNULL void
884track_remove_region (Track * self, ZRegion * region, bool fire_events, bool free);
885
897void
899 const Track * self,
900 const EngineProcessTimeInfo * const time_nfo,
901 MidiEvents * midi_events,
902 StereoPorts * stereo_ports);
903
910bool
912
920void
921track_add_folder_parents (const Track * self, GPtrArray * parents, bool prepend);
922
926Track *
928
934void
936
944ZRegion *
946 const Track * track,
947 const Position * pos,
948 bool include_region_end);
949
954ZRegion *
956
960void
961track_set_lanes_visible (Track * track, const int visible);
962
966void
967track_set_automation_visible (Track * track, const bool visible);
968
973int
975
976static inline bool
977track_type_has_mono_compat_switch (const TrackType tt)
978{
979 return tt == TRACK_TYPE_AUDIO_GROUP || tt == TRACK_TYPE_MASTER;
980}
981
982#define track_type_is_audio_group track_type_has_mono_compat_switch
983
984static inline bool
985track_type_is_fx (const TrackType type)
986{
987 return type == TRACK_TYPE_AUDIO_BUS || type == TRACK_TYPE_MIDI_BUS;
988}
989
993static inline int
994track_type_can_record (const TrackType type)
995{
996 return type == TRACK_TYPE_AUDIO || type == TRACK_TYPE_MIDI
997 || type == TRACK_TYPE_CHORD || type == TRACK_TYPE_INSTRUMENT;
998}
999
1006void
1008
1012void
1014
1019static inline AutomationTracklist *
1020track_get_automation_tracklist (Track * const track)
1021{
1022 g_return_val_if_fail (IS_TRACK (track), NULL);
1023
1024 switch (track->type)
1025 {
1026 case TRACK_TYPE_MARKER:
1027 case TRACK_TYPE_FOLDER:
1028 break;
1029 case TRACK_TYPE_CHORD:
1035 case TRACK_TYPE_AUDIO:
1036 case TRACK_TYPE_MASTER:
1037 case TRACK_TYPE_MIDI:
1038 case TRACK_TYPE_TEMPO:
1040 return &track->automation_tracklist;
1041 default:
1042 g_warn_if_reached ();
1043 break;
1044 }
1045
1046 return NULL;
1047}
1048
1053NONNULL static inline Channel *
1054track_get_channel (const Track * const track)
1055{
1056 switch (track->type)
1057 {
1058 case TRACK_TYPE_MASTER:
1060 case TRACK_TYPE_AUDIO:
1065 case TRACK_TYPE_MIDI:
1066 case TRACK_TYPE_CHORD:
1067 return track->channel;
1068 default:
1069 return NULL;
1070 }
1071}
1072
1078void
1080
1084CONST
1085static inline bool
1086track_type_has_piano_roll (const TrackType type)
1087{
1088 return type == TRACK_TYPE_MIDI || type == TRACK_TYPE_INSTRUMENT;
1089}
1090
1095static inline int
1096track_has_inputs (const Track * track)
1097{
1098 return track->type == TRACK_TYPE_MIDI || track->type == TRACK_TYPE_INSTRUMENT
1099 || track->type == TRACK_TYPE_AUDIO;
1100}
1101
1102Track *
1103track_find_by_name (const char * name);
1104
1113void
1115 const Track * track,
1116 const Position * start_pos,
1117 const Position * end_pos,
1118 Velocity *** velocities,
1119 int * num_velocities,
1120 size_t * velocities_size,
1121 int inside);
1122
1126const char *
1128
1133NONNULL bool
1134track_set_name_with_action_full (Track * track, const char * name);
1135
1140void
1141track_set_name_with_action (Track * track, const char * name);
1142
1151void
1152track_set_name (Track * self, const char * name, bool pub_events);
1153
1158char *
1159track_get_unique_name (Track * track_to_skip, const char * name);
1160
1167Track *
1168track_get_from_name (const char * name);
1169
1170const char *
1171track_stringize_type (TrackType type);
1172
1177static inline int
1178track_type_is_compatible_for_moving (const TrackType type1, const TrackType type2)
1179{
1180 return type1 == type2
1181 || (type1 == TRACK_TYPE_MIDI && type2 == TRACK_TYPE_INSTRUMENT)
1182 || (type1 == TRACK_TYPE_INSTRUMENT && type2 == TRACK_TYPE_MIDI);
1183}
1184
1193void
1194track_update_positions (Track * self, bool from_ticks, bool bpm_change);
1195
1202Fader *
1203track_get_fader (Track * track, bool post_fader);
1204
1211
1218
1224bool
1225track_create_missing_lanes (Track * self, const int pos);
1226
1231void
1233
1241int
1243 Track * self,
1244 Position * p1,
1245 Position * p2,
1246 ZRegion ** regions);
1247
1253int
1254track_get_plugins (const Track * const self, GPtrArray * arr);
1255
1256void
1257track_activate_all_plugins (Track * track, bool activate);
1258
1264void
1265track_comment_setter (void * track, const char * comment);
1266
1270void
1271track_set_comment (Track * self, const char * comment, bool undoable);
1272
1276const char *
1277track_get_comment (void * track);
1278
1282void
1284 Track * self,
1285 const GdkRGBA * color,
1286 bool undoable,
1287 bool fire_events);
1288
1292void
1294 Track * self,
1295 const char * icon_name,
1296 bool undoable,
1297 bool fire_events);
1298
1305Plugin *
1306track_get_plugin_at_slot (Track * track, ZPluginSlotType slot_type, int slot);
1307
1319void
1321 Track * self,
1322 bool bounce,
1323 bool mark_regions,
1324 bool mark_children,
1325 bool mark_parents);
1326
1331void
1332track_append_ports (Track * self, GPtrArray * ports, bool include_plugins);
1333
1347bool
1348track_freeze (Track * self, bool freeze, GError ** error);
1349
1357void
1359 Track * self,
1360 Plugin * pl,
1361 ZPluginSlotType slot_type,
1362 int slot,
1363 bool instantiate_plugin,
1364 bool replacing_plugin,
1365 bool moving_plugin,
1366 bool confirm,
1367 bool gen_automatables,
1368 bool recalc_graph,
1369 bool fire_events);
1370
1375void
1377 Track * self,
1378 ZPluginSlotType slot_type,
1379 int slot,
1380 bool replacing_plugin,
1381 bool moving_plugin,
1382 bool deleting_plugin,
1383 bool deleting_track,
1384 bool recalc_graph);
1385
1396void
1397track_disconnect (Track * self, bool remove_pl, bool recalc_graph);
1398
1399NONNULL bool
1400track_is_enabled (Track * self);
1401
1402NONNULL void
1403track_set_enabled (
1404 Track * self,
1405 bool enabled,
1406 bool trigger_undo,
1407 bool auto_select,
1408 bool fire_events);
1409
1410static inline const char *
1411track_type_to_string (TrackType type)
1412{
1413 return track_type_strings[type];
1414}
1415
1417track_type_get_from_string (const char * str);
1418
1419void
1420track_get_total_bars (Track * self, int * total_bars);
1421
1426void
1427track_set_caches (Track * self, CacheTypes types);
1428
1433typedef void (*TracksReadyCallback) (const FileImportInfo *, const GError *);
1434
1440bool
1442 TrackType type,
1443 const PluginSetting * pl_setting,
1444 const SupportedFile * file_descr,
1445 const Position * pos,
1446 int index,
1447 int num_tracks,
1448 int disable_track_idx,
1449 TracksReadyCallback ready_cb,
1450 GError ** error);
1451
1452Track *
1453track_create_empty_at_idx_with_action (TrackType type, int index, GError ** error);
1454
1455Track *
1456track_create_for_plugin_at_idx_w_action (
1457 TrackType type,
1458 const PluginSetting * pl_setting,
1459 int index,
1460 GError ** error);
1461
1466#define track_create_empty_with_action(type, error) \
1467 track_create_empty_at_idx_with_action (type, TRACKLIST->num_tracks, error)
1468
1469GMenu *
1470track_generate_edit_context_menu (Track * track, int num_selected);
1471
1476GMenu *
1478
1482void
1484
1489#endif // __AUDIO_TRACK_H__
Automation tracklist containing automation points and curves.
API for Channel, representing a channel strip on the mixer.
Chord object in the TimelineArranger.
Marker related code.
A region in the timeline.
Scale object inside the chord Track in the TimelineArranger.
NONNULL_ARGS(1) int undo_manager_undo(UndoManager *self
Undo last action.
NONNULL bool track_get_listened(Track *self)
Returns if the track is listened.
NONNULL void track_set_monitor_audio(Track *self, bool monitor, bool auto_select, bool fire_events)
Sets whether monitor audio is on.
ZRegion * track_get_last_region(Track *track)
Returns the last ZRegion in the track, or NULL.
NONNULL void track_remove_region(Track *self, ZRegion *region, bool fire_events, bool free)
Only removes the region from the track.
void(* TracksReadyCallback)(const FileImportInfo *, const GError *)
Called when track(s) are actually imported into the project.
Definition track.h:1433
GMenu * track_generate_channel_context_menu(Track *track)
Generates a menu to be used for channel-related items, eg, fader buttons, direct out,...
void track_remove_plugin(Track *self, ZPluginSlotType slot_type, int slot, bool replacing_plugin, bool moving_plugin, bool deleting_plugin, bool deleting_track, bool recalc_graph)
Wrapper over channel_remove_plugin() and modulator_track_remove_modulator().
FaderType
Fader type.
Definition fader.h:67
bool track_create_with_action(TrackType type, const PluginSetting *pl_setting, const SupportedFile *file_descr, const Position *pos, int index, int num_tracks, int disable_track_idx, TracksReadyCallback ready_cb, GError **error)
NONNULL int track_is_selected(Track *self)
Returns if Track is in TracklistSelections.
void track_disconnect(Track *self, bool remove_pl, bool recalc_graph)
Disconnects the track from the processing chain.
void track_append_ports(Track *self, GPtrArray *ports, bool include_plugins)
Appends all channel ports and optionally plugin ports to the array.
bool track_freeze(Track *self, bool freeze, GError **error)
Freezes or unfreezes the track.
Track * track_get_direct_folder_parent(Track *track)
Returns the closest foldable parent or NULL.
Plugin * track_get_plugin_at_slot(Track *track, ZPluginSlotType slot_type, int slot)
Returns the plugin at the given slot, if any.
const char * track_get_name(Track *track)
Getter for the track name.
void track_add_folder_parents(const Track *self, GPtrArray *parents, bool prepend)
Adds the track's folder parents to the given array.
int track_get_plugins(const Track *const self, GPtrArray *arr)
Fills in the given array (if non-NULL) with all plugins in the track and returns the number of plugin...
Fader * track_get_fader(Track *track, bool post_fader)
Returns the Fader (if applicable).
void track_update_children(Track *self)
Updates the track's children.
void track_write_to_midi_file(const Track *self, MIDI_FILE *mf, MidiEvents *events, const Position *start, const Position *end, bool lanes_as_tracks, bool use_track_pos)
Writes the track to the given MIDI file.
HOT NONNULL bool track_get_soloed(Track *self)
Returns if the track is soloed.
ZPortType
Type of signals the Port handles.
bool track_type_has_channel(TrackType type)
Returns if the given TrackType is a type of Track that has a Channel.
void track_set_lanes_visible(Track *track, const int visible)
Set track lanes visible and fire events.
void track_get_velocities_in_range(const Track *track, const Position *start_pos, const Position *end_pos, Velocity ***velocities, int *num_velocities, size_t *velocities_size, int inside)
Fills in the array with all the velocities in the project that are within or outside the range given.
bool track_create_missing_lanes(Track *self, const int pos)
Creates missing TrackLane's until pos.
NONNULL bool track_set_name_with_action_full(Track *track, const char *name)
Internally called by track_set_name_with_action().
ZRegion * track_get_region_at_pos(const Track *track, const Position *pos, bool include_region_end)
Returns the region at the given position, or NULL.
void track_mark_for_bounce(Track *self, bool bounce, bool mark_regions, bool mark_children, bool mark_parents)
Marks the track for bouncing.
void track_set_color(Track *self, const GdkRGBA *color, bool undoable, bool fire_events)
Sets the track color.
FaderType track_type_get_prefader_type(TrackType type)
Returns the prefader type corresponding to the given Track.
void track_update_positions(Track *self, bool from_ticks, bool bpm_change)
Updates the frames/ticks of each position in each child of the track recursively.
void track_remove_from_folder_parents(Track *self)
Remove the track from all folders.
NONNULL void track_set_muted(Track *track, bool mute, bool trigger_undo, bool auto_select, bool fire_events)
Sets track muted and optionally adds the action to the undo stack.
void track_insert_plugin(Track *self, Plugin *pl, ZPluginSlotType slot_type, int slot, bool instantiate_plugin, bool replacing_plugin, bool moving_plugin, bool confirm, bool gen_automatables, bool recalc_graph, bool fire_events)
Wrapper over channel_add_plugin() and modulator_track_insert_modulator().
void track_fill_events(const Track *self, const EngineProcessTimeInfo *const time_nfo, MidiEvents *midi_events, StereoPorts *stereo_ports)
Wrapper for audio and MIDI/instrument tracks to fill in MidiEvents or StereoPorts from the timeline d...
FaderType track_get_fader_type(const Track *track)
Returns the FaderType corresponding to the given Track.
NONNULL double track_get_full_visible_height(Track *const self)
Returns the full visible height (main height + height of all visible automation tracks + height of al...
void track_remove_empty_last_lanes(Track *self)
Removes the empty last lanes of the Track (except the last one).
void track_set_name(Track *self, const char *name, bool pub_events)
Setter for the track name.
void track_setup(Track *track)
Wrapper.
void track_generate_automation_tracks(Track *track)
Generates automatables for the track.
NONNULL void track_unselect_all(Track *self)
Unselects all arranger objects in the track.
int track_type_can_host_region_type(const TrackType tt, const RegionType rt)
Returns if the given TrackType can host the given RegionType.
void track_set_caches(Track *self, CacheTypes types)
Set various caches (snapshots, track name hash, plugin input/output ports, etc).
NONNULL void track_set_magic(Track *self)
Sets magic on objects recursively.
bool track_validate(Track *self)
Verifies the identifiers on a live Track (in the project, not a clone).
void track_set_name_with_action(Track *track, const char *name)
Setter to be used by the UI to create an undoable action.
NONNULL void track_set_listened(Track *self, bool listen, bool trigger_undo, bool auto_select, bool fire_events)
Sets track soloed, updates UI and optionally adds the action to the undo stack.
bool track_insert_region(Track *track, ZRegion *region, AutomationTrack *at, int lane_pos, int idx, int gen_name, int fire_events, GError **error)
Inserts a ZRegion to the given lane or AutomationTrack of the track, at the given index.
void track_free(Track *track)
Wrapper for each track type.
char * track_get_unique_name(Track *track_to_skip, const char *name)
Returns a unique name for a new track based on the given name.
void track_init(Track *self, const int add_lane)
Inits the Track, optionally adding a single lane.
const char * track_get_comment(void *track)
Comment getter.
NONNULL void track_clear(Track *self)
Removes all objects recursively from the track.
RegionType
Type of Region.
NONNULL bool track_get_monitor_audio(Track *self)
Returns whether monitor audio is on.
NONNULL void track_set_folded(Track *self, bool folded, bool trigger_undo, bool auto_select, bool fire_events)
Sets track folded and optionally adds the action to the undo stack.
NONNULL bool track_get_implied_soloed(Track *self)
Returns whether the track is not soloed on its own but its direct out (or its direct out's direct out...
int track_get_regions_in_range(Track *self, Position *p1, Position *p2, ZRegion **regions)
Returns all the regions inside the given range, or all the regions if both p1 and p2 are NULL.
NONNULL bool track_has_soloed_lanes(const Track *const self)
Returns whether the track has any soloed lanes.
void track_set_icon(Track *self, const char *icon_name, bool undoable, bool fire_events)
Sets the track icon.
void track_set_automation_visible(Track *track, const bool visible)
Set automation visible and fire events.
NONNULL void track_set_recording(Track *track, bool recording, bool fire_events)
Sets recording and connects/disconnects the JACK ports.
Track * track_get_from_name(const char *name)
Returns the Track from the Project matching name.
NONNULL bool track_get_should_be_visible(const Track *self)
Returns whether the track should be visible.
NONNULL void track_select(Track *self, bool select, bool exclusive, bool fire_events)
Appends the Track to the selections.
TrackType
The Track's type.
Definition track.h:82
void track_set_comment(Track *self, const char *comment, bool undoable)
NONNULL bool track_type_is_deletable(TrackType type)
Returns whether the track type is deletable by the user.
NONNULL void track_set_soloed(Track *self, bool solo, bool trigger_undo, bool auto_select, bool fire_events)
Sets track soloed, updates UI and optionally adds the action to the undo stack.
Track * track_new(TrackType type, int pos, const char *label, const int with_lane)
Creates a track with the given label and returns it.
void track_comment_setter(void *track, const char *comment)
Comment setter.
NONNULL bool track_get_muted(Track *self)
Returns if the track is muted.
@ TRACK_TYPE_INSTRUMENT
Instrument tracks must have an Instrument plugin at the first slot and they produce audio output.
Definition track.h:88
@ TRACK_TYPE_MIDI_BUS
Same with audio bus but for MIDI signals.
Definition track.h:153
@ TRACK_TYPE_MODULATOR
Special track to contain global Modulator's.
Definition track.h:125
@ TRACK_TYPE_AUDIO_BUS
Buses are channels that receive audio input and have effects on their channel strip.
Definition track.h:134
@ TRACK_TYPE_CHORD
The chord track contains chords that can be used to modify midi in real time or to color the piano ro...
Definition track.h:108
@ TRACK_TYPE_AUDIO_GROUP
Group Tracks are used for grouping audio signals, for example routing multiple drum tracks to a "Drum...
Definition track.h:143
@ TRACK_TYPE_AUDIO
Audio tracks can record and contain audio clips.
Definition track.h:95
@ TRACK_TYPE_FOLDER
Foldable track used for visual grouping.
Definition track.h:159
@ TRACK_TYPE_MASTER
The master track is a special type of group track.
Definition track.h:101
@ TRACK_TYPE_MARKER
Marker Track's contain named markers at specific Position's in the song.
Definition track.h:114
@ TRACK_TYPE_MIDI
Midi tracks can only have MIDI effects in the strip and produce MIDI output that can be routed to ins...
Definition track.h:150
@ TRACK_TYPE_MIDI_GROUP
Same with audio group but for MIDI signals.
Definition track.h:156
@ TRACK_TYPE_TEMPO
Special track for BPM (tempo) and time signature events.
Definition track.h:120
ZPluginSlotType
Modulator macro button processor.
Base plugin.
Musical scales.
An automation point inside an AutomationTrack.
Each track has an automation tracklist with automation tracks to be generated at runtime,...
A Channel is part of a Track (excluding Tracks that don't have Channels) and contains information rel...
Definition channel.h:61
A ChordObject to be shown in the TimelineArrangerWidget.
Common struct to pass around during processing to avoid repeating the data in function arguments.
Definition types.h:138
A Fader is a processor that is used for volume controls and pan.
Definition fader.h:102
Marker for the MarkerTrack.
Definition marker.h:49
Container for passing midi events through ports.
Definition midi_event.h:68
Modulator macro button processor.
Musical scale descriptor.
Definition scale.h:132
A setting for a specific plugin descriptor.
The base plugin Inheriting plugins must have this as a child.
Definition plugin.h:74
Must ONLY be created via port_new()
Definition port.h:139
A Position is made up of bars.beats.sixteenths.ticks.
Definition position.h:126
A ScaleObject to be shown in the TimelineArrangerWidget.
L & R port, for convenience.
Definition port.h:505
Stretcher interface.
Definition stretcher.h:44
Metadata for a supported file.
A TrackLane belongs to a Track (can have many TrackLanes in a Track) and contains Regions.
Definition track_lane.h:41
A TrackProcessor is a processor that is used as the first entry point when processing a track.
The TrackWidget is split into 3 parts.
Definition track.h:109
Track to be inserted into the Project's Tracklist.
Definition track.h:177
bool block_auto_creation_and_deletion
Block auto-creating or deleting lanes.
Definition track.h:516
bool frozen
Whether the track is currently frozen.
Definition track.h:486
bool drum_mode
Whether drum mode in the piano roll is enabled for this track.
Definition track.h:273
char * name
Track name, used in channel too.
Definition track.h:190
ZPortType in_signal_type
The input signal type (eg audio bus tracks have audio input signals).
Definition track.h:450
bool automation_visible
Flag to set automations visible or not.
Definition track.h:210
bool lanes_visible
Flag to set track lanes visible or not.
Definition track.h:213
bool record_set_automatically
Whether record was set automatically when the channel was selected.
Definition track.h:236
bool bounce
Set to ON during bouncing if this track should be included.
Definition track.h:467
WrappedObjectWithChangeSignal * gobj
Used in Gtk.
Definition track.h:519
ScaleObject ** scale_snapshots
Snapshots used during playback TODO unimplemented.
Definition track.h:361
bool recording_paused
This must only be set by the RecordingManager when temporarily pausing recording, eg when looping or ...
Definition track.h:321
unsigned int * children
Name hashes of tracks that are routed to this track, if group track.
Definition track.h:481
Plugin ** modulators
Modulators.
Definition track.h:408
unsigned int name_hash
Cache calculated when adding to graph.
Definition track.h:193
Port * beats_per_bar_port
Automatable beats per bar port.
Definition track.h:384
char * comment
User comments.
Definition track.h:459
Port * recording
Recording or not.
Definition track.h:226
int last_lane_idx
Lane index of region before recording paused.
Definition track.h:325
GdkRGBA color
Track color.
Definition track.h:251
bool disconnecting
Whether currently disconnecting.
Definition track.h:494
bool trigger_midi_activity
Flag to tell the UI that this channel had MIDI activity.
Definition track.h:444
Port * bpm_port
Automatable BPM control.
Definition track.h:381
Stretcher * rt_stretcher
Real-time time stretcher.
Definition track.h:332
double main_height
Height of the main part (without lanes).
Definition track.h:223
uint8_t midi_ch
MIDI channel (MIDI/Instrument track only).
Definition track.h:265
TrackType type
The type of track this is.
Definition track.h:187
char * icon_name
Icon name of the track.
Definition track.h:196
TrackProcessor * processor
The TrackProcessor, used for processing.
Definition track.h:432
int size
Number of tracks inside this track.
Definition track.h:398
Marker ** marker_snapshots
Snapshots used during playback TODO unimplemented.
Definition track.h:373
bool bounce_to_master
Whether to temporarily route the output to master (e.g., when bouncing the track on its own without i...
Definition track.h:473
TrackLane ** lanes
Lanes in this track containing Regions.
Definition track.h:256
int pos
Position in the Tracklist.
Definition track.h:184
ZPortType out_signal_type
The output signal type (eg midi tracks have MIDI output signals).
Definition track.h:456
Port * beat_unit_port
Automatable beat unit port.
Definition track.h:387
Tracklist * tracklist
Pointer to owner tracklist, if any.
Definition track.h:497
bool folded
Whether currently folded.
Definition track.h:401
bool recording_stop_sent
This is a flag to let the recording manager know that a STOP signal was already sent for recording.
Definition track.h:311
ZRegion ** chord_regions
ChordObject's.
Definition track.h:343
ZRegion ** chord_region_snapshots
Snapshots used during playback.
Definition track.h:348
ScaleObject ** scales
ScaleObject's.
Definition track.h:356
bool recording_start_sent
This is a flag to let the recording manager know that a START signal was already sent for recording.
Definition track.h:301
ZRegion * recording_region
ZRegion currently recording on.
Definition track.h:291
bool visible
Whole Track is visible or not.
Definition track.h:216
TrackWidget * widget
Track Widget created dynamically.
Definition track.h:202
int pool_id
Pool ID of the clip if track is frozen.
Definition track.h:489
TrackLane ** lane_snapshots
Snapshots used during playback.
Definition track.h:261
bool enabled
Active (enabled) or not.
Definition track.h:244
TracklistSelections * ts
Pointer to owner tracklist selections, if any.
Definition track.h:500
FolderChannelWidget * folder_ch_widget
Widget used for foldable tracks in the mixer.
Definition track.h:207
ModulatorMacroProcessor * modulator_macros[TRACK_MAX_MODULATOR_MACROS]
Modulator macros.
Definition track.h:413
bool filtered
Track will be hidden if true (temporary and not serializable).
Definition track.h:220
Channel * channel
1 Track has 0 or 1 Channel.
Definition track.h:422
int passthrough_midi_input
If set to 1, the input received will not be changed to the selected MIDI channel.
Definition track.h:282
int last_lane_created
Last lane created during this drag.
Definition track.h:513
Selections to be used for the tracklist's current selections, copying, undoing, etc.
The Tracklist contains all the tracks in the Project.
Definition tracklist.h:61
The MidiNote velocity.
Definition velocity.h:41
A GObject-ified normal C object with a signal that interested parties can listen to for changes.
A region (clip) is an object on the timeline that contains either MidiNote's or AudioClip's.
Definition region.h:72
Track lanes for each track.
Track processor.
YAML utils.