Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::host::CrossfadePluginSlot Class Referencefinal

#include <crossfade_plugin_slot.hpp>

Public Types

enum class  ProcessStatus : std::uint8_t { ok , failed }
enum class  LatencyQuery { Available , Unsupported , QueryFailed }
 Whether latency_samples() is a fact from the plugin, or a placeholder. More...
using EditorResizeRequestHandler = std::function<bool(uint32_t width, uint32_t height)>
 Called when the plugin asks the host to resize its editor.

Public Member Functions

 CrossfadePluginSlot (std::shared_ptr< PluginSlot > new_slot, std::shared_ptr< PluginSlot > old_slot, std::size_t fade_samples, signal::TransitionCurve curve, int out_channels, int max_block)
bool fade_done () const noexcept
const std::shared_ptr< PluginSlot > & new_slot () const noexcept
void process (audio::BufferView< float > &output, const audio::BufferView< const float > &input, const midi::MidiBuffer &midi_in, midi::MidiBuffer &midi_out, const ParameterEventQueue &param_events, int num_samples) override
void begin_process () noexcept override
ProcessStatus process_status () const noexcept override
void process (format::ProcessBuffers &audio, const midi::MidiBuffer &midi_in, midi::MidiBuffer &midi_out, const ParameterEventQueue &param_events, int num_samples) override
void process (format::ProcessBuffers &audio, const midi::MidiBuffer &midi_in, midi::MidiBuffer &midi_out, const ParameterEventQueue &param_events, int num_samples, const format::ProcessContext &transport) override
const PluginInfo & info () const override
bool is_loaded () const override
bool prepare (double sr, int block) override
void release () override
std::vector< HostParamInfo > parameters () const override
float get_parameter (uint32_t id) const override
void set_parameter (uint32_t id, float v) override
void set_bypass (bool b) override
bool is_bypassed () const override
BypassSurface bypass_surface () const override
 Where this plugin keeps its own bypass control.
std::vector< uint8_t > save_state () const override
bool restore_state (const std::vector< uint8_t > &d) override
bool has_editor () const override
void * create_editor_view () override
void destroy_editor_view () override
std::unique_ptr< HostedEditor > create_hosted_editor (void *parent) override
 Create the hosted editor.
void destroy_hosted_editor (std::unique_ptr< HostedEditor > ed) override
 Tear down a hosted editor. Default routes to destroy_editor_view().
int latency_samples () const override
int tail_samples () const override
void accept (NativeHandleVisitor &v) const override
bool wants_transport () const override
virtual LatencyQuery latency_query () const
 Whether latency_samples() is a fact from the plugin, or a placeholder.
virtual void set_editor_resize_request_handler (EditorResizeRequestHandler)
 Install the handler invoked on a plugin-initiated resize request.
virtual bool set_hosted_editor_size (uint32_t &, uint32_t &)
 Host-initiated resize: ask the plugin to adopt (width, height).
virtual void set_preferred_channel_layout (int, int)
virtual std::string retained_history_key () const
 Optional realtime DSP-history carry for a prepared replacement.
virtual std::vector< uint8_t > serialize_dsp_state () const
virtual bool restore_dsp_state (const std::vector< uint8_t > &)
virtual bool reseed_dsp_state (std::uint64_t)
virtual std::optional< PluginResolvedIdentity > resolved_identity () const
 Detached strict-load receipt; unavailable for legacy or unsupported loaders.

Static Public Member Functions

static std::unique_ptr< PluginSlot > load (const PluginInfo &info)
static PluginLoadResult load_exact (const PluginSelection &selection)
 Explicit strict CLAP selection. Legacy load() keeps best-effort behavior.

Member Typedef Documentation

◆ EditorResizeRequestHandler

using pulp::host::PluginSlot::EditorResizeRequestHandler = std::function<bool(uint32_t width, uint32_t height)>
inherited

Called when the plugin asks the host to resize its editor.

Return true if the host honored the request. Refusing is legal in every format — the plugin must cope with a denial.

Member Enumeration Documentation

◆ LatencyQuery

enum class pulp::host::PluginSlot::LatencyQuery
stronginherited

Whether latency_samples() is a fact from the plugin, or a placeholder.

See latency_query(), which is declared at the end of the class so the vtable stays append-only.

Enumerator
Available 

The value is the plugin's own report. Zero means zero.

Unsupported 

This backend cannot ask. The value is meaningless.

QueryFailed 

The backend asked and the plugin errored.

◆ ProcessStatus

enum class pulp::host::PluginSlot::ProcessStatus : std::uint8_t
stronginherited
Enumerator
ok 
failed 

Constructor & Destructor Documentation

◆ CrossfadePluginSlot()

pulp::host::CrossfadePluginSlot::CrossfadePluginSlot ( std::shared_ptr< PluginSlot > new_slot,
std::shared_ptr< PluginSlot > old_slot,
std::size_t fade_samples,
signal::TransitionCurve curve,
int out_channels,
int max_block )
inline

Member Function Documentation

◆ accept()

void pulp::host::CrossfadePluginSlot::accept ( NativeHandleVisitor & v) const
inlineoverridevirtual

Reimplemented from pulp::host::PluginSlot.

◆ begin_process()

void pulp::host::CrossfadePluginSlot::begin_process ( )
inlineoverridevirtualnoexcept

Reimplemented from pulp::host::PluginSlot.

◆ bypass_surface()

BypassSurface pulp::host::CrossfadePluginSlot::bypass_surface ( ) const
inlineoverridevirtual

Where this plugin keeps its own bypass control.

A loader that cannot tell reports none rather than guessing; a wrapper slot reports what it wraps. Appended last to preserve the existing PluginSlot virtual ordering.

Reimplemented from pulp::host::PluginSlot.

◆ create_editor_view()

void * pulp::host::CrossfadePluginSlot::create_editor_view ( )
inlineoverridevirtual

◆ create_hosted_editor()

std::unique_ptr< HostedEditor > pulp::host::CrossfadePluginSlot::create_hosted_editor ( void * )
inlineoverridevirtual

Create the hosted editor.

Default implementation preserves the void* path so every slot already compiled against create_editor_view() still works; new slots override this directly.

Reimplemented from pulp::host::PluginSlot.

◆ destroy_editor_view()

void pulp::host::CrossfadePluginSlot::destroy_editor_view ( )
inlineoverridevirtual

◆ destroy_hosted_editor()

void pulp::host::CrossfadePluginSlot::destroy_hosted_editor ( std::unique_ptr< HostedEditor > ed)
inlineoverridevirtual

Tear down a hosted editor. Default routes to destroy_editor_view().

Reimplemented from pulp::host::PluginSlot.

◆ fade_done()

bool pulp::host::CrossfadePluginSlot::fade_done ( ) const
inlinenoexcept

◆ get_parameter()

float pulp::host::CrossfadePluginSlot::get_parameter ( uint32_t id) const
inlineoverridevirtual

◆ has_editor()

bool pulp::host::CrossfadePluginSlot::has_editor ( ) const
inlineoverridevirtual

◆ info()

const PluginInfo & pulp::host::CrossfadePluginSlot::info ( ) const
inlineoverridevirtual

◆ is_bypassed()

bool pulp::host::CrossfadePluginSlot::is_bypassed ( ) const
inlineoverridevirtual

◆ is_loaded()

bool pulp::host::CrossfadePluginSlot::is_loaded ( ) const
inlineoverridevirtual

◆ latency_query()

virtual LatencyQuery pulp::host::PluginSlot::latency_query ( ) const
inlinevirtualinherited

Whether latency_samples() is a fact from the plugin, or a placeholder.

Appended last to preserve the existing PluginSlot virtual ordering.

latency_samples() returns an int either way, so on its own it cannot distinguish "this plugin reports zero latency" from "this backend has no way to ask." Those are completely different claims, and collapsing them turns an unanswered question into a confident zero — which a latency proof would then happily certify. Ask this before trusting the number.

Defaults to Available: the CLAP, VST3, and AU backends all read a real value from the plugin. The LV2 backend overrides it, because Pulp's hosted LV2 slot cannot currently read the plugin's latency port.

◆ latency_samples()

int pulp::host::CrossfadePluginSlot::latency_samples ( ) const
inlineoverridevirtual

◆ load()

std::unique_ptr< PluginSlot > pulp::host::PluginSlot::load ( const PluginInfo & info)
staticinherited

◆ load_exact()

PluginLoadResult pulp::host::PluginSlot::load_exact ( const PluginSelection & selection)
staticinherited

Explicit strict CLAP selection. Legacy load() keeps best-effort behavior.

◆ new_slot()

const std::shared_ptr< PluginSlot > & pulp::host::CrossfadePluginSlot::new_slot ( ) const
inlinenoexcept

◆ parameters()

std::vector< HostParamInfo > pulp::host::CrossfadePluginSlot::parameters ( ) const
inlineoverridevirtual

