import java.util.Optional;
import java.util.function.Consumer;
-public class VideoMode extends Mode implements Consumer<Optional<File>> {
+public class VideoMode extends Mode {
private Configuration config;
private Thread thread;
private Consumer<Frame> frameConsumer;
public VideoMode() {
deviceListener = new VideoDeviceListener();
- deviceListener.onVideoDeviceChange(this);
+ deviceListener.onVideoDeviceChange(this::onVideoDeviceChange);
}
@Override
frameListener.accept(frame.getLedFrame());
}
- @Override
- public void accept(Optional<File> videoDevice) {
+ public void onVideoDeviceChange(Optional<File> videoDevice) {
// Should only happen when this mode is active!
if (thread != null) {
thread.interrupt();