1
0
Fork 0

Add poly mod config constant to ClapPlugin

Setting this will enable the 'voice-info' extension.
This commit is contained in:
Robbert van der Helm 2022-07-05 22:53:14 +02:00
parent 1466358e14
commit 1de561e4a0
5 changed files with 30 additions and 6 deletions

View file

@ -226,7 +226,9 @@ impl BoolParam {
/// Enable polyphonic modulation for this parameter. The ID is used to uniquely identify this /// Enable polyphonic modulation for this parameter. The ID is used to uniquely identify this
/// parameter in [`NoteEvent::PolyModulation][crate::prelude::NoteEvent::PolyModulation`] /// parameter in [`NoteEvent::PolyModulation][crate::prelude::NoteEvent::PolyModulation`]
/// events, and must thus be unique between _all_ polyphonically modulatable parameters. See the /// events, and must thus be unique between _all_ polyphonically modulatable parameters. See the
/// event's documentation for more information on how to use this. /// event's documentation on how to do this. Consider configuring the
/// [`ClapPlugin::CLAP_POLY_MODULATION_CONFIG`][crate::prelude::ClapPlugin::CLAP_POLY_MODULATION_CONFIG]
/// constant when enabling this.
/// ///
/// # Important /// # Important
/// ///

View file

@ -337,7 +337,9 @@ impl<T: Enum + PartialEq + 'static> EnumParam<T> {
/// Enable polyphonic modulation for this parameter. The ID is used to uniquely identify this /// Enable polyphonic modulation for this parameter. The ID is used to uniquely identify this
/// parameter in [`NoteEvent::PolyModulation][crate::prelude::NoteEvent::PolyModulation`] /// parameter in [`NoteEvent::PolyModulation][crate::prelude::NoteEvent::PolyModulation`]
/// events, and must thus be unique between _all_ polyphonically modulatable parameters. See the /// events, and must thus be unique between _all_ polyphonically modulatable parameters. See the
/// event's documentation for more information on how to use this. /// event's documentation on how to do this. Consider configuring the
/// [`ClapPlugin::CLAP_POLY_MODULATION_CONFIG`][crate::prelude::ClapPlugin::CLAP_POLY_MODULATION_CONFIG]
/// constant when enabling this.
/// ///
/// # Important /// # Important
/// ///

View file

@ -293,7 +293,10 @@ impl FloatParam {
/// Enable polyphonic modulation for this parameter. The ID is used to uniquely identify this /// Enable polyphonic modulation for this parameter. The ID is used to uniquely identify this
/// parameter in [`NoteEvent::PolyModulation][crate::prelude::NoteEvent::PolyModulation`] /// parameter in [`NoteEvent::PolyModulation][crate::prelude::NoteEvent::PolyModulation`]
/// events, and must thus be unique between _all_ polyphonically modulatable parameters. /// events, and must thus be unique between _all_ polyphonically modulatable parameters. See the
/// event's documentation on how to do this. Consider configuring the
/// [`ClapPlugin::CLAP_POLY_MODULATION_CONFIG`][crate::prelude::ClapPlugin::CLAP_POLY_MODULATION_CONFIG]
/// constant when enabling this.
/// ///
/// # Important /// # Important
/// ///

View file

@ -258,7 +258,9 @@ impl IntParam {
/// Enable polyphonic modulation for this parameter. The ID is used to uniquely identify this /// Enable polyphonic modulation for this parameter. The ID is used to uniquely identify this
/// parameter in [`NoteEvent::PolyModulation][crate::prelude::NoteEvent::PolyModulation`] /// parameter in [`NoteEvent::PolyModulation][crate::prelude::NoteEvent::PolyModulation`]
/// events, and must thus be unique between _all_ polyphonically modulatable parameters. See the /// events, and must thus be unique between _all_ polyphonically modulatable parameters. See the
/// event's documentation for more information on how to use this. /// event's documentation on how to do this. Consider configuring the
/// [`ClapPlugin::CLAP_POLY_MODULATION_CONFIG`][crate::prelude::ClapPlugin::CLAP_POLY_MODULATION_CONFIG]
/// constant when enabling this.
/// ///
/// # Important /// # Important
/// ///

View file

@ -19,8 +19,8 @@ use crate::wrapper::clap::features::ClapFeature;
/// This is super basic, and lots of things I didn't need or want to use yet haven't been /// This is super basic, and lots of things I didn't need or want to use yet haven't been
/// implemented. Notable missing features include: /// implemented. Notable missing features include:
/// ///
/// - MIDI SysEx and MIDI2 for CLAP, note expressions and MIDI1 are already supported /// - MIDI SysEx and MIDI2 for CLAP, note expressions, polyphonic modulation and MIDI1 are already
/// - Polyphonic modulation for CLAP /// supported
/// - Audio thread thread pools (with host integration in CLAP) /// - Audio thread thread pools (with host integration in CLAP)
#[allow(unused_variables)] #[allow(unused_variables)]
pub trait Plugin: Default + Send + Sync + 'static { pub trait Plugin: Default + Send + Sync + 'static {
@ -206,6 +206,9 @@ pub trait ClapPlugin: Plugin {
/// Keywords describing the plugin. The host may use this to classify the plugin in its plugin /// Keywords describing the plugin. The host may use this to classify the plugin in its plugin
/// browser. /// browser.
const CLAP_FEATURES: &'static [ClapFeature]; const CLAP_FEATURES: &'static [ClapFeature];
/// If set, this informs the host about the plugin's capabilities for polyphonic modulation.
const CLAP_POLY_MODULATION_CONFIG: Option<PolyModulationConfig> = None;
} }
/// Provides auxiliary metadata needed for a VST3 plugin. /// Provides auxiliary metadata needed for a VST3 plugin.
@ -419,3 +422,15 @@ pub enum ProcessMode {
/// processed. /// processed.
Offline, Offline,
} }
/// Configuration for the plugin's polyphonic modulation options, if it supports .
pub struct PolyModulationConfig {
/// The maximum number of voices this plugin will ever use. Call the context's
/// `set_current_voices()` method during initialization or audio processing to set the number of
/// currently active voices.
pub max_voices: u32,
/// If set to `true`, then the host may send note events for the same channel and key, but using
/// different voice IDs. Bitwig Studio, for instance, can use this to do voice stacking. After
/// enabling this, you should always prioritize using voice IDs to map note events to voices.
pub supports_overlapping_voices: bool,
}