GUI Backend module

Serializable structs that define how the GUI should behave.

Contents

Classes

struct ArrangerObject
Base struct for arranger objects.
struct AudioClipEditor
Audio clip editor serializable backend.
struct AudioSelections
Selections to be used for the AudioArrangerWidget's current selections, copying, undoing, etc.
struct AutomationEditor
Backend for the automation editor.
struct AutomationSelections
Selections to be used for the AutomationArrangerWidget's current selections, copying, undoing, etc.
struct ChordEditor
Backend for the chord editor.
struct ChordSelections
Selections to be used for the ChordArrangerWidget's current selections, copying, undoing, etc.
struct ClipEditor
Clip editor serializable backend.
struct EditorSettings
Common editor settings.
struct FileBrowserLocation
Locations to be used in the file browser.
struct MidiArrangerSelections
Selections to be used for the midi_arranger's current selections, copying, undoing, etc.
struct MixerSelections
Selections to be used for the timeline's current selections, copying, undoing, etc.
struct MidiNoteDescriptor
A descriptor for a MidiNote, used by the piano roll.
struct PianoRoll
Piano roll serializable backend.
struct Timeline
Clip editor serializable backend.
struct TimelineSelections
Selections to be used for the timeline's current selections, copying, undoing, etc.
struct TracklistSelections
Selections to be used for the tracklist's current selections, copying, undoing, etc.

Enums

enum ArrangerObjectResizeType { ARRANGER_OBJECT_RESIZE_NORMAL, ARRANGER_OBJECT_RESIZE_LOOP, ARRANGER_OBJECT_RESIZE_FADE, ARRANGER_OBJECT_RESIZE_STRETCH, ARRANGER_OBJECT_RESIZE_STRETCH_BPM_CHANGE }
Flag used in some functions.
enum ArrangerObjectType { ARRANGER_OBJECT_TYPE_NONE, ARRANGER_OBJECT_TYPE_ALL, ARRANGER_OBJECT_TYPE_REGION, ARRANGER_OBJECT_TYPE_MIDI_NOTE, ARRANGER_OBJECT_TYPE_CHORD_OBJECT, ARRANGER_OBJECT_TYPE_SCALE_OBJECT, ARRANGER_OBJECT_TYPE_MARKER, ARRANGER_OBJECT_TYPE_AUTOMATION_POINT, ARRANGER_OBJECT_TYPE_VELOCITY }
The type of the object.
enum ArrangerObjectFlags { ARRANGER_OBJECT_FLAG_NON_PROJECT = 1 << 0 }
ArrangerObject flags.
enum FileBrowserSelectionType { FB_SELECTION_TYPE_COLLECTIONS, FB_SELECTION_TYPE_LOCATIONS }
Current selection in the top window.
enum MidiModifier { MIDI_MODIFIER_VELOCITY, MIDI_MODIFIER_PITCH_WHEEL, MIDI_MODIFIER_MOD_WHEEL, MIDI_MODIFIER_AFTERTOUCH }
A MIDI modifier to use to display data for.
enum PianoRollHighlighting { PR_HIGHLIGHT_NONE, PR_HIGHLIGHT_CHORD, PR_HIGHLIGHT_SCALE, PR_HIGHLIGHT_BOTH }
Highlighting for the piano roll.

Typedefs

using ArrangerObjectResizeType = enum ArrangerObjectResizeType
Flag used in some functions.
using ArrangerObjectType = enum ArrangerObjectType
The type of the object.
using ArrangerObjectFlags = enum ArrangerObjectFlags
ArrangerObject flags.
using ArrangerObject = struct ArrangerObject
Base struct for arranger objects.
using AudioClipEditor = struct AudioClipEditor
Audio clip editor serializable backend.
using AudioSelections = struct AudioSelections
Selections to be used for the AudioArrangerWidget's current selections, copying, undoing, etc.
using AutomationEditor = struct AutomationEditor
Backend for the automation editor.
using AutomationSelections = struct AutomationSelections
Selections to be used for the AutomationArrangerWidget's current selections, copying, undoing, etc.
using ChordEditor = struct ChordEditor
Backend for the chord editor.
using ChordSelections = struct ChordSelections
Selections to be used for the ChordArrangerWidget's current selections, copying, undoing, etc.
using ClipEditor = struct ClipEditor
Clip editor serializable backend.
using EditorSettings = struct EditorSettings
Common editor settings.
using FileBrowserLocation = struct FileBrowserLocation
Locations to be used in the file browser.
using FileBrowserSelectionType = enum FileBrowserSelectionType
Current selection in the top window.
using MidiArrangerSelections = struct MidiArrangerSelections
Selections to be used for the midi_arranger's current selections, copying, undoing, etc.
using MixerSelections = struct MixerSelections
Selections to be used for the timeline's current selections, copying, undoing, etc.
using MidiModifier = enum MidiModifier
A MIDI modifier to use to display data for.
using PianoRollHighlighting = enum PianoRollHighlighting
Highlighting for the piano roll.
using MidiNoteDescriptor = struct MidiNoteDescriptor
A descriptor for a MidiNote, used by the piano roll.
using PianoRoll = struct PianoRoll
Piano roll serializable backend.
using Timeline = struct Timeline
Clip editor serializable backend.
using TimelineSelections = struct TimelineSelections
Selections to be used for the timeline's current selections, copying, undoing, etc.
using TracklistSelections = struct TracklistSelections
Selections to be used for the tracklist's current selections, copying, undoing, etc.

