GUI Backend module

Serializable structs that define how the GUI should behave.

Contents

Classes

struct ArrangerObject
Base struct for arranger objects.
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 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 TimelineSelections
Selections to be used for the timeline'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 }
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 ArrangerObjectCloneFlag { ARRANGER_OBJECT_CLONE_COPY_MAIN, ARRANGER_OBJECT_CLONE_COPY, ARRANGER_OBJECT_CLONE_COPY_LINK }
Flag do indicate how to clone the object.
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 ArrangerObjectCloneFlag = enum ArrangerObjectCloneFlag
Flag do indicate how to clone the object.
using ArrangerObject = struct ArrangerObject
Base struct for arranger objects.
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 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 TimelineSelections = struct TimelineSelections
Selections to be used for the timeline's current selections, copying, undoing, etc.
using ArrangerObject = struct ArrangerObject
Base struct for arranger objects.

Functions

auto arranger_object_get_arranger(ArrangerObject* self) -> ArrangerWidget*
Gets the arranger for this arranger object.
auto arranger_object_get_region(ArrangerObject* self) -> 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) -> int
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 int select, const int append)
Selects the object by adding it to its corresponding selections or making it the only selection.
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) -> int
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)
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) -> Track*
Returns the Track this ArrangerObject is in.
void arranger_object_post_deserialize(ArrangerObject* self)
Returns the widget type for the given ArrangerObjectType.
auto arranger_object_validate_pos(ArrangerObject* self, const Position* pos, ArrangerObjectPositionType type) -> int
Validates the given Position.
auto arranger_object_find(ArrangerObject* obj) -> ArrangerObject*
Returns the ArrangerObject matching the given one.
auto arranger_object_clone(ArrangerObject* self, ArrangerObjectCloneFlag clone_flag) -> ArrangerObject*
Clone the ArrangerObject.
void arranger_object_split(ArrangerObject* self, const Position* pos, const int pos_is_local, ArrangerObject** r1, ArrangerObject** r2)
Splits the given object at the given Position, deletes the original object and adds 2 new objects in the same parent (Track or AutomationTrack or Region).
void arranger_object_unsplit(ArrangerObject* r1, ArrangerObject* r2, ArrangerObject** region)
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_selections_init_loaded(ArrangerSelections* self)
Inits the selections after loading a project.
void arranger_selections_init(ArrangerSelections* self, ArrangerSelectionsType type)
Initializes the selections.
void arranger_selections_add_object(ArrangerSelections* self, ArrangerObject* obj)
Appends the given object to the selections.
void arranger_selections_set_from_selections(ArrangerSelections* dest, ArrangerSelections* src)
Sets the values of each object in the dest selections to the values in the src selections.
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).
auto arranger_selections_clone(ArrangerSelections* self) -> ArrangerSelections*
Clone the struct for copying, undoing, etc.
auto arranger_selections_has_any(ArrangerSelections* self) -> int
Returns if there are any selections.
void arranger_selections_get_start_pos(ArrangerSelections* self, Position* pos, int global)
Returns the position of the leftmost object.
void arranger_selections_get_end_pos(ArrangerSelections* self, Position* pos, int global)
Returns the end position of the rightmost object.
auto arranger_selections_get_num_objects(ArrangerSelections* self) -> int
Returns the number of selected objects.
auto arranger_selections_get_first_object(ArrangerSelections* self) -> ArrangerObject*
Gets first object.
auto arranger_selections_get_last_object(ArrangerSelections* self) -> ArrangerObject*
Gets last object.
auto arranger_selections_get_all_objects(ArrangerSelections* self, int* size) -> ArrangerObject**
Pastes the given selections to the given Position.
void arranger_selections_redraw(ArrangerSelections* self)
Redraws each object in the arranger selections.
void arranger_selections_add_ticks(ArrangerSelections* self, const double ticks)
Moves the selections by the given amount of ticks.
void arranger_selections_clear(ArrangerSelections* self)
Clears selections.
void arranger_selections_post_deserialize(ArrangerSelections* self)
Code to run after deserializing.
void arranger_selections_free(ArrangerSelections* self)
Frees the selections but not the objects.
void arranger_selections_free_full(ArrangerSelections* self)
Frees all the objects as well.
auto arranger_selections_contains_object(ArrangerSelections* self, ArrangerObject* obj) -> int
Returns if the arranger object is in the selections or not.
void arranger_selections_remove_object(ArrangerSelections* self, ArrangerObject* obj)
Removes the arranger object from the selections.
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) -> int
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_set_region(ClipEditor* self, ZRegion* region)
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.
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) -> 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, Channel* ch, PluginSlotType type, int slot)
Adds a slot to the selections.
void mixer_selections_remove_slot(MixerSelections* ms, int slot, PluginSlotType type, int publish_events)
Removes a slot from the selections.
auto mixer_selections_get_first_plugin(MixerSelections* self) -> Plugin*
Returns the first selected plugin if any is selected, otherwise NULL.
void mixer_selections_clear(MixerSelections* ms, const int pub_events)
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.
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.

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.

