From 122f45b3485778a602213fdec37e753eccb3c9e2 Mon Sep 17 00:00:00 2001 From: Marco Bavagnoli Date: Sun, 24 Nov 2024 18:07:13 +0100 Subject: [PATCH] chore on new filters examples --- example/lib/filters/compressor.dart | 44 +++++++++++++++------------ example/lib/filters/limiter.dart | 47 +++++++++++++++++------------ 2 files changed, 52 insertions(+), 39 deletions(-) diff --git a/example/lib/filters/compressor.dart b/example/lib/filters/compressor.dart index ef19c61..1a087fd 100644 --- a/example/lib/filters/compressor.dart +++ b/example/lib/filters/compressor.dart @@ -117,25 +117,31 @@ class _CompressorExampleState extends State { padding: const EdgeInsets.all(16), child: Column( children: [ - Checkbox( - value: isFilterActive, - onChanged: (value) { - if (value!) { - compressor.activate(); - compressor.wet.value = wet; - compressor.threshold.value = threshold; - compressor.makeupGain.value = makeupGain; - compressor.kneeWidth.value = kneeWidth; - compressor.ratio.value = ratio; - compressor.attackTime.value = attackTime; - compressor.releaseTime.value = releaseTime; - } else { - compressor.deactivate(); - } - setState(() { - isFilterActive = value; - }); - }, + Row( + mainAxisSize: MainAxisSize.min, + children: [ + const Text('Activate Compressor'), + Checkbox( + value: isFilterActive, + onChanged: (value) { + if (value!) { + compressor.activate(); + compressor.wet.value = wet; + compressor.threshold.value = threshold; + compressor.makeupGain.value = makeupGain; + compressor.kneeWidth.value = kneeWidth; + compressor.ratio.value = ratio; + compressor.attackTime.value = attackTime; + compressor.releaseTime.value = releaseTime; + } else { + compressor.deactivate(); + } + setState(() { + isFilterActive = value; + }); + }, + ), + ], ), ElevatedButton( diff --git a/example/lib/filters/limiter.dart b/example/lib/filters/limiter.dart index 57be10b..d704634 100644 --- a/example/lib/filters/limiter.dart +++ b/example/lib/filters/limiter.dart @@ -103,23 +103,33 @@ class _LimiterExampleState extends State { padding: const EdgeInsets.all(16), child: Column( children: [ - Checkbox( - value: isFilterActive, - onChanged: (value) { - if (value!) { - limiter.activate(); - limiter.wet.value = wet; - limiter.threshold.value = threshold; - limiter.makeupGain.value = makeupGain; - limiter.kneeWidth.value = kneeWidth; - limiter.releaseTime.value = releaseTime; - } else { - limiter.deactivate(); - } - setState(() { - isFilterActive = value; - }); - }, + const Text( + 'WARNING: lower the volume down!', + style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold), + ), + Row( + mainAxisSize: MainAxisSize.min, + children: [ + const Text('Activate Limiter'), + Checkbox( + value: isFilterActive, + onChanged: (value) { + if (value!) { + limiter.activate(); + limiter.wet.value = wet; + limiter.threshold.value = threshold; + limiter.makeupGain.value = makeupGain; + limiter.kneeWidth.value = kneeWidth; + limiter.releaseTime.value = releaseTime; + } else { + limiter.deactivate(); + } + setState(() { + isFilterActive = value; + }); + }, + ), + ], ), ElevatedButton( @@ -138,9 +148,6 @@ class _LimiterExampleState extends State { SoLoud.instance.play(sound!, looping: true); SoLoud.instance.play(sound!, looping: true); SoLoud.instance.play(sound!, looping: true); - SoLoud.instance.play(sound!, looping: true); - SoLoud.instance.play(sound!, looping: true); - SoLoud.instance.play(sound!, looping: true); }, child: const Text('play sound'), ),