Functions

auto arranger_object_get_arranger(ArrangerObject* self) -> ArrangerWidget*
Gets the arranger for this arranger object.
void arranger_object_set_magic(ArrangerObject* self)
Sets the magic on the arranger object.
auto arranger_object_get_region(ArrangerObject* self) -> HOT ZRegion*
If the object is part of a ZRegion, returns it, otherwise returns NULL.
auto arranger_object_get_name(ArrangerObject* self) -> const char*
Returns a pointer to the name of the object, if the object can have names.
void arranger_object_set_to_object(ArrangerObject* dest, ArrangerObject* src)
Sets the dest object's values to the main src object's values.
auto arranger_object_should_lane_be_visible(ArrangerObject* self) -> int
Returns if the lane counterpart should be visible.
auto arranger_object_should_orig_be_visible(ArrangerObject* self) -> bool
Returns if the cached object should be visible, ie, while copy- moving (ctrl+drag) we want to show both the object at its original position and the current object.
auto arranger_object_get_object(ArrangerObject* self) -> ArrangerObject*
Gets the object the ArrangerObjectInfo represents.
void arranger_object_init_loaded(ArrangerObject* self)
Initializes the object after loading a Project.
auto arranger_object_get_selections_for_type(ArrangerObjectType type) -> ArrangerSelections*
Returns the ArrangerSelections corresponding to the given object type.
void arranger_object_select(ArrangerObject* self, const bool select, const bool append, bool fire_events)
Selects the object by adding it to its corresponding selections or making it the only selection.
auto arranger_object_is_hit(ArrangerObject* self, Position* start, Position* end) -> bool
Returns whether the given object is hit by the given position or range.
auto arranger_object_get_num_loops(ArrangerObject* self, const int count_incomplete) -> int
Returns the number of loops in the ArrangerObject, optionally including incomplete ones.
auto arranger_object_is_selected(ArrangerObject* self) -> bool
Returns if the object is in the selections.
void arranger_object_print(ArrangerObject* self)
Prints debug information about the given object.
auto arranger_object_get_muted(ArrangerObject* self) -> bool
Gets the mute status of the object.
void arranger_object_set_muted(ArrangerObject* self, bool muted, bool fire_events)
Sets the mute status of the object.
void arranger_object_get_pos(const ArrangerObject* self, Position* pos)
Getter.
void arranger_object_get_end_pos(const ArrangerObject* self, Position* pos)
Getter.
void arranger_object_get_clip_start_pos(const ArrangerObject* self, Position* pos)
Getter.
void arranger_object_get_loop_start_pos(const ArrangerObject* self, Position* pos)
Getter.
void arranger_object_get_loop_end_pos(const ArrangerObject* self, Position* pos)
Getter.
void arranger_object_pos_setter(ArrangerObject* self, const Position* pos)
The setter is for use in e.g.
void arranger_object_end_pos_setter(ArrangerObject* self, const Position* pos)
The setter is for use in e.g.
void arranger_object_clip_start_pos_setter(ArrangerObject* self, const Position* pos)
The setter is for use in e.g.
void arranger_object_loop_start_pos_setter(ArrangerObject* self, const Position* pos)
The setter is for use in e.g.
void arranger_object_loop_end_pos_setter(ArrangerObject* self, const Position* pos)
The setter is for use in e.g.
auto arranger_object_is_position_valid(ArrangerObject* self, const Position* pos, ArrangerObjectPositionType pos_type) -> int
Returns if the given Position is valid.
void arranger_object_set_position(ArrangerObject* self, const Position* pos, ArrangerObjectPositionType pos_type, const int validate)
Sets the Position all of the object's linked objects (see ArrangerObjectInfo)
auto arranger_object_stringize_type(ArrangerObjectType type) -> const char*
Returns the type as a string.
void arranger_object_copy_identifier(ArrangerObject* dest, ArrangerObject* src)
Copies the identifier from src to dest.
void arranger_object_move(ArrangerObject* self, const double ticks)
Moves the object by the given amount of ticks.
auto arranger_object_get_length_in_ticks(ArrangerObject* self) -> double
Returns the length of the ArrangerObject (if it has length) in ticks.
auto arranger_object_get_length_in_frames(ArrangerObject* self) -> long
Returns the length of the ArrangerObject (if it has length) in frames.
auto arranger_object_get_loop_length_in_ticks(ArrangerObject* self) -> double
Returns the length of the loop in ticks.
auto arranger_object_get_loop_length_in_frames(ArrangerObject* self) -> long
Returns the length of the loop in ticks.
void arranger_object_update_frames(ArrangerObject* self)
Updates the frames of each position in each child recursively.
void arranger_object_free(ArrangerObject* self)
Frees only this object.
void arranger_object_resize(ArrangerObject* self, const int left, ArrangerObjectResizeType type, const double ticks, bool during_ui_action)
Resizes the object on the left side or right side by given amount of ticks, for objects that do not have loops (currently none? keep it as reference).
void arranger_object_add_ticks_to_children(ArrangerObject* self, const double ticks)
Adds the given ticks to each included object.
auto arranger_object_get_track(ArrangerObject* self) -> HOT Track*
Returns the Track this ArrangerObject is in.
auto arranger_object_validate_pos(ArrangerObject* self, const Position* pos, ArrangerObjectPositionType type) -> int
Validates the given Position.
auto arranger_object_validate_name(ArrangerObject* self, const char* name) -> bool
Validates the given name.
auto arranger_object_find(ArrangerObject* obj) -> ArrangerObject*
Returns the ArrangerObject matching the given one.
auto arranger_object_clone(ArrangerObject* self) -> ArrangerObject*
Clones the ArrangerObject.
void arranger_object_split(ArrangerObject* self, const Position* pos, const bool pos_is_local, ArrangerObject** r1, ArrangerObject** r2, bool is_project)
Splits the given object at the given Position.
void arranger_object_unsplit(ArrangerObject* r1, ArrangerObject* r2, ArrangerObject** obj, bool fire_events)
Undoes what arranger_object_split() did.
void arranger_object_set_name(ArrangerObject* self, const char* name, int fire_events)
Sets the name of the object, if the object can have a name.
void arranger_object_set_name_with_action(ArrangerObject* self, const char* name)
Changes the name and adds an action to the undo stack.
void arranger_object_set_start_pos_full_size(ArrangerObject* obj, Position* pos)
Sets the end position of the ArrangerObject and also sets the loop end and fade out so that they are at the end.
void arranger_object_set_end_pos_full_size(ArrangerObject* obj, Position* pos)
Sets the end position of the ArrangerObject and also sets the loop end and fade out to that position.
void arranger_object_add_to_project(ArrangerObject* obj, bool fire_events)
Appends the ArrangerObject to where it belongs in the project (eg, a Track), without taking into account its previous index (eg, before deletion if undoing).
void arranger_object_insert_to_project(ArrangerObject* obj)
Inserts the ArrangerObject where it belongs in the project (eg, a Track).
void arranger_object_remove_from_project(ArrangerObject* obj)
Removes the object from its parent in the project.
auto arranger_object_is_frozen(ArrangerObject* obj) -> bool
Returns whether the arranger object is part of a frozen track.
auto arranger_object_is_deletable(ArrangerObject* obj) -> bool
Returns whether the given object is deletable or not (eg, start marker).
auto arranger_selections_init_loaded(ArrangerSelections* self, bool project) -> NONNULL void
Inits the selections after loading a project.
auto arranger_selections_init(ArrangerSelections* self, ArrangerSelectionsType type) -> NONNULL void
Initializes the selections.
auto arranger_selections_verify(ArrangerSelections* self) -> NONNULL bool
Verify that the objects are not invalid.
auto arranger_selections_add_object(ArrangerSelections* self, ArrangerObject* obj) -> NONNULL void
Appends the given object to the selections.
auto arranger_selections_set_from_selections(ArrangerSelections* dest, ArrangerSelections* src) -> NONNULL void
Sets the values of each object in the dest selections to the values in the src selections.
auto arranger_selections_sort_by_indices(ArrangerSelections* sel, int desc) -> NONNULL void
Sorts the selections by their indices (eg, for regions, their track indices, then the lane indices, then the index in the lane).
auto arranger_selections_clone(ArrangerSelections* self) -> NONNULL ArrangerSelections*
Clone the struct for copying, undoing, etc.
auto arranger_selections_has_any(ArrangerSelections* self) -> NONNULL bool
Returns if there are any selections.
auto arranger_selections_get_start_pos(ArrangerSelections* self, Position* pos, bool global) -> NONNULL void
Returns the position of the leftmost object.
auto arranger_selections_get_end_pos(ArrangerSelections* self, Position* pos, int global) -> NONNULL void
Returns the end position of the rightmost object.
auto arranger_selections_get_num_objects(ArrangerSelections* self) -> NONNULL int
Returns the number of selected objects.
auto arranger_selections_get_first_object(ArrangerSelections* self) -> NONNULL ArrangerObject*
Gets first object.
auto arranger_selections_get_last_object(ArrangerSelections* self) -> NONNULL ArrangerObject*
Gets last object.
auto arranger_selections_paste_to_pos(ArrangerSelections* self, Position* pos, bool undoable) -> NONNULL void
Pastes the given selections to the given Position.
auto arranger_selections_get_all_objects(ArrangerSelections* self, int* size) -> NONNULL ArrangerObject**
Returns all objects in the selections in a newly allocated array that should be free'd.
auto arranger_selections_redraw(ArrangerSelections* self) -> NONNULL void
Redraws each object in the arranger selections.
auto arranger_selections_add_to_region(ArrangerSelections* self, ZRegion* region) -> NONNULL void
Adds each object in the selection to the given region (if applicable).
auto arranger_selections_add_ticks(ArrangerSelections* self, const double ticks) -> NONNULL void
Moves the selections by the given amount of ticks.
auto arranger_selections_all_on_same_lane(ArrangerSelections* self) -> NONNULL bool
Returns whether all the selections are on the same lane (track lane or automation lane).
auto arranger_selections_select_all(ArrangerSelections* self, bool fire_events) -> NONNULL void
Selects all possible objects from the project.
auto arranger_selections_clear(ArrangerSelections* self, bool free, bool fire_events) -> NONNULL void
Clears selections.
auto arranger_selections_post_deserialize(ArrangerSelections* self) -> NONNULL void
Code to run after deserializing.
auto arranger_selections_free(ArrangerSelections* self) -> NONNULL void
Frees the selections but not the objects.
auto arranger_selections_free_full(ArrangerSelections* self) -> NONNULL void
Frees all the objects as well.
auto arranger_selections_contains_object(ArrangerSelections* self, ArrangerObject* obj) -> NONNULL int
Returns if the arranger object is in the selections or not.
auto arranger_selections_contains_undeletable_object(ArrangerSelections* self) -> NONNULL bool
Returns if the selections contain an undeletable object (such as the start marker).
auto arranger_selections_remove_object(ArrangerSelections* self, ArrangerObject* obj) -> NONNULL void
Removes the arranger object from the selections.
auto arranger_selections_merge(ArrangerSelections* self) -> NONNULL void
Merges the given selections into one region.
auto arranger_selections_can_be_pasted(ArrangerSelections* self) -> NONNULL bool
Returns if the selections can be pasted.
void audio_selections_init(AudioSelections* self)
Inits the audio selections.
auto audio_selections_new(void) -> AudioSelections*
Creates a new AudioSelections instance.
void audio_selections_set_has_range(AudioSelections* self, bool has_range)
Sets whether a range selection exists and sends events to update the UI.
auto audio_selections_can_be_pasted(AudioSelections* ts, Position* pos, ZRegion* r) -> bool
Returns if the selections can be pasted.
void automation_editor_init_loaded(AutomationEditor* self)
Inits the AutomationEditor after a Project has been loaded.
void automation_editor_init(AutomationEditor* self)
Initializes the AutomationEditor.
auto automation_selections_can_be_pasted(AutomationSelections* ts, Position* pos, ZRegion* r) -> bool
Returns if the selections can be pasted.
void chord_editor_init_loaded(ChordEditor* self)
Inits the ChordEditor after a Project has been loaded.
void chord_editor_init(ChordEditor* self)
Initializes the ChordEditor.
auto chord_selections_can_be_pasted(ChordSelections* ts, Position* pos, ZRegion* region) -> int
Returns if the selections can be pasted.
void clip_editor_init_loaded(ClipEditor* self)
Inits the ClipEditor after a Project is loaded.
void clip_editor_init(ClipEditor* self)
Inits the clip editor.
auto clip_editor_new(void) -> ClipEditor*
Creates a new clip editor.
void clip_editor_set_region(ClipEditor* self, ZRegion* region, bool fire_events)
Sets the track and refreshes the piano roll widgets.
void clip_editor_redraw_region(ClipEditor* self)
Causes the selected ZRegion to be redrawin in the UI, if any.
auto file_manager_new(void) -> FileManager*
Creates the file manager.
void file_manager_load_files(FileManager* self)
Loads the files under the current selection.
void file_manager_free(FileManager* self)
Frees the file manager.
void midi_arranger_selections_unlisten_note_diff(MidiArrangerSelections* prev, MidiArrangerSelections* mas)
Sets the listen status of notes on and off based on changes in the previous selections and the current selections.
auto midi_arranger_selections_can_be_pasted(MidiArrangerSelections* ts, Position* pos, ZRegion* region) -> int
Returns if the selections can be pasted.
auto mixer_selections_clone(MixerSelections* src, bool src_is_project) -> MixerSelections*
Clone the struct for copying, undoing, etc.
auto mixer_selections_has_any(MixerSelections* ms) -> int
Returns if there are any selections.
auto mixer_selections_get_highest_slot(MixerSelections* ms) -> int
Gets highest slot in the selections.
auto mixer_selections_get_lowest_slot(MixerSelections* ms) -> int
Gets lowest slot in the selections.
void mixer_selections_paste_to_slot(MixerSelections* ts, Channel* ch, PluginSlotType type, int slot)
Paste the selections starting at the slot in the given channel.
auto mixer_selections_get_track(MixerSelections* self) -> Track*
Get current Track.
auto mixer_selections_contains_slot(MixerSelections* ms, PluginSlotType type, int slot) -> bool
Returns if the slot is selected or not.
auto mixer_selections_contains_plugin(MixerSelections* ms, Plugin* pl) -> bool
Returns if the plugin is selected or not.
void mixer_selections_add_slot(MixerSelections* ms, Track* track, PluginSlotType type, int slot, bool clone_pl)
Adds a slot to the selections.
auto mixer_selections_remove_slot(MixerSelections* ms, int slot, PluginSlotType type, bool publish_events) -> NONNULL void
Removes a slot from the selections.
auto mixer_selections_sort(MixerSelections* self, bool asc) -> NONNULL void
Sorts the selections by slot index.
auto mixer_selections_get_first_plugin(MixerSelections* self) -> NONNULL Plugin*
Returns the first selected plugin if any is selected, otherwise NULL.
auto mixer_selections_clear(MixerSelections* ms, const int pub_events) -> NONNULL void
Clears selections.
auto piano_roll_is_key_black(int note) -> int
Returns if the key is black.
void piano_roll_add_current_note(PianoRoll* self, int note)
Adds the note if it doesn't exist in the array.
void piano_roll_remove_current_note(PianoRoll* self, int note)
Removes the note if it exists in the array.
auto piano_roll_contains_current_note(PianoRoll* self, int note) -> int
Returns 1 if it contains the given note, 0 otherwise.
auto piano_roll_get_current_track(const PianoRoll* self) -> Track*
Returns the current track whose regions are being shown in the piano roll.
void piano_roll_init_loaded(PianoRoll* self)
Inits the PianoRoll after a Project has been loaded.
auto piano_roll_find_midi_note_descriptor_by_val(PianoRoll* self, const uint8_t val) -> const MidiNoteDescriptor*
Returns the MidiNoteDescriptor matching the value (0-127).
void piano_roll_set_highlighting(PianoRoll* self, PianoRollHighlighting highlighting)
Updates the highlighting and notifies the UI.
void piano_roll_set_midi_modifier(PianoRoll* self, MidiModifier modifier)
Sets the MIDI modifier.
static void piano_roll_get_visible_notes(PianoRoll* self, MidiNoteDescriptor* arr, int* num)
Gets the visible notes.
void piano_roll_init(PianoRoll* self)
Initializes the PianoRoll.
void timeline_init_loaded(Timeline* self)
Inits the Timeline after a Project is loaded.
void timeline_init(Timeline* self)
Inits the Timeline instance.
auto timeline_new(void) -> Timeline*
Creates a new Timeline instance.
auto timeline_selections_new(void) -> TimelineSelections*
Creates a new TimelineSelections instance.
auto timeline_selections_new_for_range(Position* start_pos, Position* end_pos, bool clone_objs) -> TimelineSelections*
Creates a new TimelineSelections instance for the given range.
auto timeline_selections_get_first_track(TimelineSelections* ts) -> Track*
Gets highest track in the selections.
auto timeline_selections_get_last_track(TimelineSelections* ts) -> Track*
Gets lowest track in the selections.
void timeline_selections_set_vis_track_indices(TimelineSelections* ts)
Replaces the track positions in each object with visible track indices starting from 0.
void timeline_selections_sort_by_indices(TimelineSelections* sel, int desc)
Sorts the selections by their indices (eg, for regions, their track indices, then the lane indices, then the index in the lane).
auto timeline_selections_can_be_pasted(TimelineSelections* ts, Position* pos, const int idx) -> int
Returns if the selections can be pasted.
void timeline_selections_mark_for_bounce(TimelineSelections* ts, bool with_parents)
auto timeline_selections_move_regions_to_new_lanes(TimelineSelections* self, const int diff) -> bool
Move the selected Regions to new Lanes.
auto timeline_selections_move_regions_to_new_tracks(TimelineSelections* self, const int vis_track_diff) -> bool
Move the selected Regions to the new Track.
void timeline_selections_set_index_in_prev_lane(TimelineSelections* self)
Sets the regions' ZRegion.index_in_prev_lane.
auto tracklist_selections_new(bool is_project) -> TracklistSelections*
auto tracklist_selections_clone(TracklistSelections* src) -> TracklistSelections*
Clone the struct for copying, undoing, etc.
auto tracklist_selections_get_highest_track(TracklistSelections* self) -> Track*
Gets highest track in the selections.
auto tracklist_selections_get_lowest_track(TracklistSelections* self) -> Track*
Gets lowest track in the selections.
void tracklist_selections_clear(TracklistSelections* self)
Clears the selections.
void tracklist_selections_handle_click(Track* track, bool ctrl, bool shift, bool dragged)
Handle a click selection.
auto tracklist_selections_contains_soloed_track(TracklistSelections* self, bool soloed) -> bool
Returns whether the selections contain a soloed track if soloed is true or an unsoloed track if soloed is false.
auto tracklist_selections_contains_listened_track(TracklistSelections* self, bool listened) -> bool
Returns whether the selections contain a listened track if listened is true or an unlistened track if listened is false.
auto tracklist_selections_contains_muted_track(TracklistSelections* self, bool muted) -> bool
Returns whether the selections contain a muted track if muted is true or an unmuted track if muted is false.
auto tracklist_selections_contains_track(TracklistSelections* self, Track* track) -> int
Returns if the Track is selected or not.
void tracklist_selections_select_single(TracklistSelections* ts, Track* track, bool fire_events)
Selects a single track after clearing the selections.
void tracklist_selections_select_all(TracklistSelections* ts, int visible_only)
Selects all Track's.
void tracklist_selections_select_last_visible(TracklistSelections* ts)
Selects the last visible track after clearing the selections.
void tracklist_selections_toggle_visibility(TracklistSelections* ts)
Toggle visibility of the selected tracks.
void tracklist_selections_toggle_pinned(TracklistSelections* ts)
Toggle pin/unpin of the selected tracks.
void tracklist_selections_print(TracklistSelections* self)
For debugging.
void tracklist_selections_sort(TracklistSelections* self)
Sorts the tracks by position.
void tracklist_selections_mark_for_bounce(TracklistSelections* ts, bool with_parents, bool mark_master)
Marks the tracks to be bounced.

