### Create New Project with Cookiecutter Source: https://github.com/vizia/vizia-plug-book/blob/main/src/getting_started.md Initializes a new nih-plug project using a template. This command prompts for project details and sets up the basic structure. Requires cookiecutter and pipx to be installed. ```shell pipx run cookiecutter gh:robbert-vdh/nih-plug-template ``` -------------------------------- ### Run Standalone Plugin Source: https://github.com/vizia/vizia-plug-book/blob/main/src/getting_started.md Builds and executes the standalone version of the plugin. This command is used for testing the plugin's functionality outside of a Digital Audio Workstation (DAW). ```bash cargo run ``` -------------------------------- ### Configure Crate Type for Standalone Source: https://github.com/vizia/vizia-plug-book/blob/main/src/getting_started.md Updates the `Cargo.toml` file to include `"lib"` in the `crate-type` array. This is necessary for building the standalone executable alongside the dynamic library. ```toml crate-type = ["cdylib", "lib"] ``` -------------------------------- ### Create Standalone Entry Point Source: https://github.com/vizia/vizia-plug-book/blob/main/src/getting_started.md Adds a `main.rs` file to the `src` directory to define the entry point for the standalone plugin executable. It uses `nih_export_standalone` to export the main plugin struct. ```rust use nih_plug::prelude::*; use vizia_plug::ViziaPlug; fn main() { nih_export_standalone::(); } ``` -------------------------------- ### Create Basic Vizia GUI Editor Source: https://github.com/vizia/vizia-plug-book/blob/main/src/getting_started.md Defines a function to create a Vizia-based GUI editor for the plugin. It uses `create_vizia_editor` to set up the window size, theming, and initial UI elements like a label. The `_params` argument is an `Arc` to plugin parameters. ```rust use nih_plug::prelude::Editor; use nih_plug_vizia::vizia::prelude::*; use nih_plug_vizia::{create_vizia_editor, ViziaState, ViziaTheming}; use std::sync::Arc; use crate::ViziaPlugParams; pub(crate) fn create(_params: Arc) -> Option> { create_vizia_editor( ViziaState::new(|| (200, 150)), ViziaTheming::Custom, move |cx, _| { Label::new(cx, "Hello Plugin GUI"); }, ) } ``` -------------------------------- ### Enable Standalone Feature in Cargo.toml Source: https://github.com/vizia/vizia-plug-book/blob/main/src/getting_started.md Configures the `Cargo.toml` file to enable the `standalone` feature for the `nih_plug` dependency. This allows the plugin to be run as a standalone application for testing without a DAW. ```toml nih_plug = { git = "https://github.com/robbert-vdh/nih-plug.git", features = ["assert_process_allocs", "standalone"] } ``` -------------------------------- ### Build Plugin with Cargo xtask Source: https://github.com/vizia/vizia-plug-book/blob/main/src/getting_started.md Compiles the plugin into distributable formats (VST and CLAP) using the `xtask` build script. The `--release` flag ensures an optimized build. The output is placed in the `target/bundled` directory. ```shell cargo xtask bundle vizia_plug --release ``` -------------------------------- ### Add Vizia Dependency to Cargo.toml Source: https://github.com/vizia/vizia-plug-book/blob/main/src/getting_started.md Modifies the project's Cargo.toml file to include the nih_plug_vizia crate. This enables Vizia integration for the plugin's GUI. Ensure the git URL matches the nih_plug dependency. ```toml nih_plug_vizia = { git = "https://github.com/robbert-vdh/nih-plug.git" } ``` -------------------------------- ### Implement Plugin Editor Method Source: https://github.com/vizia/vizia-plug-book/blob/main/src/getting_started.md Adds the `editor` method to the `Plugin` trait implementation for the main plugin struct. This method is responsible for returning the GUI editor instance, linking it to the plugin's parameters. ```rust fn editor(&mut self, _async_executor: AsyncExecutor) -> Option> { editor::create(self.params.clone()) } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.