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

The read side of the contract: a read-only window onto one pinned snapshot's context, narrowed to what its owner declared. More...

#include <compile_context.hpp>

Public Member Functions

 CompileContextView (const Project &project, ItemId sequence_id, CompileContextSubscriptions subscriptions) noexcept
 Creates a borrowed view of sequence_id narrowed to subscriptions.
CompileContextSubscriptions subscriptions () const noexcept
 Returns the context kinds this view permits callers to read.
const ChordScaleLane * chord_scale_lane () const noexcept
 The sequence's chord/scale lane, or null when ChordScale was not declared or the sequence is not in this snapshot.
const ChordScaleEvent * chord_scale_at (timebase::TickPosition position) const noexcept
 The harmony in force at position, or null when ChordScale was not declared, the lane is empty, or position precedes its first event.
const DynamicsLane * dynamics_lane () const noexcept
 The sequence's intensity lane, or null when Dynamics was not declared or the sequence is not in this snapshot.
std::optional< float > dynamics_at (timebase::TickPosition position) const noexcept
 The interpolated intensity at position, or empty when Dynamics was not declared, the lane is empty, or position precedes its first event.
const GrooveTemplate * groove () const noexcept
 The sequence's groove, or null when Groove was not declared or the sequence is not in this snapshot.

Detailed Description

The read side of the contract: a read-only window onto one pinned snapshot's context, narrowed to what its owner declared.

The view borrows the snapshot; the caller pins it (the compiler holds the same shared_ptr<const Project> the request carried) for the view's lifetime. Every accessor returns null for a kind the owner did not declare, so the declaration is load-bearing at the point of the read and not merely paperwork filed at registration.

Constructor & Destructor Documentation

◆ CompileContextView()

pulp::timeline::CompileContextView::CompileContextView ( const Project & project,
ItemId sequence_id,
CompileContextSubscriptions subscriptions )
noexcept

Creates a borrowed view of sequence_id narrowed to subscriptions.

project must outlive this view. A missing sequence produces a view whose context accessors all return nullptr.

Member Function Documentation

◆ chord_scale_at()

const ChordScaleEvent * pulp::timeline::CompileContextView::chord_scale_at ( timebase::TickPosition position) const
noexcept

The harmony in force at position, or null when ChordScale was not declared, the lane is empty, or position precedes its first event.

◆ chord_scale_lane()

const ChordScaleLane * pulp::timeline::CompileContextView::chord_scale_lane ( ) const
noexcept

The sequence's chord/scale lane, or null when ChordScale was not declared or the sequence is not in this snapshot.

◆ dynamics_at()

std::optional< float > pulp::timeline::CompileContextView::dynamics_at ( timebase::TickPosition position) const
noexcept

The interpolated intensity at position, or empty when Dynamics was not declared, the lane is empty, or position precedes its first event.

Empty is not zero: a reader that has not been told an intensity must decide for itself, and handing back 0.0 would look like an authored silence the document never states.

◆ dynamics_lane()

const DynamicsLane * pulp::timeline::CompileContextView::dynamics_lane ( ) const
noexcept

The sequence's intensity lane, or null when Dynamics was not declared or the sequence is not in this snapshot.

◆ groove()

const GrooveTemplate * pulp::timeline::CompileContextView::groove ( ) const
noexcept

The sequence's groove, or null when Groove was not declared or the sequence is not in this snapshot.

A sequence that plays straight still returns a groove — one that states no feel — because "plays straight" is an answer, not an absence.

◆ subscriptions()

CompileContextSubscriptions pulp::timeline::CompileContextView::subscriptions ( ) const
inlinenoexcept

Returns the context kinds this view permits callers to read.


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