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

Track span that offers helper methods on a range of tracks. More...

#include <src/structure/arrangement/arranger_object_span.h>

Inheritance diagram for zrythm::structure::arrangement::ArrangerObjectSpan:
Collaboration diagram for zrythm::structure::arrangement::ArrangerObjectSpan:

Public Types

using Base = utils::UuidIdentifiableObjectView<ArrangerObjectRegistry>
using VariantType = typename Base::VariantType
using ArrangerObjectUuid = typename Base::UuidType
Public Types inherited from zrythm::utils::UuidIdentifiableObjectView< ArrangerObjectRegistry >
using UuidType
using VariantType
using UuidRefType

Public Member Functions

auto create_new_identities (const auto &object_factory) const -> std::vector< ArrangerObjectUuidReference >
std::vector< VariantType > sort_by_indices (bool desc)
 Sorts the selections by their indices (eg, for regions, their track indices, then the lane indices, then the index in the lane).
auto get_first_object_and_pos () const -> std::pair< VariantType, double >
 Gets first object of the given type (if any, otherwise matches all types) and its start position.
auto get_last_object_and_pos (bool ends_last) const -> std::pair< VariantType, double >
 Gets last object of the given type (if any, otherwise matches all types) and its end (if applicable, otherwise start) position.
std::pair< MidiNote *, MidiNote * > get_first_and_last_note () const
bool contains_undeletable_object () const
 Returns if the selections contain an undeletable object (such as the start marker).
bool contains_unclonable_object () const
 Returns if the selections contain an unclonable object (such as the start marker).
bool contains_unrenamable_object () const
 Whether the selections contain an unrenameable object (such as the start marker).
auto merge () const -> ArrangerObjectUuidReference
 Checks whether an object matches the given parameters.
bool can_be_pasted () const
 Returns if the selections can be pasted at the current place/playhead.
bool all_on_same_lane () const
bool contains_looped () const
bool can_be_merged () const
double get_length_in_ticks () const
std::optional< VariantType > get_bounded_object_at_position (units::sample_t pos_samples, bool include_region_end=false) const
 Returns the region at the given position, or NULL.
Public Member Functions inherited from zrythm::utils::UuidIdentifiableObjectView< ArrangerObjectRegistry >
 UuidIdentifiableObjectView (std::span< const VariantType > objects)
 Constructor for direct object range.
 UuidIdentifiableObjectView (std::span< const UuidRefType > refs)
 Constructor for UuidReference range.
 UuidIdentifiableObjectView (const ArrangerObjectRegistry &registry, std::span< const UuidType > uuids)
 Constructor for Uuid + Registry.
 UuidIdentifiableObjectView (const VariantType &obj)
 Single object constructor.
Iterator begin () const
Iterator end () const
VariantType operator[] (size_t index) const
VariantType front () const
VariantType back () const
VariantType at (size_t index) const
size_t size () const
bool empty () const
auto get_elements_by_type () const
auto as_base_type () const
bool contains_type () const
auto as_type () const
auto get_elements_derived_from () const

Static Public Member Functions

static auto name_projection (const VariantType &obj_var)
static auto position_ticks_projection (const VariantType &obj_var)
static auto end_position_ticks_with_start_position_fallback_projection (const VariantType &obj_var)
static auto midi_note_pitch_projection (const VariantType &obj_var)
static auto looped_projection (const VariantType &obj_var)
static auto is_timeline_object_projection (const VariantType &obj_var)
static auto is_editor_object_projection (const VariantType &obj_var)
static auto deletable_projection (const VariantType &obj_var)
static auto cloneable_projection (const VariantType &obj_var)
static auto renameable_projection (const VariantType &obj_var)
static auto bounded_projection (const VariantType &obj_var)
static auto is_region_projection (const VariantType &obj_var)
static auto bounds_projection (const VariantType &obj_var)
template<BoundedObject BoundedObjectT>
static auto split_bounded_object (const BoundedObjectT &self, const auto &factory, signed_frame_t global_pos) -> std::pair< ArrangerObjectUuidReference, ArrangerObjectUuidReference >
 Splits the given object at the given position and returns a pair of newly-created objects (with unique identities).
