1
0
Fork 0

Move the hard realtime constant to Plugin

Since we could indeed just add the `|OnlyRT` category to the VST3
plugin.
This commit is contained in:
Robbert van der Helm 2022-07-05 22:20:07 +02:00
parent 992fcfe969
commit 905925e032
3 changed files with 12 additions and 8 deletions

View file

@ -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

View file

@ -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.

View file

@ -2934,7 +2934,7 @@ impl<P: ClapPlugin> Wrapper<P> {
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(