Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
Editing and sessions

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.

Enumerations

enum class  pulp::timeline::GesturePhase : std::uint8_t {
  pulp::timeline::GesturePhase::Single , pulp::timeline::GesturePhase::Begin , pulp::timeline::GesturePhase::Update , pulp::timeline::GesturePhase::End ,
  pulp::timeline::GesturePhase::Cancel
}
 Lifecycle position of a transaction within an interactive gesture. More...
enum class  pulp::timeline::CommandClass : std::uint8_t {
  pulp::timeline::CommandClass::Clip , pulp::timeline::CommandClass::Note , pulp::timeline::CommandClass::Automation , pulp::timeline::CommandClass::Track ,
  pulp::timeline::CommandClass::Take , pulp::timeline::CommandClass::Scene , pulp::timeline::CommandClass::Sequence , pulp::timeline::CommandClass::Device ,
  pulp::timeline::CommandClass::Annotation , pulp::timeline::CommandClass::Timing , pulp::timeline::CommandClass::Asset
}
 The part of the document one command governs. More...
enum class  pulp::timeline::CommandIntent : std::uint8_t { pulp::timeline::CommandIntent::Create , pulp::timeline::CommandIntent::Modify , pulp::timeline::CommandIntent::Remove }
 What a command does to the entity its class names. More...
enum class  pulp::timeline::DirtyFlags : std::uint16_t {
  pulp::timeline::DirtyFlags::None = 0 , pulp::timeline::DirtyFlags::Structure = 1 << 0 , pulp::timeline::DirtyFlags::Timing = 1 << 1 , pulp::timeline::DirtyFlags::Content = 1 << 2 ,
  pulp::timeline::DirtyFlags::Notes = 1 << 3 , pulp::timeline::DirtyFlags::Added = 1 << 4 , pulp::timeline::DirtyFlags::Removed = 1 << 5 , pulp::timeline::DirtyFlags::Automation = 1 << 6 ,
  pulp::timeline::DirtyFlags::Take = 1 << 7 , pulp::timeline::DirtyFlags::Freeze = 1 << 8 , pulp::timeline::DirtyFlags::Marker = 1 << 9 , pulp::timeline::DirtyFlags::Context = 1 << 10 ,
  pulp::timeline::DirtyFlags::Mixer = 1 << 11
}
 Bitmask describing which interpretation of an item became stale. More...
enum class  pulp::timeline::ConflictCode : std::uint8_t {
  pulp::timeline::ConflictCode::InvalidIdentifier , pulp::timeline::ConflictCode::EmptyTransaction , pulp::timeline::ConflictCode::StaleRevision , pulp::timeline::ConflictCode::TransactionIdCollision ,
  pulp::timeline::ConflictCode::CommandIdCollision , pulp::timeline::ConflictCode::AlreadyAppliedResultExpired , pulp::timeline::ConflictCode::TargetMissing , pulp::timeline::ConflictCode::WrongTargetKind ,
  pulp::timeline::ConflictCode::InactiveTarget , pulp::timeline::ConflictCode::GestureState , pulp::timeline::ConflictCode::ParentMismatch , pulp::timeline::ConflictCode::ExpectedValueMismatch ,
  pulp::timeline::ConflictCode::IdentityNotAvailable , pulp::timeline::ConflictCode::JournalFull , pulp::timeline::ConflictCode::UndoFull , pulp::timeline::ConflictCode::NothingToUndo ,
  pulp::timeline::ConflictCode::NothingToRedo , pulp::timeline::ConflictCode::WriterLimit , pulp::timeline::ConflictCode::SequenceExhausted , pulp::timeline::ConflictCode::ModelInvariant ,
  pulp::timeline::ConflictCode::JournalDurability , pulp::timeline::ConflictCode::CheckpointMismatch , pulp::timeline::ConflictCode::ReplayDivergence , pulp::timeline::ConflictCode::Unspecified ,
  pulp::timeline::ConflictCode::CapabilityDenied , pulp::timeline::ConflictCode::WriterQuotaExhausted
}
 Stable reason a transaction cannot be reduced or committed. More...
enum class  pulp::timeline_editor::EditIntentKind : std::uint8_t { pulp::timeline_editor::EditIntentKind::Draw , pulp::timeline_editor::EditIntentKind::Erase , pulp::timeline_editor::EditIntentKind::Move , pulp::timeline_editor::EditIntentKind::Resize }
 What an editing gesture does to the document. More...
enum class  pulp::timeline_editor::NoteEditIntentKind : std::uint8_t {
  pulp::timeline_editor::NoteEditIntentKind::Insert , pulp::timeline_editor::NoteEditIntentKind::Erase , pulp::timeline_editor::NoteEditIntentKind::Move , pulp::timeline_editor::NoteEditIntentKind::Resize ,
  pulp::timeline_editor::NoteEditIntentKind::SetVelocity
}
 What a piano-roll gesture does to one note. More...
enum class  pulp::timeline_editor::EditGestureIdentityState : std::uint8_t { pulp::timeline_editor::EditGestureIdentityState::AwaitingBegin , pulp::timeline_editor::EditGestureIdentityState::Open , pulp::timeline_editor::EditGestureIdentityState::Closed , pulp::timeline_editor::EditGestureIdentityState::Exhausted }
 Confirmed lifecycle state of one continuous edit gesture. More...
enum class  pulp::timeline_editor::EditGestureIdentityError : std::uint8_t {
  pulp::timeline_editor::EditGestureIdentityError::InvalidWriter , pulp::timeline_editor::EditGestureIdentityError::WriterMismatch , pulp::timeline_editor::EditGestureIdentityError::InvalidPhase , pulp::timeline_editor::EditGestureIdentityError::GestureClosed ,
  pulp::timeline_editor::EditGestureIdentityError::IdentityExhausted , pulp::timeline_editor::EditGestureIdentityError::IdentityPending , pulp::timeline_editor::EditGestureIdentityError::ForeignOrStaleIssue , pulp::timeline_editor::EditGestureIdentityError::IntentLoweringFailed ,
  pulp::timeline_editor::EditGestureIdentityError::SubmissionResultMismatch
}
 Why an edit-gesture identity operation was refused. More...
enum class  pulp::timeline_editor::NoteLoweringError : std::uint8_t {
  pulp::timeline_editor::NoteLoweringError::ContinuousGestureUnsupported , pulp::timeline_editor::NoteLoweringError::DuplicateNoteIdentity , pulp::timeline_editor::NoteLoweringError::NoteNotInClip , pulp::timeline_editor::NoteLoweringError::ExpectedNoteMismatch ,
  pulp::timeline_editor::NoteLoweringError::InvalidIdentity
}
 Why a note intent could not be lowered to a transaction. More...
enum class  pulp::timeline_editor::ProjectedHitRegion : std::uint8_t { pulp::timeline_editor::ProjectedHitRegion::Body , pulp::timeline_editor::ProjectedHitRegion::LeadingEdge , pulp::timeline_editor::ProjectedHitRegion::TrailingEdge }
 The horizontal part of a projected item selected by a hit test. More...
enum class  pulp::timeline_editor::LoopRangeError : std::uint8_t { pulp::timeline_editor::LoopRangeError::CollapsedSpan }
 Why an already-snapped loop range could not be constructed. More...
enum class  pulp::timeline_editor::SnapDirection : std::uint8_t { pulp::timeline_editor::SnapDirection::AtOrBefore , pulp::timeline_editor::SnapDirection::Nearest , pulp::timeline_editor::SnapDirection::AtOrAfter }
 Which inclusive grid boundary a gesture requests. More...
enum class  pulp::timeline_editor::SnapGridError : std::uint8_t { pulp::timeline_editor::SnapGridError::InvalidInterval , pulp::timeline_editor::SnapGridError::InvalidSwingRatio }
enum class  pulp::timeline_editor::TrackEditIntentKind : std::uint8_t { pulp::timeline_editor::TrackEditIntentKind::Reorder }
 What a track-arrangement gesture does to the document. More...

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.

