if(p!=null) { p.setValue(val); }
}
if(type==1) {
- p = glucose.getSelectedTransition().getParameters().get(num);
+ p = lx.engine.getDeck(RIGHT_DECK).getFaderTransition().getParameters().get(num);
if(p!=null) { p.setValue(val); }
}
if(type==2) {
import java.util.Collections;
import java.util.List;
-final int VIEWPORT_WIDTH = 900;
-final int VIEWPORT_HEIGHT = 700;
+static final int VIEWPORT_WIDTH = 900;
+static final int VIEWPORT_HEIGHT = 700;
+
+static final int LEFT_DECK = 0;
+static final int RIGHT_DECK = 1;
// The trailer is measured from the outside of the black metal (but not including the higher welded part on the front)
-final float TRAILER_WIDTH = 192;
-final float TRAILER_DEPTH = 192;
-final float TRAILER_HEIGHT = 33;
+static final float TRAILER_WIDTH = 192;
+static final float TRAILER_DEPTH = 192;
+static final float TRAILER_HEIGHT = 33;
int targetFramerate = 60;
int startMillis, lastMillis;
LX lx;
Model model;
LXPattern[] patterns;
+LXTransition[] transitions;
+DiscreteParameter activeTransition;
Effects effects;
MappingTool mappingTool;
GrizzlyOutput[] grizzlies;
engine.setPatterns(patterns = _leftPatterns(lx));
engine.addDeck(_rightPatterns(lx));
logTime("Built patterns");
- glucose.setTransitions(transitions(lx));
+
+ // Transitions
+ transitions = transitions(lx);
+ activeTransition = new DiscreteParameter("TRANSITION", transitions.length);
+ activeTransition.addListener(new LXParameterListener() {
+ public void onParameterChanged(LXParameter parameter) {
+ lx.engine.getDeck(RIGHT_DECK).setFaderTransition(transitions[activeTransition.getValuei()]);
+ }
+ });
+ lx.engine.getDeck(RIGHT_DECK).setFaderTransition(transitions[activeTransition.getValuei()]);
logTime("Built transitions");
+
+ // Effects
glucose.lx.addEffects(_effectsArray(effects = new Effects()));
logTime("Built effects");
public UIBlendMode(float x, float y, float w, float h) {
super(lx.ui, "BLEND MODE", x, y, w, h);
List<UIScrollList.Item> items = new ArrayList<UIScrollList.Item>();
- for (LXTransition t : glucose.getTransitions()) {
- items.add(new TransitionScrollItem(t));
+ int i = 0;
+ for (LXTransition t : transitions) {
+ items.add(new TransitionScrollItem(t, i++));
}
final UIScrollList tList;
(tList = new UIScrollList(1, UIWindow.TITLE_LABEL_HEIGHT, w-2, 60)).setItems(items).addToContainer(this);
class TransitionScrollItem extends UIScrollList.AbstractItem {
private final LXTransition transition;
- private String label;
+ private final int index;
+ private final String label;
- TransitionScrollItem(LXTransition transition) {
+ TransitionScrollItem(LXTransition transition, int index) {
this.transition = transition;
- label = className(transition, "Transition");
+ this.index = index;
+ this.label = className(transition, "Transition");
}
public String getLabel() {
}
public boolean isSelected() {
- return transition == glucose.getSelectedTransition();
+ return index == activeTransition.getValuei();
}
public boolean isPending() {
}
public void onMousePressed() {
- glucose.setSelectedTransition(transition);
+ activeTransition.setValue(this.index);
}
}