Bugfix - let PipeController set modes
[kaka/cakelight.git] / src / kaka / cakelight / mode / Mode.java
CommitLineData
67b0a758
TW
1package kaka.cakelight.mode;
2
3import kaka.cakelight.Configuration;
4import kaka.cakelight.LedFrame;
4a2d6056 5
03b67a73
TW
6import java.util.function.Consumer;
7
8public abstract class Mode {
6b569670 9 private Consumer<LedFrame> frameListener;
03b67a73
TW
10
11 public abstract void enter(Configuration config);
d0afa6fb
TW
12 public abstract void pause();
13 public abstract void resume();
03b67a73
TW
14 public abstract void exit();
15
16 public void setFrameListener(Consumer<LedFrame> listener) {
17 frameListener = listener;
18 }
6b569670
TW
19
20 public void updateWithFrame(LedFrame frame) {
21 assert frameListener != null;
22 frameListener.accept(frame);
23 }
4a2d6056 24}