]> www.dolda2000.com Git - kaka/cakelight.git/commitdiff
Changed 'level' to 'brightness'
authorTomas Wenström <tomas.wenstrom@gmail.com>
Fri, 25 Aug 2017 22:21:50 +0000 (00:21 +0200)
committerTomas Wenström <tomas.wenstrom@gmail.com>
Fri, 25 Aug 2017 22:21:50 +0000 (00:21 +0200)
config.properties.template
src/kaka/cakelight/Configuration.java
src/kaka/cakelight/LedFrame.java

index 77f6aebb990a1555157792f0d3136f7708ef7392..d7333fb8f02334d8b7c2542d75bc3ae1450d9f49 100644 (file)
@@ -14,8 +14,8 @@ video.crop.bottom=18
 
 # Supported types: apa102, ws2801
 leds.type=apa102
-# Light level: 1-31
-leds.level=31
+# LED brightness: 1-31
+leds.brightness=31
 leds.cols=32
 leds.rows=17
 
index 286da18bacb7a7da0fd2b3052b0c540d2956a228..4a6a6a6b5ad033f7bc0bbcdd2cedce89717c4eb4 100644 (file)
@@ -98,13 +98,13 @@ public class Configuration {
     public class LedConfiguration {
         public int cols;
         public int rows;
-        public int level;
+        public int brightness;
         public LedType type;
 
         private LedConfiguration(Properties prop) {
             cols = Integer.parseInt(get(prop, "leds.cols"));
             rows = Integer.parseInt(get(prop, "leds.rows"));
-            level = Math.max(1, Math.min(31, Integer.parseInt(get(prop, "leds.level", "31"))));
+            brightness = Math.max(1, Math.min(31, Integer.parseInt(get(prop, "leds.brightness", "31"))));
             switch (get(prop, "leds.type", "").toUpperCase()) {
                 case "WS2801":
                     type = LedType.WS2801;
index cb92dabb823aa2a2635bde6f10aecbc966729b9c..546e78bfe0601572ed331f4d144d9342abb17275 100644 (file)
@@ -37,7 +37,7 @@ public class LedFrame {
                 frame.goff = 2 + 4;
                 frame.boff = 1 + 4;
                 frame.bytes = new byte[4 + config.leds.getCount() * frame.stride + 4];
-                Arrays.fill(frame.bytes, 4, frame.bytes.length - 5, (byte)(0b11100000 | config.leds.level)); // Initiate the first byte of each LED
+                Arrays.fill(frame.bytes, 4, frame.bytes.length - 5, (byte)(0b11100000 | config.leds.brightness)); // Initiate the first byte of each LED
                 Arrays.fill(frame.bytes, frame.bytes.length - 5, frame.bytes.length - 1, (byte)0xff); // Initiate the end frame with ones
                 break;
         }