Static Public Member Functions inherited from zrythm::utils::UuidIdentifiableObjectView< ArrangerObjectRegistry >
static UuidType uuid_projection (const VariantType &var)
static ArrangerObjectRegistry::BaseType * base_projection (const VariantType &var)
static auto type_projection (const VariantType &var)
static auto derived_from_type_projection (const VariantType &var)
static auto type_transformation (const VariantType &var)
static auto derived_from_type_transformation (const VariantType &var)

Detailed Description

Track span that offers helper methods on a range of tracks.

Definition at line 281 of file arranger_object_span.h.

Member Typedef Documentation

◆ ArrangerObjectUuid

using zrythm::structure::arrangement::ArrangerObjectSpan::ArrangerObjectUuid = typename Base::UuidType

Definition at line 287 of file arranger_object_span.h.

◆ Base

using zrythm::structure::arrangement::ArrangerObjectSpan::Base = utils::UuidIdentifiableObjectView<ArrangerObjectRegistry>

Definition at line 285 of file arranger_object_span.h.

◆ VariantType

using zrythm::structure::arrangement::ArrangerObjectSpan::VariantType = typename Base::VariantType

Definition at line 286 of file arranger_object_span.h.

Member Function Documentation

◆ bounded_projection()

auto zrythm::structure::arrangement::ArrangerObjectSpan::bounded_projection ( const VariantType & obj_var)
inlinestatic

Definition at line 390 of file arranger_object_span.h.

◆ bounds_projection()

auto zrythm::structure::arrangement::ArrangerObjectSpan::bounds_projection ( const VariantType & obj_var)
inlinestatic

Definition at line 402 of file arranger_object_span.h.

◆ cloneable_projection()

auto zrythm::structure::arrangement::ArrangerObjectSpan::cloneable_projection ( const VariantType & obj_var)
inlinestatic

Definition at line 377 of file arranger_object_span.h.

◆ contains_looped()

bool zrythm::structure::arrangement::ArrangerObjectSpan::contains_looped ( ) const
inline

Definition at line 533 of file arranger_object_span.h.

◆ contains_unclonable_object()

bool zrythm::structure::arrangement::ArrangerObjectSpan::contains_unclonable_object ( ) const
inline

Returns if the selections contain an unclonable object (such as the start marker).

Definition at line 499 of file arranger_object_span.h.

◆ contains_undeletable_object()

bool zrythm::structure::arrangement::ArrangerObjectSpan::contains_undeletable_object ( ) const
inline

Returns if the selections contain an undeletable object (such as the start marker).

Definition at line 490 of file arranger_object_span.h.

◆ contains_unrenamable_object()

bool zrythm::structure::arrangement::ArrangerObjectSpan::contains_unrenamable_object ( ) const
inline

Whether the selections contain an unrenameable object (such as the start marker).

Definition at line 506 of file arranger_object_span.h.

◆ create_new_identities()

auto zrythm::structure::arrangement::ArrangerObjectSpan::create_new_identities ( const auto & object_factory) const->std::vector< ArrangerObjectUuidReference >
inline

Definition at line 435 of file arranger_object_span.h.

◆ deletable_projection()

auto zrythm::structure::arrangement::ArrangerObjectSpan::deletable_projection ( const VariantType & obj_var)
inlinestatic

Definition at line 372 of file arranger_object_span.h.

◆ end_position_ticks_with_start_position_fallback_projection()

auto zrythm::structure::arrangement::ArrangerObjectSpan::end_position_ticks_with_start_position_fallback_projection ( const VariantType & obj_var)
inlinestatic

Definition at line 319 of file arranger_object_span.h.

◆ get_bounded_object_at_position()

std::optional< VariantType > zrythm::structure::arrangement::ArrangerObjectSpan::get_bounded_object_at_position ( units::sample_t pos_samples,
bool include_region_end = false ) const
inline

Returns the region at the given position, or NULL.

Parameters
include_region_endWhether to include the region's end in the calculation.