Detailed Description

Typed commands, optimistic transactions, sessions, and undo history.

Typedef Documentation

◆ Command

Initial value:
std::variant<
Clones a sequence using an explicit, complete owned-identity mapping.
Definition command.hpp:402
Adds one sealed recorded or imported media asset.
Definition command.hpp:237
Inserts an automation lane into a track.
Definition command.hpp:96
Inserts an identity-bearing clip into a track.
Definition command.hpp:82
Inserts a typed device declaration into a track's authored chain.
Definition command.hpp:471
Inserts a track-owned macro control.
Definition command.hpp:682
Inserts a sequence-owned marker identity.
Definition command.hpp:335
Inserts a controller/expression lane into a MIDI clip.
Definition command.hpp:540
Inserts one authored source-to-parameter connection.
Definition command.hpp:752
Inserts a track-owned modulation source.
Definition command.hpp:638
Inserts a set of identity-bearing notes into one MIDI clip.
Definition command.hpp:182
Inserts a sequence-owned region identity.
Definition command.hpp:347
Inserts a scene at an authored position in a sequence.
Definition command.hpp:366
Inserts a complete sequence and its owned identity subtree.
Definition command.hpp:397
Inserts a slot at an authored position in a scene.
Definition command.hpp:381
Inserts one take lane and its owned take-identity subtree.
Definition command.hpp:249
Inserts one take into an existing take lane.
Definition command.hpp:263
Inserts a track and its complete owned identity subtree at an authored position.
Definition command.hpp:433
Replaces a clip's time range under an exact optimistic-value gate.
Definition command.hpp:110
Moves a device under an exact optimistic authored-position gate.
Definition command.hpp:493
Moves a track in authored order under an exact optimistic-position gate.
Definition command.hpp:463
Removes a project-owned media asset by identity.
Definition command.hpp:242
Removes an automation lane by identity.
Definition command.hpp:103
Removes a clip by its owning coordinates and identity.
Definition command.hpp:89
Removes a device declaration by identity.
Definition command.hpp:483
Removes a track-owned macro control by identity.
Definition command.hpp:695
Removes a sequence-owned marker by identity.
Definition command.hpp:341
Removes a controller/expression lane from a MIDI clip by identity.
Definition command.hpp:556
Removes one authored connection by identity.
Definition command.hpp:766
Removes a track-owned modulation source by identity.
Definition command.hpp:652
Removes a named set of notes under an exact optimistic-value gate.
Definition command.hpp:201
Removes a sequence-owned region by identity.
Definition command.hpp:353
Removes a scene and its owned slots by identity.
Definition command.hpp:375
Removes a sequence and its owned identity subtree.
Definition command.hpp:411
Removes a slot from a scene by identity.
Definition command.hpp:390
Removes a take lane and its owned take identities.
Definition command.hpp:256
Removes one take from an existing take lane.
Definition command.hpp:271
Removes a track and its complete owned identity subtree by identity.
Definition command.hpp:441
Replaces the complete note event set of one note clip.
Definition command.hpp:142
Replaces device kind, binding, slot, stage, bypass, and wet/dry atomically.
Definition command.hpp:507
Selects the arrangement or an existing take lane under an exact value gate.
Definition command.hpp:289
Replaces a sequence's complete chord/scale lane under an exact value gate.
Definition command.hpp:314
Replaces clip-level gain and fade controls under an exact value gate.
Definition command.hpp:213
Retargets a sequence-reference clip under an exact optimistic-value gate.
Definition command.hpp:416
Replaces the optional content-addressed opaque state reference.
Definition command.hpp:521
Replaces a sequence's complete dynamics lane under an exact value gate.
Definition command.hpp:325
Replaces a sequence's complete groove under an exact value gate.
Definition command.hpp:359
Replaces only a macro's authored position under an exact value gate.
Definition command.hpp:735
Replaces a macro control's declaration under an exact value gate.
Definition command.hpp:709
Replaces the complete project meter map under an exact value gate.
Definition command.hpp:228
Replaces one lane's authored points under an exact optimistic-value gate.
Definition command.hpp:573
Replaces a route's source, target, depth, and bypass under an exact gate.
Definition command.hpp:786
Replaces a modulation source's declaration under an exact value gate.
Definition command.hpp:668
Replaces the values of a named subset of one note clip's notes.
Definition command.hpp:167
Replaces one note velocity under an exact optimistic-value gate.
Definition command.hpp:119
Replaces the project-wide tuning statement under an exact value gate.
Definition command.hpp:595
Replaces record-arm document intent under an exact optimistic-value gate.
Definition command.hpp:279
Replaces one sequence-owned region under an exact value gate.
Definition command.hpp:625
Replaces a take lane's canonical comp segments under an exact value gate.
Definition command.hpp:297
Replaces the complete project tempo map under an exact value gate.
Definition command.hpp:222
Publishes or clears a pre-rendered track artifact under an exact value gate.
Definition command.hpp:306
Replaces track gain and pan under an exact optimistic-value gate.
Definition command.hpp:425
Replaces a track's authored name under an exact optimistic-value gate.
Definition command.hpp:447
Replaces one track's tuning override under an exact value gate.
Definition command.hpp:606

