Function nih_plug::wrapper::standalone::nih_export_standalone
source · pub fn nih_export_standalone<P: Plugin>() -> bool
Available on crate feature
standalone
only.Expand description
Open an NIH-plug plugin as a standalone application. If the plugin has an editor, this will open
the editor and block until the editor is closed. Otherwise this will block until SIGINT is
received. This is mainly useful for quickly testing plugin GUIs. In order to use this, you will
first need to make your plugin’s main struct pub
and expose a lib
artifact in addition to
your plugin’s cdylib
:
# Cargo.toml
[lib]
# The `lib` artifact is needed for the standalone target
crate-type = ["cdylib", "lib"]
You can then create a src/main.rs
file that calls this function:
ⓘ
// src/main.rs
use nih_plug::prelude::*;
use plugin_name::PluginName;
fn main() {
nih_export_standalone::<PluginName>();
}
By default this will connect to the ‘default’ audio and MIDI ports. Use the command line options
to change this. --help
lists all available options.
If the wrapped plugin fails to initialize or throws an error during audio processing, then this
function will return false
.