Module nih_plug::params::enums

source ·
Expand description

Enum parameters. enum is a keyword, so enums it is.

Structs

  • An IntParam-backed categorical parameter that allows convenient conversion to and from a simple enum. This enum must derive the re-exported Enum trait. Check the trait’s documentation for more information on how this works.
  • The type-erased internals for EnumParam so that the wrapper can interact with it. Acts like an IntParam but with different conversions from strings to values.

Traits

  • An enum usable with EnumParam. This trait can be derived. Variants are identified either by a stable id (see below), or if those are not set then they are identifier by their declaration order. If you don’t provide IDs then you can freely rename the variant names, but reordering them will break compatibility with existing presets. The variant’s name is used as the display name by default. If you want to override this, for instance, because it needs to contain spaces, then you can use the #[name = "..."] attribute:

Derive Macros

  • Derive the Enum trait for simple enum parameters. See EnumParam for more information.