Immutable, position-ordered automation points. More...
#include <automation_curve.hpp>
Public Member Functions | |
| std::span< const AutomationPoint > | points () const noexcept |
| Returns points in canonical position-then-identity order. | |
| const AutomationPoint * | find_point (ItemId id) const noexcept |
| Finds a point by identity, or returns nullptr when absent. | |
| std::optional< float > | value_at (timebase::TickPosition position) const noexcept |
| Random-access evaluation for control-thread and compile-time use. | |
| runtime::Result< AutomationCurve, AutomationCurveError > | insert_point (AutomationPoint point) const |
| Returns a new curve containing point; this snapshot remains unchanged. | |
| runtime::Result< AutomationCurve, AutomationCurveError > | replace_point (AutomationPoint point) const |
| Returns a new curve replacing the point with the same identity. | |
| runtime::Result< AutomationCurve, AutomationCurveError > | erase_point (ItemId id) const |
| Returns a new curve without id, or MissingPoint when absent. | |
Static Public Member Functions | |
| static runtime::Result< AutomationCurve, AutomationCurveError > | create (std::vector< AutomationPoint > points) |
| Validates, canonically orders, and immutably stores points. | |
Immutable, position-ordered automation points.
A point's interpolation and curvature describe the segment from that point to the next point. Dormant metadata (the final point's segment fields and curvature on a hold segment) is retained so later edits preserve the author's settings. Continuous segments use a monotonic quadratic blend: zero is linear, positive values ease in, and negative values ease out.
|
static |
Validates, canonically orders, and immutably stores points.
Point identities and positions must be unique; numeric fields must be finite and interpolation values valid.
| runtime::Result< AutomationCurve, AutomationCurveError > pulp::timeline::AutomationCurve::erase_point | ( | ItemId | id | ) | const |
Returns a new curve without id, or MissingPoint when absent.
|
noexcept |
Finds a point by identity, or returns nullptr when absent.
The returned pointer is owned by this immutable curve snapshot.
| runtime::Result< AutomationCurve, AutomationCurveError > pulp::timeline::AutomationCurve::insert_point | ( | AutomationPoint | point | ) | const |
Returns a new curve containing point; this snapshot remains unchanged.
Fails when the point is invalid or conflicts by identity or position.
|
inlinenoexcept |
Returns points in canonical position-then-identity order.
The span remains valid while this curve snapshot remains alive.
| runtime::Result< AutomationCurve, AutomationCurveError > pulp::timeline::AutomationCurve::replace_point | ( | AutomationPoint | point | ) | const |
Returns a new curve replacing the point with the same identity.
Fails when the identity is absent or the replacement is invalid or collides with another point's position.
|
noexcept |
Random-access evaluation for control-thread and compile-time use.
An empty curve has no value; positions outside a non-empty curve clamp to its first or last value. Evaluation uses IEEE double arithmetic with explicit fused multiply-add operations, followed by one float conversion. The audio thread consumes a compiled automation cursor instead.