43 timebaseProvider CONSTANT)
45 double timelineLengthTicks READ timelineLengthTicks NOTIFY
46 timelineLengthTicksChanged)
58 bool trackBounds READ trackBounds WRITE setTrackBounds NOTIFY
60 Q_PROPERTY (
bool looped READ looped NOTIFY loopedChanged)
65 ~Clip ()
noexcept override;
66 Q_DISABLE_COPY_MOVE (Clip)
70 return qobject_cast<dsp::TimelinePosition *> (ArrangerObject::position ());
79 dsp::TimebaseProvider * timebaseProvider ()
const
81 return timebase_provider_.get ();
85 Q_INVOKABLE
void setLengthTicks (
double ticks)
87 length ()->setTicks (ticks);
99 Q_INVOKABLE QList<double>
110 Q_SIGNAL
void timelineLengthTicksChanged ();
130 is_hit (
const units::sample_t frames,
bool object_end_pos_inclusive =
false)
137 std::pair<units::sample_t, units::sample_t> global_frames,
138 bool range_start_inclusive =
true,
139 bool range_end_inclusive =
true,
140 bool object_end_pos_inclusive =
false)
const;
148 return clip_start_pos_.get ();
152 return loop_start_pos_.get ();
156 return loop_end_pos_.get ();
159 bool trackBounds ()
const {
return track_bounds_; }
160 void setTrackBounds (
bool track);
161 Q_SIGNAL
void trackBoundsChanged (
bool track);
184 dsp::ContentTick clip_start,
185 dsp::ContentTick loop_start,
186 dsp::ContentTick loop_end);
188 bool looped ()
const;
189 Q_SIGNAL
void loopedChanged ();
220 dsp::ContentTick (units::ticks (0.0)),
221 loop_end_pos_->asTick () - loop_start_pos_->asTick ());
242 QObject * parent =
nullptr) noexcept;
245 init_from (Clip &obj, const Clip &other,
utils::ObjectCloneType clone_type);
246 friend
void to_json (nlohmann::json &j, const Clip &clip);
247 friend
void from_json (const nlohmann::json &j, Clip &clip);
250 static constexpr auto kTimebaseKey =
"timebase"sv;
251 static constexpr auto kClipStartPosKey =
"clipStartPosition"sv;
252 static constexpr auto kLoopStartPosKey =
"loopStartPosition"sv;
253 static constexpr auto kLoopEndPosKey =
"loopEndPosition"sv;
254 static constexpr auto kTrackBoundsKey =
"trackBounds"sv;
257 utils::QObjectUniquePtr<dsp::ContentTimeWarp> content_warp_;
258 utils::QObjectUniquePtr<dsp::TimebaseProvider> timebase_provider_;
263 utils::QObjectUniquePtr<dsp::ContentPosition> clip_start_pos_;
266 utils::QObjectUniquePtr<dsp::ContentPosition> loop_start_pos_;
269 utils::QObjectUniquePtr<dsp::ContentPosition> loop_end_pos_;
279 bool track_bounds_{
true };
280 std::optional<QMetaObject::Connection> track_bounds_connection_;
A Position whose ticks are content-space (clip-local) ticks.
Maintains the mapping between clip-native content ticks and project timeline ticks.
void set_loop_range(dsp::ContentTick clip_start, dsp::ContentTick loop_start, dsp::ContentTick loop_end)
Set the three loop positions atomically, bypassing the per-position clamping constraints.
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 clip is hit by the given range.