Zrythm
a highly automated and intuitive digital audio workstation
|
A region (clip) is an object on the timeline that contains either MidiNote's or AudioClip's. More...
#include <dsp/region.h>
Public Member Functions | |
NONNULL void | region_print (const Region *region) |
Print region info for debugging. | |
TrackLane * | region_get_lane (const Region *region) |
Get lane. | |
RegionLinkGroup * | region_get_link_group (Region *self) |
Returns the region's link group. | |
void | region_set_link_group (Region *region, int group_idx, bool update_identifier) |
Sets the link group to the region. | |
MidiNote * | region_find_midi_note (Region *r, MidiNote *_mn) |
Returns the MidiNote matching the properties of the given MidiNote. | |
NONNULL HOT signed_frame_t | region_timeline_frames_to_local (const Region *const self, const signed_frame_t timeline_frames, const bool normalize) |
Converts frames on the timeline (global) to local frames (in the clip). | |
NONNULL void | region_get_frames_till_next_loop_or_end (const Region *const self, const signed_frame_t timeline_frames, signed_frame_t *ret_frames, bool *is_loop) |
Returns the number of frames until the next loop end point or the end of the region. | |
NONNULL void | region_set_lane (Region *self, TrackLane *lane) |
Sets the track lane. | |
void | region_gen_name (Region *region, const char *base_name, AutomationTrack *at, Track *track) |
Generates a name for the Region, either using the given AutomationTrack or Track, or appending to the given base name. | |
NONNULL WARN_UNUSED_RESULT bool | region_stretch (Region *self, double ratio, GError **error) |
Stretch the region's contents. | |
NONNULL void | region_update_identifier (Region *self) |
To be called every time the identifier changes to update the region's children. | |
NONNULL void | region_update_link_group (Region *self) |
Updates all other regions in the region link group, if any. | |
void | region_move_to_track (Region *region, Track *track, int lane_or_at_index, int index) |
Moves the Region to the given Track, maintaining the selection status of the Region. | |
void | region_set_automation_track (Region *region, AutomationTrack *at) |
Sets the automation track. | |
AutomationTrack * | region_get_automation_track (const Region *const region) |
Gets the AutomationTrack using the saved index. | |
NONNULL int | region_is_hit (const Region *region, const signed_frame_t gframes, const bool inclusive) |
Returns if the position is inside the region or not. | |
int | region_is_hit_by_range (const Region *region, const signed_frame_t gframes_start, const signed_frame_t gframes_end, const bool end_inclusive) |
Returns if any part of the Region is inside the given range, inclusive. | |
char * | region_generate_filename (Region *region) |
Generates the filename for this region. | |
bool | region_is_recording (Region *self) |
Returns if this region is currently being recorded onto. | |
bool | region_get_musical_mode (Region *self) |
Returns whether the region is effectively in musical mode. | |
void | region_add_arranger_object (Region *self, ArrangerObject *obj, bool fire_events) |
Wrapper for adding an arranger object. | |
void | region_unlink (Region *region) |
Removes the link group from the region, if any. | |
void | region_remove_all_children (Region *region) |
Removes all children objects from the region. | |
ArrangerSelections * | region_get_arranger_selections (Region *self) |
Returns the ArrangerSelections based on the given region type. | |
ArrangerWidget * | region_get_arranger_for_children (Region *self) |
Returns the arranger for editing the region's children. | |
bool | region_validate (Region *self, bool is_project, double frames_per_tick) |
Sanity checking. | |
void | region_disconnect (Region *self) |
Disconnects the region and anything using it. | |
Public Member Functions inherited from ArrangerObject | |
void | arranger_object_move (ArrangerObject *self, const double ticks) |
Moves the object by the given amount of ticks. | |
bool | arranger_object_validate (const ArrangerObject *const self) |
Validates the arranger object. | |
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. | |
Data Fields | |
ArrangerObject | base |
Base struct. | |
RegionIdentifier | id |
Unique ID. | |
char * | name |
Name to be shown on the widget. | |
char * | escaped_name |
Escaped name for drawing. | |
GdkRGBA | color |
Region color independent of track. | |
bool | use_color |
Whether to use the custom color. | |
MidiNote ** | midi_notes |
MIDI notes. | |
int | num_midi_notes |
size_t | midi_notes_size |
MidiNote * | unended_notes [12000] |
Unended notes started in recording with MIDI NOTE ON signal but haven't received a NOTE OFF yet. | |
int | num_unended_notes |
int | pool_id |
Audio pool ID of the associated audio file, mostly used during serialization. | |
bool | stretching |
Whether currently running the stretching algorithm. | |
double | before_length |
The length before stretching, in ticks. | |
double | stretch_ratio |
Used during arranger UI overlay actions. | |
bool | read_from_pool |
Whether to read the clip from the pool (used in most cases). | |
float | gain |
Gain to apply to the audio (amplitude 0.0-2.0). | |
AudioClip * | clip |
Clip to read frames from, if not from the pool. | |
RegionMusicalMode | musical_mode |
Musical mode setting. | |
Position * | split_points |
Array of split points. | |
int | num_split_points |
size_t | split_points_size |
AutomationPoint ** | aps |
The automation points this region contains. | |
int | num_aps |
size_t | aps_size |
AutomationPoint * | last_recorded_ap |
Last recorded automation point. | |
ChordObject ** | chord_objects |
ChordObject's in this Region. | |
int | num_chord_objects |
size_t | chord_objects_size |
int | bounce |
Set to ON during bouncing if this region should be included. | |
PangoLayout * | layout |
Cache layout for drawing the name. | |
PangoLayout * | chords_layout |
Cache layout for drawing the chord names inside the region. | |
GdkRectangle | last_main_full_rect |
GdkRectangle | last_main_draw_rect |
Last main draw rect. | |
GdkRectangle | last_lane_full_rect |
GdkRectangle | last_lane_draw_rect |
Last lane draw rect. | |
gint64 | last_clip_change |
Last timestamp the audio clip or its contents changed. | |
gint64 | last_cache_time |
Last timestamp the region was cached. | |
ArrangerObject | last_positions_obj |
Last known marker positions (only positions are used). | |
TrackLane * | owner_lane = nullptr |
int | magic |
Data Fields inherited from ArrangerObject | |
ArrangerObjectType | type |
ArrangerObjectFlags | flags |
Flags. | |
Position | pos |
Position (or start Position if the object has length). | |
Position | end_pos |
End Position, if the object has one. | |
Position | clip_start_pos |
Start position of the clip loop, relative to the object's start. | |
Position | loop_start_pos |
Loop start Position, if the object has one, relative to the object's start. | |
Position | loop_end_pos |
End position of the clip loop, relative to the object's start. | |
Position | fade_in_pos |
Fade in position, relative to the object's start. | |
Position | fade_out_pos |
Fade out position, relative to the object's start. | |
CurveOptions | fade_in_opts |
Fade in curve options. | |
CurveOptions | fade_out_opts |
Fade out curve options. | |
GdkRectangle | full_rect |
The full rectangle this object covers including off-screen parts, in absolute coordinates. | |
int | textw |
Cache text H extents and W extents for the text, if the object has any. | |
int | texth |
ArrangerObject * | transient |
A copy ArrangerObject corresponding to this, such as when ctrl+dragging. | |
ArrangerObject * | main |
The opposite of the above. | |
bool | muted |
Whether muted or not (if applicable). | |
int | magic |
RegionIdentifier | region_id |
Parent region identifier for objects that are part of a region. | |
int | index_in_prev_lane |
Object's index in the previous lane (before being moved to a new lane/track). | |
bool | deleted_temporarily |
Whether deleted with delete tool. | |
cairo_t * | cached_cr [2] |
Cached cairo_t. | |
cairo_surface_t * | cached_surface [2] |
Cached surface containing drawing. | |
GdkRectangle | last_name_rect |
Last drawn name rectangle, if object has a name. | |
bool | is_auditioner |
Whether part of an auditioner track. | |
A region (clip) is an object on the timeline that contains either MidiNote's or AudioClip's.
It is uniquely identified using its name, so it must be unique throughout the Project.
AutomationPoint** Region::aps |
ArrangerObject Region::base |
double Region::before_length |
int Region::bounce |
ChordObject** Region::chord_objects |
ChordObject's in this Region.
PangoLayout* Region::chords_layout |
AudioClip* Region::clip |
float Region::gain |
RegionIdentifier Region::id |
gint64 Region::last_cache_time |
gint64 Region::last_clip_change |
GdkRectangle Region::last_lane_draw_rect |
GdkRectangle Region::last_main_draw_rect |
ArrangerObject Region::last_positions_obj |
AutomationPoint* Region::last_recorded_ap |
PangoLayout* Region::layout |
RegionMusicalMode Region::musical_mode |
int Region::pool_id |
bool Region::read_from_pool |
double Region::stretch_ratio |
bool Region::stretching |
MidiNote* Region::unended_notes[12000] |
Unended notes started in recording with MIDI NOTE ON signal but haven't received a NOTE OFF yet.
This is also used temporarily when reading from MIDI files.
FIXME allocate.
bool Region::use_color |