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;
52 std::shared_ptr<const Curve>
curve;
70 return duration.value_or(DefaultDuration);
74 return minDistance.value_or(DefaultMinDistance);
78 return sequenceMode.value_or(DefaultSequenceMode);
82 return staggerInterval.value_or(DefaultStaggerInterval);
90 static constexpr auto JsonFieldCurve =
"curve";
91 static constexpr auto JsonFieldDuration =
"duration";
92 static constexpr auto JsonFieldMinDistance =
"minDistance";
93 static constexpr auto JsonFieldSequenceMode =
"sequenceMode";
94 static constexpr auto JsonFieldStaggerInterval =
"staggerInterval";
95 static constexpr auto JsonFieldPresetName =
"presetName";
107 return !(*
this == other);
String-id <-> curve factory registry.
Definition CurveRegistry.h:22
Configuration for a single animation event.
Definition Profile.h:33
SequenceMode effectiveSequenceMode() const
Definition Profile.h:76
std::optional< int > minDistance
Skip threshold in px — animation skipped if distance < this and no size change.
Definition Profile.h:58
std::optional< SequenceMode > sequenceMode
Definition Profile.h:60
Profile & operator=(Profile &&)=default
bool operator!=(const Profile &other) const
Definition Profile.h:105
Profile(const Profile &)=default
static Profile fromJson(const QJsonObject &obj, const CurveRegistry ®istry)
Parse from JSON.
int effectiveMinDistance() const
Definition Profile.h:72
bool operator==(const Profile &other) const
std::optional< qreal > duration
Animation length in ms. Spring curves derive their own settle time.
Definition Profile.h:55
Profile withDefaults() const
Copy with every unset field filled from library defaults.
std::shared_ptr< const Curve > curve
nullptr = inherit from parent / library default (outCubic bezier).
Definition Profile.h:52
std::optional< int > staggerInterval
Milliseconds between cascade starts.
Definition Profile.h:63
std::optional< QString > presetName
Optional user-assigned preset name. Purely decorative for UI.
Definition Profile.h:66
Profile & operator=(const Profile &)=default
QJsonObject toJson() const
Serialize to JSON. Only set fields are emitted.
qreal effectiveDuration() const
Definition Profile.h:68
int effectiveStaggerInterval() const
Definition Profile.h:80
Profile(Profile &&)=default
Definition AnimatedValue.h:31
SequenceMode
How a batch of animations starts. Numeric values match the historical wire format.
Definition Profile.h:21