From c1ea1e429fb24e4d94265e9715bc90180711e7c9 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Sun, 30 Jan 2022 16:16:15 +0100 Subject: [PATCH] Use the persist attribute in the gain example --- plugins/gain/src/lib.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugins/gain/src/lib.rs b/plugins/gain/src/lib.rs index bcfa4e7f..02a7a298 100644 --- a/plugins/gain/src/lib.rs +++ b/plugins/gain/src/lib.rs @@ -33,6 +33,12 @@ struct Gain { struct GainParams { #[id = "gain"] pub gain: FloatParam, + + /// This field isn't used in this exampleq, but anything written to the vector would be restored + /// together with a preset/state file saved for this plugin. This can be useful for storign + /// things like sample data. + #[persist = "industry_secrets"] + pub random_data: Vec, } impl Default for Gain { @@ -57,6 +63,7 @@ impl Default for GainParams { value_to_string: formatters::f32_rounded(2), string_to_value: None, }, + random_data: Vec::new(), } } }