#[derive(Clone, Debug)]
pub struct PluginInfo {
pub name: &'static str,
pub vendor: &'static str,
pub url: &'static str,
pub version: &'static str,
pub category: PluginCategory,
pub bundle_id: &'static str,
pub vst3_id: &'static str,
pub clap_id: &'static str,
pub fourcc: [u8; 4],
pub au_type: [u8; 4],
pub au_manufacturer: [u8; 4],
pub aax_id: Option<&'static str>,
pub aax_category: Option<&'static str>,
pub vst3_name: Option<&'static str>,
pub clap_name: Option<&'static str>,
pub vst2_name: Option<&'static str>,
pub au_name: Option<&'static str>,
pub au3_name: Option<&'static str>,
pub aax_name: Option<&'static str>,
pub lv2_name: Option<&'static str>,
#[doc(hidden)]
pub mute_preview_output: bool,
}
#[must_use]
pub fn resolve_name_override(
override_value: Option<&'static str>,
fallback: &'static str,
) -> &'static str {
match override_value {
Some(s) if !s.is_empty() => s,
_ => fallback,
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum PluginCategory {
Effect,
Instrument,
NoteEffect,
Analyzer,
Tool,
}
#[must_use]
pub const fn category_from_str(s: &str) -> PluginCategory {
match s.as_bytes() {
b"Instrument" => PluginCategory::Instrument,
b"NoteEffect" => PluginCategory::NoteEffect,
b"Analyzer" => PluginCategory::Analyzer,
b"Tool" => PluginCategory::Tool,
_ => PluginCategory::Effect,
}
}
#[must_use]
pub const fn fourcc(s: &[u8]) -> [u8; 4] {
assert!(s.len() == 4, "FourCC must be exactly 4 bytes");
[s[0], s[1], s[2], s[3]]
}