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 cyaml_strval_t track_type_strings[] = {
163 {N_ ("Instrument"), TRACK_TYPE_INSTRUMENT },
164 { N_ ("Audio"), TRACK_TYPE_AUDIO },
165 { N_ ("Master"), TRACK_TYPE_MASTER },
166 { N_ ("Chord"), TRACK_TYPE_CHORD },
167 { N_ ("Marker"), TRACK_TYPE_MARKER },
168 { N_ ("Tempo"), TRACK_TYPE_TEMPO },
169 { N_ ("Modulator"), TRACK_TYPE_MODULATOR },
170 { N_ ("Audio FX"), TRACK_TYPE_AUDIO_BUS },
171 { N_ ("Audio Group"), TRACK_TYPE_AUDIO_GROUP},
172 { N_ ("MIDI"), TRACK_TYPE_MIDI },
173 { N_ ("MIDI FX"), TRACK_TYPE_MIDI_BUS },
174 { N_ ("MIDI Group"), TRACK_TYPE_MIDI_GROUP },
175 { N_ ("Folder"), TRACK_TYPE_FOLDER },
176};
177
185typedef struct Track
186{
193 int pos;
194
197
199 char * name;
200
202 unsigned int name_hash;
203
205 char * icon_name;
206
212
217
220
223
226
230
233
236
246
254
260 GdkRGBA color;
261
262 /* ==== INSTRUMENT/MIDI/AUDIO TRACK ==== */
263
266 int num_lanes;
267 size_t lanes_size;
268
271 int num_lane_snapshots;
272
274 uint8_t midi_ch;
275
283
292
301
311
321
331
335
336 /* ==== INSTRUMENT/MIDI/AUDIO TRACK END ==== */
337
338 /* ==== AUDIO TRACK ==== */
339
342
343 /* ==== AUDIO TRACK END ==== */
344
345 /* ==== CHORD TRACK ==== */
346
353 int num_chord_regions;
354 size_t chord_regions_size;
355
358 int num_chord_region_snapshots;
359
366 int num_scales;
367 size_t scales_size;
368
371 int num_scale_snapshots;
372
373 /* ==== CHORD TRACK END ==== */
374
375 /* ==== MARKER TRACK ==== */
376
377 Marker ** markers;
378 int num_markers;
379 size_t markers_size;
380
383 int num_marker_snapshots;
384
385 /* ==== MARKER TRACK END ==== */
386
387 /* ==== TEMPO TRACK ==== */
388
391
394
397
398 /* ==== TEMPO TRACK END ==== */
399
400 /* ==== FOLDABLE TRACK ==== */
401
407 int size;
408
410 bool folded;
411
412 /* ==== FOLDABLE TRACK END ==== */
413
414 /* ==== MODULATOR TRACK ==== */
415
418 int num_modulators;
419 size_t modulators_size;
420
422 ModulatorMacroProcessor * modulator_macros[TRACK_MAX_MODULATOR_MACROS];
423 int num_modulator_macros;
424 int num_visible_modulator_macros;
425
426 /* ==== MODULATOR TRACK END ==== */
427
428 /* ==== CHANNEL TRACK ==== */
429
432
433 /* ==== CHANNEL TRACK END ==== */
434
442
443 AutomationTracklist automation_tracklist;
444
454
460
466
468 char * comment;
469
476 bool bounce;
477
483
490 unsigned int * children;
491 int num_children;
492 size_t children_size;
493
495 bool frozen;
496
499
500 int magic;
501
504
507
510
523
526
529} Track;
530
531COLD NONNULL_ARGS (1) void track_init_loaded (
532 Track * self,
533 Tracklist * tracklist,
535
544void
545track_init (Track * self, const int add_lane);
546
557Track *
558track_new (TrackType type, int pos, const char * label, const int with_lane);
559
565NONNULL_ARGS (1) Track * track_clone (Track * track, GError ** error);
566
571bool
573
574static inline bool
575track_type_can_have_direct_out (TrackType type)
576{
577 return type != TRACK_TYPE_MASTER;
578}
579
580static inline bool
581track_type_can_have_region_type (TrackType type, RegionType region_type)
582{
583 switch (region_type)
584 {
585 case REGION_TYPE_AUDIO:
586 return type == TRACK_TYPE_AUDIO;
587 case REGION_TYPE_MIDI:
588 return type == TRACK_TYPE_MIDI || type == TRACK_TYPE_INSTRUMENT;
589 case REGION_TYPE_CHORD:
590 return type == TRACK_TYPE_CHORD;
591 case REGION_TYPE_AUTOMATION:
592 return true;
593 }
594
595 g_return_val_if_reached (false);
596}
597
598static inline bool
599track_type_is_foldable (TrackType type)
600{
601 return type == TRACK_TYPE_FOLDER || type == TRACK_TYPE_MIDI_GROUP
602 || type == TRACK_TYPE_AUDIO_GROUP;
603}
604
605static inline bool
606track_type_is_copyable (TrackType type)
607{
608 return type != TRACK_TYPE_MASTER && type != TRACK_TYPE_TEMPO
609 && type != TRACK_TYPE_CHORD && type != TRACK_TYPE_MODULATOR
610 && type != TRACK_TYPE_MARKER;
611}
612
616NONNULL void
618
619#define track_get_name_hash(self) g_str_hash (self->name)
620
625NONNULL void
627 Track * track,
628 bool mute,
629 bool trigger_undo,
630 bool auto_select,
631 bool fire_events);
632
637NONNULL void
639 Track * self,
640 bool folded,
641 bool trigger_undo,
642 bool auto_select,
643 bool fire_events);
644
645NONNULL TrackType
646track_get_type_from_plugin_descriptor (PluginDescriptor * descr);
647
652NONNULL bool
654
655NONNULL Tracklist *
656track_get_tracklist (Track * self);
657
664NONNULL bool
666
674NONNULL double
676
677bool
678track_multiply_heights (
679 Track * self,
680 double multiplier,
681 bool visible_only,
682 bool check_only);
683
687HOT NONNULL bool
689
695NONNULL bool
697
701NONNULL bool
703
707NONNULL bool
709
713NONNULL bool
715
719NONNULL void
721 Track * self,
722 bool monitor,
723 bool auto_select,
724 bool fire_events);
725
737NONNULL void
739 Track * self,
740 bool listen,
741 bool trigger_undo,
742 bool auto_select,
743 bool fire_events);
744
745HOT NONNULL bool
746track_get_recording (const Track * const track);
747
752NONNULL void
753track_set_recording (Track * track, bool recording, bool fire_events);
754
766NONNULL void
768 Track * self,
769 bool solo,
770 bool trigger_undo,
771 bool auto_select,
772 bool fire_events);
773
777NONNULL bool
778track_has_soloed_lanes (const Track * const self);
779
783NONNULL int
785
789#define track_is_pinned(x) (x->pos < TRACKLIST->pinned_tracks_cutoff)
790
806#define track_add_region( \
807 self, region, at, lane_pos, gen_name, fire_events, error) \
808 track_insert_region ( \
809 self, region, at, lane_pos, -1, gen_name, fire_events, error)
810
831bool
833 Track * track,
834 ZRegion * region,
835 AutomationTrack * at,
836 int lane_pos,
837 int idx,
838 int gen_name,
839 int fire_events,
840 GError ** error);
841
852NONNULL_ARGS (1, 2)
854 const Track * self,
855 MIDI_FILE * mf,
856 MidiEvents * events,
857 const Position * start,
858 const Position * end,
859 bool lanes_as_tracks,
860 bool use_track_pos);
861
869NONNULL void
870track_select (Track * self, bool select, bool exclusive, bool fire_events);
871
875NONNULL void
877
878NONNULL bool
879track_contains_uninstantiated_plugin (const Track * const self);
880
884NONNULL void
886
892NONNULL void
893track_remove_region (Track * self, ZRegion * region, bool fire_events, bool free);
894
906void
908 const Track * self,
909 const EngineProcessTimeInfo * const time_nfo,
910 MidiEvents * midi_events,
911 StereoPorts * stereo_ports);
912
919bool
921
929void
930track_add_folder_parents (const Track * self, GPtrArray * parents, bool prepend);
931
935Track *
937
943void
945
953ZRegion *
955 const Track * track,
956 const Position * pos,
957 bool include_region_end);
958
963ZRegion *
965
969void
970track_set_lanes_visible (Track * track, const int visible);
971
975void
976track_set_automation_visible (Track * track, const bool visible);
977
982int
984
985static inline bool
986track_type_has_mono_compat_switch (const TrackType tt)
987{
988 return tt == TRACK_TYPE_AUDIO_GROUP || tt == TRACK_TYPE_MASTER;
989}
990
991#define track_type_is_audio_group track_type_has_mono_compat_switch
992
993static inline bool
994track_type_is_fx (const TrackType type)
995{
996 return type == TRACK_TYPE_AUDIO_BUS || type == TRACK_TYPE_MIDI_BUS;
997}
998
1002static inline int
1003track_type_can_record (const TrackType type)
1004{
1005 return type == TRACK_TYPE_AUDIO || type == TRACK_TYPE_MIDI
1006 || type == TRACK_TYPE_CHORD || type == TRACK_TYPE_INSTRUMENT;
1007}
1008
1015void
1017
1021void
1023
1028static inline AutomationTracklist *
1029track_get_automation_tracklist (Track * const track)
1030{
1031 g_return_val_if_fail (IS_TRACK (track), NULL);
1032
1033 switch (track->type)
1034 {
1035 case TRACK_TYPE_MARKER:
1036 case TRACK_TYPE_FOLDER:
1037 break;
1038 case TRACK_TYPE_CHORD:
1044 case TRACK_TYPE_AUDIO:
1045 case TRACK_TYPE_MASTER:
1046 case TRACK_TYPE_MIDI:
1047 case TRACK_TYPE_TEMPO:
1049 return &track->automation_tracklist;
1050 default:
1051 g_warn_if_reached ();
1052 break;
1053 }
1054
1055 return NULL;
1056}
1057
1062NONNULL static inline Channel *
1063track_get_channel (const Track * const track)
1064{
1065 switch (track->type)
1066 {
1067 case TRACK_TYPE_MASTER:
1069 case TRACK_TYPE_AUDIO:
1074 case TRACK_TYPE_MIDI:
1075 case TRACK_TYPE_CHORD:
1076 return track->channel;
1077 default:
1078 return NULL;
1079 }
1080}
1081
1087void
1089
1093CONST
1094static inline bool
1095track_type_has_piano_roll (const TrackType type)
1096{
1097 return type == TRACK_TYPE_MIDI || type == TRACK_TYPE_INSTRUMENT;
1098}
1099
1104static inline int
1105track_has_inputs (const Track * track)
1106{
1107 return track->type == TRACK_TYPE_MIDI || track->type == TRACK_TYPE_INSTRUMENT
1108 || track->type == TRACK_TYPE_AUDIO;
1109}
1110
1111Track *
1112track_find_by_name (const char * name);
1113
1122void
1124 const Track * track,
1125 const Position * start_pos,
1126 const Position * end_pos,
1127 Velocity *** velocities,
1128 int * num_velocities,
1129 size_t * velocities_size,
1130 int inside);
1131
1135const char *
1137
1142NONNULL bool
1143track_set_name_with_action_full (Track * track, const char * name);
1144
1149void
1150track_set_name_with_action (Track * track, const char * name);
1151
1160void
1161track_set_name (Track * self, const char * name, bool pub_events);
1162
1167char *
1168track_get_unique_name (Track * track_to_skip, const char * name);
1169
1176Track *
1177track_get_from_name (const char * name);
1178
1179const char *
1180track_stringize_type (TrackType type);
1181
1186static inline int
1187track_type_is_compatible_for_moving (const TrackType type1, const TrackType type2)
1188{
1189 return type1 == type2
1190 || (type1 == TRACK_TYPE_MIDI && type2 == TRACK_TYPE_INSTRUMENT)
1191 || (type1 == TRACK_TYPE_INSTRUMENT && type2 == TRACK_TYPE_MIDI);
1192}
1193
1202void
1203track_update_positions (Track * self, bool from_ticks, bool bpm_change);
1204
1211Fader *
1212track_get_fader (Track * track, bool post_fader);
1213
1220
1227
1233bool
1234track_create_missing_lanes (Track * self, const int pos);
1235
1240void
1242
1250int
1252 Track * self,
1253 Position * p1,
1254 Position * p2,
1255 ZRegion ** regions);
1256
1262int
1263track_get_plugins (const Track * const self, GPtrArray * arr);
1264
1265void
1266track_activate_all_plugins (Track * track, bool activate);
1267
1273void
1274track_comment_setter (void * track, const char * comment);
1275
1279void
1280track_set_comment (Track * self, const char * comment, bool undoable);
1281
1285const char *
1286track_get_comment (void * track);
1287
1291void
1293 Track * self,
1294 const GdkRGBA * color,
1295 bool undoable,
1296 bool fire_events);
1297
1301void
1303 Track * self,
1304 const char * icon_name,
1305 bool undoable,
1306 bool fire_events);
1307
1314Plugin *
1315track_get_plugin_at_slot (Track * track, PluginSlotType slot_type, int slot);
1316
1328void
1330 Track * self,
1331 bool bounce,
1332 bool mark_regions,
1333 bool mark_children,
1334 bool mark_parents);
1335
1340void
1341track_append_ports (Track * self, GPtrArray * ports, bool include_plugins);
1342
1356bool
1357track_freeze (Track * self, bool freeze, GError ** error);
1358
1366void
1368 Track * self,
1369 Plugin * pl,
1370 PluginSlotType slot_type,
1371 int slot,
1372 bool instantiate_plugin,
1373 bool replacing_plugin,
1374 bool moving_plugin,
1375 bool confirm,
1376 bool gen_automatables,
1377 bool recalc_graph,
1378 bool fire_events);
1379
1384void
1386 Track * self,
1387 PluginSlotType slot_type,
1388 int slot,
1389 bool replacing_plugin,
1390 bool moving_plugin,
1391 bool deleting_plugin,
1392 bool deleting_track,
1393 bool recalc_graph);
1394
1405void
1406track_disconnect (Track * self, bool remove_pl, bool recalc_graph);
1407
1408NONNULL bool
1409track_is_enabled (Track * self);
1410
1411NONNULL void
1412track_set_enabled (
1413 Track * self,
1414 bool enabled,
1415 bool trigger_undo,
1416 bool auto_select,
1417 bool fire_events);
1418
1419static inline const char *
1420track_type_to_string (TrackType type)
1421{
1422 return track_type_strings[type].str;
1423}
1424
1426track_type_get_from_string (const char * str);
1427
1428void
1429track_get_total_bars (Track * self, int * total_bars);
1430
1435void
1436track_set_caches (Track * self, CacheTypes types);
1437
1442typedef void (*TracksReadyCallback) (const FileImportInfo *, const GError *);
1443
1449bool
1451 TrackType type,
1452 const PluginSetting * pl_setting,
1453 const SupportedFile * file_descr,
1454 const Position * pos,
1455 int index,
1456 int num_tracks,
1457 int disable_track_idx,
1458 TracksReadyCallback ready_cb,
1459 GError ** error);
1460
1461Track *
1462track_create_empty_at_idx_with_action (TrackType type, int index, GError ** error);
1463
1464Track *
1465track_create_for_plugin_at_idx_w_action (
1466 TrackType type,
1467 const PluginSetting * pl_setting,
1468 int index,
1469 GError ** error);
1470
1475#define track_create_empty_with_action(type, error) \
1476 track_create_empty_at_idx_with_action (type, TRACKLIST->num_tracks, error)
1477
1478GMenu *
1479track_generate_edit_context_menu (Track * track, int num_selected);
1480
1485GMenu *
1487
1491void
1493
1498#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.
void track_remove_plugin(Track *self, PluginSlotType 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().
Plugin * track_get_plugin_at_slot(Track *track, PluginSlotType slot_type, int slot)
Returns the plugin at the given slot, if any.
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:1442
GMenu * track_generate_channel_context_menu(Track *track)
Generates a menu to be used for channel-related items, eg, fader buttons, direct out,...
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.
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.
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().
void track_insert_plugin(Track *self, Plugin *pl, PluginSlotType 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().
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_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...
PortType
Type of signals the Port handles.
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
PluginSlotType
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:118
Marker for the MarkerTrack.
Definition marker.h:55
Container for passing midi events through ports.
Definition midi_event.h:68
Modulator macro button processor.
Musical scale descriptor.
Definition scale.h:196
A setting for a specific plugin descriptor.
The base plugin Inheriting plugins must have this as a child.
Definition plugin.h:71
Must ONLY be created via port_new()
Definition port.h:140
A Position is made up of bars.beats.sixteenths.ticks.
Definition position.h:129
A ScaleObject to be shown in the TimelineArrangerWidget.
L & R port, for convenience.
Definition port.h:562
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:186
bool block_auto_creation_and_deletion
Block auto-creating or deleting lanes.
Definition track.h:525
bool frozen
Whether the track is currently frozen.
Definition track.h:495
bool drum_mode
Whether drum mode in the piano roll is enabled for this track.
Definition track.h:282
char * name
Track name, used in channel too.
Definition track.h:199
bool automation_visible
Flag to set automations visible or not.
Definition track.h:219
bool lanes_visible
Flag to set track lanes visible or not.
Definition track.h:222
bool record_set_automatically
Whether record was set automatically when the channel was selected.
Definition track.h:245
bool bounce
Set to ON during bouncing if this track should be included.
Definition track.h:476
WrappedObjectWithChangeSignal * gobj
Used in Gtk.
Definition track.h:528
ScaleObject ** scale_snapshots
Snapshots used during playback TODO unimplemented.
Definition track.h:370
bool recording_paused
This must only be set by the RecordingManager when temporarily pausing recording, eg when looping or ...
Definition track.h:330
unsigned int * children
Name hashes of tracks that are routed to this track, if group track.
Definition track.h:490
Plugin ** modulators
Modulators.
Definition track.h:417
unsigned int name_hash
Cache calculated when adding to graph.
Definition track.h:202
Port * beats_per_bar_port
Automatable beats per bar port.
Definition track.h:393
char * comment
User comments.
Definition track.h:468
Port * recording
Recording or not.
Definition track.h:235
int last_lane_idx
Lane index of region before recording paused.
Definition track.h:334
GdkRGBA color
Track color.
Definition track.h:260
bool disconnecting
Whether currently disconnecting.
Definition track.h:503
bool trigger_midi_activity
Flag to tell the UI that this channel had MIDI activity.
Definition track.h:453
Port * bpm_port
Automatable BPM control.
Definition track.h:390
Stretcher * rt_stretcher
Real-time time stretcher.
Definition track.h:341
double main_height
Height of the main part (without lanes).
Definition track.h:232
uint8_t midi_ch
MIDI channel (MIDI/Instrument track only).
Definition track.h:274
TrackType type
The type of track this is.
Definition track.h:196
PortType out_signal_type
The output signal type (eg midi tracks have MIDI output signals).
Definition track.h:465
char * icon_name
Icon name of the track.
Definition track.h:205
TrackProcessor * processor
The TrackProcessor, used for processing.
Definition track.h:441
int size
Number of tracks inside this track.
Definition track.h:407
PortType in_signal_type
The input signal type (eg audio bus tracks have audio input signals).
Definition track.h:459
Marker ** marker_snapshots
Snapshots used during playback TODO unimplemented.
Definition track.h:382
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:482
TrackLane ** lanes
Lanes in this track containing Regions.
Definition track.h:265
int pos
Position in the Tracklist.
Definition track.h:193
Port * beat_unit_port
Automatable beat unit port.
Definition track.h:396
Tracklist * tracklist
Pointer to owner tracklist, if any.
Definition track.h:506
bool folded
Whether currently folded.
Definition track.h:410
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:320
ZRegion ** chord_regions
ChordObject's.
Definition track.h:352
ZRegion ** chord_region_snapshots
Snapshots used during playback.
Definition track.h:357
ScaleObject ** scales
ScaleObject's.
Definition track.h:365
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:310
ZRegion * recording_region
ZRegion currently recording on.
Definition track.h:300
bool visible
Whole Track is visible or not.
Definition track.h:225
TrackWidget * widget
Track Widget created dynamically.
Definition track.h:211
int pool_id
Pool ID of the clip if track is frozen.
Definition track.h:498
TrackLane ** lane_snapshots
Snapshots used during playback.
Definition track.h:270
bool enabled
Active (enabled) or not.
Definition track.h:253
TracklistSelections * ts
Pointer to owner tracklist selections, if any.
Definition track.h:509
FolderChannelWidget * folder_ch_widget
Widget used for foldable tracks in the mixer.
Definition track.h:216
ModulatorMacroProcessor * modulator_macros[TRACK_MAX_MODULATOR_MACROS]
Modulator macros.
Definition track.h:422
bool filtered
Track will be hidden if true (temporary and not serializable).
Definition track.h:229
Channel * channel
1 Track has 0 or 1 Channel.
Definition track.h:431
int passthrough_midi_input
If set to 1, the input received will not be changed to the selected MIDI channel.
Definition track.h:291
int last_lane_created
Last lane created during this drag.
Definition track.h:522
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:43
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:77
Track lanes for each track.
Track processor.
YAML utils.