Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
arranger_object.h File Reference

Macros for arranger object backends. More...

#include "dsp/curve.h"
#include "dsp/position.h"
#include "dsp/region_identifier.h"
#include "utils/yaml.h"
#include <glib/gi18n.h>
Include dependency graph for arranger_object.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ArrangerObject
 Base struct for arranger objects. More...
 

Macros

#define ARRANGER_OBJECT_MAGIC   347616554
 
#define IS_ARRANGER_OBJECT(tr)
 
#define IS_ARRANGER_OBJECT_AND_NONNULL(x)   (x && IS_ARRANGER_OBJECT (x))
 
#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_type_has_name(type)
 
#define arranger_object_can_have_lanes(_obj)
 Returns if the object is allowed to have lanes.
 
#define arranger_object_type_can_loop(type)    (type == ArrangerObjectType::ARRANGER_OBJECT_TYPE_REGION)
 Returns if the object can loop.
 
#define arranger_object_can_fade(_obj)
 
#define arranger_object_can_mute(_obj)
 
#define arranger_object_owned_by_region(_obj)
 
#define arranger_object_can_cache_drawing(_obj)   (false)
 Whether or not this object supports cached drawing.
 
#define arranger_object_validate_pos   arranger_object_is_position_valid
 
#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.
 

Typedefs

typedef struct _ArrangerWidget ArrangerWidget
 
typedef struct _ArrangerObjectWidget ArrangerObjectWidget
 

Enumerations

enum class  ArrangerObjectResizeType {
  ARRANGER_OBJECT_RESIZE_NORMAL , ARRANGER_OBJECT_RESIZE_LOOP , ARRANGER_OBJECT_RESIZE_FADE , ARRANGER_OBJECT_RESIZE_STRETCH ,
  ArrangerObjectResizeType::ARRANGER_OBJECT_RESIZE_STRETCH_BPM_CHANGE
}
 Flag used in some functions. More...
 
enum class  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. More...
 
enum class  ArrangerObjectFlags { ArrangerObjectFlags::ARRANGER_OBJECT_FLAG_NON_PROJECT = 1 << 0 }
 ArrangerObject flags. More...
 
enum class  ArrangerObjectPositionType {
  ARRANGER_OBJECT_POSITION_TYPE_START , ARRANGER_OBJECT_POSITION_TYPE_END , ARRANGER_OBJECT_POSITION_TYPE_CLIP_START , ARRANGER_OBJECT_POSITION_TYPE_LOOP_START ,
  ARRANGER_OBJECT_POSITION_TYPE_LOOP_END , ARRANGER_OBJECT_POSITION_TYPE_FADE_IN , ARRANGER_OBJECT_POSITION_TYPE_FADE_OUT
}
 

Functions

ArrangerWidgetarranger_object_get_arranger (const ArrangerObject *self)
 Gets the arranger for this arranger object.
 
void arranger_object_set_magic (ArrangerObject *self)
 Sets the magic on the arranger object.
 
HOT Regionarranger_object_get_region (const ArrangerObject *const self)
 If the object is part of a Region, returns it, otherwise returns NULL.
 
const char * arranger_object_get_name (const ArrangerObject *self)
 Returns a pointer to the name of the object, if the object can have names.
 
char * arranger_object_gen_human_readable_name (const ArrangerObject *self)
 Generates a human readable name for the object.
 
void arranger_object_gen_escaped_name (const ArrangerObject *self)
 Generates the escaped name for the object, where applicable.
 
void arranger_object_set_to_object (ArrangerObject *dest, ArrangerObject *src)
 Sets the dest object's values to the main src object's values.
 
ArrangerObjectarranger_object_get_object (ArrangerObject *self)
 Gets the object the ArrangerObjectInfo represents.
 
void arranger_object_init (ArrangerObject *self)
 
void arranger_object_init_loaded (ArrangerObject *self)
 Initializes the object after loading a Project.
 
ArrangerSelectionsarranger_object_get_selections_for_type (ArrangerObjectType type)
 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.
 
WARN_UNUSED_RESULT bool arranger_object_is_hit (const ArrangerObject *self, const Position *start, const Position *end)
 Returns whether the given object is hit by the given position or range.
 
int arranger_object_get_num_loops (ArrangerObject *self, const int count_incomplete)
 Returns the number of loops in the ArrangerObject, optionally including incomplete ones.
 
bool arranger_object_is_selected (ArrangerObject *self)
 Returns if the object is in the selections.
 
NONNULL void arranger_object_print (const ArrangerObject *self)
 Prints debug information about the given object.
 
