From 905925e0325265497b8fd0c0f348b1bbfbbf3d1a Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Tue, 5 Jul 2022 22:20:07 +0200 Subject: [PATCH] Move the hard realtime constant to Plugin Since we could indeed just add the `|OnlyRT` category to the VST3 plugin. --- BREAKING_CHANGES.md | 6 ++++++ src/plugin.rs | 12 +++++------- src/wrapper/clap/wrapper.rs | 2 +- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/BREAKING_CHANGES.md b/BREAKING_CHANGES.md index f3cc09c5..d25200c7 100644 --- a/BREAKING_CHANGES.md +++ b/BREAKING_CHANGES.md @@ -6,6 +6,12 @@ new and what's changed, this document lists all breaking changes in reverse chronological order. If a new feature did not require any changes to existing code then it will not be listed here. +## [2022-07-05] + +- The `ClapPlugin::CLAP_HARD_REALTIME` constant was moved to the general + `Plugin` trait as `Plugin::HARD_REALTIME_ONLY` and best-effort support for + VST3 was added. + ## [2022-07-04] - There is a new `NoteEvent::Choke` event the host can send to a plugin to let diff --git a/src/plugin.rs b/src/plugin.rs index 1f0ff959..90b225a2 100644 --- a/src/plugin.rs +++ b/src/plugin.rs @@ -80,6 +80,11 @@ pub trait Plugin: Default + Send + Sync + 'static { /// every 64 samples. const SAMPLE_ACCURATE_AUTOMATION: bool = false; + /// If this is set to true, then the plugin will report itself as having a hard realtime + /// processing requirement when the host asks for it. Supported hosts will never ask the plugin + /// to do offline processing. + const HARD_REALTIME_ONLY: bool = false; + /// 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 /// plugin receives an update. @@ -201,13 +206,6 @@ pub trait ClapPlugin: Plugin { /// Keywords describing the plugin. The host may use this to classify the plugin in its plugin /// browser. const CLAP_FEATURES: &'static [ClapFeature]; - - /// If this is set to true, then the plugin will report itself as having a hard realtime - /// processing requirement when the host asks for it. Supported hosts will never ask the plugin - /// to do offline processing. - // TODO: Supposedly VST3 also has something similar if you add an `|OnlyRT` category. We should - // move this to the Plugin trait and use that for VST3 - const CLAP_HARD_REALTIME: bool = false; } /// Provides auxiliary metadata needed for a VST3 plugin. diff --git a/src/wrapper/clap/wrapper.rs b/src/wrapper/clap/wrapper.rs index bb208b7b..ee9e2e15 100644 --- a/src/wrapper/clap/wrapper.rs +++ b/src/wrapper/clap/wrapper.rs @@ -2934,7 +2934,7 @@ impl Wrapper

{ unsafe extern "C" fn ext_render_has_hard_realtime_requirement( _plugin: *const clap_plugin, ) -> bool { - P::CLAP_HARD_REALTIME + P::HARD_REALTIME_ONLY } unsafe extern "C" fn ext_render_set(