1
0
Fork 0

Add a debug assert for the subcategory length

Since this will be truncated otherwise.
This commit is contained in:
Robbert van der Helm 2023-02-01 16:50:25 +01:00
parent d6184ea06e
commit 7874e1796f

View file

@ -148,15 +148,18 @@ fn make_subcategories_string<P: Vst3Plugin>() -> String {
// No idea if any hosts do something with OnlyRT, but it's part of VST3's example categories // No idea if any hosts do something with OnlyRT, but it's part of VST3's example categories
// list. Plugins should not be adding this feature manually // list. Plugins should not be adding this feature manually
nih_debug_assert!(!P::VST3_SUBCATEGORIES.contains(&Vst3SubCategory::Custom("OnlyRT"))); nih_debug_assert!(!P::VST3_SUBCATEGORIES.contains(&Vst3SubCategory::Custom("OnlyRT")));
let category_string = P::VST3_SUBCATEGORIES let subcategory_string = P::VST3_SUBCATEGORIES
.iter() .iter()
.map(Vst3SubCategory::as_str) .map(Vst3SubCategory::as_str)
.collect::<Vec<&str>>() .collect::<Vec<&str>>()
.join("|"); .join("|");
if P::HARD_REALTIME_ONLY { let subcategory_string = if P::HARD_REALTIME_ONLY {
format!("{category_string}|OnlyRT") format!("{subcategory_string}|OnlyRT")
} else { } else {
category_string subcategory_string
} };
nih_debug_assert!(subcategory_string.len() <= 127);
subcategory_string
} }