◆ prepare()

bool pulp::host::CrossfadePluginSlot::prepare ( double sr,
int block )
inlineoverridevirtual

◆ process() [1/3]

void pulp::host::CrossfadePluginSlot::process ( audio::BufferView< float > & output,
const audio::BufferView< const float > & input,
const midi::MidiBuffer & midi_in,
midi::MidiBuffer & midi_out,
const ParameterEventQueue & param_events,
int num_samples )
inlineoverridevirtual

◆ process() [2/3]

void pulp::host::CrossfadePluginSlot::process ( format::ProcessBuffers & audio,
const midi::MidiBuffer & midi_in,
midi::MidiBuffer & midi_out,
const ParameterEventQueue & param_events,
int num_samples )
inlineoverridevirtual

Reimplemented from pulp::host::PluginSlot.

◆ process() [3/3]

void pulp::host::CrossfadePluginSlot::process ( format::ProcessBuffers & audio,
const midi::MidiBuffer & midi_in,
midi::MidiBuffer & midi_out,
const ParameterEventQueue & param_events,
int num_samples,
const format::ProcessContext & transport )
inlineoverridevirtual

Reimplemented from pulp::host::PluginSlot.

◆ process_status()

ProcessStatus pulp::host::CrossfadePluginSlot::process_status ( ) const
inlineoverridevirtualnoexcept

Reimplemented from pulp::host::PluginSlot.

◆ release()

void pulp::host::CrossfadePluginSlot::release ( )
inlineoverridevirtual

◆ reseed_dsp_state()

virtual bool pulp::host::PluginSlot::reseed_dsp_state ( std::uint64_t )
inlinevirtualinherited

◆ resolved_identity()

virtual std::optional< PluginResolvedIdentity > pulp::host::PluginSlot::resolved_identity ( ) const
inlinevirtualinherited

Detached strict-load receipt; unavailable for legacy or unsupported loaders.

◆ restore_dsp_state()

virtual bool pulp::host::PluginSlot::restore_dsp_state ( const std::vector< uint8_t > & )
inlinevirtualinherited

◆ restore_state()

bool pulp::host::CrossfadePluginSlot::restore_state ( const std::vector< uint8_t > & d)
inlineoverridevirtual

◆ retained_history_key()

virtual std::string pulp::host::PluginSlot::retained_history_key ( ) const
inlinevirtualinherited

Optional realtime DSP-history carry for a prepared replacement.

This is deliberately separate from save_state()/restore_state(): preset state describes user-facing parameters, while this opaque blob carries delay lines, tails, waveguide state, or physical-model integrators. The default is cold-start safe for every existing slot implementation.

◆ save_state()

std::vector< uint8_t > pulp::host::CrossfadePluginSlot::save_state ( ) const
inlineoverridevirtual

◆ serialize_dsp_state()

virtual std::vector< uint8_t > pulp::host::PluginSlot::serialize_dsp_state ( ) const
inlinevirtualinherited

◆ set_bypass()

void pulp::host::CrossfadePluginSlot::set_bypass ( bool b)
inlineoverridevirtual

◆ set_editor_resize_request_handler()

virtual void pulp::host::PluginSlot::set_editor_resize_request_handler ( EditorResizeRequestHandler )
inlinevirtualinherited

Install the handler invoked on a plugin-initiated resize request.

Pass a null handler to clear it. The handler must outlive the open editor. Slots that cannot report resize requests ignore this.

◆ set_hosted_editor_size()

virtual bool pulp::host::PluginSlot::set_hosted_editor_size ( uint32_t & ,
uint32_t &  )
inlinevirtualinherited

Host-initiated resize: ask the plugin to adopt (width, height).

The plugin may snap to its own constraints, so the accepted size is written back through width/height. Returns false when the slot has no open editor, the format cannot resize, or the plugin refused.

◆ set_parameter()

void pulp::host::CrossfadePluginSlot::set_parameter ( uint32_t id,
float v )
inlineoverridevirtual

◆ set_preferred_channel_layout()

virtual void pulp::host::PluginSlot::set_preferred_channel_layout ( int ,
int  )
inlinevirtualinherited

◆ tail_samples()

int pulp::host::CrossfadePluginSlot::tail_samples ( ) const
inlineoverridevirtual

◆ wants_transport()

bool pulp::host::CrossfadePluginSlot::wants_transport ( ) const
inlineoverridevirtual

Reimplemented from pulp::host::PluginSlot.


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