Typed commands, optimistic transactions, sessions, and undo history. More...
Namespaces | |
| namespace | pulp::timeline::detail |
| namespace | pulp::timeline_editor::hit_test_detail |
Classes | |
| struct | pulp::timeline::WriterId |
| Stable non-zero identity of a document writer. More... | |
| struct | pulp::timeline::CommandId |
| Writer-scoped, monotonically assigned command identity. More... | |
| struct | pulp::timeline::TransactionId |
| Writer-scoped, monotonically assigned transaction identity. More... | |
| struct | pulp::timeline::DocumentRevision |
| Monotonic document snapshot revision used for optimistic admission. More... | |
| struct | pulp::timeline::UndoGroupId |
| Writer-scoped identity joining gesture transactions into one undo unit. More... | |
| struct | pulp::timeline::InsertClip |
| Inserts an identity-bearing clip into a track. More... | |
| struct | pulp::timeline::RemoveClip |
| Removes a clip by its owning coordinates and identity. More... | |
| struct | pulp::timeline::InsertAutomationLane |
| Inserts an automation lane into a track. More... | |
| struct | pulp::timeline::RemoveAutomationLane |
| Removes an automation lane by identity. More... | |
| struct | pulp::timeline::MoveClip |
| Replaces a clip's time range under an exact optimistic-value gate. More... | |
| struct | pulp::timeline::SetNoteVelocity |
| Replaces one note velocity under an exact optimistic-value gate. More... | |
| struct | pulp::timeline::ReplaceNoteContent |
| Replaces the complete note event set of one note clip. More... | |
| struct | pulp::timeline::SetNoteEvents |
| Replaces the values of a named subset of one note clip's notes. More... | |
| struct | pulp::timeline::InsertNotes |
| Inserts a set of identity-bearing notes into one MIDI clip. More... | |
| struct | pulp::timeline::RemoveNotes |
| Removes a named set of notes under an exact optimistic-value gate. More... | |
| struct | pulp::timeline::SetClipPlaybackProperties |
| Replaces clip-level gain and fade controls under an exact value gate. More... | |
| struct | pulp::timeline::SetTempoMap |
| Replaces the complete project tempo map under an exact value gate. More... | |
| struct | pulp::timeline::SetMeterMap |
| Replaces the complete project meter map under an exact value gate. More... | |
| struct | pulp::timeline::CreateAsset |
| Adds one sealed recorded or imported media asset. More... | |
| struct | pulp::timeline::RemoveAsset |
| Removes a project-owned media asset by identity. More... | |
| struct | pulp::timeline::InsertTakeLane |
| Inserts one take lane and its owned take-identity subtree. More... | |
| struct | pulp::timeline::RemoveTakeLane |
| Removes a take lane and its owned take identities. More... | |
| struct | pulp::timeline::InsertTake |
| Inserts one take into an existing take lane. More... | |
| struct | pulp::timeline::RemoveTake |
| Removes one take from an existing take lane. More... | |
| struct | pulp::timeline::SetRecordArm |
| Replaces record-arm document intent under an exact optimistic-value gate. More... | |
| struct | pulp::timeline::SetActiveTakeLane |
| Selects the arrangement or an existing take lane under an exact value gate. More... | |
| struct | pulp::timeline::SetTakeComp |
| Replaces a take lane's canonical comp segments under an exact value gate. More... | |
| struct | pulp::timeline::SetTrackFreeze |
| Publishes or clears a pre-rendered track artifact under an exact value gate. More... | |
| struct | pulp::timeline::SetChordScaleLane |
| Replaces a sequence's complete chord/scale lane under an exact value gate. More... | |
| struct | pulp::timeline::SetDynamicsLane |
| Replaces a sequence's complete dynamics lane under an exact value gate. More... | |
| struct | pulp::timeline::InsertMarker |
| Inserts a sequence-owned marker identity. More... | |
| struct | pulp::timeline::RemoveMarker |
| Removes a sequence-owned marker by identity. More... | |
| struct | pulp::timeline::InsertRegion |
| Inserts a sequence-owned region identity. More... | |
| struct | pulp::timeline::RemoveRegion |
| Removes a sequence-owned region by identity. More... | |
| struct | pulp::timeline::SetGroove |
| Replaces a sequence's complete groove under an exact value gate. More... | |
| struct | pulp::timeline::InsertScene |
| Inserts a scene at an authored position in a sequence. More... | |
| struct | pulp::timeline::RemoveScene |
| Removes a scene and its owned slots by identity. More... | |
| struct | pulp::timeline::InsertSlot |
| Inserts a slot at an authored position in a scene. More... | |
| struct | pulp::timeline::RemoveSlot |
| Removes a slot from a scene by identity. More... | |
| struct | pulp::timeline::InsertSequence |
| Inserts a complete sequence and its owned identity subtree. More... | |
| struct | pulp::timeline::CloneSequence |
| Clones a sequence using an explicit, complete owned-identity mapping. More... | |
| struct | pulp::timeline::RemoveSequence |
| Removes a sequence and its owned identity subtree. More... | |
| struct | pulp::timeline::SetClipSequenceRef |
| Retargets a sequence-reference clip under an exact optimistic-value gate. More... | |
| struct | pulp::timeline::SetTrackMixer |
| Replaces track gain and pan under an exact optimistic-value gate. More... | |
| struct | pulp::timeline::InsertTrack |
| Inserts a track and its complete owned identity subtree at an authored position. More... | |
| struct | pulp::timeline::RemoveTrack |
| Removes a track and its complete owned identity subtree by identity. More... | |
| struct | pulp::timeline::SetTrackName |
| Replaces a track's authored name under an exact optimistic-value gate. More... | |
| struct | pulp::timeline::MoveTrack |
| Moves a track in authored order under an exact optimistic-position gate. More... | |
| struct | pulp::timeline::InsertDevice |
| Inserts a typed device declaration into a track's authored chain. More... | |
| struct | pulp::timeline::RemoveDevice |
| Removes a device declaration by identity. More... | |
| struct | pulp::timeline::MoveDevice |
| Moves a device under an exact optimistic authored-position gate. More... | |
| struct | pulp::timeline::RetargetDevice |
| Replaces device kind, binding, slot, stage, bypass, and wet/dry atomically. More... | |
| struct | pulp::timeline::SetDeviceState |
| Replaces the optional content-addressed opaque state reference. More... | |
| struct | pulp::timeline::InsertMidiExpressionLane |
| Inserts a controller/expression lane into a MIDI clip. More... | |
| struct | pulp::timeline::RemoveMidiExpressionLane |
| Removes a controller/expression lane from a MIDI clip by identity. More... | |
| struct | pulp::timeline::SetMidiExpressionLanePoints |
| Replaces one lane's authored points under an exact optimistic-value gate. More... | |
| struct | pulp::timeline::SetProjectTuning |
| Replaces the project-wide tuning statement under an exact value gate. More... | |
| struct | pulp::timeline::SetTrackTuning |
| Replaces one track's tuning override under an exact value gate. More... | |
| struct | pulp::timeline::SetRegion |
| Replaces one sequence-owned region under an exact value gate. More... | |
| struct | pulp::timeline::InsertModulator |
| Inserts a track-owned modulation source. More... | |
| struct | pulp::timeline::RemoveModulator |
| Removes a track-owned modulation source by identity. More... | |
| struct | pulp::timeline::SetModulator |
| Replaces a modulation source's declaration under an exact value gate. More... | |
| struct | pulp::timeline::InsertMacro |
| Inserts a track-owned macro control. More... | |
| struct | pulp::timeline::RemoveMacro |
| Removes a track-owned macro control by identity. More... | |
| struct | pulp::timeline::SetMacro |
| Replaces a macro control's declaration under an exact value gate. More... | |
| struct | pulp::timeline::SetMacroValue |
| Replaces only a macro's authored position under an exact value gate. More... | |
| struct | pulp::timeline::InsertModulationRoute |
| Inserts one authored source-to-parameter connection. More... | |
| struct | pulp::timeline::RemoveModulationRoute |
| Removes one authored connection by identity. More... | |
| struct | pulp::timeline::SetModulationRoute |
| Replaces a route's source, target, depth, and bypass under an exact gate. More... | |
| struct | pulp::timeline::CommandEnvelope |
| One command paired with its writer-scoped idempotency identity. More... | |
| struct | pulp::timeline::Transaction |
| Atomically admitted ordered command batch. More... | |
| struct | pulp::timeline::SessionLimits |
| Resource ceilings for one mutable document session. More... | |
| struct | pulp::timeline::CommandAuthority |
| The authority one command requires, as a class and intent pair. More... | |
| struct | pulp::timeline::WriterCapabilityMask |
| Fixed authority of one writer over command classes and retained size. More... | |
| class | pulp::timeline::WriterToken |
| Move-only authority for submitting transactions to one DocumentSession. More... | |
| struct | pulp::timeline::DocumentView |
| Atomically observed immutable project snapshot and its matching revision. More... | |
| class | pulp::timeline::DocumentSession |
| Thread-safe owner of a revisioned Timeline document. More... | |
| struct | pulp::timeline::DirtyItem |
| Canonical invalidation record for one item and its owning location. More... | |
| struct | pulp::timeline::DirtyContext |
| One sequence-owned context kind a transaction changed. More... | |
| class | pulp::timeline::DirtySet |
| Owned canonical collection of incremental invalidations. More... | |
| struct | pulp::timeline::TransactionError |
| Structured transaction rejection. More... | |
| struct | pulp::timeline::ReducedTransaction |
| Pure reduction result before revision publication. More... | |
| struct | pulp::timeline::CommitResult |
| Immutable state published by a successful session commit. More... | |
| struct | pulp::timeline::UndoLimits |
| Bounds the number and retained memory of undo groups in a session. More... | |
| struct | pulp::timeline_editor::EditIntent |
| One editing step expressed without reference to the device that produced it. More... | |
| struct | pulp::timeline_editor::NoteEditIntent |
| One validated note editing step, independent of pointer or view geometry. More... | |
| class | pulp::timeline_editor::ValidatedNoteEditIntent |
| A note intent that passed validate_note_edit_intent and may cross a host seam. More... | |
| struct | pulp::timeline_editor::EditIntentIdentity |
| Identities a lowered transaction needs and an intent deliberately does not carry. More... | |
| struct | pulp::timeline_editor::EditGestureSubmitOutcome |
| Result of submitting one issued gesture transaction through its allocator. More... | |
| struct | pulp::timeline_editor::EditGestureSubmitError |
| A refusal before submission, or an inconsistent successful session result. More... | |
| class | pulp::timeline_editor::EditGestureIdentityIssue |
| One opaque, single-owner identity issue awaiting a submission outcome. More... | |
| class | pulp::timeline_editor::EditGestureIdentityAllocator |
| Allocates one undo group and submits a construction-safe stream of gesture identities. More... | |
| struct | pulp::timeline_editor::UndoGestureBudget |
| What one open gesture may spend against the undo budget. More... | |
| struct | pulp::timeline_editor::ProjectedHitCandidate |
| One timeline item after a front-end projects it into pixel space. More... | |
| struct | pulp::timeline_editor::ProjectedHit |
| The identity and region selected from a projected candidate set. More... | |
| class | pulp::timeline_editor::Selection |
| Identity-only editor state that never enters the document or its undo history. More... | |
| class | pulp::timeline_editor::SnapGrid |
| A validated musical grid whose phase restarts at every authored bar. More... | |
| struct | pulp::timeline_editor::TrackEditIntent |
| One track-arrangement step expressed without reference to the device that produced it. More... | |
| struct | pulp::timeline_editor::TrackCreateIntent |
| One complete track insertion expressed without device coordinates. More... | |
Typedefs | |
| using | pulp::timeline::Command |
| Exhaustive set of durable Timeline document mutations. | |
| using | pulp::timeline_editor::NoteEditIntentHost = SequencerUiHostT<ValidatedNoteEditIntent> |
| Host binding used by a piano-roll front-end before command lowering. | |
| using | pulp::timeline_editor::EditIntentHost = SequencerUiHostT<EditIntent> |
| The host an editor submits its intents to. | |
| using | pulp::timeline_editor::TrackArrangementIntent = std::variant<TrackEditIntent, TrackCreateIntent> |
| Reorder or create vocabulary for controls that offer both operations. | |
| using | pulp::timeline_editor::TrackEditIntentHost = SequencerUiHostT<TrackEditIntent> |
| The host an arranger submits track intents to. | |
| using | pulp::timeline_editor::TrackArrangementIntentHost = SequencerUiHostT<TrackArrangementIntent> |
| The host an arranger offering reorder and creation submits intents to. | |
Functions | |
| runtime::Result< Transaction, ModelError > | pulp::timeline::build_diverge_transaction (const Project &project, ItemLocation clip, TransactionId transaction_id, DocumentRevision expected_revision, CommandId clone_command_id, CommandId retarget_command_id, std::optional< UndoGroupId > undo_group=std::nullopt) |
| Builds the atomic clone-and-retarget transaction used to diverge a sequence reference. | |
| bool | pulp::timeline::equivalent (const ClipTimeRange &lhs, const ClipTimeRange &rhs) noexcept |
| Compares time ranges by authored value rather than storage representation. | |
| bool | pulp::timeline::equivalent (const Clip &lhs, const Clip &rhs) noexcept |
| Compares complete authored clip state. | |
| bool | pulp::timeline::equivalent (const AutomationLane &lhs, const AutomationLane &rhs) noexcept |
| Compares complete authored automation-lane state. | |
| bool | pulp::timeline::equivalent (const TakeLane &lhs, const TakeLane &rhs) noexcept |
| Compares complete authored take-lane state. | |
| bool | pulp::timeline::equivalent (const Command &lhs, const Command &rhs) noexcept |
| Compares command alternatives and all authored fields. | |
| bool | pulp::timeline::equivalent (const Transaction &lhs, const Transaction &rhs) noexcept |
| Compares transaction identity, admission metadata, and commands. | |
| std::size_t | pulp::timeline::retained_size (const Command &command) noexcept |
| Returns the retained heap-byte estimate used for command/journal limits. | |
| std::size_t | pulp::timeline::retained_size (const Transaction &transaction) noexcept |
| Returns the retained heap-byte estimate of a transaction and its commands. | |
| template<class T> | |
| constexpr CommandAuthority | pulp::timeline::command_authority_of () noexcept |
| Returns the primary authority command type T requires. | |
| CommandAuthority | pulp::timeline::command_authority (const Command &command) noexcept |
| Returns the primary authority command requires. | |
| constexpr std::uint64_t | pulp::timeline::capability_bit (CommandAuthority authority) noexcept |
| Returns the single mask bit representing authority. | |
| constexpr bool | pulp::timeline::allows (const WriterCapabilityMask &mask, CommandAuthority authority) noexcept |
| Reports whether mask permits authority. | |
| constexpr WriterCapabilityMask | pulp::timeline::deny (WriterCapabilityMask mask, CommandClass command_class, CommandIntent intent) noexcept |
| Returns mask with one class/intent pair denied. | |
| constexpr WriterCapabilityMask | pulp::timeline::allow (WriterCapabilityMask mask, CommandClass command_class, CommandIntent intent) noexcept |
| Returns mask with one class/intent pair permitted. | |
| constexpr WriterCapabilityMask | pulp::timeline::unrestricted_capabilities () noexcept |
| Returns the legacy authority carried by writers registered without a mask. | |
| constexpr WriterCapabilityMask | pulp::timeline::non_destructive_capabilities () noexcept |
| Returns a mask permitting every class but denying every destructive intent. | |
| constexpr DirtyFlags | pulp::timeline::operator| (DirtyFlags lhs, DirtyFlags rhs) noexcept |
| Combines independent dirty reasons. | |
| runtime::Result< ReducedTransaction, TransactionError > | pulp::timeline::reduce_transaction (const Project &project, const Transaction &transaction) |
| Purely applies a transaction to a project without session publication. | |
| std::size_t | pulp::timeline::retained_size (std::span< const Command > commands) noexcept |
| Returns a saturated retained-memory estimate for a command sequence. | |
| std::optional< timeline::ModelError > | pulp::timeline_editor::validate_note_edit_intent (const NoteEditIntent &intent) noexcept |
| Returns the first structural or note-domain error, or nullopt when valid. | |
| runtime::Result< timeline::Transaction, NoteLoweringError > | pulp::timeline_editor::lower_note_edit_intent (const ValidatedNoteEditIntent &intent, std::span< const timeline::NoteEvent > current_notes, const EditIntentIdentity &identity) |
| Lowers one note intent to the granular transaction that performs it. | |
| runtime::Result< timeline::Transaction, timeline::ModelError > | pulp::timeline_editor::lower_edit_intent (const EditIntent &intent, const EditIntentIdentity &identity) |
| Lowers one intent to the ordinary transaction that performs it. | |
| UndoGestureBudget | pulp::timeline_editor::undo_gesture_budget (const timeline::UndoLimits &limits, std::span< const timeline::Command > step_forward, std::span< const timeline::Command > step_inverse) noexcept |
| Returns what one open gesture of uniform per-step cost may spend. | |
| std::optional< ProjectedHit > | pulp::timeline_editor::hit_test_projected_items (std::span< const ProjectedHitCandidate > back_to_front, float x_px, float y_px, float tolerance_px) noexcept |
| Selects one projected timeline item using already-resolved pixel tolerance. | |
| runtime::Result< timebase::LoopRegion, LoopRangeError > | pulp::timeline_editor::loop_region_from_snapped_endpoints (timebase::TickPosition first, timebase::TickPosition second) noexcept |
| Build an enabled, structurally canonical loop candidate. | |
| constexpr timebase::LoopRegion | pulp::timeline_editor::with_loop_enabled (timebase::LoopRegion loop, bool enabled) noexcept |
| Return loop with only its enabled state changed. | |
| runtime::Result< timeline::Transaction, timeline::ModelError > | pulp::timeline_editor::lower_track_edit_intent (const TrackEditIntent &intent, const EditIntentIdentity &identity) |
| Lowers one track intent to the ordinary transaction that performs it. | |
| runtime::Result< timeline::Transaction, timeline::ModelError > | pulp::timeline_editor::lower_track_create_intent (const TrackCreateIntent &intent, const EditIntentIdentity &identity) |
| Lowers one complete track-creation intent to InsertTrack. | |
| runtime::Result< timeline::Transaction, timeline::ModelError > | pulp::timeline_editor::lower_track_arrangement_intent (const TrackArrangementIntent &intent, const EditIntentIdentity &identity) |
| Lowers either complete track-arrangement alternative. | |
Variables | |
| constexpr std::size_t | pulp::timeline::kCommandClassCount = 11 |
| Number of distinct command classes. | |
| constexpr std::size_t | pulp::timeline::kCommandIntentCount = 3 |
| Number of distinct command intents. | |
| constexpr std::uint64_t | pulp::timeline::kAllCommandAuthorities |
| Every class/intent pair set. | |
Typed commands, optimistic transactions, sessions, and undo history.
| using pulp::timeline::Command |
Exhaustive set of durable Timeline document mutations.
The host an editor submits its intents to.
SequencerUiHostT is parameterized so the playback seam and the intent vocabulary stay free to evolve apart. This alias is the binding that gives the parameter a concrete meaning; without one the template is only ever instantiated with a test stand-in, and an abstraction with no real instantiation is indistinguishable from an unused one. It is declared beside the vocabulary rather than in a header of its own so exactly one place says which vocabulary an editor submits, while the template itself stays ignorant of that answer.
Host binding used by a piano-roll front-end before command lowering.
| using pulp::timeline_editor::TrackArrangementIntent = std::variant<TrackEditIntent, TrackCreateIntent> |
Reorder or create vocabulary for controls that offer both operations.
The host an arranger offering reorder and creation submits intents to.
The host an arranger submits track intents to.
A second binding of SequencerUiHostT beside EditIntentHost, which is what "a separate channel" means concretely: a view that only rearranges tracks names this one and never acquires the clip vocabulary.
|
strong |
The part of the document one command governs.
Classes partition Command exactly: every alternative maps to one class, so an allowlist over classes is total rather than best-effort.
| Enumerator | |
|---|---|
| Clip | Clip placement, timing, and playback properties on a track. |
| Note | Note content within a clip. |
| Automation | Non-performed control of parameter values on a track: automation lanes, modulation sources, macros, and routes. A lane and a route differ in mechanism – a lane authors a parameter's base value, a route adds a relative offset on top of it – but a class partitions by the authority a grant confers, and the authority is the same one. This is the broadest track-scoped class, which is stated rather than hidden: a writer granted Automation/Create to add lanes can also create modulators. The narrower alternatives are worse, and adding a class is not available – an enumerator renumbers capability_bit and silently repurposes every persisted and transmitted writer mask. |
| Track | Track existence, order, naming, mix, arm, and freeze. |
| Take | Take lanes, takes, and comping. |
| Scene | Launch scenes and their slots. |
| Sequence | Sequence existence and cloning. |
| Device | Device placement, ordering, retargeting, and state. |
| Annotation | Markers, regions, chord/scale lane, and groove. |
| Timing | How the document is interpreted musically: the project tempo and meter maps, and the tuning a project or one of its tracks plays in. The only class that spans project and track scope, because it partitions by what a command governs rather than by where the field is stored. |
| Asset | Project-owned media assets. |
|
strong |
What a command does to the entity its class names.
Remove is the destructive intent: it is the axis a capability mask denies by default for an untrusted writer.
| Enumerator | |
|---|---|
| Create | Brings a new entity into the document. |
| Modify | Changes an existing entity in place. |
| Remove | Takes an existing entity out of the document. |
|
strong |
Stable reason a transaction cannot be reduced or committed.
The ordinals are part of the observable surface: the MCP transaction-failure envelope emits them verbatim as numeric_code. New causes are appended at the end so an existing code never renumbers.
| Enumerator | |
|---|---|
| InvalidIdentifier | |
| EmptyTransaction | |
| StaleRevision | |
| TransactionIdCollision | |
| CommandIdCollision | |
| AlreadyAppliedResultExpired | |
| TargetMissing | |
| WrongTargetKind | |
| InactiveTarget | |
| GestureState | |
| ParentMismatch | |
| ExpectedValueMismatch | |
| IdentityNotAvailable | |
| JournalFull | |
| UndoFull | |
| NothingToUndo | |
| NothingToRedo | |
| WriterLimit | |
| SequenceExhausted | |
| ModelInvariant | |
| JournalDurability | |
| CheckpointMismatch | A replay checkpoint matched the journal base revision but is not the document the journal was built on. A caller precondition failure – recoverable by supplying the right checkpoint – and never evidence that the journal itself is damaged. |
| ReplayDivergence | Replaying a recorded entry did not reproduce what was recorded: the entry no longer reduces, or its re-reduction yielded a different DirtySet. Always a journal-integrity or reducer-nondeterminism failure, never a caller error. transaction names the first diverging entry; item, related_item, and model_error, when present, carry the reducer's account of the second pass. |
| Unspecified | Never produced deliberately. A TransactionError carrying it was returned without its cause being assigned, which is a Pulp bug. |
| CapabilityDenied | The submitting writer's capability mask does not permit the class of one named command. command identifies the first command refused; nothing in the transaction was applied. |
| WriterQuotaExhausted | The transaction's retained size exceeds the writer's per-transaction budget, or would carry its cumulative session total past the writer's ceiling. Nothing was applied, so a smaller transaction may still commit. |
|
strong |
|
strong |
Why an edit-gesture identity operation was refused.
|
strong |
Confirmed lifecycle state of one continuous edit gesture.
|
strong |
What an editing gesture does to the document.
Each verb lowers to a command that already exists; there is deliberately no intent-specific command vocabulary underneath. Selection and marquee are view state rather than document state, and zoom-to-range is viewport state, so none of the three appear here — routing them through this type would push transient UI state into the undo history.
|
strong |
Lifecycle position of a transaction within an interactive gesture.
End and Cancel are the two closing phases and share the mechanical close path: both require a matching open gesture, both clear it, and both close the undo group. They differ in what they assert about the edits already applied — End says they stand, Cancel says they do not. A cancel necessarily arrives AFTER its transactions have been applied, so closing is all the session does: the revert is the caller's existing one-call DocumentSession::undo() over the now-closed group, not a second reduction path hidden inside commit.
| Enumerator | |
|---|---|
| Single | |
| Begin | |
| Update | |
| End | |
| Cancel | |
|
strong |
|
strong |
What a piano-roll gesture does to one note.
This vocabulary is separate from EditIntentKind because note lowering depends on the granular note commands. A view and a ScriptedUiHost can still exchange and compare the complete edit before those commands are available; no note verb pretends to lower to a clip command in the meantime.
|
strong |
Why a note intent could not be lowered to a transaction.
Distinct from ModelError because these refusals describe the caller's stale view or malformed transaction identity rather than an invalid note value.
|
strong |
|
strong |
|
strong |
|
strong |
What a track-arrangement gesture does to the document.
Separate from EditIntentKind rather than added to it. A clip intent names a clip inside a track and carries clip time ranges; a track intent names a track inside a sequence and carries an insertion point. Folding the two together would mean every clip intent carries track-destination fields that are always empty and every track intent carries clip ranges that are always empty, and nothing in the type could say which combination is meaningful — a front-end would validate by convention instead of by construction.
| Enumerator | |
|---|---|
| Reorder | Move a track to a new authored position. Lowers to MoveTrack. |
|
constexprnoexcept |
Returns mask with one class/intent pair permitted.
|
constexprnoexcept |
Reports whether mask permits authority.
| runtime::Result< Transaction, ModelError > pulp::timeline::build_diverge_transaction | ( | const Project & | project, |
| ItemLocation | clip, | ||
| TransactionId | transaction_id, | ||
| DocumentRevision | expected_revision, | ||
| CommandId | clone_command_id, | ||
| CommandId | retarget_command_id, | ||
| std::optional< UndoGroupId > | undo_group = std::nullopt ) |
Builds the atomic clone-and-retarget transaction used to diverge a sequence reference.
clip must locate a SequenceRef clip in project. The returned transaction clones the referenced sequence with fresh identities and retargets the clip; failure leaves the project and supplied identities unchanged.
|
constexprnoexcept |
Returns the single mask bit representing authority.
|
noexcept |
Returns the primary authority command requires.
|
constexprnoexcept |
Returns the primary authority command type T requires.
Total over the Command variant by construction: an unclassified alternative fails to compile rather than defaulting to a permissive answer, so a command added to the variant cannot silently arrive unguarded. Stated per type rather than per value so a conformance check can walk every alternative without constructing one. Admission additionally accounts for identity-bearing children carried by aggregate commands and for the note-ID set difference in ReplaceNoteContent.
|
constexprnoexcept |
Returns mask with one class/intent pair denied.
|
noexcept |
Compares complete authored automation-lane state.
Compares complete authored clip state.
|
noexcept |
Compares time ranges by authored value rather than storage representation.
Compares command alternatives and all authored fields.
Compares complete authored take-lane state.
|
noexcept |
Compares transaction identity, admission metadata, and commands.
|
inlinenodiscardnoexcept |
Selects one projected timeline item using already-resolved pixel tolerance.
This lower-rung kernel deliberately does not name view::HitMetrics or any view-layer geometry type. A front-end resolves its pointer policy to tolerance_px, projects model items into candidates, and passes only those values here.
Tolerance expands each half-open rectangle on all sides. When expanded rectangles overlap, the candidate with the shortest Euclidean distance to its unexpanded rectangle wins. Containment wins a zero-distance boundary tie, preserving half-open ownership; otherwise an exact distance tie selects the later, frontmost candidate. An acquired point outside the original horizontal span selects that side's edge. Inside the span, each edge band is capped at one third of the item width so even a narrow item retains a body band for move gestures.
Invalid identities, non-finite or inverted candidate bounds are ignored. A non-finite point, non-finite tolerance, or negative tolerance fails closed.
|
inlinenodiscardnoexcept |
Build an enabled, structurally canonical loop candidate.
first and second must already contain the caller's explicit snapping decision. Their order describes gesture direction only; the returned range always has start < end. Equal endpoints fail instead of fabricating a duration. This function validates tick structure only. A transport can still reject the candidate when its endpoints map to the same sample or its sample span is shorter than the prepared maximum block.
| runtime::Result< timeline::Transaction, timeline::ModelError > pulp::timeline_editor::lower_edit_intent | ( | const EditIntent & | intent, |
| const EditIntentIdentity & | identity ) |
Lowers one intent to the ordinary transaction that performs it.
Pure: the intent already names its target, so no project lookup is required and the optimistic range gates pass through to the reducer unchanged. A non-Single phase requires a valid undo group owned by the transaction's writer, matching what DocumentSession admits, so a malformed gesture is rejected here instead of at commit.
| runtime::Result< timeline::Transaction, NoteLoweringError > pulp::timeline_editor::lower_note_edit_intent | ( | const ValidatedNoteEditIntent & | intent, |
| std::span< const timeline::NoteEvent > | current_notes, | ||
| const EditIntentIdentity & | identity ) |
Lowers one note intent to the granular transaction that performs it.
current_notes is the target clip's note array as the caller believes it to be. It is a parameter rather than a project lookup so this stays pure for the same reason lower_edit_intent is: one intent can be lowered twice — once per input device in a parity test, once per retry after a stale revision — without the intent being rewritten. The array becomes the command's expected value, so a caller that passes a stale one gets the named ExpectedNoteMismatch refusal before submission rather than a silent overwrite.
Insert lowers to InsertNotes, Erase to RemoveNotes, and Move, Resize, and SetVelocity to SetNoteEvents. The transaction preserves the intent's exact gesture phase, so Begin/Update/End submissions sharing one writer-owned undo group coalesce without retaining the clip's complete note array per frame. A non-Single phase requires a valid undo group owned by the transaction's writer; malformed brackets fail before session submission.
| runtime::Result< timeline::Transaction, timeline::ModelError > pulp::timeline_editor::lower_track_arrangement_intent | ( | const TrackArrangementIntent & | intent, |
| const EditIntentIdentity & | identity ) |
Lowers either complete track-arrangement alternative.
Dispatch is exhaustive: adding an alternative to TrackArrangementIntent also requires adding its lowering arm.
| intent | The reorder or creation step to lower. |
| identity | Transaction, command, revision, and optional undo group. |
| runtime::Result< timeline::Transaction, timeline::ModelError > pulp::timeline_editor::lower_track_create_intent | ( | const TrackCreateIntent & | intent, |
| const EditIntentIdentity & | identity ) |
Lowers one complete track-creation intent to InsertTrack.
Pure, and validates identity agreement plus structurally invalid sequence or destination identities. Project membership and identity availability remain reducer concerns. The resulting transaction always has Single phase.
| intent | The complete track insertion to lower. |
| identity | Transaction, command, revision, and optional undo group. |
| runtime::Result< timeline::Transaction, timeline::ModelError > pulp::timeline_editor::lower_track_edit_intent | ( | const TrackEditIntent & | intent, |
| const EditIntentIdentity & | identity ) |
Lowers one track intent to the ordinary transaction that performs it.
Pure, and validates only what a malformed gesture would get wrong: identity agreement, the undo-group bracket a non-Single phase requires, and ids that are structurally invalid. Whether the destination exists, whether the track is in the sequence, and whether the optimistic gate still holds are the reducer's to answer against a project this function does not have.
It also does not reject naming the moved track as its own destination, though that request describes no position: Sequence::move_track already refuses it with a stated reason, and a second copy of a model rule here could disagree with the one the editing paths enforce.
| intent | The gesture step to lower. |
| identity | Transaction, command, revision, and undo group for the result. |
|
constexprnoexcept |
Returns a mask permitting every class but denying every destructive intent.
|
constexprnoexcept |
Combines independent dirty reasons.
| runtime::Result< ReducedTransaction, TransactionError > pulp::timeline::reduce_transaction | ( | const Project & | project, |
| const Transaction & | transaction ) |
Purely applies a transaction to a project without session publication.
The input project is not mutated. The transaction must be nonempty and use valid, unique command IDs belonging to its writer. Every command is reduced in order; any conflict rejects the entire transaction and returns no partial project. This public reducer does not restore tombstoned identities and is not internally synchronized.
|
noexcept |
Returns the retained heap-byte estimate used for command/journal limits.
|
noexcept |
Returns the retained heap-byte estimate of a transaction and its commands.
|
noexcept |
Returns a saturated retained-memory estimate for a command sequence.
|
noexcept |
Returns what one open gesture of uniform per-step cost may spend.
It sits at the editor rung rather than beside UndoLimits for the reason the edit verbs do: the document model enforces the ceiling and needs no help planning around it, while choosing between streaming a gesture and committing one edit on release is an editor's decision alone. A headless importer, a .pulpgraph loader, and a plugin that wants only commands should not carry it.
Pure, and deliberately takes limits rather than a session: the answer does not depend on what the undo stack already holds. open_gesture is one optional per session, so every group present when a gesture opens is closed, the eviction loop reclaims all of them, and the whole max_retained_bytes is available to the open group alone. max_groups cannot bind either: only the opening Begin adds a group, and the same eviction makes room for it, while every step after it coalesces into that group rather than adding another.
This is the undo ceiling only, and which ceiling actually binds depends on the payload rather than being fixed. JournalLimits bounds the same gesture independently and has no automatic eviction, only checkpoint(). Its byte ceiling never binds first: a step charges the journal roughly its forward commands and the undo stack roughly forward plus inverse, so at twice the charge against half the bytes (8 MiB against 16 MiB) undo is about four times the tighter of the two. Its flat max_transactions cap is the axis that can, since a step is one transaction however small.
So the two swap around a payload size: above it undo binds and this number is the session's real ceiling; below it the journal's flat transaction cap binds and this number is optimistic. The crossover is where a step's undo charge reaches max_retained_bytes / max_transactions, which at the defaults is a whole-content note edit over a clip of roughly sixty notes. A caller below that gets the flat cap — 1024 steps, some seventeen seconds of continuous dragging at 60 Hz — which is longer than a real gesture, and a caller above it is in the regime where the undo ceiling is the problem in the first place. test_timeline_gesture_budget.cpp pins both sides.
The step is taken to be representative: steps is the count at THIS cost. That holds for a drag that moves or reshapes a fixed set of notes, whose arrays keep their size across the gesture. A gesture whose payload grows as it runs should be priced on the largest step it will reach, since a count derived from the first one overestimates.
| limits | The session's undo ceilings. |
| step_forward | Commands one step submits. |
| step_inverse | The inverse the reducer derives for that step. |
|
constexprnoexcept |
Returns the legacy authority carried by writers registered without a mask.
|
noexcept |
Returns the first structural or note-domain error, or nullopt when valid.
This checks only the device-neutral intent contract. Project membership and optimistic concurrency remain the future transaction builder's responsibility.
|
nodiscardconstexprnoexcept |
Return loop with only its enabled state changed.
Both document bounds are preserved exactly, so disabling and later re-enabling a loop restores the same authored range without re-snapping.
|
inlineconstexpr |
Every class/intent pair set.
|
inlineconstexpr |
Number of distinct command classes.
|
inlineconstexpr |
Number of distinct command intents.