From: Tomas Wenström Date: Mon, 14 Jun 2021 18:07:31 +0000 (+0200) Subject: Rename noise mode X-Git-Url: http://git.dolda2000.com/gitweb/?a=commitdiff_plain;h=6a3d0edaa676312429f2f2bd6ed44e59ed07cc70;p=kaka%2Fcakelight.git Rename noise mode --- diff --git a/src/kaka/cakelight/Commands.java b/src/kaka/cakelight/Commands.java index cbd9e38..e665cf1 100644 --- a/src/kaka/cakelight/Commands.java +++ b/src/kaka/cakelight/Commands.java @@ -155,15 +155,13 @@ class Commands { }); } - static Console.Command twoColorNoiseMode() { + static Console.Command noiseMode() { return modeCommand(new String[] {"n", "noise"}, (console, args) -> { if (args.length > 1) { console.out("setting multi-color noise mode"); - return new TwoColorNoiseMode(Stream.of(args) - .map(arg -> console.parseColor(arg)) + return new NoiseMode(Stream.of(args) + .map(console::parseColor) .toArray(Color[]::new) -// console.parseColor(args[0]), -// console.parseColor(args[1]) ); } return null; diff --git a/src/kaka/cakelight/Console.java b/src/kaka/cakelight/Console.java index 89acbbd..d7a29a3 100644 --- a/src/kaka/cakelight/Console.java +++ b/src/kaka/cakelight/Console.java @@ -36,7 +36,7 @@ public class Console extends Thread { register(Commands.gamma()); register(Commands.saturation()); register(Commands.ambientMode()); - register(Commands.twoColorNoiseMode()); + register(Commands.noiseMode()); register(Commands.sunriseMode()); } diff --git a/src/kaka/cakelight/mode/TwoColorNoiseMode.java b/src/kaka/cakelight/mode/NoiseMode.java similarity index 77% rename from src/kaka/cakelight/mode/TwoColorNoiseMode.java rename to src/kaka/cakelight/mode/NoiseMode.java index 6e8de55..57d973d 100644 --- a/src/kaka/cakelight/mode/TwoColorNoiseMode.java +++ b/src/kaka/cakelight/mode/NoiseMode.java @@ -4,22 +4,15 @@ import kaka.cakelight.Color; import kaka.cakelight.LedFrame; import kaka.cakelight.util.SimplexNoise3D; -public class TwoColorNoiseMode extends AmbientMode { - // private final Color primary, secondary; +public class NoiseMode extends AmbientMode { private final Color[] colors; private SimplexNoise3D noise = new SimplexNoise3D(0); - public TwoColorNoiseMode(Color... colors) { + public NoiseMode(Color... colors) { assert colors.length > 1; this.colors = colors; } - public TwoColorNoiseMode(Color primary, Color secondary) { - this(new Color[] {primary, secondary}); -// this.primary = primary; -// this.secondary = secondary; - } - @Override protected void updateFrame(LedFrame frame, long time, int count) { for (int i = 0; i < config.leds.getCount(); i++) {