Defines

#define arranger_object_type_has_length(type)
Returns if the object type has a length.
#define arranger_object_type_has_global_pos(type)
Returns if the object type has a global position.
#define arranger_object_can_have_lanes(_obj)
Returns if the object is allowed to have lanes.
#define arranger_object_type_can_loop(type)
Returns if the object can loop.
#define arranger_object_can_cache_drawing(_obj)
Whether or not this object supports cached drawing.
#define _ARRANGER_OBJECT_FREE_AND_SET_STRING(_obj, _val_name, _val_value)
Not to be used anywhere besides below.
#define arranger_object_set_string(cc, obj, val_name, val_value)
Updates an arranger object's string value.

Enum documentation

enum ArrangerObjectResizeType

Flag used in some functions.

Enumerators
ARRANGER_OBJECT_RESIZE_NORMAL
ARRANGER_OBJECT_RESIZE_LOOP
ARRANGER_OBJECT_RESIZE_FADE
ARRANGER_OBJECT_RESIZE_STRETCH
ARRANGER_OBJECT_RESIZE_STRETCH_BPM_CHANGE

Used when we want to resize to contents when BPM changes.

Only applies to audio.

enum ArrangerObjectFlags

ArrangerObject flags.

Enumerators
ARRANGER_OBJECT_FLAG_NON_PROJECT

