Added a LED controller that consumes LED frames from the modes
[kaka/cakelight.git] / src / kaka / cakelight / Mode.java
index 3a1f5d0..7b0227b 100644 (file)
@@ -1,6 +1,14 @@
 package kaka.cakelight;
 
-public interface Mode {
-    void enter(Configuration config);
-    void exit();
+import java.util.function.Consumer;
+
+public abstract class Mode {
+    protected Consumer<LedFrame> frameListener;
+
+    public abstract void enter(Configuration config);
+    public abstract void exit();
+
+    public void setFrameListener(Consumer<LedFrame> listener) {
+        frameListener = listener;
+    }
 }