20class ArrangerObjectBounds :
public QObject
29 ArrangerObjectBounds (
31 QObject * parent =
nullptr);
32 ~ArrangerObjectBounds ()
override =
default;
33 Z_DISABLE_COPY_MOVE (ArrangerObjectBounds)
41 return length_adapter_.get ();
45 Q_INVOKABLE
void setLengthTicks (
double ticks)
47 length ()->setTicks (ticks);
52 units::sample_t get_end_position_samples (
bool end_position_inclusive)
const;
63 is_hit (
const units::sample_t frames,
bool object_end_pos_inclusive =
false)
78 std::pair<units::sample_t, units::sample_t> global_frames,
79 bool range_start_inclusive =
true,
80 bool range_end_inclusive =
true,
81 bool object_end_pos_inclusive =
false)
const;
84 friend void init_from (
85 ArrangerObjectBounds &obj,
86 const ArrangerObjectBounds &other,
89 static constexpr auto kLengthKey =
"length"sv;
90 friend auto to_json (nlohmann::json &j,
const ArrangerObjectBounds &
object)
92 j[kLengthKey] =
object.length_;
96 j.at (kLengthKey).get_to (
object.length_);
99 auto position () const -> const dsp::AtomicPositionQmlAdapter *
101 return std::addressof (position_);
111 BOOST_DESCRIBE_CLASS (ArrangerObjectBounds, (), (), (), (length_))
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.