This object is not a project object, but an object used temporarily eg.

when undoing/ redoing.

Typedef documentation

typedef struct AudioClipEditor AudioClipEditor

Audio clip editor serializable backend.

The actual widgets should reflect the information here.

typedef struct ClipEditor ClipEditor

Clip editor serializable backend.

The actual widgets should reflect the information here.

typedef struct FileBrowserLocation FileBrowserLocation

Locations to be used in the file browser.

These are to be saved/updated every time there are changes and reloaded when Zrythm starts.

Label is the visible part and path is the actual path. Eg. "Home" -> /home/user "Documents" -> /home/user/Documents "Samples" -> (some arbitrary path)

typedef struct MidiNoteDescriptor MidiNoteDescriptor

A descriptor for a MidiNote, used by the piano roll.

Notes will only be draggable and reorderable in drum mode.

In normal mode, only visibility can be changed.

typedef struct PianoRoll PianoRoll

Piano roll serializable backend.

The actual widgets should reflect the information here.

typedef struct Timeline Timeline

Clip editor serializable backend.

The actual widgets should reflect the information here.

typedef struct TracklistSelections TracklistSelections

Selections to be used for the tracklist's current selections, copying, undoing, etc.

TracklistSelections are special in that they do not allow 0 selections. There must always be a Track selected.

Function documentation

bool arranger_object_should_orig_be_visible(ArrangerObject* self)

Returns if the cached object should be visible, ie, while copy- moving (ctrl+drag) we want to show both the object at its original position and the current object.

This refers to the object at its original position (called "transient").

void arranger_object_select(ArrangerObject* self, const bool select, const bool append, bool fire_events)

Selects the object by adding it to its corresponding selections or making it the only selection.

Parameters
self
select 1 to select, 0 to deselect.
append 1 to append, 0 to make it the only selection.
fire_events

bool arranger_object_is_hit(ArrangerObject* self, Position* start, Position* end)

Returns whether the given object is hit by the given position or range.

Parameters
self
start Start position.
end End position, or NULL to only check for intersection with start.

void arranger_object_pos_setter(ArrangerObject* self, const Position* pos)

The setter is for use in e.g.

the digital meters whereas the set_pos func is used during arranger actions.

void arranger_object_end_pos_setter(ArrangerObject* self, const Position* pos)

The setter is for use in e.g.

the digital meters whereas the set_pos func is used during arranger actions.

void arranger_object_clip_start_pos_setter(ArrangerObject* self, const Position* pos)

The setter is for use in e.g.

the digital meters whereas the set_pos func is used during arranger actions.

void arranger_object_loop_start_pos_setter(ArrangerObject* self, const Position* pos)