Definition at line 553 of file arranger_object_span.h.

◆ get_first_and_last_note()

std::pair< MidiNote *, MidiNote * > zrythm::structure::arrangement::ArrangerObjectSpan::get_first_and_last_note ( ) const
inline

Definition at line 476 of file arranger_object_span.h.

◆ get_last_object_and_pos()

auto zrythm::structure::arrangement::ArrangerObjectSpan::get_last_object_and_pos ( bool ends_last) const->std::pair< VariantType, double >

Gets last object of the given type (if any, otherwise matches all types) and its end (if applicable, otherwise start) position.

Parameters
ends_lastWhether to get the object that ends last, otherwise the object that starts last.

◆ get_length_in_ticks()

double zrythm::structure::arrangement::ArrangerObjectSpan::get_length_in_ticks ( ) const
inline

Definition at line 540 of file arranger_object_span.h.

◆ is_editor_object_projection()

auto zrythm::structure::arrangement::ArrangerObjectSpan::is_editor_object_projection ( const VariantType & obj_var)
inlinestatic

Definition at line 368 of file arranger_object_span.h.

◆ is_region_projection()

auto zrythm::structure::arrangement::ArrangerObjectSpan::is_region_projection ( const VariantType & obj_var)
inlinestatic

Definition at line 396 of file arranger_object_span.h.

◆ is_timeline_object_projection()

auto zrythm::structure::arrangement::ArrangerObjectSpan::is_timeline_object_projection ( const VariantType & obj_var)
inlinestatic

Definition at line 362 of file arranger_object_span.h.

◆ looped_projection()

auto zrythm::structure::arrangement::ArrangerObjectSpan::looped_projection ( const VariantType & obj_var)
inlinestatic

Definition at line 348 of file arranger_object_span.h.

◆ merge()

auto zrythm::structure::arrangement::ArrangerObjectSpan::merge ( ) const->ArrangerObjectUuidReference

Checks whether an object matches the given parameters.

If a parameter should be checked, the has_* argument must be true and the corresponding argument must have the value to be checked against. Merges the objects into one.

Note
All selections must be on the same lane.

◆ midi_note_pitch_projection()

auto zrythm::structure::arrangement::ArrangerObjectSpan::midi_note_pitch_projection ( const VariantType & obj_var)
inlinestatic

Definition at line 344 of file arranger_object_span.h.

◆ name_projection()

auto zrythm::structure::arrangement::ArrangerObjectSpan::name_projection ( const VariantType & obj_var)
inlinestatic

Definition at line 290 of file arranger_object_span.h.

◆ position_ticks_projection()

auto zrythm::structure::arrangement::ArrangerObjectSpan::position_ticks_projection ( const VariantType & obj_var)
inlinestatic

Definition at line 314 of file arranger_object_span.h.

◆ renameable_projection()

auto zrythm::structure::arrangement::ArrangerObjectSpan::renameable_projection ( const VariantType & obj_var)
inlinestatic

Definition at line 381 of file arranger_object_span.h.

◆ sort_by_indices()

std::vector< VariantType > zrythm::structure::arrangement::ArrangerObjectSpan::sort_by_indices ( bool desc)

Sorts the selections by their indices (eg, for regions, their track indices, then the lane indices, then the index in the lane).

Note
Only works for objects whose tracks exist.
Parameters
descDescending or not.

◆ split_bounded_object()

template<BoundedObject BoundedObjectT>
auto zrythm::structure::arrangement::ArrangerObjectSpan::split_bounded_object ( const BoundedObjectT & self,
const auto & factory,
signed_frame_t global_pos )->std::pair< ArrangerObjectUuidReference, ArrangerObjectUuidReference >
inlinestatic

Splits the given object at the given position and returns a pair of newly-created objects (with unique identities).

Parameters
object_varThe object to split.
global_posThe position to split at (global).
Returns
A pair of the new objects created.
Note
This doesn't modify anything inside the project. The caller is responsible removing/adding objects to/from the project.

Definition at line 601 of file arranger_object_span.h.


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