7#include <PhosphorAnimation/phosphoranimation_export.h>
35 static constexpr qreal DefaultDuration = 150.0;
36 static constexpr int DefaultMinDistance = 0;
37 static constexpr SequenceMode DefaultSequenceMode = SequenceMode::AllAtOnce;
38 static constexpr int DefaultStaggerInterval = 30;
41 static constexpr qreal MaxDurationMs = 60.0 * 60.0 * 1000.0;
42 static constexpr int MaxStaggerIntervalMs = 60 * 60 * 1000;
49 static constexpr int MaxMinDistancePx = 100000;
59 std::shared_ptr<const Curve>
curve;
77 return duration.value_or(DefaultDuration);
81 return minDistance.value_or(DefaultMinDistance);
85 return sequenceMode.value_or(DefaultSequenceMode);
89 return staggerInterval.value_or(DefaultStaggerInterval);
101 static constexpr auto JsonFieldCurve =
"curve";
102 static constexpr auto JsonFieldDuration =
"duration";
103 static constexpr auto JsonFieldMinDistance =
"minDistance";
104 static constexpr auto JsonFieldSequenceMode =
"sequenceMode";
105 static constexpr auto JsonFieldStaggerInterval =
"staggerInterval";
106 static constexpr auto JsonFieldPresetName =
"presetName";
144 return !(*
this == other);
String-id <-> curve factory registry.
Definition CurveRegistry.h:26
Configuration for a single animation event.
Definition Profile.h:33
SequenceMode effectiveSequenceMode() const
Definition Profile.h:83
std::optional< int > minDistance
Skip threshold in px — animation skipped if distance < this and no size change.
Definition Profile.h:65
std::optional< SequenceMode > sequenceMode
Definition Profile.h:67
Profile & operator=(Profile &&)=default
bool operator!=(const Profile &other) const
Definition Profile.h:142
Profile(const Profile &)=default
static Profile fromJson(const QJsonObject &obj, const CurveRegistry ®istry)
Parse from JSON.
int effectiveMinDistance() const
Definition Profile.h:79
bool operator==(const Profile &other) const
std::optional< qreal > duration
Animation length in ms. Spring curves derive their own settle time.
Definition Profile.h:62
Profile withDefaults() const
Copy with every unset field filled from library defaults — curve is backfilled with a default-constru...
std::shared_ptr< const Curve > curve
nullptr = inherit from parent / library default (outCubic bezier).
Definition Profile.h:59
std::optional< int > staggerInterval
Milliseconds between cascade starts.
Definition Profile.h:70
std::optional< QString > presetName
Optional user-assigned preset name. Purely decorative for UI.
Definition Profile.h:73
Profile & operator=(const Profile &)=default
QJsonObject toJson() const
Serialize to JSON. Only set fields are emitted.
qreal effectiveDuration() const
Definition Profile.h:75
int effectiveStaggerInterval() const
Definition Profile.h:87
Profile(Profile &&)=default
Definition AnimatedValue.h:32
SequenceMode
How a batch of animations starts. Numeric values match the historical wire format.
Definition Profile.h:21