Behavior<String> priceLCD2 = Behavior.switchB(outputs.map(o -> o.priceLCD2));
Behavior<String> priceLCD3 = Behavior.switchB(outputs.map(o -> o.priceLCD3));
Event<Unit> eBeep = Behavior.switchE(outputs.map(o -> o.eBeep));
Event<Sale> eSaleComplete = Behavior.switchE(outputs.map(o -> o.eSaleComplete));
AudioClip beepClip = Applet.newAudioClip(new URL(rootURL, "sounds/beep.wav"));
l = l.append(eBeep.listen(u -> {
System.out.println("BEEP!");
beepClip.play();
}));
AudioClip fastRumble = Applet.newAudioClip(new URL(rootURL, "sounds/fast.wav"));
AudioClip slowRumble = Applet.newAudioClip(new URL(rootURL, "sounds/slow.wav"));
l = l.append(changes(delivery).listen(d -> {
switch (d) {
case FAST1:
case FAST2:
case FAST3:
fastRumble.loop();
break;
default:
fastRumble.stop();
}
switch (d) {
case SLOW1:
case SLOW2:
case SLOW3:
slowRumble.loop();
break;
default:
slowRumble.stop();
}
}));
PumpFace face = new PumpFace(
rootURL, eClick,