Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
zrythm::structure::arrangement::LaneOwnedObject Class Reference
Inheritance diagram for zrythm::structure::arrangement::LaneOwnedObject:
Collaboration diagram for zrythm::structure::arrangement::LaneOwnedObject:

Public Types

using MidiLane = structure::tracks::MidiLane
 
using AudioLane = structure::tracks::AudioLane
 
- Public Types inherited from zrythm::structure::arrangement::ArrangerObject
enum class  ResizeType : basic_enum_base_type_t {
  Normal , Loop , Fade , Stretch ,
  StretchTempoChange
}
 Flag used in some functions. More...
 
enum class  Type : basic_enum_base_type_t {
  MidiRegion , AudioRegion , ChordRegion , AutomationRegion ,
  MidiNote , ChordObject , ScaleObject , Marker ,
  AutomationPoint
}
 The type of the object. More...
 
enum class  Flags : basic_enum_base_type_t { NonProject = 1 << 0 }
 Flags. More...
 
enum class  PositionType : basic_enum_base_type_t {
  Start , End , ClipStart , LoopStart ,
  LoopEnd , FadeIn , FadeOut
}
 
using SelectionStatusGetter = std::function<bool (const Uuid &)>
 
using TrackUuid = structure::tracks::TrackUuid
 
using Track = structure::tracks::Track
 
using TrackResolver = structure::tracks::TrackResolver
 
using TrackPtrVariant = structure::tracks::TrackPtrVariant
 
using Position = zrythm::dsp::Position
 
using ArrangerObjectPtr = ArrangerObject *
 

Public Member Functions

 Z_DISABLE_COPY_MOVE (LaneOwnedObject)
 
bool is_inserted_in_lane () const
 
template<typename SelfT>
requires std::is_same_v<SelfT, MidiRegion>
MidiLaneget_lane (this const SelfT &self)
 
template<typename SelfT>
requires std::is_same_v<SelfT, AudioRegion>
AudioLaneget_lane (this const SelfT &self)
 
template<typename SelfT>
auto get_lane_index (this const SelfT &self)
 
void set_lane (structure::tracks::TrackLanePtrVariant lane)
 Sets the track lane.
 
- Public Member Functions inherited from zrythm::structure::arrangement::ArrangerObject
auto get_type () const
 
virtual utils::Utf8String gen_human_friendly_name () const
 Generates a human readable name for the object.
 
bool is_start_hit_by_range (const dsp::Position &start, const dsp::Position &end, bool range_start_inclusive=true, bool range_end_inclusive=false) const
 Returns whether the given object is hit by the given range.
 
bool is_start_hit_by_range (const signed_frame_t global_frames_start, const signed_frame_t global_frames_end, bool range_start_inclusive=true, bool range_end_inclusive=false) const
 
void set_parent_on_base_qproperties (QObject &derived)
 Set the parent on QObject's that are children of this class.
 
auto get_position () const
 Getter.
 
void position_setter_validated (const dsp::Position &pos, dsp::TicksPerFrame ticks_per_frame)
 The setter is for use in e.g.
 
void set_position_unvalidated (const dsp::Position &pos)
 
bool is_position_valid (const dsp::Position &pos, PositionType pos_type, dsp::TicksPerFrame ticks_per_frame) const
 Returns if the given Position is valid.
 
bool set_position (const dsp::Position &pos, PositionType pos_type, bool validate, dsp::TicksPerFrame ticks_per_frame)
 Sets the given position on the object, optionally attempting to validate before.
 
void move (double ticks, dsp::FramesPerTick frames_per_tick)
 Moves the object by the given amount of ticks.
 
void set_track_id (const TrackUuid &track_id)
 
void set_track_id (std::optional< TrackUuid > track_id)
 
void unset_track_id ()
 
void update_positions (bool from_ticks, bool bpm_change, dsp::FramesPerTick frames_per_tick)
 Updates the positions in each child recursively.
 
auto get_track () const
 Returns the Track this ArrangerObject is in.
 
std::optional< TrackUuidget_track_id () const
 
virtual bool validate (bool is_project, dsp::FramesPerTick frames_per_tick) const =0
 Validates the arranger object.
 
virtual ArrangerObjectPtrVariant add_clone_to_project (bool fire_events) const =0
 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).
 
virtual ArrangerObjectPtrVariant insert_clone_to_project () const =0
 Inserts the object where it belongs in the project (eg, a Track).
 
