}
}
-class SwipeTransition extends SCTransition {
+class SwipeTransition extends LXTransition {
final BasicParameter bleed = new BasicParameter("WIDTH", 0.5);
- SwipeTransition(GLucose glucose) {
- super(glucose);
+ SwipeTransition(LX lx) {
+ super(lx);
setDuration(5000);
addParameter(bleed);
}
}
}
-abstract class BlendTransition extends SCTransition {
-
- final int blendType;
-
- BlendTransition(GLucose glucose, int blendType) {
- super(glucose);
- this.blendType = blendType;
- }
-
- void computeBlend(int[] c1, int[] c2, double progress) {
- if (progress < 0.5) {
- for (int i = 0; i < c1.length; ++i) {
- colors[i] = lerpColor(
- c1[i],
- blendColor(c1[i], c2[i], blendType),
- (float) (2.*progress),
- RGB);
- }
- } else {
- for (int i = 0; i < c1.length; ++i) {
- colors[i] = lerpColor(
- c2[i],
- blendColor(c1[i], c2[i], blendType),
- (float) (2.*(1. - progress)),
- RGB);
- }
- }
- }
-}
-
-class MultiplyTransition extends BlendTransition {
- MultiplyTransition(GLucose glucose) {
- super(glucose, MULTIPLY);
- }
-}
-
-class ScreenTransition extends BlendTransition {
- ScreenTransition(GLucose glucose) {
- super(glucose, SCREEN);
- }
-}
-
-class BurnTransition extends BlendTransition {
- BurnTransition(GLucose glucose) {
- super(glucose, BURN);
- }
-}
-
-class DodgeTransition extends BlendTransition {
- DodgeTransition(GLucose glucose) {
- super(glucose, DODGE);
- }
-}
-
-class OverlayTransition extends BlendTransition {
- OverlayTransition(GLucose glucose) {
- super(glucose, OVERLAY);
- }
-}
-
-class AddTransition extends BlendTransition {
- AddTransition(GLucose glucose) {
- super(glucose, ADD);
- }
-}
-
-class SubtractTransition extends BlendTransition {
- SubtractTransition(GLucose glucose) {
- super(glucose, SUBTRACT);
- }
-}
-
-class SoftLightTransition extends BlendTransition {
- SoftLightTransition(GLucose glucose) {
- super(glucose, SOFT_LIGHT);
- }
-}
-
class BassPod extends SCPattern {
private GraphicEQ eq = null;
}
}
-class BoomEffect extends SCEffect {
+class BoomEffect extends LXEffect {
final BasicParameter falloff = new BasicParameter("WIDTH", 0.5);
final BasicParameter speed = new BasicParameter("SPD", 0.5);
}
}
- BoomEffect(GLucose glucose) {
- super(glucose, true);
+ BoomEffect(LX lx) {
+ super(lx, true);
addParameter(falloff);
addParameter(speed);
addParameter(bright);
}
}
-class ColorFuckerEffect extends SCEffect {
+class ColorFuckerEffect extends LXEffect {
final BasicParameter level = new BasicParameter("BRT", 1);
final BasicParameter desat = new BasicParameter("DSAT", 0);
float[] hsb = new float[3];
- ColorFuckerEffect(GLucose glucose) {
- super(glucose);
+ ColorFuckerEffect(LX lx) {
+ super(lx);
addParameter(level);
addParameter(desat);
addParameter(sharp);
}
}
-class QuantizeEffect extends SCEffect {
+class QuantizeEffect extends LXEffect {
color[] quantizedFrame;
float lastQuant;
final BasicParameter amount = new BasicParameter("AMT", 0);
- QuantizeEffect(GLucose glucose) {
- super(glucose);
+ QuantizeEffect(LX lx) {
+ super(lx);
quantizedFrame = new color[glucose.lx.total];
lastQuant = 0;
}
}
}
-class BlurEffect extends SCEffect {
+class BlurEffect extends LXEffect {
final BasicParameter amount = new BasicParameter("AMT", 0);
final int[] frame;
final LinearEnvelope env = new LinearEnvelope(0, 1, 100);
- BlurEffect(GLucose glucose) {
- super(glucose);
+ BlurEffect(LX lx) {
+ super(lx);
addParameter(amount);
addModulator(env);
frame = new int[lx.total];
LXTransition[] transitions(GLucose glucose) {
return new LXTransition[] {
new DissolveTransition(lx),
- new AddTransition(glucose),
- new MultiplyTransition(glucose),
- new OverlayTransition(glucose),
- new DodgeTransition(glucose),
- new SwipeTransition(glucose),
+ new AddTransition(lx),
+ new MultiplyTransition(lx),
+ new OverlayTransition(lx),
+ new DodgeTransition(lx),
+ new SwipeTransition(lx),
new FadeTransition(lx),
// new SubtractTransition(glucose), // similar to multiply - dh
// new BurnTransition(glucose), // similar to multiply - dh
// Handles to globally triggerable effects
class Effects {
FlashEffect flash = new FlashEffect(lx);
- BoomEffect boom = new BoomEffect(glucose);
- BlurEffect blur = new BlurEffect(glucose);
- QuantizeEffect quantize = new QuantizeEffect(glucose);
- ColorFuckerEffect colorFucker = new ColorFuckerEffect(glucose);
+ BoomEffect boom = new BoomEffect(lx);
+ BlurEffect blur = new BlurEffect(lx);
+ QuantizeEffect quantize = new QuantizeEffect(lx);
+ ColorFuckerEffect colorFucker = new ColorFuckerEffect(lx);
Effects() {
blur.enable();