audio/region.h file

A region in the timeline.

Contents

Classes

struct Region
A region (clip) is an object on the timeline that contains either MidiNote's or AudioClip's.

Enums

enum RegionType { REGION_TYPE_MIDI = 0x01, REGION_TYPE_AUDIO = 0x02, REGION_TYPE_AUTOMATION = 0x04, REGION_TYPE_CHORD = 0x08 }
Type of Region.
enum RegionCloneFlag { REGION_CLONE_COPY_MAIN, REGION_CLONE_COPY, REGION_CLONE_LINK }
Flag do indicate how to clone the Region.

Typedefs

using RegionType = enum RegionType
Type of Region.
using RegionCloneFlag = enum RegionCloneFlag
Flag do indicate how to clone the Region.
using Region = struct Region
A region (clip) is an object on the timeline that contains either MidiNote's or AudioClip's.

Functions

void region_init(Region* region, const Position* start_pos, const Position* end_pos, const int is_main)
Only to be used by implementing structs.
void region_init_loaded(Region* region)
Inits freshly loaded region.
auto region_find(Region* r) -> Region*
Finds the region corresponding to the given one.
auto region_find_by_name(const char* name) -> Region*
Looks for the Region under the given name.
void region_split(Region* region, const Position* pos, const int pos_is_local, Region** r1, Region** r2)
Splits the given Region at the given Position, deletes the original Region and adds 2 new Regions in the same parent (Track or AutomationTrack).
void region_unsplit(Region* r1, Region* r2, Region** region)
Undoes what region_split() did.
auto region_find_midi_note(Region* r, MidiNote* _mn) -> MidiNote*
Returns the MidiNote matching the properties of the given MidiNote.
auto region_get_full_length_in_ticks(Region* region) -> long
Returns the full length as it appears on the timeline in ticks.
auto region_get_full_length_in_frames(const Region* region) -> long
Returns the full length as it appears on the timeline in frames.
auto region_get_true_length_in_ticks(Region* region) -> long
Returns the true length as it appears on the piano roll (not taking into account any looping) in ticks.
auto region_get_loop_length_in_frames(const Region* region) -> long
Returns the length of the loop in frames.
auto region_get_loop_length_in_ticks(const Region* region) -> long
Returns the length of the loop in ticks.
auto region_timeline_frames_to_local(const Region* region, const long timeline_frames, const int normalize) -> long
Converts frames on the timeline (global) to local frames (in the clip).
auto region_get_track(Region* region) -> Track*
Returns the Track this Region is in.
auto region_get_num_loops(Region* region, int count_incomplete_loops) -> int
Returns the number of loops in the region, optionally including incomplete ones.
void region_set_lane(Region* region, TrackLane* lane)
Sets the track lane.
void region_set_automation_track(Region* region, AutomationTrack* at)
Sets the automation track.
void region_copy(Region* src, Region* dest)
Copies the data from src to dest.
void region_set_true_end_pos(Region* region, const Position* pos, ArrangerObjectUpdateFlag update_flag)
Checks if position is valid then sets it.
void region_set_loop_end_pos(Region* region, const Position* pos, ArrangerObjectUpdateFlag update_flag)
Checks if position is valid then sets it.
void region_set_loop_start_pos(Region* region, const Position* pos, ArrangerObjectUpdateFlag update_flag)
Checks if position is valid then sets it.
void region_set_clip_start_pos(Region* region, const Position* pos, ArrangerObjectUpdateFlag update_flag)
Checks if position is valid then sets it.
auto region_is_selected(Region* self) -> int
Returns if Region is in MidiArrangerSelections.
void region_update_frames(Region* self)
Updates the frames of each position in each child of the region recursively.
auto region_is_hit(const Region* region, const long gframes) -> int
Returns if the position is inside the region or not.
auto region_is_hit_by_range(const Region* region, const long gframes_start, const long gframes_end) -> int
Returns if any part of the Region is inside the given range, inclusive.
auto region_at_position(Track* track, Position* pos) -> Region*
Returns the region at the given position in the given Track.
auto region_generate_filename(Region* region) -> char*
Generates the filename for this region.
auto region_get_start_region(Region** regions, int num_regions) -> Region*
Returns the region with the earliest start point.
void region_set_name(Region* region, char* name)
Sets Region name (without appending anything to it) to all associated regions.
void region_remove_midi_note(Region* region, MidiNote* midi_note)
Removes the MIDI note and its components completely.
auto region_clone(Region* region, RegionCloneFlag flag) -> Region*
Clone region.
void region_disconnect(Region* self)
Disconnects the region and anything using it.
void region_free_all(Region* region)
Frees each Region stored in obj_info.
void region_free(Region* region)
Frees a single Region and its components.

Defines

#define region_get_lane_region(r)
Gets the TrackLane counterpart of the Region.
#define region_get_main_region(r)
Gets the non-TrackLane counterpart of the Region.
#define region_get_lane_trans_region(r)
Gets the TrackLane counterpart of the Region (transient).
#define region_get_main_trans_region(r)
Gets the non-TrackLane counterpart of the Region (transient).
#define region_should_be_visible(mn)
Returns if Region is (should be) visible.

Define documentation

#define region_get_lane_region(r)

Gets the TrackLane counterpart of the Region.

Only applies to Regions that have lanes.

#define region_get_lane_trans_region(r)

Gets the TrackLane counterpart of the Region (transient).

Only applies to Regions that have lanes.