Struct Product
pub struct Product<'a> { /* private fields */ }Expand description
Everything formats need to describe one plug-in.
Build it with Product::new and the with_* methods, usually as a
const, then call Product::resolve to validate it.
Implementations§
§impl<'a> Product<'a>
impl<'a> Product<'a>
pub const fn new(
name: &'a str,
vendor: &'a str,
version: &'a str,
plugin_id: &'a str,
category: Category,
state: StateFormat,
) -> Self
pub const fn new( name: &'a str, vendor: &'a str, version: &'a str, plugin_id: &'a str, category: Category, state: StateFormat, ) -> Self
A product with a stereo layout (stereo output only for instruments), f32 processing, no notes and no parameters.
version has three numeric components. plugin_id is a reverse-domain
identity such as com.example.delay; format identities derive from it.
pub const fn with_layouts(self, layouts: &'a [AudioLayout]) -> Self
pub const fn with_layouts(self, layouts: &'a [AudioLayout]) -> Self
Supported main-bus layouts, preferred first. Hosts may choose any of them.
pub const fn with_auxiliary_buses(self, buses: &'a [AuxiliaryBus<'a>]) -> Self
pub const fn with_auxiliary_buses(self, buses: &'a [AuxiliaryBus<'a>]) -> Self
Audio buses beyond the main bus, in the order the processor receives
them (at most MAXIMUM_AUXILIARY_BUSES); see AuxiliaryBus. Every
main layout uses the same auxiliary buses.
pub const fn with_notes(self, notes: NotePorts) -> Self
pub const fn with_precision(self, precision: Precision) -> Self
pub const fn with_parameters(self, parameters: &'a [Parameter<'a>]) -> Self
pub const fn with_url(self, url: &'a str) -> Self
pub const fn with_editor(self, editor: Editor<'a>) -> Self
pub const fn with_editor(self, editor: Editor<'a>) -> Self
Give the product a web editor.
pub const fn with_editor_assets(self, assets: &'a [EditorAsset<'a>]) -> Self
pub const fn with_editor_assets(self, assets: &'a [EditorAsset<'a>]) -> Self
Files the editor page loads by relative URL; see EditorAsset.
Requires Product::with_editor.
pub const fn with_identities(self, identities: IdentityOverrides<'a>) -> Self
pub const fn with_identities(self, identities: IdentityOverrides<'a>) -> Self
Keep format identities from an earlier product instead of deriving them.
pub const fn with_automation(self, automation: AutomationPolicy) -> Self
pub const fn with_automation(self, automation: AutomationPolicy) -> Self
How parameter changes reach the processor within a block; see
AutomationPolicy. The default is sample-accurate.
pub const fn with_bypass(self, bypass: BypassPolicy) -> Self
pub const fn with_bypass(self, bypass: BypassPolicy) -> Self
How the host bypass parameter is applied; see BypassPolicy. The
default passes it to the processor. Other policies require a
Parameter::bypass parameter.
pub const fn with_maximum_latency(self, samples: u32) -> Self
pub const fn with_maximum_latency(self, samples: u32) -> Self
The most latency, in samples, the processor can report while active
(at most MAXIMUM_BYPASS_LATENCY). Bypass policies other than
BypassPolicy::Processor size their latency-compensating dry delay
for the larger of this and the latency reported after prepare;
declare it when parameters or state can raise the latency after
preparation. Unused with BypassPolicy::Processor. The default is 0.
pub fn name(&self) -> &'a str
pub fn vendor(&self) -> &'a str
pub fn version(&self) -> &'a str
pub fn plugin_id(&self) -> &'a str
pub fn url(&self) -> &'a str
pub fn category(&self) -> Category
pub fn layouts(&self) -> &'a [AudioLayout]
pub fn auxiliary_buses(&self) -> &'a [AuxiliaryBus<'a>]
pub fn auxiliary_layouts(&self) -> Vec<AudioLayout>
pub fn auxiliary_layouts(&self) -> Vec<AudioLayout>
The auxiliary buses’ layouts, in order, for
ProcessConfig::with_auxiliary_buses.
Invalid buses are skipped; Product::resolve rejects them.
pub fn notes(&self) -> NotePorts
pub fn precision(&self) -> Precision
pub fn parameters(&self) -> &'a [Parameter<'a>]
pub fn state_format(&self) -> StateFormat
pub fn identity_overrides(&self) -> IdentityOverrides<'a>
pub fn editor(&self) -> Option<Editor<'a>>
pub fn editor_assets(&self) -> &'a [EditorAsset<'a>]
pub fn automation(&self) -> AutomationPolicy
pub fn bypass_policy(&self) -> BypassPolicy
pub fn maximum_latency(&self) -> u32
pub fn maximum_latency(&self) -> u32
The declared maximum latency; see Product::with_maximum_latency.
pub fn resolve(&self) -> Result<ResolvedProduct<'a>, ProductError>
pub fn resolve(&self) -> Result<ResolvedProduct<'a>, ProductError>
Validate the description and resolve parameter IDs and format identities. Allocates; call on a control thread.