Wrap nested Params structs in Arcs
So we can use the generic UIs. Vizia needs these to be 'static.
This commit is contained in:
parent
2fbf4ca00d
commit
4f62ebd2ea
|
@ -93,9 +93,9 @@ pub struct ThresholdParams {
|
|||
#[derive(Params)]
|
||||
pub struct CompressorBankParams {
|
||||
#[nested = "downwards"]
|
||||
pub downwards: CompressorParams,
|
||||
pub downwards: Arc<CompressorParams>,
|
||||
#[nested = "upwards"]
|
||||
pub upwards: CompressorParams,
|
||||
pub upwards: Arc<CompressorParams>,
|
||||
}
|
||||
|
||||
/// This struct contains the parameters for either the upward or downward compressors. The `Params`
|
||||
|
@ -217,18 +217,18 @@ impl CompressorBankParams {
|
|||
/// recompute its values on the next processing cycle.
|
||||
pub fn new(compressor: &CompressorBank) -> Self {
|
||||
CompressorBankParams {
|
||||
downwards: CompressorParams::new(
|
||||
downwards: Arc::new(CompressorParams::new(
|
||||
"downwards_",
|
||||
"Downwards",
|
||||
compressor.should_update_downwards_thresholds.clone(),
|
||||
compressor.should_update_downwards_ratios.clone(),
|
||||
),
|
||||
upwards: CompressorParams::new(
|
||||
)),
|
||||
upwards: Arc::new(CompressorParams::new(
|
||||
"upwards_",
|
||||
"Upwards",
|
||||
compressor.should_update_upwards_thresholds.clone(),
|
||||
compressor.should_update_upwards_ratios.clone(),
|
||||
),
|
||||
)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -79,14 +79,16 @@ struct Plan {
|
|||
|
||||
#[derive(Params)]
|
||||
pub struct SpectralCompressorParams {
|
||||
// NOTE: These `Arc`s are only here temporarily to work around Vizia's Lens requirements so we
|
||||
// can use the generic UIs
|
||||
/// Global parameters. These could just live in this struct but I wanted a separate generic UI
|
||||
/// just for these.
|
||||
#[nested = "global"]
|
||||
global: GlobalParams,
|
||||
global: Arc<GlobalParams>,
|
||||
|
||||
/// Parameters controlling the compressor thresholds and curves.
|
||||
#[nested = "threshold"]
|
||||
threshold: compressor_bank::ThresholdParams,
|
||||
threshold: Arc<compressor_bank::ThresholdParams>,
|
||||
/// Parameters for the upwards and downwards compressors.
|
||||
#[nested = "compressors"]
|
||||
compressors: compressor_bank::CompressorBankParams,
|
||||
|
@ -241,9 +243,9 @@ impl SpectralCompressorParams {
|
|||
SpectralCompressorParams {
|
||||
// TODO: Do still enable per-block smoothing for these settings, because why not. This
|
||||
// will require updating the compressor bank.
|
||||
global: GlobalParams::default(),
|
||||
global: Arc::new(GlobalParams::default()),
|
||||
|
||||
threshold: compressor_bank::ThresholdParams::new(compressor_bank),
|
||||
threshold: Arc::new(compressor_bank::ThresholdParams::new(compressor_bank)),
|
||||
compressors: compressor_bank::CompressorBankParams::new(compressor_bank),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue