use std::path::PathBuf;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum PluginCategory {
Effect,
Instrument,
NoteEffect,
Analyzer,
Tool,
}
#[derive(Debug, Clone)]
pub struct PluginInfo {
pub name: String,
pub vendor: String,
pub version: u32,
pub category: PluginCategory,
pub path: PathBuf,
pub unique_id: String,
pub format: &'static str,
pub has_editor: bool,
pub accepts_midi: bool,
}
impl std::fmt::Display for PluginInfo {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(
f,
"[{}] {} — {} (v{}, {:?})",
self.format, self.name, self.vendor, self.version, self.category
)
}
}
#[derive(Debug, Clone)]
pub struct ParameterInfo {
pub id: u32,
pub name: String,
pub short_name: String,
pub unit: String,
pub min: f64,
pub max: f64,
pub default: f64,
pub step_count: u32,
pub flags: ParameterFlags,
}
bitflags::bitflags! {
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct ParameterFlags: u32 {
const BYPASS = 1 << 0;
const AUTOMATABLE = 1 << 1;
const HIDDEN = 1 << 2;
const READ_ONLY = 1 << 3;
const ENUMERATED = 1 << 4;
}
}
#[derive(Debug, Clone)]
pub struct PresetInfo {
pub index: usize,
pub name: String,
pub preset_number: i32,
}