9#include <PhosphorAnimation/phosphoranimation_export.h>
11#include <QtCore/QJsonObject>
12#include <QtCore/QObject>
13#include <QtCore/QString>
14#include <QtCore/QtMath>
15#include <QtQml/qqmlregistration.h>
72 QML_VALUE_TYPE(phosphorProfile)
138 m_value.curve = c.
curve();
143 return m_value.effectiveDuration();
148 m_value.duration.reset();
151 m_value.duration = ms;
156 return m_value.effectiveMinDistance();
161 m_value.minDistance.reset();
164 m_value.minDistance = px;
169 return static_cast<SequenceMode>(
static_cast<int>(m_value.effectiveSequenceMode()));
180 const int raw =
static_cast<int>(mode);
183 m_value.sequenceMode.reset();
191 return m_value.effectiveStaggerInterval();
196 m_value.staggerInterval.reset();
199 m_value.staggerInterval = ms;
204 return m_value.presetName.value_or(QString());
208 m_value.presetName = name;
218 return m_value.toJson();
245 return m_value == other.m_value;
249 return !(*
this == other);
String-id <-> curve factory registry.
Definition CurveRegistry.h:26
Opaque QML value-type wrapper around shared_ptr<const Curve>.
Definition PhosphorCurve.h:47
std::shared_ptr< const Curve > curve() const
The wrapped pointer. May be null on a default-constructed handle.
Definition PhosphorCurve.h:64
static CurveRegistry * defaultRegistry()
Read-only view of the process-wide default CurveRegistry pointer installed via setDefaultRegistry.
Definition PhosphorCurve.h:106
QML value-type wrapper around PhosphorAnimation::Profile.
Definition PhosphorProfile.h:70
void setCurve(const PhosphorCurve &c)
Definition PhosphorProfile.h:136
QString presetName() const
Definition PhosphorProfile.h:202
SequenceMode sequenceMode() const
Definition PhosphorProfile.h:167
QJsonObject toJson() const
Serialize to a JSON object via Profile::toJson.
Definition PhosphorProfile.h:216
void setPresetName(const QString &name)
Definition PhosphorProfile.h:206
void setDuration(qreal ms)
Definition PhosphorProfile.h:145
PhosphorCurve curve() const
Definition PhosphorProfile.h:132
SequenceMode
Definition PhosphorProfile.h:87
bool operator!=(const PhosphorProfile &other) const
Definition PhosphorProfile.h:247
void setMinDistance(int px)
Definition PhosphorProfile.h:158
static PhosphorProfile fromJson(const QJsonObject &obj)
Parse from a JSON object.
Definition PhosphorProfile.h:234
int minDistance() const
Definition PhosphorProfile.h:154
qreal duration() const
Definition PhosphorProfile.h:141
int staggerInterval() const
Definition PhosphorProfile.h:189
bool operator==(const PhosphorProfile &other) const
Definition PhosphorProfile.h:243
void setSequenceMode(SequenceMode mode)
Definition PhosphorProfile.h:171
PhosphorProfile()=default
void setStaggerInterval(int ms)
Definition PhosphorProfile.h:193
const Profile & value() const
Read-only access to the underlying value.
Definition PhosphorProfile.h:106
Configuration for a single animation event.
Definition Profile.h:33
static constexpr int MaxMinDistancePx
Upper bound on minDistance, in pixels.
Definition Profile.h:49
static constexpr qreal MaxDurationMs
Definition Profile.h:41
static constexpr int MaxStaggerIntervalMs
Definition Profile.h:42
static Profile fromJson(const QJsonObject &obj, const CurveRegistry ®istry)
Parse from JSON.
Definition AnimatedValue.h:32
SequenceMode
How a batch of animations starts. Numeric values match the historical wire format.
Definition Profile.h:21
@ Cascade
Definition Profile.h:23
@ AllAtOnce
Definition Profile.h:22