use std::path::PathBuf;
#[derive(Debug, Clone)]
pub struct PluginInfo {
pub name: String,
pub manufacturer: String,
pub version: u32,
pub plugin_type: PluginType,
pub path: PathBuf,
pub unique_id: String,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum PluginType {
Effect,
Instrument,
Mixer,
FormatConverter,
Analyzer,
Spatial,
Other,
}
impl PluginInfo {
pub fn new(
name: String,
manufacturer: String,
version: u32,
plugin_type: PluginType,
path: PathBuf,
unique_id: String,
) -> Self {
Self {
name,
manufacturer,
version,
plugin_type,
path,
unique_id,
}
}
}
impl std::fmt::Display for PluginInfo {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(
f,
"{} by {} (v{}) [{:?}]",
self.name, self.manufacturer, self.version, self.plugin_type
)
}
}
#[derive(Debug, Clone)]
pub struct ParameterInfo {
pub index: usize,
pub name: String,
pub min: f32,
pub max: f32,
pub default: f32,
pub unit: String,
}
impl ParameterInfo {
pub fn new(
index: usize,
name: String,
min: f32,
max: f32,
default: f32,
unit: String,
) -> Self {
Self {
index,
name,
min,
max,
default,
unit,
}
}
}
#[derive(Debug, Clone)]
pub struct PresetInfo {
pub index: usize,
pub name: String,
pub preset_number: i32,
}
impl PresetInfo {
pub fn new(index: usize, name: String, preset_number: i32) -> Self {
Self {
index,
name,
preset_number,
}
}
}