From d35276437d0ba2296eae33bf8093181c27636697 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Wed, 23 Mar 2022 23:29:49 +0100 Subject: [PATCH] Patch vizia to not require pub for lenses --- Cargo.lock | 8 ++++---- nih_plug_vizia/src/widgets/param_slider.rs | 3 +-- plugins/crisp/src/editor.rs | 3 +-- plugins/crisp/src/lib.rs | 2 +- plugins/diopser/src/editor.rs | 3 +-- plugins/diopser/src/lib.rs | 2 +- plugins/examples/gain-gui-vizia/src/editor.rs | 3 +-- plugins/examples/gain-gui-vizia/src/lib.rs | 3 +-- 8 files changed, 11 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d6f2309a..97237a54 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3607,7 +3607,7 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "vizia" version = "0.1.0" -source = "git+https://github.com/robbert-vdh/vizia.git?branch=feature/baseview-modifiers#8772bc3f68441fb2ae89809b5c4624be4ae21da3" +source = "git+https://github.com/robbert-vdh/vizia.git?branch=feature/baseview-modifiers#78122bddc2bfc9ee27d84d2f4838a10f48becd34" dependencies = [ "vizia_baseview", "vizia_core", @@ -3616,7 +3616,7 @@ dependencies = [ [[package]] name = "vizia_baseview" version = "0.1.0" -source = "git+https://github.com/robbert-vdh/vizia.git?branch=feature/baseview-modifiers#8772bc3f68441fb2ae89809b5c4624be4ae21da3" +source = "git+https://github.com/robbert-vdh/vizia.git?branch=feature/baseview-modifiers#78122bddc2bfc9ee27d84d2f4838a10f48becd34" dependencies = [ "baseview", "femtovg", @@ -3628,7 +3628,7 @@ dependencies = [ [[package]] name = "vizia_core" version = "0.1.0" -source = "git+https://github.com/robbert-vdh/vizia.git?branch=feature/baseview-modifiers#8772bc3f68441fb2ae89809b5c4624be4ae21da3" +source = "git+https://github.com/robbert-vdh/vizia.git?branch=feature/baseview-modifiers#78122bddc2bfc9ee27d84d2f4838a10f48becd34" dependencies = [ "bitflags", "copypasta", @@ -3651,7 +3651,7 @@ dependencies = [ [[package]] name = "vizia_derive" version = "0.1.0" -source = "git+https://github.com/robbert-vdh/vizia.git?branch=feature/baseview-modifiers#8772bc3f68441fb2ae89809b5c4624be4ae21da3" +source = "git+https://github.com/robbert-vdh/vizia.git?branch=feature/baseview-modifiers#78122bddc2bfc9ee27d84d2f4838a10f48becd34" dependencies = [ "proc-macro2", "quote", diff --git a/nih_plug_vizia/src/widgets/param_slider.rs b/nih_plug_vizia/src/widgets/param_slider.rs index c8d3c792..1dbc25e0 100644 --- a/nih_plug_vizia/src/widgets/param_slider.rs +++ b/nih_plug_vizia/src/widgets/param_slider.rs @@ -63,8 +63,7 @@ enum ParamSliderEvent { /// Internal param slider state the view needs to react to. #[derive(Lens)] -// TODO: Lens requires everything to be marked as `pub` -pub struct ParamSliderInternal { +struct ParamSliderInternal { /// What style to use for the slider. style: ParamSliderStyle, /// Will be set to `true` when the field gets Alt+Click'ed which will replae the label with a diff --git a/plugins/crisp/src/editor.rs b/plugins/crisp/src/editor.rs index 1409f251..793ecabe 100644 --- a/plugins/crisp/src/editor.rs +++ b/plugins/crisp/src/editor.rs @@ -27,8 +27,7 @@ use crate::CrispParams; const POINT_SCALE: f32 = 0.75; #[derive(Lens)] -// TODO: Lens requires everything to be marked as `pub` -pub struct Data { +struct Data { params: Pin>, } diff --git a/plugins/crisp/src/lib.rs b/plugins/crisp/src/lib.rs index 56b4f9c4..9b16a9b0 100644 --- a/plugins/crisp/src/lib.rs +++ b/plugins/crisp/src/lib.rs @@ -63,7 +63,7 @@ struct Crisp { } #[derive(Params)] -pub struct CrispParams { +struct CrispParams { /// On a range of `[0, 1]`, how much of the modulated sound to mix in. #[id = "amount"] amount: FloatParam, diff --git a/plugins/diopser/src/editor.rs b/plugins/diopser/src/editor.rs index 0e5e97bf..658f80ac 100644 --- a/plugins/diopser/src/editor.rs +++ b/plugins/diopser/src/editor.rs @@ -27,8 +27,7 @@ use crate::DiopserParams; const POINT_SCALE: f32 = 0.75; #[derive(Lens)] -// TODO: Lens requires everything to be marked as `pub` -pub struct Data { +struct Data { params: Pin>, } diff --git a/plugins/diopser/src/lib.rs b/plugins/diopser/src/lib.rs index 7ed88809..2062a9f1 100644 --- a/plugins/diopser/src/lib.rs +++ b/plugins/diopser/src/lib.rs @@ -80,7 +80,7 @@ struct Diopser { // TODO: Some combinations of parameters can cause really loud resonance. We should limit the // resonance and filter stages parameter ranges in the GUI until the user unlocks. #[derive(Params)] -pub struct DiopserParams { +struct DiopserParams { /// The number of all-pass filters applied in series. #[id = "stages"] filter_stages: IntParam, diff --git a/plugins/examples/gain-gui-vizia/src/editor.rs b/plugins/examples/gain-gui-vizia/src/editor.rs index c2321b87..547678f7 100644 --- a/plugins/examples/gain-gui-vizia/src/editor.rs +++ b/plugins/examples/gain-gui-vizia/src/editor.rs @@ -16,8 +16,7 @@ const POINT_SCALE: f32 = 0.75; const STYLE: &str = r#""#; #[derive(Lens)] -// TODO: Lens requires everything to be marked as `pub` -pub struct Data { +struct Data { params: Pin>, peak_meter: Arc, } diff --git a/plugins/examples/gain-gui-vizia/src/lib.rs b/plugins/examples/gain-gui-vizia/src/lib.rs index a68f63bd..ed2f3a10 100644 --- a/plugins/examples/gain-gui-vizia/src/lib.rs +++ b/plugins/examples/gain-gui-vizia/src/lib.rs @@ -22,8 +22,7 @@ struct Gain { } #[derive(Params)] -// TODO: Lens requires everything to be marked as `pub` -pub struct GainParams { +struct GainParams { #[id = "gain"] pub gain: FloatParam, }