Exhaustive set of durable Timeline document mutations.

◆ EditIntentHost

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.

◆ NoteEditIntentHost

Host binding used by a piano-roll front-end before command lowering.

◆ TrackArrangementIntent

Reorder or create vocabulary for controls that offer both operations.

◆ TrackArrangementIntentHost

The host an arranger offering reorder and creation submits intents to.

◆ TrackEditIntentHost

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.

Enumeration Type Documentation

◆ CommandClass

enum class pulp::timeline::CommandClass : std::uint8_t
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.

◆ CommandIntent

enum class pulp::timeline::CommandIntent : std::uint8_t
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.

◆ ConflictCode

enum class pulp::timeline::ConflictCode : std::uint8_t
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.

◆ DirtyFlags

enum class pulp::timeline::DirtyFlags : std::uint16_t
strong

Bitmask describing which interpretation of an item became stale.

Enumerator
None 
Structure 
Timing 
Content 
Notes 
Added 
Removed 
Automation 
Take 
Freeze 
Marker 
Context 
Mixer 

◆ EditGestureIdentityError

enum class pulp::timeline_editor::EditGestureIdentityError : std::uint8_t
strong

Why an edit-gesture identity operation was refused.

Enumerator
InvalidWriter 

The supplied writer carries no valid session authority.

WriterMismatch 

The writer does not match the allocator's opaque provenance.

InvalidPhase 

The requested phase is illegal for the confirmed lifecycle.

GestureClosed 

The allocator already committed End or Cancel.

IdentityExhausted 

A required writer-local identity sequence was exhausted.

IdentityPending 

One previously issued identity still awaits submission.

ForeignOrStaleIssue 

The issue is consumed, moved-from, foreign, or no longer pending.

IntentLoweringFailed 

The supplied intent could not be lowered before session submission.

SubmissionResultMismatch 

A cached success is not the session's current publication.

◆ EditGestureIdentityState

enum class pulp::timeline_editor::EditGestureIdentityState : std::uint8_t
strong

Confirmed lifecycle state of one continuous edit gesture.

Enumerator
AwaitingBegin 

No Begin has been confirmed for this allocator's group.

Open 

A Begin or Update is confirmed and End/Cancel may be issued.

Closed 

End or Cancel committed; this allocator cannot issue again.

Exhausted 

A required writer-local identity sequence was exhausted.

◆ EditIntentKind

enum class pulp::timeline_editor::EditIntentKind : std::uint8_t
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.

Enumerator
Draw 

Create a clip. Lowers to InsertClip.

Erase 

Delete a clip. Lowers to RemoveClip.

Move 

Reposition a clip. Lowers to MoveClip.

Resize 

