Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
automation_lane.hpp
Go to the documentation of this file.
1#pragma once
2
7
8#include <cstddef>
9#include <cstdint>
10#include <type_traits>
11#include <variant>
12
13namespace pulp::timeline {
14
18
22
38template <class... Fs> struct AutomationTargetCases : Fs... {
39 using Fs::operator()...;
40};
41template <class... Fs> AutomationTargetCases(Fs...) -> AutomationTargetCases<Fs...>;
42
49inline constexpr std::size_t kAutomationTargetAlternativeCount =
51
58
65
72class AutomationLane {
73 public:
79
81 ItemId id() const noexcept {
82 return id_;
83 }
84
85 const AutomationTarget& target() const noexcept {
86 return target_;
87 }
88
89 const AutomationCurve& curve() const noexcept {
90 return curve_;
91 }
92
96 AutomationLane with_curve(AutomationCurve replacement) const noexcept;
97
98 private:
99 AutomationLane(ItemId id, AutomationTarget target, AutomationCurve curve) noexcept;
100
101 ItemId id_;
102 AutomationTarget target_;
103 AutomationCurve curve_;
104};
105
106static_assert(std::is_nothrow_copy_constructible_v<AutomationLane>);
107static_assert(std::is_nothrow_copy_assignable_v<AutomationLane>);
108static_assert(std::is_nothrow_move_constructible_v<AutomationLane>);
109static_assert(std::is_nothrow_move_assignable_v<AutomationLane>);
110
112
113} // namespace pulp::timeline
Result<T, E> — either holds a T or an E, never both.
Definition result.hpp:76
Immutable, position-ordered automation points.
Definition automation_curve.hpp:88
const AutomationTarget & target() const noexcept
Returns the format-neutral target stored by this lane.
Definition automation_lane.hpp:85
const AutomationCurve & curve() const noexcept
Returns the immutable authored curve.
Definition automation_lane.hpp:89
static runtime::Result< AutomationLane, AutomationLaneError > create(ItemId id, AutomationTarget target, AutomationCurve curve)
Validates and constructs a lane owning curve for target.
ItemId id() const noexcept
Returns the lane's stable document identity.
Definition automation_lane.hpp:81
AutomationLane with_curve(AutomationCurve replacement) const noexcept
Returns a lane snapshot with replacement, preserving identity and target.
ParameterTarget AutomationTarget
Exhaustive authored-target set.
Definition automation_lane.hpp:21
constexpr std::size_t kParameterTargetAlternativeCount
Number of alternatives in ParameterTarget.
Definition parameter_target.hpp:102
AutomationLaneErrorCode
Validation failures returned when constructing an AutomationLane.
Definition automation_lane.hpp:53
constexpr std::size_t kAutomationTargetAlternativeCount
Guard for code that can only be correct for a known set of alternatives — chiefly std::get<T> on a ta...
Definition automation_lane.hpp:49
AutomationTargetCases(Fs...) -> AutomationTargetCases< Fs... >
std::variant< DeviceParameterTarget, TrackMixerTarget > ParameterTarget
Exhaustive set of document parameters an authored control can address.
Definition parameter_target.hpp:92
@ InvalidDevicePlacementId
Definition automation_lane.hpp:55
@ InvalidDeviceId
Definition automation_lane.hpp:56
@ InvalidLaneId
Definition automation_lane.hpp:54
Definition program_compiler.hpp:18
Result<T, E> — success / failure union for fallible operations.
Automation lane failure with the lane and related target identity.
Definition automation_lane.hpp:60
ItemId lane
Definition automation_lane.hpp:62
AutomationLaneErrorCode code
Definition automation_lane.hpp:61
ItemId related_item
Definition automation_lane.hpp:63
Overload set for visiting an AutomationTarget with no generic fallback.
Definition automation_lane.hpp:38
Nonzero monotonic identity for a Timeline-owned object.
Definition item_id.hpp:19