The setter is for use in e.g.

the digital meters whereas the set_pos func is used during arranger actions.

void arranger_object_loop_end_pos_setter(ArrangerObject* self, const Position* pos)

The setter is for use in e.g.

the digital meters whereas the set_pos func is used during arranger actions.

int arranger_object_is_position_valid(ArrangerObject* self, const Position* pos, ArrangerObjectPositionType pos_type)

Returns if the given Position is valid.

Parameters
self
pos The position to set to.
pos_type The type of Position to set in the ArrangerObject.

void arranger_object_set_position(ArrangerObject* self, const Position* pos, ArrangerObjectPositionType pos_type, const int validate)

Sets the Position all of the object's linked objects (see ArrangerObjectInfo)

Parameters
self
pos The position to set to.
pos_type The type of Position to set in the ArrangerObject.
validate Validate the Position before setting it.

double arranger_object_get_length_in_ticks(ArrangerObject* self)

Returns the length of the ArrangerObject (if it has length) in ticks.

(End Position - start Position).

long arranger_object_get_length_in_frames(ArrangerObject* self)

Returns the length of the ArrangerObject (if it has length) in frames.

(End Position - start Position).

void arranger_object_resize(ArrangerObject* self, const int left, ArrangerObjectResizeType type, const double ticks, bool during_ui_action)

