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

Adds length functionality to arranger objects. More...

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

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

Public Member Functions

 ArrangerObjectBounds (const dsp::AtomicPositionQmlAdapter &start_position, QObject *parent=nullptr)
dsp::AtomicPositionQmlAdapterlength () const
Q_INVOKABLE void setLengthTicks (double ticks)
units::sample_t get_end_position_samples (bool end_position_inclusive) const
bool is_hit (const units::sample_t frames, bool object_end_pos_inclusive=false) const
 Returns whether the object is hit by the given position (local position if non-timeline object).
bool is_hit_by_range (std::pair< units::sample_t, units::sample_t > global_frames, bool range_start_inclusive=true, bool range_end_inclusive=true, bool object_end_pos_inclusive=false) const
 Whether the object is hit by the given range.

Properties

zrythm::dsp::AtomicPositionQmlAdapterlength

Friends

void init_from (ArrangerObjectBounds &obj, const ArrangerObjectBounds &other, utils::ObjectCloneType clone_type)
auto to_json (nlohmann::json &j, const ArrangerObjectBounds &object)
auto from_json (const nlohmann::json &j, ArrangerObjectBounds &object)

Detailed Description

Adds length functionality to arranger objects.

It provides common functionality and properties shared by objects with length, and methods to resize and check if the object is hit by a position or range.

ArrangerObjectBounds depends on the start position of an ArrangerObject.

Definition at line 20 of file bounded_object.h.

Member Function Documentation

◆ is_hit()

bool zrythm::structure::arrangement::ArrangerObjectBounds::is_hit ( const units::sample_t frames,
bool object_end_pos_inclusive = false ) const

Returns whether the object is hit by the given position (local position if non-timeline object).

Parameters
framesLocal position if non-timeline object.
object_end_pos_inclusiveWhether end_pos_ is considered as part of the object. This is probably always false.

◆ is_hit_by_range()

bool zrythm::structure::arrangement::ArrangerObjectBounds::is_hit_by_range ( std::pair< units::sample_t, units::sample_t > global_frames,
bool range_start_inclusive = true,
bool range_end_inclusive = true,
bool object_end_pos_inclusive = false ) const

Whether the object is hit by the given range.

Parameters
global_framesStart and end positions of the range, in samples.
range_start_inclusiveWhether the start of the range is considered as part of the range.
range_end_inclusiveWhether the end of the range is considered as part of the range.
object_end_pos_inclusiveWhether the end position of the object is considered as part of the object (this is probably always false).

◆ length()

dsp::AtomicPositionQmlAdapter * zrythm::structure::arrangement::ArrangerObjectBounds::length ( ) const
inline

Definition at line 38 of file bounded_object.h.

◆ setLengthTicks()

Q_INVOKABLE void zrythm::structure::arrangement::ArrangerObjectBounds::setLengthTicks ( double ticks)
inline

Definition at line 44 of file bounded_object.h.

◆ from_json

auto from_json ( const nlohmann::json & j,
ArrangerObjectBounds & object )
friend

Definition at line 93 of file bounded_object.h.

◆ to_json

auto to_json ( nlohmann::json & j,
const ArrangerObjectBounds & object )
friend

Definition at line 89 of file bounded_object.h.

Property Documentation

◆ length

zrythm::dsp::AtomicPositionQmlAdapter * zrythm::structure::arrangement::ArrangerObjectBounds::length
read

Definition at line 23 of file bounded_object.h.


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