enum ArrangerObjectType

The type of the object.

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.

enum ArrangerObjectCloneFlag

Flag do indicate how to clone the object.

Enumerators
ARRANGER_OBJECT_CLONE_COPY_MAIN

Create a new ZRegion to be added to a Track as a main Region.

ARRANGER_OBJECT_CLONE_COPY

Create a new ZRegion that will not be used as a main Region.

ARRANGER_OBJECT_CLONE_COPY_LINK

Create a link copy that references the parent (only used for regions).

enum MidiModifier

A MIDI modifier to use to display data for.

enum PianoRollHighlighting

Highlighting for the piano roll.

Typedef documentation

typedef enum ArrangerObjectResizeTypeArrangerObjectResizeType

Flag used in some functions.

typedef enum ArrangerObjectTypeArrangerObjectType

The type of the object.

typedef enum ArrangerObjectCloneFlagArrangerObjectCloneFlag

Flag do indicate how to clone the object.

typedef struct ArrangerObjectArrangerObject

Base struct for arranger objects.

typedef struct AutomationEditorAutomationEditor

Backend for the automation editor.

typedef struct AutomationSelectionsAutomationSelections

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

typedef struct ChordEditorChordEditor

Backend for the chord editor.

typedef struct ChordSelectionsChordSelections

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

typedef struct ClipEditorClipEditor

Clip editor serializable backend.

The actual widgets should reflect the information here.

typedef struct MidiArrangerSelectionsMidiArrangerSelections

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

typedef struct MixerSelectionsMixerSelections

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

typedef enum MidiModifierMidiModifier

A MIDI modifier to use to display data for.

typedef enum PianoRollHighlightingPianoRollHighlighting

Highlighting for the piano roll.

typedef struct MidiNoteDescriptorMidiNoteDescriptor

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 PianoRollPianoRoll

Piano roll serializable backend.

The actual widgets should reflect the information here.

typedef struct TimelineSelectionsTimelineSelections

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

typedef struct ArrangerObjectArrangerObject

Base struct for arranger objects.

Function documentation

ArrangerWidget* arranger_object_get_arranger(ArrangerObject* self)

Gets the arranger for this arranger object.

ZRegion* arranger_object_get_region(ArrangerObject* self)

If the object is part of a ZRegion, returns it, otherwise returns NULL.

const char* arranger_object_get_name(ArrangerObject* self)

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.

int arranger_object_should_lane_be_visible(ArrangerObject* self)

Returns if the lane counterpart should be visible.

int 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").

ArrangerObject* arranger_object_get_object(ArrangerObject* self)

Gets the object the ArrangerObjectInfo represents.

void arranger_object_init_loaded(ArrangerObject* self)

Initializes the object after loading a Project.

void arranger_object_select(ArrangerObject* self, const int select, const int append)

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.

int arranger_object_get_num_loops(ArrangerObject* self, const int count_incomplete)

Returns the number of loops in the ArrangerObject, optionally including incomplete ones.

int arranger_object_is_selected(ArrangerObject* self)

Returns if the object is in the selections.

void arranger_object_print(ArrangerObject* self)

Prints debug information about the given object.

bool arranger_object_get_muted(ArrangerObject* self)

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_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.

const char* arranger_object_stringize_type(ArrangerObjectType type)

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.

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).

double arranger_object_get_loop_length_in_ticks(ArrangerObject* self)

Returns the length of the loop in ticks.

long arranger_object_get_loop_length_in_frames(ArrangerObject* self)

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)

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.