NONNULL bool arranger_object_get_muted (ArrangerObject *self, bool check_parent)
 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_get_fade_in_pos (const ArrangerObject *self, Position *pos)
 Getter.
 
void arranger_object_get_fade_out_pos (const ArrangerObject *self, Position *pos)
 Getter.
 
void arranger_object_get_position_from_type (const ArrangerObject *self, Position *pos, ArrangerObjectPositionType type)
 
void arranger_object_edit_begin (const ArrangerObject *self)
 Callback when beginning to edit the object.
 
void arranger_object_edit_finish (const ArrangerObject *self, ArrangerSelectionsActionEditType type)
 Callback when finishing editing the object.
 
void arranger_object_edit_position_finish (const ArrangerObject *self)
 
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.
 
HOT NONNULL WARN_UNUSED_RESULT bool arranger_object_is_position_valid (const ArrangerObject *const self, const Position *pos, ArrangerObjectPositionType pos_type)
 Returns if the given Position is valid.
 
bool arranger_object_set_position (ArrangerObject *self, const Position *pos, ArrangerObjectPositionType pos_type, const bool validate)
 Sets the given position on the object, optionally attempting to validate before.
 
void arranger_object_copy_identifier (ArrangerObject *dest, ArrangerObject *src)
 Copies the identifier from src to dest.
 
void arranger_object_add_linked_region (ArrangerObject *self, Region *region)
 
void arranger_object_remove_linked_region (ArrangerObject *self, Region *region)
 
void arranger_object_update_positions (ArrangerObject *self, bool from_ticks, bool bpm_change, UndoableAction *action)
 Updates the positions in each child recursively.
 
void arranger_object_free (ArrangerObject *self)
 Frees only this object.
 
WARN_UNUSED_RESULT bool arranger_object_resize (ArrangerObject *self, const bool left, ArrangerObjectResizeType type, const double ticks, bool during_ui_action, GError **error)
 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_append_children (ArrangerObject *self, GPtrArray *children)
 
void arranger_object_add_ticks_to_children (ArrangerObject *self, const double ticks)
 Adds the given ticks to each included object.
 
HOT NONNULL Trackarranger_object_get_track (const ArrangerObject *const self)
 Returns the Track this ArrangerObject is in.
 
void arranger_object_post_deserialize (ArrangerObject *self)
 
bool arranger_object_validate_name (ArrangerObject *self, const char *name)
 Validates the given name.
 
ArrangerObjectarranger_object_find (ArrangerObject *obj)
 Returns the ArrangerObject matching the given one.
 
ArrangerObjectarranger_object_clone (const ArrangerObject *self)
 Clones the ArrangerObject.
 
WARN_UNUSED_RESULT bool arranger_object_split (ArrangerObject *self, const Position *pos, const bool pos_is_local, ArrangerObject **r1, ArrangerObject **r2, bool is_project, GError **error)
 Splits the given object at the given Position.
 
WARN_UNUSED_RESULT NONNULL_ARGS (1, 2) bool arranger_object_unsplit(ArrangerObject *r1
 Undoes what arranger_object_split() did.
 
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.
 
WARN_UNUSED_RESULT NONNULL_ARGS (1) bool arranger_object_add_to_project(ArrangerObject *obj
 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).
 
WARN_UNUSED_RESULT bool arranger_object_insert_to_project (ArrangerObject *obj, GError **error)
 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.
 
bool arranger_object_is_frozen (ArrangerObject *obj)
 Returns whether the arranger object is part of a frozen track.
 
bool arranger_object_is_deletable (const ArrangerObject *obj)
 Returns whether the given object is deletable or not (eg, start marker).
 
bool arranger_object_is_renamable (const ArrangerObject *obj)
 
void arranger_object_remove_child (ArrangerObject *self, ArrangerObject *child)
 Removes the child from the given object.
 

Variables

WARN_UNUSED_RESULT ArrangerObjectr2
 
WARN_UNUSED_RESULT ArrangerObject ArrangerObject ** obj
 
WARN_UNUSED_RESULT ArrangerObject ArrangerObject bool fire_events
 
WARN_UNUSED_RESULT ArrangerObject ArrangerObject bool GError ** error
 

Detailed Description

Macros for arranger object backends.

Definition in file arranger_object.h.

Typedef Documentation

◆ ArrangerObjectWidget

typedef struct _ArrangerObjectWidget ArrangerObjectWidget

Definition at line 23 of file arranger_object.h.

◆ ArrangerWidget

typedef struct _ArrangerWidget ArrangerWidget

Definition at line 22 of file arranger_object.h.