Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
offline_render_host.hpp
Go to the documentation of this file.
1#pragma once
2
7
8#include <cstdint>
9#include <functional>
10#include <span>
11
12namespace pulp::format {
13
21 double sample_rate = 48000.0;
22 std::uint32_t max_block_frames = 512;
23 std::uint32_t input_channels = 2;
24 std::uint32_t output_channels = 2;
25 double tempo_bpm = 120.0;
28};
29
31 std::uint64_t frame = 0;
33};
34
39
41 std::uint64_t frame_count = 0;
42 std::uint32_t block_frames = 0;
44 std::span<const OfflineMidiEvent> midi_events;
45 std::span<const OfflineParameterEvent> parameter_events;
46
47 bool is_playing = true;
48 bool is_recording = false;
49 bool is_looping = false;
50 double loop_start_beats = 0.0;
51 double loop_end_beats = 0.0;
52
54 double tempo_bpm = 0.0;
57
58 std::int64_t start_position_samples = 0;
60 std::int64_t host_time_ns = 0;
61
62};
63
65 std::uint64_t frames_rendered = 0;
66 std::uint32_t blocks_rendered = 0;
67 std::uint32_t midi_events_dispatched = 0;
68 std::uint32_t parameter_events_dispatched = 0;
69 std::uint32_t parameter_events_dropped = 0;
70 bool input_truncated = false;
71 bool event_order_invalid = false;
72};
73
79
89public:
91
93 bool prepared() const noexcept { return prepared_; }
94 const OfflineRenderConfig& config() const noexcept { return config_; }
95
100 std::function<bool()> should_continue);
101
102 HeadlessHost& headless() noexcept { return host_; }
103 const HeadlessHost& headless() const noexcept { return host_; }
104
105private:
106 HeadlessHost host_;
107 OfflineRenderConfig config_;
108 bool prepared_ = false;
109
110 audio::Buffer<float> input_block_;
111 audio::Buffer<float> output_block_;
112};
113
114} // namespace pulp::format
Non-owning view over multi-channel audio sample data.
Definition buffer.hpp:30
Owning multi-channel audio buffer with contiguous storage.
Definition buffer.hpp:119
Headless plugin host for testing and offline processing.
Definition headless.hpp:29
OfflineRenderResult render(const OfflineRenderOptions &options, std::function< bool()> should_continue)
Versioned cancellation/deadline seam for control-thread callers.
bool prepare(const OfflineRenderConfig &config)
bool prepared() const noexcept
Definition offline_render_host.hpp:93
OfflineRenderResult render(const OfflineRenderOptions &options)
const HeadlessHost & headless() const noexcept
Definition offline_render_host.hpp:103
const OfflineRenderConfig & config() const noexcept
Definition offline_render_host.hpp:94
HeadlessHost & headless() noexcept
Definition offline_render_host.hpp:102
OfflineRenderHost(ProcessorFactory factory)
Headless processing adapter for programmatic plugin use without UI or audio device.
What the product grants a device: the quota table indexed by capability tier and live thermal state.
Definition aax_editor.hpp:31
std::unique_ptr< Processor >(*)() ProcessorFactory
Factory function type — plugins provide this to create processor instances.
Definition processor.hpp:1416
Definition offline_render_host.hpp:30
std::uint64_t frame
Absolute render frame; event.sample_offset is overwritten per block.
Definition offline_render_host.hpp:31
midi::MidiEvent event
Definition offline_render_host.hpp:32
Definition offline_render_host.hpp:35
std::uint64_t frame
Absolute render frame; event.sample_offset is overwritten per block.
Definition offline_render_host.hpp:36
state::ParameterEvent event
Definition offline_render_host.hpp:37
Prepare-time configuration for deterministic offline rendering.
Definition offline_render_host.hpp:20
double sample_rate
Definition offline_render_host.hpp:21
int time_sig_numerator
Definition offline_render_host.hpp:26
int time_sig_denominator
Definition offline_render_host.hpp:27
std::uint32_t input_channels
Definition offline_render_host.hpp:23
std::uint32_t max_block_frames
Definition offline_render_host.hpp:22
std::uint32_t output_channels
Definition offline_render_host.hpp:24
double tempo_bpm
Definition offline_render_host.hpp:25
Definition offline_render_host.hpp:40
std::uint64_t frame_count
Definition offline_render_host.hpp:41
audio::BufferView< const float > input
Definition offline_render_host.hpp:43
int time_sig_denominator
Definition offline_render_host.hpp:56
bool is_looping
Definition offline_render_host.hpp:49
double tempo_bpm
Non-positive values use the prepared config defaults.
Definition offline_render_host.hpp:54
std::int64_t host_time_ns
Definition offline_render_host.hpp:60
std::uint32_t block_frames
0 uses OfflineRenderConfig::max_block_frames.
Definition offline_render_host.hpp:42
double loop_end_beats
Definition offline_render_host.hpp:51
double loop_start_beats
Definition offline_render_host.hpp:50
double start_position_beats
Definition offline_render_host.hpp:59
std::span< const OfflineMidiEvent > midi_events
Definition offline_render_host.hpp:44
bool is_playing
Definition offline_render_host.hpp:47
std::span< const OfflineParameterEvent > parameter_events
Definition offline_render_host.hpp:45
std::int64_t start_position_samples
Definition offline_render_host.hpp:58
bool is_recording
Definition offline_render_host.hpp:48
int time_sig_numerator
Definition offline_render_host.hpp:55
Definition offline_render_host.hpp:74
bool ok
Definition offline_render_host.hpp:75
OfflineRenderStats stats
Definition offline_render_host.hpp:77
audio::Buffer< float > audio
Definition offline_render_host.hpp:76
Definition offline_render_host.hpp:64
std::uint32_t parameter_events_dispatched
Definition offline_render_host.hpp:68
std::uint32_t midi_events_dispatched
Definition offline_render_host.hpp:67
std::uint32_t blocks_rendered
Definition offline_render_host.hpp:66
bool event_order_invalid
Definition offline_render_host.hpp:71
bool input_truncated
Definition offline_render_host.hpp:70
std::uint32_t parameter_events_dropped
Definition offline_render_host.hpp:69
std::uint64_t frames_rendered
Definition offline_render_host.hpp:65
Timestamped MIDI event combining a choc::midi::ShortMessage with timing info.
Definition message.hpp:32
Definition parameter_event_queue.hpp:34