1
0
Fork 0

Add another plugin constant for MIDI support

This commit is contained in:
Robbert van der Helm 2022-02-04 01:09:09 +01:00
parent c1f435d909
commit f69fdcef5f
3 changed files with 8 additions and 0 deletions

View file

@ -96,6 +96,8 @@ impl Plugin for Gain {
const DEFAULT_NUM_INPUTS: u32 = 2; const DEFAULT_NUM_INPUTS: u32 = 2;
const DEFAULT_NUM_OUTPUTS: u32 = 2; const DEFAULT_NUM_OUTPUTS: u32 = 2;
const ACCEPTS_MIDI: bool = false;
fn params(&self) -> Pin<&dyn Params> { fn params(&self) -> Pin<&dyn Params> {
self.params.as_ref() self.params.as_ref()
} }

View file

@ -98,6 +98,8 @@ impl Plugin for Sine {
const DEFAULT_NUM_INPUTS: u32 = 0; const DEFAULT_NUM_INPUTS: u32 = 0;
const DEFAULT_NUM_OUTPUTS: u32 = 2; const DEFAULT_NUM_OUTPUTS: u32 = 2;
const ACCEPTS_MIDI: bool = true;
fn params(&self) -> Pin<&dyn Params> { fn params(&self) -> Pin<&dyn Params> {
self.params.as_ref() self.params.as_ref()
} }

View file

@ -54,6 +54,10 @@ pub trait Plugin: Default + Send + Sync {
/// instead of setting up the busses properly. /// instead of setting up the busses properly.
const DEFAULT_NUM_OUTPUTS: u32; const DEFAULT_NUM_OUTPUTS: u32;
/// Whether the plugin accepts note events. If this is set to `false`, then the plugin won't
/// receive any note events.
const ACCEPTS_MIDI: bool;
/// The plugin's parameters. The host will update the parameter values before calling /// The plugin's parameters. The host will update the parameter values before calling
/// `process()`. These parameters are identified by strings that should never change when the /// `process()`. These parameters are identified by strings that should never change when the
/// plugin receives an update. /// plugin receives an update.