use vst3::Steinberg::TUID;
pub const DEFAULT_SYSEX_SLOTS: usize = 16;
pub const DEFAULT_SYSEX_BUFFER_SIZE: usize = 512;
pub struct PluginConfig {
pub name: &'static str,
pub vendor: &'static str,
pub url: &'static str,
pub email: &'static str,
pub version: &'static str,
pub component_uid: TUID,
pub controller_uid: Option<TUID>,
pub category: &'static str,
pub sub_categories: &'static str,
pub has_editor: bool,
pub sysex_slots: usize,
pub sysex_buffer_size: usize,
}
impl PluginConfig {
pub const fn new(name: &'static str, component_uid: TUID) -> Self {
Self {
name,
vendor: "Unknown Vendor",
url: "",
email: "",
version: "1.0.0",
component_uid,
controller_uid: None,
category: "Fx",
sub_categories: "",
has_editor: false,
sysex_slots: DEFAULT_SYSEX_SLOTS,
sysex_buffer_size: DEFAULT_SYSEX_BUFFER_SIZE,
}
}
pub const fn with_controller(mut self, controller_uid: TUID) -> Self {
self.controller_uid = Some(controller_uid);
self
}
pub const fn with_vendor(mut self, vendor: &'static str) -> Self {
self.vendor = vendor;
self
}
pub const fn with_url(mut self, url: &'static str) -> Self {
self.url = url;
self
}
pub const fn with_email(mut self, email: &'static str) -> Self {
self.email = email;
self
}
pub const fn with_version(mut self, version: &'static str) -> Self {
self.version = version;
self
}
pub const fn with_category(mut self, category: &'static str) -> Self {
self.category = category;
self
}
pub const fn with_sub_categories(mut self, sub_categories: &'static str) -> Self {
self.sub_categories = sub_categories;
self
}
pub const fn with_editor(mut self) -> Self {
self.has_editor = true;
self
}
pub const fn with_sysex_slots(mut self, slots: usize) -> Self {
self.sysex_slots = slots;
self
}
pub const fn with_sysex_buffer_size(mut self, size: usize) -> Self {
self.sysex_buffer_size = size;
self
}
}
impl PluginConfig {
pub const fn has_controller(&self) -> bool {
self.controller_uid.is_some()
}
}