void arranger_object_add_ticks_to_children(ArrangerObject* self, const double ticks)

Adds the given ticks to each included object.

void arranger_object_post_deserialize(ArrangerObject* self)

Returns the widget type for the given ArrangerObjectType.

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

Validates the given Position.

Returns 1 if valid, 0 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.

ArrangerObject* arranger_object_clone(ArrangerObject* self, ArrangerObjectCloneFlag clone_flag)

Clone the ArrangerObject.

Creates a new region and either links to the original or copies every field.

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

Splits the given object at the given Position, deletes the original object and adds 2 new objects in the same parent (Track or AutomationTrack or Region).

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.

The given object must be the main object, as this will create 2 new main objects.

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_selections_init_loaded(ArrangerSelections* self)

Inits the selections after loading a project.

void arranger_selections_init(ArrangerSelections* self, ArrangerSelectionsType type)

Initializes the selections.

void arranger_selections_add_object(ArrangerSelections* self, ArrangerObject* obj)

Appends the given object to the selections.

void arranger_selections_set_from_selections(ArrangerSelections* dest, ArrangerSelections* src)

Sets the values of each object in the dest selections to the values in the src selections.

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.

ArrangerSelections* arranger_selections_clone(ArrangerSelections* self)

Clone the struct for copying, undoing, etc.

int arranger_selections_has_any(ArrangerSelections* self)

Returns if there are any selections.

void arranger_selections_get_start_pos(ArrangerSelections* self, Position* pos, int global)

Returns the position of the leftmost 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.

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.

int arranger_selections_get_num_objects(ArrangerSelections* self)

Returns the number of selected objects.

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

Pastes the given selections to the given Position.

Parameters
self
size A pointer to save the size into.

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

void arranger_selections_redraw(ArrangerSelections* self)

Redraws each object in the arranger selections.

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.

void arranger_selections_free(ArrangerSelections* self)

Frees the selections but not the objects.

void arranger_selections_free_full(ArrangerSelections* self)

Frees all the objects as well.

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

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).

void arranger_selections_remove_object(ArrangerSelections* self, ArrangerObject* obj)

Removes the arranger object from the selections.

int 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

void chord_editor_init_loaded(ChordEditor* self)

Inits the ChordEditor after a Project has been loaded.

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_init_loaded(ClipEditor* self)

Inits the ClipEditor after a Project is loaded.

void clip_editor_set_region(ClipEditor* self, ZRegion* region)

Sets the track and refreshes the piano roll widgets.

To be called only from GTK threads.

void clip_editor_redraw_region(ClipEditor* self)

Causes the selected ZRegion to be redrawin in the UI, if any.

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.

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)

Clone the struct for copying, undoing, etc.

int mixer_selections_has_any(MixerSelections* ms)

Returns if there are any selections.

int mixer_selections_get_highest_slot(MixerSelections* ms)

Gets highest slot in the selections.

int mixer_selections_get_lowest_slot(MixerSelections* ms)

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.

bool mixer_selections_contains_slot(MixerSelections* ms, PluginSlotType type, int slot)

Returns if the slot is selected or not.

bool mixer_selections_contains_plugin(MixerSelections* ms, Plugin* pl)

Returns if the plugin is selected or not.

void mixer_selections_add_slot(MixerSelections* ms, Channel* ch, PluginSlotType type, int slot)

Adds a slot to the selections.

Parameters
ms
ch The channel.
type
slot The slot to add to the selections.

The selections can only be from one channel.

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

Removes a slot from the selections.

Assumes that the channel is the one already selected.

Plugin* mixer_selections_get_first_plugin(MixerSelections* self)

Returns the first selected plugin if any is selected, otherwise NULL.

void mixer_selections_clear(MixerSelections* ms, const int pub_events)

Clears selections.

int piano_roll_is_key_black(int note)

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.

int piano_roll_contains_current_note(PianoRoll* self, int note)

Returns 1 if it contains the given note, 0 otherwise.

Track* piano_roll_get_current_track(const PianoRoll* self)

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.

const MidiNoteDescriptor* piano_roll_find_midi_note_descriptor_by_val(PianoRoll* self, const uint8_t val)

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_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.

Define documentation

#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.

Parameters
cc CamelCase (eg, Region).
obj The object.
val_name The struct member name to set the primitive value to.
val_value The value to store.