From 8e34e9de55581bdc045d02b74db01ed96961a92a Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Sat, 11 Sep 2021 08:20:54 -0400 Subject: [PATCH] Revise Migrate2. --- Migrate2.md | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/Migrate2.md b/Migrate2.md index 5c66e9d..cba711d 100644 --- a/Migrate2.md +++ b/Migrate2.md @@ -1,5 +1,7 @@ # Migrating v1 Plugins to v2 -The API of VCV Rack 2 has been designed to be nearly backward-compatible with v1 plugins, so updating your plugin to v2 likely only involves a version update and a recompile. +The API of VCV Rack 2 has been designed to be nearly backward-compatible with v1 plugins. +This means that 90% of plugins will only require a version update and a recompile (a 1-line edit, 15 seconds of work). +For the other 10% of plugins using advanced or unstable API feature, updating to v2 is easy and involves following a few search-and-replace steps. ### 1.1) Update `plugin.json` version string to v2 @@ -32,7 +34,14 @@ If your plugin compiles successfully, you can skip ahead to [Potential runtime b If not, read on to solve potential errors or warnings. -### 1.2) `ParamWidget::reset()` and `ParamWidget::randomize()` has been removed +### 1.2) `ParamWidget::paramQuantity` has been replaced by `getParamQuantity()` +If your `ParamWidget` methods use the `paramQuantity` member variable, replace it with the getter method, or add this line to the top of your method. +```cpp +ParamQuantity* paramQuantity = getParamQuantity(); +``` + + +### 1.3) `ParamWidget::reset()` and `ParamWidget::randomize()` has been removed If you would like to disable resetting or randomization of a particular parameter when the user resets/randomizes the module, set these properties in your `Module` constructor. ```cpp getParamQuantity(MY_PARAM)->resetEnabled = false; @@ -59,13 +68,6 @@ void onRandomize(const RandomizeEvent& e) override { ``` -### 1.3) `ParamWidget::paramQuantity` has been replaced by `getParamQuantity()` -If your `ParamWidget` methods use the `paramQuantity` member variable, replace it with the getter method, or add this line to the top of your method. -```cpp -ParamQuantity* paramQuantity = getParamQuantity(); -``` - - ### 1.4) `Window::loadSvg()` has been deprecated and moved to `Svg::load()` Search and replace: ```bash