Resizes the object on the left side or right side by given amount of ticks, for objects that do not have loops (currently none? keep it as reference).

Parameters
self
left 1 to resize left side, 0 to resize right side.
type
ticks Number of ticks to resize.
during_ui_action Whether this is called during a UI action (not at the end).

int arranger_object_validate_pos(ArrangerObject* self, const Position* pos, ArrangerObjectPositionType type)

Validates the given Position.

Returns 1 if valid, 0 otherwise.

bool arranger_object_validate_name(ArrangerObject* self, const char* name)

Validates the given name.

Returns True if valid, false otherwise.

ArrangerObject* arranger_object_find(ArrangerObject* obj)

Returns the ArrangerObject matching the given one.

This should be called when we have a copy or a clone, to get the actual region in the project.

void arranger_object_split(ArrangerObject* self, const Position* pos, const bool pos_is_local, ArrangerObject** r1, ArrangerObject** r2, bool is_project)

Splits the given object at the given Position.

Parameters
self
pos The Position to split at.
pos_is_local If the position is local (1) or global (0).
r1 Address to hold the pointer to the newly created ArrangerObject 1.
r2 Address to hold the pointer to the newly created ArrangerObject 2.
is_project Whether the object being passed is a project object. If true, it will be removed from the project and the child objects will be added to the project, otherwise it will be untouched and the children will be mere clones.

if is_project is true, it deletes the original object and adds 2 new objects in the same parent (Track or AutomationTrack or Region).

void arranger_object_set_name_with_action(ArrangerObject* self, const char* name)

Changes the name and adds an action to the undo stack.

Calls arranger_object_set_name() internally.

void arranger_object_insert_to_project(ArrangerObject* obj)

Inserts the ArrangerObject where it belongs in the project (eg, a Track).

This function assumes that the object already knows the index where it should be inserted in its parent.

This is mostly used when undoing.

NONNULL void arranger_selections_init_loaded(ArrangerSelections* self, bool project)

Inits the selections after loading a project.

Parameters
self
project Whether these are project selections (as opposed to clones).

NONNULL void arranger_selections_sort_by_indices(ArrangerSelections* sel, int desc)

Sorts the selections by their indices (eg, for regions, their track indices, then the lane indices, then the index in the lane).

Parameters
sel
desc Descending or not.

NONNULL void arranger_selections_get_start_pos(ArrangerSelections* self, Position* pos, bool global)

Returns the position of the leftmost object.

Parameters
self
pos
global Return global (timeline) Position, otherwise returns the local (from the start of the Region) Position.

NONNULL void arranger_selections_get_end_pos(ArrangerSelections* self, Position* pos, int global)

Returns the end position of the rightmost object.

Parameters
self
pos The return value will be stored here.
global Return global (timeline) Position, otherwise returns the local (from the start of the Region) Position.

NONNULL ArrangerObject** arranger_selections_get_all_objects(ArrangerSelections* self, int* size)

Returns all objects in the selections in a newly allocated array that should be free'd.

Parameters
self
size A pointer to save the size into.

NONNULL void arranger_selections_add_ticks(ArrangerSelections* self, const double ticks)

Moves the selections by the given amount of ticks.

Parameters
self
ticks Ticks to add.

NONNULL void arranger_selections_free_full(ArrangerSelections* self)

Frees all the objects as well.

To be used in actions where the selections are all clones.

NONNULL int arranger_selections_contains_object(ArrangerSelections* self, ArrangerObject* obj)

Returns if the arranger object is in the selections or not.

The object must be the main object (see ArrangerObjectInfo).

NONNULL void arranger_selections_merge(ArrangerSelections* self)

Merges the given selections into one region.

bool audio_selections_can_be_pasted(AudioSelections* ts, Position* pos, ZRegion* r)

Returns if the selections can be pasted.

Parameters
ts
pos Position to paste to.
r