std::optional< ArrangerObjectPtrVariant > remove_from_project (bool free_obj, bool fire_events=false)
 Removes the object (which can be obtained from find_in_project()) from its parent in the project.
 
void set_selection_status_getter (SelectionStatusGetter getter)
 
void unset_selection_status_getter ()
 
virtual bool is_deletable () const
 Returns whether the given object is deletable or not (eg, start marker).
 
- Public Member Functions inherited from zrythm::utils::UuidIdentifiableObject< ArrangerObject >
 UuidIdentifiableObject (const Uuid &id)
 
 UuidIdentifiableObject (const UuidIdentifiableObject &other)=default
 
 UuidIdentifiableObject (UuidIdentifiableObject &&other)=default
 
UuidIdentifiableObjectoperator= (const UuidIdentifiableObject &other)=default
 
UuidIdentifiableObjectoperator= (UuidIdentifiableObject &&other)=default
 
auto get_uuid () const
 

Data Fields

std::optional< int > index_in_prev_lane_
 Object's index in the previous lane (before being moved to a new lane/track).
 
- Data Fields inherited from zrythm::structure::arrangement::ArrangerObject
Flags flags_ {}
 Flags.
 

Friends

void init_from (LaneOwnedObject &obj, const LaneOwnedObject &other, utils::ObjectCloneType clone_type)
 

Additional Inherited Members

- Static Public Attributes inherited from zrythm::structure::arrangement::ArrangerObject
static constexpr double DEFAULT_NUDGE_TICKS = 0.1
 
- Protected Member Functions inherited from zrythm::structure::arrangement::ArrangerObject
 ArrangerObject (Type type, TrackResolver track_resolver) noexcept
 
bool are_members_valid (bool is_project, dsp::FramesPerTick frames_per_tick) const
 To be called by validate() implementations.
 
- Protected Attributes inherited from zrythm::structure::arrangement::ArrangerObject
TrackResolver track_resolver_
 
utils::QObjectUniquePtr< PositionProxypos_
 Position (or start Position if the object has length).
 
std::optional< TrackUuidtrack_id_
 ID of the track this object belongs to.
 
std::optional< SelectionStatusGetter > selection_status_getter_
 

Detailed Description

Definition at line 18 of file lane_owned_object.h.

Member Typedef Documentation

◆ AudioLane

◆ MidiLane

Constructor & Destructor Documentation

◆ LaneOwnedObject()

zrythm::structure::arrangement::LaneOwnedObject::LaneOwnedObject ( )
inlinenoexcept

Definition at line 25 of file lane_owned_object.h.

Member Function Documentation

◆ get_lane() [1/2]

template<typename SelfT>
requires std::is_same_v<SelfT, MidiRegion>
MidiLane & zrythm::structure::arrangement::LaneOwnedObject::get_lane ( this const SelfT & self)
inline

Definition at line 32 of file lane_owned_object.h.

◆ get_lane() [2/2]

template<typename SelfT>
requires std::is_same_v<SelfT, AudioRegion>
AudioLane & zrythm::structure::arrangement::LaneOwnedObject::get_lane ( this const SelfT & self)
inline

Definition at line 39 of file lane_owned_object.h.

◆ get_lane_index()

template<typename SelfT>
auto zrythm::structure::arrangement::LaneOwnedObject::get_lane_index ( this const SelfT & self)
inline

Definition at line 45 of file lane_owned_object.h.

◆ is_inserted_in_lane()

bool zrythm::structure::arrangement::LaneOwnedObject::is_inserted_in_lane ( ) const
inline

Definition at line 29 of file lane_owned_object.h.

◆ set_lane()

void zrythm::structure::arrangement::LaneOwnedObject::set_lane ( structure::tracks::TrackLanePtrVariant lane)
inline

Sets the track lane.

Definition at line 53 of file lane_owned_object.h.

Friends And Related Symbol Documentation

◆ init_from

void init_from ( LaneOwnedObject & obj,
const LaneOwnedObject & other,
utils::ObjectCloneType clone_type )
friend

Definition at line 58 of file lane_owned_object.h.

Field Documentation

◆ index_in_prev_lane_

std::optional<int> zrythm::structure::arrangement::LaneOwnedObject::index_in_prev_lane_

Object's index in the previous lane (before being moved to a new lane/track).

Used at runtime when duplicating objects in new lanes/tracks so we can put the object back to its place before creating new copies.

See also
arranger_selections_action_do().

Definition at line 80 of file lane_owned_object.h.


The documentation for this class was generated from the following file: