|
Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
|
Track span that offers helper methods on a range of tracks. More...
#include <src/gui/dsp/arranger_object_span.h>


Public Types | |
| using | Base = utils::UuidIdentifiableObjectView<ArrangerObjectRegistry> |
| using | VariantType = typename Base::VariantType |
| using | ArrangerObjectUuid = typename Base::UuidType |
| using | Position = dsp::Position |
Public Types inherited from zrythm::utils::UuidIdentifiableObjectView< ArrangerObjectRegistry > | |
| using | UuidType |
| using | VariantType |
| using | UuidRefType |
Public Member Functions | |
| void | init_loaded (bool project, dsp::FramesPerTick frames_per_tick) |
| Inits the selections after loading a project. | |
| std::vector< VariantType > | create_snapshots (const auto &object_factory, QObject &owner) const |
| 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 (bool global) const -> std::pair< VariantType, Position > |
| Gets first object of the given type (if any, otherwise matches all types) and its start position. | |
| auto | get_last_object_and_pos (bool global, bool ends_last) const -> std::pair< VariantType, Position > |
| Gets last object of the given type (if any, otherwise matches all types) and its end (if applicable, otherwise start) position. | |
| std::pair< TrackPtrVariant, TrackPtrVariant > | get_first_and_last_track () const |
| Gets the highest track in the selections. | |
| std::pair< MidiNote *, MidiNote * > | get_first_and_last_note () const |
| void | paste_to_pos (const Position &pos, bool undoable) |
| Pastes the given selections to the given Position. | |
| void | post_deserialize (dsp::FramesPerTick frames_per_tick) |
| Code to run after deserializing a span of objects. | |
| bool | validate () const |
| Used for debugging. | |
| 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 (dsp::FramesPerTick frames_per_tick) 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 | can_be_pasted_at (Position pos, int idx=-1) const |
| Returns if the selections can be pasted at the given position/region. | |
| bool | contains_looped () const |
| bool | can_be_merged () const |
| double | get_length_in_ticks () const |
| bool | contains_clip (const AudioClip &clip) const |
| Whether the selections contain the given clip. | |
| bool | can_split_at_pos (Position pos) const |
| std::optional< VariantType > | get_bounded_object_at_pos (dsp::Position pos, bool include_region_end=false) const |
| Returns the region at the given position, or NULL. | |
| void | unlisten_note_diff (const ArrangerObjectSpan &prev) const |
| Sets the listen status of notes on and off based on changes in the previous selections and the current selections. | |
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 ®istry, 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 Position | position_projection (const VariantType &obj_var) |
| static Position | end_position_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 | track_projection (const VariantType &obj_var) |
| static auto | selected_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) |
| template<FinalBoundedObjectSubclass BoundedObjectT> | |
| static auto | split_bounded_object (const BoundedObjectT &self, const auto &factory, const Position &global_pos, dsp::FramesPerTick frames_per_tick) -> std::pair< ArrangerObjectUuidReference, ArrangerObjectUuidReference > |
| Splits the given object at the given position and returns a pair of newly-created objects (with unique identities). | |
| static void | copy_arranger_object_identifier (const VariantType &dest, const VariantType &src) |
| Copies identifier values from src to this object. | |
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) |
Track span that offers helper methods on a range of tracks.
Definition at line 13 of file arranger_object_span.h.
| using ArrangerObjectSpan::ArrangerObjectUuid = typename Base::UuidType |
Definition at line 19 of file arranger_object_span.h.
Definition at line 17 of file arranger_object_span.h.
Definition at line 22 of file arranger_object_span.h.
| using ArrangerObjectSpan::VariantType = typename Base::VariantType |
Definition at line 18 of file arranger_object_span.h.
| bool ArrangerObjectSpan::can_be_pasted_at | ( | Position | pos, |
| int | idx = -1 ) const |
Returns if the selections can be pasted at the given position/region.
| pos | Position to paste to. |
| idx | Track index to start pasting to, if applicable. |
|
inlinestatic |
Definition at line 103 of file arranger_object_span.h.
|
inline |
Whether the selections contain the given clip.
Definition at line 307 of file arranger_object_span.h.
|
inline |
Definition at line 292 of file arranger_object_span.h.
|
inline |
Returns if the selections contain an unclonable object (such as the start marker).
Definition at line 249 of file arranger_object_span.h.
|
inline |
Returns if the selections contain an undeletable object (such as the start marker).
Definition at line 240 of file arranger_object_span.h.
|
inline |
Whether the selections contain an unrenameable object (such as the start marker).
Definition at line 256 of file arranger_object_span.h.
|
static |
Copies identifier values from src to this object.
Used by UndoableActions where only partial copies that identify the original objects are needed.
Need to rethink this as it's not easily maintainable.
|
inline |
Definition at line 135 of file arranger_object_span.h.
|
inline |
Definition at line 123 of file arranger_object_span.h.
|
inlinestatic |
Definition at line 98 of file arranger_object_span.h.
|
inlinestatic |
Definition at line 46 of file arranger_object_span.h.
|
inline |
Returns the region at the given position, or NULL.
| include_region_end | Whether to include the region's end in the calculation. |
Definition at line 326 of file arranger_object_span.h.
Definition at line 187 of file arranger_object_span.h.
| auto ArrangerObjectSpan::get_first_object_and_pos | ( | bool | global | ) | const -> std::pair< VariantType, Position > |
Gets first object of the given type (if any, otherwise matches all types) and its start position.
| global | For non-timeline selections, whether to return the global position (local + region start). |
| auto ArrangerObjectSpan::get_last_object_and_pos | ( | bool | global, |
| bool | ends_last ) const -> std::pair< VariantType, Position > |
Gets last object of the given type (if any, otherwise matches all types) and its end (if applicable, otherwise start) position.
| ends_last | Whether to get the object that ends last, otherwise the object that starts last. |
| global | For non-timeline selections, whether to return the global position (local + region start). |
|
inline |
Definition at line 299 of file arranger_object_span.h.
| void ArrangerObjectSpan::init_loaded | ( | bool | project, |
| dsp::FramesPerTick | frames_per_tick ) |
Inits the selections after loading a project.
| project | Whether these are project selections (as opposed to clones). |
| frames_per_tick | Frames per tick to use in position conversions. |
|
inlinestatic |
Definition at line 85 of file arranger_object_span.h.
|
inlinestatic |
Definition at line 81 of file arranger_object_span.h.
|
inlinestatic |
Definition at line 67 of file arranger_object_span.h.
| auto ArrangerObjectSpan::merge | ( | dsp::FramesPerTick | frames_per_tick | ) | 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.
|
inlinestatic |
Definition at line 63 of file arranger_object_span.h.
|
inlinestatic |
Definition at line 24 of file arranger_object_span.h.
|
inlinestatic |
Definition at line 41 of file arranger_object_span.h.
|
inline |
Code to run after deserializing a span of objects.
Definition at line 205 of file arranger_object_span.h.
|
inlinestatic |
Definition at line 107 of file arranger_object_span.h.
|
inlinestatic |
Definition at line 93 of file arranger_object_span.h.
| std::vector< VariantType > 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).
| desc | Descending or not. |
|
inlinestatic |
Splits the given object at the given position and returns a pair of newly-created objects (with unique identities).
| object_var | The object to split. |
| global_pos | The position to split at (global). |
Definition at line 375 of file arranger_object_span.h.
|
inlinestatic |
Definition at line 89 of file arranger_object_span.h.
|
inline |
Sets the listen status of notes on and off based on changes in the previous selections and the current selections.
Definition at line 346 of file arranger_object_span.h.