Skip to main content

nice_plug_core/
context.rs

1//! Different contexts the plugin can use to make callbacks to the host in different...contexts.
2
3use std::fmt::Display;
4
5pub mod activate;
6pub mod process;
7
8// Contexts for more plugin-API specific features
9pub mod remote_controls;
10
11#[cfg(feature = "editor")]
12pub mod gui;
13
14/// The currently active plugin API. This may be useful to display in an about screen in the
15/// plugin's GUI for debugging purposes.
16#[derive(Debug, Clone, Copy, PartialEq, Eq)]
17pub enum PluginApi {
18    Clap,
19    Standalone,
20    Vst3,
21}
22
23impl Display for PluginApi {
24    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
25        match self {
26            PluginApi::Clap => write!(f, "CLAP"),
27            PluginApi::Standalone => write!(f, "standalone"),
28            PluginApi::Vst3 => write!(f, "VST3"),
29        }
30    }
31}