Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::timeline::AutomationCurve Class Reference

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.

Detailed Description

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.

Member Function Documentation

◆ create()

runtime::Result< AutomationCurve, AutomationCurveError > pulp::timeline::AutomationCurve::create ( std::vector< AutomationPoint > points)
static

Validates, canonically orders, and immutably stores points.

Point identities and positions must be unique; numeric fields must be finite and interpolation values valid.

◆ erase_point()

runtime::Result< AutomationCurve, AutomationCurveError > pulp::timeline::AutomationCurve::erase_point ( ItemId id) const

Returns a new curve without id, or MissingPoint when absent.

◆ find_point()

const AutomationPoint * pulp::timeline::AutomationCurve::find_point ( ItemId id) const
noexcept

Finds a point by identity, or returns nullptr when absent.

The returned pointer is owned by this immutable curve snapshot.

◆ insert_point()

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.

◆ points()

std::span< const AutomationPoint > pulp::timeline::AutomationCurve::points ( ) const
inlinenoexcept

Returns points in canonical position-then-identity order.

The span remains valid while this curve snapshot remains alive.

◆ replace_point()

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.

◆ value_at()

std::optional< float > pulp::timeline::AutomationCurve::value_at ( timebase::TickPosition position) const
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.


The documentation for this class was generated from the following file: