Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::format::lv2_generic Namespace Reference

Functions

bool read_numeric_atom (const LV2_Atom *atom, const lv2_adapter::Lv2TimeUrids &urids, double &out) noexcept
 Read a numeric atom body as a double, whatever integer or float type the host chose for it.
bool decode_time_position (const LV2_Atom_Object *obj, const lv2_adapter::Lv2TimeUrids &urids, lv2_adapter::Lv2TimePosition &out) noexcept
 Decode a time:Position object into out, overwriting only the properties the host actually sent.
void advance_time_position (lv2_adapter::Lv2TimePosition &pos, uint32_t n_samples, double sample_rate) noexcept
 Advance a latched transport by one block of n_samples while it is rolling, so the position keeps moving between the Positions a host chooses to send.
boundary::HostTransport to_host_transport (const lv2_adapter::Lv2TimePosition &pos) noexcept
 Project a decoded time:Position onto the neutral transport every adapter hands the shared ProcessContext mapper.
LV2_Handle instantiate (const LV2_Descriptor *, double sample_rate, const char *, const LV2_Feature *const *features)
void connect_port (LV2_Handle handle, uint32_t port, void *data)
void activate (LV2_Handle)
void write_midi_out_to_sequence (LV2_Atom_Sequence *out_seq, LV2_URID urid_atom_sequence, LV2_URID urid_midi_event, const midi::MidiBuffer &midi_out)
void run (LV2_Handle handle, uint32_t n_samples)
void deactivate (LV2_Handle)
LV2_State_Status save_state (LV2_Handle instance, LV2_State_Store_Function store, LV2_State_Handle handle, uint32_t, const LV2_Feature *const *)
LV2_State_Status restore_state (LV2_Handle instance, LV2_State_Retrieve_Function retrieve, LV2_State_Handle handle, uint32_t, const LV2_Feature *const *)
const void * extension_data (const char *uri)
void cleanup (LV2_Handle handle)
int write_bundle_ttl (const char *bundle_dir, const char *binary_name) noexcept

Variables

ProcessorFactory g_factory = nullptr
const char * g_uri = nullptr
constexpr std::size_t kRealtimeMidiEventCapacity
const LV2_State_Interface g_state_interface = {save_state, restore_state}
LV2_Descriptor g_lv2_descriptor

Function Documentation

◆ activate()

void pulp::format::lv2_generic::activate ( LV2_Handle )
inline

◆ advance_time_position()

void pulp::format::lv2_generic::advance_time_position ( lv2_adapter::Lv2TimePosition & pos,
uint32_t n_samples,
double sample_rate )
inlinenoexcept

Advance a latched transport by one block of n_samples while it is rolling, so the position keeps moving between the Positions a host chooses to send.

A stopped transport is left where it is.

◆ cleanup()

void pulp::format::lv2_generic::cleanup ( LV2_Handle handle)
inline

◆ connect_port()

void pulp::format::lv2_generic::connect_port ( LV2_Handle handle,
uint32_t port,
void * data )
inline

◆ deactivate()

void pulp::format::lv2_generic::deactivate ( LV2_Handle )
inline

◆ decode_time_position()

bool pulp::format::lv2_generic::decode_time_position ( const LV2_Atom_Object * obj,
const lv2_adapter::Lv2TimeUrids & urids,
lv2_adapter::Lv2TimePosition & out )
inlinenoexcept

Decode a time:Position object into out, overwriting only the properties the host actually sent.

Returns false when obj is not a time:Position, leaving out untouched.

Allocation-free: the whole walk is over the host's buffer.

◆ extension_data()

const void * pulp::format::lv2_generic::extension_data ( const char * uri)
inline

◆ instantiate()

LV2_Handle pulp::format::lv2_generic::instantiate ( const LV2_Descriptor * ,
double sample_rate,
const char * ,
const LV2_Feature *const * features )
inline

◆ read_numeric_atom()

bool pulp::format::lv2_generic::read_numeric_atom ( const LV2_Atom * atom,
const lv2_adapter::Lv2TimeUrids & urids,
double & out )
inlinenoexcept

Read a numeric atom body as a double, whatever integer or float type the host chose for it.

Returns false for a type this adapter does not model, in which case the property is skipped rather than guessed at.

◆ restore_state()

LV2_State_Status pulp::format::lv2_generic::restore_state ( LV2_Handle instance,
LV2_State_Retrieve_Function retrieve,
LV2_State_Handle handle,
uint32_t ,
const LV2_Feature *const *  )
inline

◆ run()

void pulp::format::lv2_generic::run ( LV2_Handle handle,
uint32_t n_samples )
inline

◆ save_state()

LV2_State_Status pulp::format::lv2_generic::save_state ( LV2_Handle instance,
LV2_State_Store_Function store,
LV2_State_Handle handle,
uint32_t ,
const LV2_Feature *const *  )
inline

◆ to_host_transport()

boundary::HostTransport pulp::format::lv2_generic::to_host_transport ( const lv2_adapter::Lv2TimePosition & pos)
inlinenoexcept

Project a decoded time:Position onto the neutral transport every adapter hands the shared ProcessContext mapper.

Unit note: LV2 counts time:beat in beats of time:beatUnit, while ProcessContext counts quarter notes, so a 6/8 host's beats are scaled by 4 / beatUnit. Fields LV2's time extension does not model stay invalid: there is no record-arm, no cycle range, and no host clock. framesPerSecond is the audio sample rate, NOT an SMPTE rate, so frame_rate stays unknown.

◆ write_bundle_ttl()

int pulp::format::lv2_generic::write_bundle_ttl ( const char * bundle_dir,
const char * binary_name )
inlinenoexcept

◆ write_midi_out_to_sequence()

void pulp::format::lv2_generic::write_midi_out_to_sequence ( LV2_Atom_Sequence * out_seq,
LV2_URID urid_atom_sequence,
LV2_URID urid_midi_event,
const midi::MidiBuffer & midi_out )
inline

Variable Documentation

◆ g_factory

ProcessorFactory pulp::format::lv2_generic::g_factory = nullptr
inline

◆ g_lv2_descriptor

LV2_Descriptor pulp::format::lv2_generic::g_lv2_descriptor
inline
Initial value:
= {nullptr,
void deactivate(LV2_Handle)
Definition lv2_entry.hpp:630
const void * extension_data(const char *uri)
Definition lv2_entry.hpp:703
void run(LV2_Handle handle, uint32_t n_samples)
Definition lv2_entry.hpp:430
void activate(LV2_Handle)
Definition lv2_entry.hpp:388
LV2_Handle instantiate(const LV2_Descriptor *, double sample_rate, const char *, const LV2_Feature *const *features)
Definition lv2_entry.hpp:209
void cleanup(LV2_Handle handle)
Definition lv2_entry.hpp:710
void connect_port(LV2_Handle handle, uint32_t port, void *data)
Definition lv2_entry.hpp:342

◆ g_state_interface

const LV2_State_Interface pulp::format::lv2_generic::g_state_interface = {save_state, restore_state}
inline

◆ g_uri

const char* pulp::format::lv2_generic::g_uri = nullptr
inline

◆ kRealtimeMidiEventCapacity

std::size_t pulp::format::lv2_generic::kRealtimeMidiEventCapacity
inlineconstexpr
Initial value:
=
static constexpr std::size_t kCapacity
Definition parameter_event_queue.hpp:84