23struct CompileInvalidationData;
24struct ContextRegistryGeneration;
59class ContentProgramFragment {
64 std::span<const ContentFragmentNote>
notes() const noexcept {
70 std::shared_ptr<
const std::vector<ContentFragmentNote>>
notes) noexcept
71 : notes_(std::move(
notes)) {}
72 std::shared_ptr<const std::vector<ContentFragmentNote>> notes_;
181 std::size_t
size() const noexcept {
182 return registrations_.size();
194 return snapshot_generation_ ? snapshot_generation_ : generation_;
205 std::shared_ptr<const CompileContextRegistry> immutable_snapshot()
const;
208 std::vector<ContentRendererRegistration> registrations_;
209 std::shared_ptr<detail::ContextRegistryGeneration> generation_;
210 std::shared_ptr<const detail::ContextRegistryGeneration> snapshot_generation_;
211 std::optional<std::uint64_t> snapshot_revision_;
244 timeline::ItemId root_sequence_id) const noexcept;
251 std::shared_ptr<const
detail::CompileInvalidationData> data_;
The declaration side of the compile-context subscription contract.
Definition compile_context_registry.hpp:148
std::optional< ContextRegistrationError > declare(ContentRendererRegistration registration)
Returns the refusal, or nothing when the registration was accepted.
const ContentRendererRegistration * find(const timeline::RegisteredContent &content) const noexcept
CompileContextRegistry(CompileContextRegistry &&other)
friend class CompileInvalidationIndex
Definition compile_context_registry.hpp:198
std::size_t size() const noexcept
Definition compile_context_registry.hpp:181
static constexpr std::size_t kMaxRegistrations
Definition compile_context_registry.hpp:150
std::shared_ptr< const void > generation_identity() const noexcept
Definition compile_context_registry.hpp:193
static constexpr std::size_t kMaximumFragmentNotesPerClip
Definition compile_context_registry.hpp:151
timeline::CompileContextSubscriptions subscriptions_for(std::string_view content_type_name) const noexcept
What the renderer for content_type_name declared.
CompileContextRegistry & operator=(CompileContextRegistry &&other)
const ContentRendererRegistration * find(const timeline::SchemaIdentity &schema) const noexcept
Finds the exact schema-version registration.
CompileContextRegistry & operator=(const CompileContextRegistry &other)
std::uint64_t revision() const noexcept
Monotonic version within this registry generation's declarations.
friend class PlaybackProgramCompiler
Definition compile_context_registry.hpp:199
CompileContextRegistry(const CompileContextRegistry &other)
friend struct CompileInvalidationInput
Definition compile_context_registry.hpp:200
std::optional< ContextRegistrationError > declare(ContentRendererRegistration registration, const timeline::SchemaRegistry &schemas)
Declares a trusted compiler after proving its exact Content schema and codec exist in the immutable s...
Bundled reverse index for nested dependencies and compile-context readers.
Definition compile_context_registry.hpp:225
static CompileInvalidationIndex build(const timeline::Project &project, timeline::ItemId sequence_id, const CompileContextRegistry ®istry)
bool empty() const noexcept
bool valid() const noexcept
std::span< const timeline::ItemId > subscribers(timeline::CompileContextKind kind) const noexcept
Sorted, deduplicated track ids that declared a read of kind.
std::span< const timeline::ItemId > subscribers(timeline::ItemId owner_sequence, timeline::CompileContextKind kind) const noexcept
Sorted, deduplicated root track ids that read kind from owner_sequence.
bool matches(const timeline::Project &project, timeline::ItemId root_sequence_id) const noexcept
friend DirtyTrackSet resolve_dirty_tracks(const timeline::Project &, timeline::ItemId, const timeline::DirtySet &, const CompileInvalidationIndex &)
Canonical translation from transaction dirtiness to root-track compiler dirtiness.
Owned immutable note output from one off-realtime compile-hook invocation.
Definition compile_context_registry.hpp:59
std::span< const ContentFragmentNote > notes() const noexcept
Definition compile_context_registry.hpp:64
static runtime::Result< ContentProgramFragment, ContentFragmentError > create(std::vector< ContentFragmentNote > notes, timebase::TickDuration clip_duration) noexcept
Result<T, E> — either holds a T or an E, never both.
Definition result.hpp:76
The declared set of context kinds one content renderer reads.
Definition compile_context.hpp:67
The read side of the contract: a read-only window onto one pinned snapshot's context,...
Definition compile_context.hpp:123
Immutable root of a Timeline document and its monotonic identity domain.
Definition model.hpp:1079
Extension-defined typed C++ content admitted by a SchemaRegistry.
Definition clip.hpp:329
Immutable, shareable registry of Timeline schema contracts.
Definition schema_registry.hpp:189
CompileContextKind
A kind of timeline context a renderer's compile hook may read beyond its own clip's content.
Definition compile_context.hpp:46
Definition automation_program.hpp:17
Definition audio_renderer.hpp:20
runtime::Result< ContentProgramFragment, ContentFragmentError >(*)( const RegisteredContentCompileInput &input, const void *context) noexcept RegisteredContentCompileFn
Definition compile_context_registry.hpp:91
RegisteredRendererStatePolicy
Registered note fragments currently admit Reset only.
Definition compile_context_registry.hpp:34
@ CarryByItemId
Definition compile_context_registry.hpp:34
@ Reset
Definition compile_context_registry.hpp:34
ContextRegistrationErrorCode
Definition compile_context_registry.hpp:120
@ InvalidSchemaVersion
Definition compile_context_registry.hpp:124
@ InvalidFragmentQuota
Definition compile_context_registry.hpp:127
@ EmptyContentTypeName
Definition compile_context_registry.hpp:121
@ InvalidProductionDeclaration
Definition compile_context_registry.hpp:128
@ MissingCompileHook
Definition compile_context_registry.hpp:129
@ SchemaUnavailable
Definition compile_context_registry.hpp:125
@ DuplicateContentType
Definition compile_context_registry.hpp:122
@ InvalidOutputKind
Definition compile_context_registry.hpp:130
@ InvalidStatePolicy
Definition compile_context_registry.hpp:131
@ SchemaCodecUnavailable
Definition compile_context_registry.hpp:126
ContentProgramOutputKind
The immutable program-fragment family emitted by a registered compiler.
Definition compile_context_registry.hpp:29
@ Notes
Definition compile_context_registry.hpp:29
@ CapacityExceeded
Definition audio_renderer.hpp:38
ContentFragmentErrorCode
Definition compile_context_registry.hpp:48
@ InvalidNote
Definition compile_context_registry.hpp:50
@ RendererFailed
Definition compile_context_registry.hpp:49
Definition program_compiler.hpp:18
How content is produced, and how honestly a render of it can be replayed.
Result<T, E> — success / failure union for fallible operations.
Definition compile_context_registry.hpp:53
ContentFragmentErrorCode code
Definition compile_context_registry.hpp:54
std::size_t note_index
Definition compile_context_registry.hpp:55
One musical note emitted by a registered content compiler.
Definition compile_context_registry.hpp:39
std::uint8_t pitch
Definition compile_context_registry.hpp:43
timebase::TickDuration duration
Definition compile_context_registry.hpp:41
std::uint16_t velocity
Definition compile_context_registry.hpp:42
std::uint8_t channel
Definition compile_context_registry.hpp:44
constexpr auto operator<=>(const ContentFragmentNote &) const =default
timebase::TickPosition start
Definition compile_context_registry.hpp:40
One content renderer's registration, reduced to the part the dirty set depends on: which content kind...
Definition compile_context_registry.hpp:103
RegisteredContentCompileFn compile
Definition compile_context_registry.hpp:114
timeline::CompileContextSubscriptions subscriptions
Definition compile_context_registry.hpp:105
std::shared_ptr< const void > compile_context
Definition compile_context_registry.hpp:113
RegisteredRendererStatePolicy state_policy
Definition compile_context_registry.hpp:111
std::string content_type_name
Definition compile_context_registry.hpp:104
std::shared_ptr< const void > schema_registry_identity
Definition compile_context_registry.hpp:117
std::uint32_t schema_version
Definition compile_context_registry.hpp:108
ContentProgramOutputKind output_kind
Definition compile_context_registry.hpp:109
timeline::ProductionDeclaration production
Definition compile_context_registry.hpp:112
std::size_t maximum_fragment_notes
Definition compile_context_registry.hpp:110
Definition compile_context_registry.hpp:134
std::string content_type_name
Definition compile_context_registry.hpp:136
ContextRegistrationErrorCode code
Definition compile_context_registry.hpp:135
Definition dirty_track_resolver.hpp:9
Bounded input presented to a trusted compiler hook on the compile worker.
Definition compile_context_registry.hpp:77
timebase::TickPosition context_start
Definition compile_context_registry.hpp:81
timebase::TickDuration clip_duration
Definition compile_context_registry.hpp:80
const timeline::RegisteredContent & content
Definition compile_context_registry.hpp:78
std::size_t maximum_fragment_notes
Definition compile_context_registry.hpp:83
timeline::CompileContextView context
Definition compile_context_registry.hpp:82
timeline::ItemId clip_id
Definition compile_context_registry.hpp:79
Nonzero monotonic identity for a Timeline-owned object.
Definition item_id.hpp:19
What a piece of content declares about its own production.
Definition production_mode.hpp:88
Versioned extension-schema identity.
Definition clip.hpp:102