From 1466358e14d60250b946187e79ffc342b10ac311 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Tue, 5 Jul 2022 22:24:52 +0200 Subject: [PATCH] Support Plugin::HARD_REALTIME_ONLY for VST3 --- src/wrapper/vst3/factory.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/wrapper/vst3/factory.rs b/src/wrapper/vst3/factory.rs index 00cc828f..3c557fac 100644 --- a/src/wrapper/vst3/factory.rs +++ b/src/wrapper/vst3/factory.rs @@ -102,7 +102,20 @@ impl IPluginFactory2 for Factory

{ strlcpy(&mut info.category, "Audio Module Class"); strlcpy(&mut info.name, P::NAME); info.class_flags = 1 << 1; // kSimpleModeSupported - strlcpy(&mut info.subcategories, P::VST3_CATEGORIES); + + // No idea if any hosts do something with this, but it's part of VST3's example categories + // list + if P::HARD_REALTIME_ONLY { + nih_debug_assert!(!P::VST3_CATEGORIES.ends_with('|')); + nih_debug_assert!(!P::VST3_CATEGORIES.contains("OnlyRT")); + strlcpy( + &mut info.subcategories, + &format!("{}|OnlyRT", P::VST3_CATEGORIES), + ); + } else { + strlcpy(&mut info.subcategories, P::VST3_CATEGORIES); + }; + strlcpy(&mut info.vendor, P::VENDOR); strlcpy(&mut info.version, P::VERSION); strlcpy(&mut info.sdk_version, VST3_SDK_VERSION);