Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
timeline_offline_renderer.hpp
Go to the documentation of this file.
1#pragma once
2
3// One-shot transport-aware offline renderer for a prepared Timeline graph.
4//
5// WHY THIS EXISTS AND WHY IT IS NOT OfflineSignalGraphHost.
6//
7// OfflineSignalGraphHost deliberately drives the *no-transport*
8// SignalGraph::process() overload: its whole contract is "block partitioning is
9// the only difference between online and offline", which requires that nodes
10// receive nothing else that varies. Timeline graph nodes are the opposite case
11// — TimelineGraphPlaybackBinding::process() needs the exact block and transport
12// state for that block, because note scheduling, automation evaluation and PDC
13// all read it. Driving a Timeline slice through the legacy offline host does not
14// fail loudly; it renders silence. So this is a separate renderer whose block
15// loop is MasterTransport::begin_block() -> TimelineGraphPlaybackBinding::
16// process(). OfflineSignalGraphHost and core/playback are unchanged.
17//
18// The renderer is one-shot and fail-closed: it either returns a complete render
19// or a status and no audio. There is no partial success, because a truncated
20// bounce that looks like a short file is the failure mode this is meant to make
21// impossible.
22//
23// Bounds are authored in ticks and derived to samples ONLY through the program's
24// own compiled tempo map, so a tempo change inside the region is honoured
25// exactly rather than approximated from a nominal rate.
26
32
33#include <cstdint>
34#include <span>
35
36namespace pulp::host {
37
58
71
80
100
116 const playback::PlaybackProgram& program,
117 std::span<const TimelineTrackGraphRoute> routes,
118 const TimelineOfflineRenderConfig& config,
119 const TimelineOfflineRenderOptions& options);
120
121} // namespace pulp::host
Definition signal_graph_runtime.hpp:83
Desktop adapter that lowers phase-1 timeline tracks into stable SignalGraph nodes.
Definition timeline_graph_binding.hpp:184
Definition program.hpp:290
Definition graph_runtime_buffer_assignment.hpp:8
Bounded event contracts shared by host ingress and graph-authored nodes.
Definition anticipation_eligibility.hpp:9
TimelineOfflineRenderCode
Why a render did not produce audio. Ok is the only success value.
Definition timeline_offline_renderer.hpp:39
@ InvalidProgram
The program has no tracks, no tempo map, or no routes were supplied.
Definition timeline_offline_renderer.hpp:50
@ TransportRejected
MasterTransport::prepare()/seek()/set_playing() failed; see transport_error.
Definition timeline_offline_renderer.hpp:54
@ Ok
Definition timeline_offline_renderer.hpp:40
@ ProcessFailed
A block failed mid-render; see process. The partial buffer is discarded.
Definition timeline_offline_renderer.hpp:56
@ InvalidRange
Bounds were rejected before any work: end <= start, negative ticks, or a tick range whose sample deri...
Definition timeline_offline_renderer.hpp:43
@ BindingRejected
TimelineGraphPlaybackBinding::prepare()/adopt failed; see admission.
Definition timeline_offline_renderer.hpp:52
@ InvalidLimits
A limit was zero, negative, or exceeded (channels, block frames, or the caller's output-frame ceiling...
Definition timeline_offline_renderer.hpp:46
@ SampleRateMismatch
Definition timeline_graph_binding.hpp:81
TimelineOfflineRenderResult render_timeline_offline(SignalGraph &graph, TimelineGraphPlaybackBinding &binding, const playback::PlaybackProgram &program, std::span< const TimelineTrackGraphRoute > routes, const TimelineOfflineRenderConfig &config, const TimelineOfflineRenderOptions &options)
Renders [start_tick, end_tick) of program through graph, plus a fixed tail, and returns deterministic...
@ Ok
Definition baked_graph_processor.hpp:156
TransportError
Definition transport.hpp:16
@ None
Definition transport.hpp:17
Definition audio_file.hpp:24
Structured admission result.
Definition timeline_graph_binding.hpp:130
Definition timeline_graph_binding.hpp:169
Prepare-time limits.
Definition timeline_offline_renderer.hpp:61
std::uint64_t max_output_frames
Hard ceiling on rendered frames including the tail pad.
Definition timeline_offline_renderer.hpp:67
std::uint32_t maximum_note_events_per_track_per_block
Note-event capacity per track per block, forwarded to the binding.
Definition timeline_offline_renderer.hpp:69
int block_frames
Definition timeline_offline_renderer.hpp:63
int output_channels
Definition timeline_offline_renderer.hpp:64
double sample_rate
Definition timeline_offline_renderer.hpp:62
One render request over a half-open tick region [start_tick, end_tick).
Definition timeline_offline_renderer.hpp:73
timebase::TickPosition start_tick
Definition timeline_offline_renderer.hpp:74
std::uint32_t tail_frames
Frames rendered after the transport stops at end_tick.
Definition timeline_offline_renderer.hpp:78
timebase::TickPosition end_tick
Definition timeline_offline_renderer.hpp:75
Result of a one-shot render. audio is populated only when code == Ok.
Definition timeline_offline_renderer.hpp:82
std::uint64_t region_frames
Frames of audio that precede the tail pad. Equals the region length.
Definition timeline_offline_renderer.hpp:86
audio::AudioFileData audio
Definition timeline_offline_renderer.hpp:84
TimelineGraphProcessResult process
Populated when code == ProcessFailed.
Definition timeline_offline_renderer.hpp:92
TimelineGraphAdmission admission
Populated when code == BindingRejected.
Definition timeline_offline_renderer.hpp:90
TimelineOfflineRenderCode code
Definition timeline_offline_renderer.hpp:83
std::uint64_t tail_frames
Frames of tail pad actually rendered. Equals options.tail_frames on Ok.
Definition timeline_offline_renderer.hpp:88
playback::TransportError transport_error
Populated when code == TransportRejected.
Definition timeline_offline_renderer.hpp:94
Definition tick.hpp:61