Change a clip's extent. Lowers to MoveClip with a changed range.

◆ GesturePhase

enum class pulp::timeline::GesturePhase : std::uint8_t
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 

◆ LoopRangeError

enum class pulp::timeline_editor::LoopRangeError : std::uint8_t
strong

Why an already-snapped loop range could not be constructed.

Enumerator
CollapsedSpan 

Both endpoints resolve to the same document tick.

◆ NoteEditIntentKind

enum class pulp::timeline_editor::NoteEditIntentKind : std::uint8_t
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.

Enumerator
Insert 

Add replacement to the target MIDI clip.

Erase 

Remove expected from the target MIDI clip.

Move 

Replace a note after changing its start and/or pitch.

Resize 

Replace a note after changing its start and/or duration.

SetVelocity 

Replace a note after changing its velocity.

◆ NoteLoweringError

enum class pulp::timeline_editor::NoteLoweringError : std::uint8_t
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.

Enumerator
ContinuousGestureUnsupported 

Reserved for source compatibility; granular lowering accepts every phase.

DuplicateNoteIdentity 

Insert supplied a note identity the clip already carries.

NoteNotInClip 

Erase or a transform named a note the supplied content does not carry.

ExpectedNoteMismatch 

The expected note does not match the one the clip currently carries.

InvalidIdentity 

The transaction or command identity is malformed.

◆ ProjectedHitRegion

enum class pulp::timeline_editor::ProjectedHitRegion : std::uint8_t
strong

The horizontal part of a projected item selected by a hit test.

Enumerator
Body 
LeadingEdge 

Left/start edge in projected timeline space.

TrailingEdge 

Right/end edge in projected timeline space.

◆ SnapDirection

enum class pulp::timeline_editor::SnapDirection : std::uint8_t
strong

Which inclusive grid boundary a gesture requests.

Enumerator
AtOrBefore 
Nearest 
AtOrAfter 

◆ SnapGridError

enum class pulp::timeline_editor::SnapGridError : std::uint8_t
strong
Enumerator
InvalidInterval 
InvalidSwingRatio 

◆ TrackEditIntentKind

enum class pulp::timeline_editor::TrackEditIntentKind : std::uint8_t
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.

Function Documentation

◆ allow()

WriterCapabilityMask pulp::timeline::allow ( WriterCapabilityMask mask,
CommandClass command_class,
CommandIntent intent )
constexprnoexcept

Returns mask with one class/intent pair permitted.

◆ allows()

bool pulp::timeline::allows ( const WriterCapabilityMask & mask,
CommandAuthority authority )
constexprnoexcept

Reports whether mask permits authority.

◆ build_diverge_transaction()

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.

◆ capability_bit()

std::uint64_t pulp::timeline::capability_bit ( CommandAuthority authority)
constexprnoexcept

Returns the single mask bit representing authority.

◆ command_authority()

CommandAuthority pulp::timeline::command_authority ( const Command & command)
noexcept

Returns the primary authority command requires.

◆ command_authority_of()

template<class T>
CommandAuthority pulp::timeline::command_authority_of ( )
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.

◆ deny()

WriterCapabilityMask pulp::timeline::deny ( WriterCapabilityMask mask,
CommandClass command_class,
CommandIntent intent )
constexprnoexcept

Returns mask with one class/intent pair denied.

◆ equivalent() [1/6]

bool pulp::timeline::equivalent ( const AutomationLane & lhs,
const AutomationLane & rhs )
noexcept

Compares complete authored automation-lane state.

◆ equivalent() [2/6]

bool pulp::timeline::equivalent ( const Clip & lhs,
const Clip & rhs )
noexcept

Compares complete authored clip state.

◆ equivalent() [3/6]

bool pulp::timeline::equivalent ( const ClipTimeRange & lhs,
const ClipTimeRange & rhs )
noexcept

Compares time ranges by authored value rather than storage representation.

◆ equivalent() [4/6]

bool pulp::timeline::equivalent ( const Command & lhs,
const Command & rhs )
noexcept