bool automation_selections_can_be_pasted(AutomationSelections* ts, Position* pos, ZRegion* r)

Returns if the selections can be pasted.

Parameters
ts
pos Position to paste to.
r

int chord_selections_can_be_pasted(ChordSelections* ts, Position* pos, ZRegion* region)

Returns if the selections can be pasted.

Parameters
ts
pos Position to paste to.
region ZRegion to paste to.

void clip_editor_set_region(ClipEditor* self, ZRegion* region, bool fire_events)

Sets the track and refreshes the piano roll widgets.

To be called only from GTK threads.

int midi_arranger_selections_can_be_pasted(MidiArrangerSelections* ts, Position* pos, ZRegion* region)

Returns if the selections can be pasted.

Parameters
ts
pos Position to paste to.
region ZRegion to paste to.

MixerSelections* mixer_selections_clone(MixerSelections* src, bool src_is_project)

Clone the struct for copying, undoing, etc.

@bool src_is_project Whether src are the project selections.

void mixer_selections_add_slot(MixerSelections* ms, Track* track, PluginSlotType type, int slot, bool clone_pl)

Adds a slot to the selections.

Parameters
ms
track The track.
type
slot The slot to add to the selections.
clone_pl Whether to clone the plugin when storing it in MixerSelections::plugins. Used in some actions.

The selections can only be from one channel.

NONNULL void mixer_selections_remove_slot(MixerSelections* ms, int slot, PluginSlotType type, bool publish_events)

Removes a slot from the selections.

Assumes that the channel is the one already selected.

NONNULL void mixer_selections_sort(MixerSelections* self, bool asc)

Sorts the selections by slot index.

Parameters
self
asc Ascending or not.

void timeline_init_loaded(Timeline* self)

Inits the Timeline after a Project is loaded.

void timeline_init(Timeline* self)

Inits the Timeline instance.

Timeline* timeline_new(void)

Creates a new Timeline instance.

TimelineSelections* timeline_selections_new_for_range(Position* start_pos, Position* end_pos, bool clone_objs)

Creates a new TimelineSelections instance for the given range.

@bool clone_objs True to clone each object, false to use pointers to project objects.

void timeline_selections_set_vis_track_indices(TimelineSelections* ts)

Replaces the track positions in each object with visible track indices starting from 0.

Used during copying.

void timeline_selections_sort_by_indices(TimelineSelections* sel, int desc)

Sorts the selections by their indices (eg, for regions, their track indices, then the lane indices, then the index in the lane).

Parameters
sel
desc Descending or not.

int timeline_selections_can_be_pasted(TimelineSelections* ts, Position* pos, const int idx)

Returns if the selections can be pasted.

Parameters
ts
pos Position to paste to.
idx Track index to start pasting to.

void timeline_selections_mark_for_bounce(TimelineSelections* ts, bool with_parents)

Parameters
ts
with_parents Also mark all the track's parents recursively.

bool timeline_selections_move_regions_to_new_lanes(TimelineSelections* self, const int diff)

Move the selected Regions to new Lanes.

Parameters
self
diff The delta to move the Tracks.
Returns True if moved.

bool timeline_selections_move_regions_to_new_tracks(TimelineSelections* self, const int vis_track_diff)

Move the selected Regions to the new Track.

Returns True if moved.

TracklistSelections* tracklist_selections_new(bool is_project)

Parameters
is_project Whether these selections are the project selections (as opposed to clones).

Track* tracklist_selections_get_highest_track(TracklistSelections* self)

Gets highest track in the selections.

If transient is 1, transient objects rae checked instead.

Track* tracklist_selections_get_lowest_track(TracklistSelections* self)

Gets lowest track in the selections.

If transient is 1, transient objects rae checked instead.

bool tracklist_selections_contains_soloed_track(TracklistSelections* self, bool soloed)

Returns whether the selections contain a soloed track if soloed is true or an unsoloed track if soloed is false.

Parameters
self
soloed Whether to check for soloed or unsoloed tracks.

bool tracklist_selections_contains_listened_track(TracklistSelections* self, bool listened)

Returns whether the selections contain a listened track if listened is true or an unlistened track if listened is false.

Parameters
self
listened Whether to check for listened or unlistened tracks.

bool tracklist_selections_contains_muted_track(TracklistSelections* self, bool muted)

Returns whether the selections contain a muted track if muted is true or an unmuted track if muted is false.

Parameters
self
muted Whether to check for muted or unmuted tracks.

void tracklist_selections_select_all(TracklistSelections* ts, int visible_only)

Selects all Track's.

Parameters
ts
visible_only Only select visible tracks.

void tracklist_selections_mark_for_bounce(TracklistSelections* ts, bool with_parents, bool mark_master)

Marks the tracks to be bounced.

Parameters
ts
with_parents Also mark all the track's parents recursively.
mark_master Also mark the master track. Set to true when exporting the mixdown, false otherwise.

Define documentation

#define arranger_object_can_cache_drawing(_obj)

Whether or not this object supports cached drawing.

FIXME off for now.