# Changelog All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). Since there is no stable release yet, the changes are organized per day in reverse chronological order. The main purpose of this document in its current state is to list breaking changes. ## [2023-03-21] ### Changed - The logger now always shows the module in debug builds to make it easier to know where logging messages are sent from. Previously this was only done for the debug and trace message levels. - The logger now filters out the `Mapped XXXX font faces in YYYms.` messages from cosmic text in release builds as this is unnecessary noise for end users. - `nih_plug_vizia`: `ParamButton`'s active color was made much lighter to make the text more readable, and the hover state has been fixed. ## [2023-03-18] ### Added - `nih_plug_vizia`: Added a `GuiContextEvent::Resize` event. The plugin can emit this to trigger a resize to its current size, as specified by its `ViziaState`'s size callback. This can be used to declaratively resize a plugin GUI and it removes some potential surface for making mistakes in the process. See `GuiContextEvent::Resize`'s documentation for an example. ## [2023-03-17] ### Added - Added a `NoteEvent::channel()` method to get an event's channel, if it has any. ([#62](https://github.com/robbert-vdh/nih-plug/pull/62)) ## [2023-03-07] This document is now also used to keep track of non-breaking changes. ### Breaking changes - The way window sizes work in `ViziaState` has been reworked to be more predictable and reliable. Instead of creating a `ViziaState` with a predefined size and then tracking the window's current size in that object, `ViziaState` now takes a callback that returns the window's current logical size. This can be used to compute the window's current size based on the plugin's state. The result is that window sizes always match the plugin's current state and recalling an old incorrect size is no longer possible. ### Added - Debug builds now include debug assertions that detect incorrect use of the `GuiContext`'s parameter setting methods. ## [2023-02-28] ### Breaking changes - `ViziaState::from_size()` now takes a third boolean argument to control whether the window's size is persisted or not. This avoids a potential bug where an old window size is recalled after the plugin's GUI's size has changed in an update to the plugin. ## [2023-02-20] ### Breaking changes - The way audio IO layouts are configured has changed completely to align better with NIH-plug's current and future supported plugin API backends. Rather than defining a default layout and allowing the host/backend to change the channel counts by polling the `Plugin::accepts_bus_config()` function, the plugin now explicitly enumerates all supported audio IO layouts in a declarative fashion. This change gives the plugin more options for defining alternative audio port layouts including layouts with variable numbers of channels and ports, while simultaneously removing ambiguities and behavior that was previously governed by heuristics. All types surrounding bus layouts and port names have changed slightly to accommodate this change. Take a look at the updated examples for more details on how this works. The `Plugin::AUDIO_IO_LAYOUTS` field's documentation also contains an example for how to initialize the layouts slice. - As a result of the above change, NIH-plug's standalones no longer have `--input` and `--output` command line arguments to change the number of input and output channels. Instead, they now have an `--audio-layout` option that lets the user select an audio layout from the list of available layouts by index. `--audio-layout=help` can be used to list those layouts. ## [2023-02-01] ### Breaking changes - The `Vst3Plugin::VST3_CATEGORIES` string constant has been replaced by a `Vst3Plugin::VST3_SUBCATEGORIES` constant of type `&[Vst3SubCategory]`. `Vst3SubCategory` is an enum containing all of VST3's predefined categories, and it behaves similarly to the `ClapFeature` enum used for CLAP plugins. This makes defining subcategories for VST3 plugins easier and less error prone. ## [2023-01-31] ### Breaking changes - NIH-plug has gained support MIDI SysEx in a simple, type-safe, and realtime-safe way. This sadly does mean that every `Plugin` instance now needs to define a `SysExMessage` type definition and constructor function as Rust does not yet support defaults for associated types (Rust issue [#29661](https://github.com/rust-lang/rust/issues/29661)): ```rust type SysExMessage = (); ``` - As the result of the above change, `NoteEvent` is now parameterized by a `SysExMessage` type. There is a new `PluginNoteEvent
` type synonym that can
be parameterized by a `Plugin` to make using this slightly less verbose.
## [2023-01-12]
### Breaking changes
- The Vizia dependency has been updated. This updated version uses a new text
rendering engine, so there are a couple breaking changes:
- The names for some of Vizia's fonts have changed. The constants and font
registration functions in `nih_plug_vizia::assets` and
`nih_plug_vizia::vizia_assets` still have the same name, but all uses of the
`font` CSS property and `.font()` view modifier will have to be changed.
- Metrics for rendered text have change slightly. Most notably the height and
vertical positioning of text is slightly different, so you may have to
adjust your layout slightly accordingly.
## [2023-01-11]
### Breaking changes
- `Editor::param_values_changes()` is no longer called from the audio thread and
thus no longer needs to be realtime safe.
- A new `Editor::param_value_changed(id, normalized_value)` method has been
added. This is used to notify the plugin of changes to individual parameters.
- A similar new `Editor::param_modulation_changed(id, modulation_offset)` is
used to inform the plugin of a parameter's new monophonic modulation offset.
## [2023-01-06]
### Breaking changes
- The threads used for the `.schedule_gui()` and `.schedule_background()`
methods are now shared between all instances of a plugin. This makes
`.schedule_gui()` on Linux behave more like it does on Windows and macOS, and
there is now only a single background thread instead of each instance spawning
their own thread.
## [2023-01-05]
### Breaking changes
- `Buffer::len()` has been renamed to `Buffer::samples()` to make this less
ambiguous.
- `Block::len()` has been renamed to `Block::samples()`.
## [2022-11-17]
### Breaking changes
- The `Params` derive macro now also properly supports persistent fields in
`#[nested]` parameter structs. This takes `#[nested(id_prefix = "...")]` and
`#[nested(array)]` into account to allow multiple copies of a persistent
field. This may break existing usages as serialized field data without a
matching preffix or suffix is no longer passed to the child object.
## [2022-11-17]
### Breaking changes
- The order of `#[nested]` parameters in the parameter list now always follows
the declaration order instead of nested parameters being ordered below regular
parameters.
## [2022-11-08]
### Breaking changes
- The `Param::{next_previous}{_step,_normalized_step}()` functions now take an
additional boolean argument to indicate that the range must be finer. This is
used for floating point parameters to chop the range up into smaller segments
when using Shift+scroll.
## [2022-11-07]
### Breaking changes
- `Param::plain_value()` and `Param::normalized_value()` have been renamed to
`Param::modulated_plain_value()` and `Param::modulated_normalized_value()`.
These functions are only used when creating GUIs, so this shouldn't break any
other plugin code. This change was made to make it extra clear that these
values do include monophonic modulation, as it's very easy to mistakenly use
the wrong value when handling user input in GUI widgets.
## [2022-11-06]
### Breaking changes
- `nih_plug_vizia::create_vizia_editor_without_theme()` has been removed, and
`nih_plug_vizia::create_vizia_editor()` has gained a new argument to specify
what amount of theming to apply. This can now also be used to completely
disable all theming include Vizia's built-in theme.
- `nih_plug_vizia::create_vizia_editor()` no longer registers any fonts by
default. Even when those fonts are not used, they will still be embedded in
the binary, increasing its size by several megabytes. Instead, you can now
register individual fonts by calling the
`nih_plug_vizia::assets::register_*()` functions. This means that you _must_
call `nih_plug_vizia::assets::register_noto_sans_light()` for the default
theming to work. All of the plugins in this repo also use
`nih_plug_vizia::assets::register_noto_sans_thin()` as a title font.
- Additionally, the Vizia fork has been updated to not register _any_ default
fonts for the same reason. If you previously relied on Vizia's default Roboto
font, then you must now call `nih_plug_vizia::vizia_assets::register_roboto()`
at the start of your process function.
## [2022-10-23]
### Breaking changes
- `nih_plug_vizia` has been updated. Widgets with custom drawing code will need
to be updated because of changes in Vizia itself.
## [2022-10-22]
### Breaking changes
- The `Editor` trait and the `ParentWindowHandle` struct have been moved from
`nih_plug::plugin` to a new `nih_plug::editor` module. If you only use the
prelude module then you won't need to change anything.
- The `nih_plug::context` module has been split up into
`nih_plug::context::init`, `nih_plug::context::process`, and
`nih_plug::context::gui` to make it clearer which structs go with which
context. You again don't have to change anything if you use the prelude.
- NIH-plug has gained support for asynchronously running background tasks in a
simple, type-safe, and realtime-safe way. This sadly does mean that every
`Plugin` instance now needs to define a `BackgroundTask` type definition and
constructor function as Rust does not yet support defaults for associated
types (Rust issue [#29661](https://github.com/rust-lang/rust/issues/29661)):
```rust
type BackgroundTask = ();
```
- The `&mut impl InitContext` argument to `Plugin::initialize()` needs to be
changed to `&mut impl InitContext