Compares command alternatives and all authored fields.

◆ equivalent() [5/6]

bool pulp::timeline::equivalent ( const TakeLane & lhs,
const TakeLane & rhs )
noexcept

Compares complete authored take-lane state.

◆ equivalent() [6/6]

bool pulp::timeline::equivalent ( const Transaction & lhs,
const Transaction & rhs )
noexcept

Compares transaction identity, admission metadata, and commands.

◆ hit_test_projected_items()

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 )
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.

◆ loop_region_from_snapped_endpoints()

runtime::Result< timebase::LoopRegion, LoopRangeError > pulp::timeline_editor::loop_region_from_snapped_endpoints ( timebase::TickPosition first,
timebase::TickPosition second )
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.

◆ lower_edit_intent()

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.

◆ lower_note_edit_intent()

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.

◆ lower_track_arrangement_intent()

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.

Parameters
intentThe reorder or creation step to lower.
identityTransaction, command, revision, and optional undo group.
Returns
The transaction, or the reason the selected intent could not be lowered.

◆ lower_track_create_intent()

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.

Parameters
intentThe complete track insertion to lower.
identityTransaction, command, revision, and optional undo group.
Returns
The transaction, or the reason the intent could not be lowered.

◆ lower_track_edit_intent()

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.

Parameters
intentThe gesture step to lower.
identityTransaction, command, revision, and undo group for the result.
Returns
The transaction, or the reason the intent could not be lowered.

◆ non_destructive_capabilities()

WriterCapabilityMask pulp::timeline::non_destructive_capabilities ( )
constexprnoexcept

Returns a mask permitting every class but denying every destructive intent.

◆ operator|()

DirtyFlags pulp::timeline::operator| ( DirtyFlags lhs,
DirtyFlags rhs )
constexprnoexcept

Combines independent dirty reasons.

◆ reduce_transaction()

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.

◆ retained_size() [1/3]

std::size_t pulp::timeline::retained_size ( const Command & command)
noexcept

Returns the retained heap-byte estimate used for command/journal limits.

◆ retained_size() [2/3]

std::size_t pulp::timeline::retained_size ( const Transaction & transaction)
noexcept

Returns the retained heap-byte estimate of a transaction and its commands.

◆ retained_size() [3/3]

std::size_t pulp::timeline::retained_size ( std::span< const Command > commands)
noexcept

Returns a saturated retained-memory estimate for a command sequence.

◆ undo_gesture_budget()

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.

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.

Parameters
limitsThe session's undo ceilings.
step_forwardCommands one step submits.
step_inverseThe inverse the reducer derives for that step.
Returns
The per-step charge and the number of steps one open gesture admits.

◆ unrestricted_capabilities()

WriterCapabilityMask pulp::timeline::unrestricted_capabilities ( )
constexprnoexcept

Returns the legacy authority carried by writers registered without a mask.

◆ validate_note_edit_intent()

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.

This checks only the device-neutral intent contract. Project membership and optimistic concurrency remain the future transaction builder's responsibility.

◆ with_loop_enabled()

timebase::LoopRegion pulp::timeline_editor::with_loop_enabled ( timebase::LoopRegion loop,
bool enabled )
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.

Variable Documentation

◆ kAllCommandAuthorities

std::uint64_t pulp::timeline::kAllCommandAuthorities
inlineconstexpr
Initial value:
=
(std::uint64_t{1} << (kCommandClassCount * kCommandIntentCount)) - 1
constexpr std::size_t kCommandClassCount
Number of distinct command classes.
Definition document_session.hpp:80
constexpr std::size_t kCommandIntentCount
Number of distinct command intents.
Definition document_session.hpp:96

Every class/intent pair set.

◆ kCommandClassCount

std::size_t pulp::timeline::kCommandClassCount = 11
inlineconstexpr

Number of distinct command classes.

◆ kCommandIntentCount

std::size_t pulp::timeline::kCommandIntentCount = 3
inlineconstexpr

Number of distinct command intents.