From: Mark Slee Date: Wed, 26 Mar 2014 20:50:03 +0000 (-0700) Subject: New LX UI X-Git-Url: https://git.piment-noir.org/?p=SugarCubes.git;a=commitdiff_plain;h=30624e974f88224b0a8719b11bd649578eb97ab6 New LX UI --- diff --git a/MIDI.pde b/MIDI.pde index a618321..56ba9b5 100644 --- a/MIDI.pde +++ b/MIDI.pde @@ -115,7 +115,7 @@ public interface SCMidiInputListener { public void onEnabled(SCMidiInput controller, boolean enabled); } -public abstract class SCMidiInput extends UIScrollList.AbstractItem { +public abstract class SCMidiInput extends UIItemList.AbstractItem { protected boolean enabled = false; private final String name; diff --git a/UIImplementation.pde b/UIImplementation.pde index 0f73b99..e0b5787 100644 --- a/UIImplementation.pde +++ b/UIImplementation.pde @@ -222,12 +222,12 @@ FloatBuffer allocateDirectFloatBuffer(int n) { class UIBlendMode extends UIWindow { public UIBlendMode(float x, float y, float w, float h) { super(lx.ui, "BLEND MODE", x, y, w, h); - List items = new ArrayList(); + List items = new ArrayList(); for (LXTransition t : transitions) { - items.add(new TransitionScrollItem(t)); + items.add(new TransitionItem(t)); } - final UIScrollList tList; - (tList = new UIScrollList(1, UIWindow.TITLE_LABEL_HEIGHT, w-2, 60)).setItems(items).addToContainer(this); + final UIItemList tList; + (tList = new UIItemList(1, UIWindow.TITLE_LABEL_HEIGHT, w-2, 60)).setItems(items).addToContainer(this); lx.engine.getDeck(RIGHT_DECK).addListener(new LXDeck.AbstractListener() { public void faderTransitionDidChange(LXDeck deck, LXTransition transition) { @@ -236,11 +236,11 @@ class UIBlendMode extends UIWindow { }); } - class TransitionScrollItem extends UIScrollList.AbstractItem { + class TransitionItem extends UIItemList.AbstractItem { private final LXTransition transition; private final String label; - TransitionScrollItem(LXTransition transition) { + TransitionItem(LXTransition transition) { this.transition = transition; this.label = className(transition, "Transition"); } @@ -290,12 +290,12 @@ class UIEffects extends UIWindow { super(lx.ui, "FX", x, y, w, h); int yp = UIWindow.TITLE_LABEL_HEIGHT; - List items = new ArrayList(); + List items = new ArrayList(); int i = 0; for (LXEffect fx : effectsArr) { items.add(new FXScrollItem(fx, i++)); } - final UIScrollList effectsList = new UIScrollList(1, yp, w-2, 60).setItems(items); + final UIItemList effectsList = new UIItemList(1, yp, w-2, 60).setItems(items); effectsList.addToContainer(this); yp += effectsList.getHeight() + 10; @@ -327,7 +327,7 @@ class UIEffects extends UIWindow { } - class FXScrollItem extends UIScrollList.AbstractItem { + class FXScrollItem extends UIItemList.AbstractItem { private final LXEffect effect; private final int index; @@ -378,9 +378,9 @@ class UIOutput extends UIWindow { super(lx.ui, "OUTPUT", x, y, w, h); float yp = UIWindow.TITLE_LABEL_HEIGHT; - final UIScrollList outputs = new UIScrollList(1, UIWindow.TITLE_LABEL_HEIGHT, w-2, 80); + final UIItemList outputs = new UIItemList(1, UIWindow.TITLE_LABEL_HEIGHT, w-2, 80); - List items = new ArrayList(); + List items = new ArrayList(); for (GrizzlyOutput grizzly : grizzlies) { items.add(new GrizzlyScrollItem(grizzly)); grizzly.enabled.addListener(new LXParameterListener() { @@ -392,7 +392,7 @@ class UIOutput extends UIWindow { outputs.setItems(items).addToContainer(this); } - class GrizzlyScrollItem extends UIScrollList.AbstractItem { + class GrizzlyScrollItem extends UIItemList.AbstractItem { final GrizzlyOutput output; GrizzlyScrollItem(GrizzlyOutput output) { @@ -498,7 +498,7 @@ class UIMapping extends UIWindow { yp += 10; - new UIScrollList(1, yp, w-2, 60).setItems(Arrays.asList(new UIScrollList.Item[] { + new UIItemList(1, yp, w-2, 60).setItems(Arrays.asList(new UIItemList.Item[] { new ColorScrollItem(ColorScrollItem.COLOR_RED), new ColorScrollItem(ColorScrollItem.COLOR_GREEN), new ColorScrollItem(ColorScrollItem.COLOR_BLUE), @@ -540,7 +540,7 @@ class UIMapping extends UIWindow { stripBox.setValue(value); } - class ColorScrollItem extends UIScrollList.AbstractItem { + class ColorScrollItem extends UIItemList.AbstractItem { public static final int COLOR_RED = 1; public static final int COLOR_GREEN = 2; @@ -644,12 +644,12 @@ class UIMidi extends UIWindow { super(lx.ui, "MIDI", x, y, w, h); // Processing compiler doesn't seem to get that list of class objects also conform to interface - List scrollItems = new ArrayList(); + List scrollItems = new ArrayList(); for (SCMidiInput mc : midiEngine.getControllers()) { scrollItems.add(mc); } - final UIScrollList scrollList; - (scrollList = new UIScrollList(1, UIWindow.TITLE_LABEL_HEIGHT, w-2, 100)).setItems(scrollItems).addToContainer(this); + final UIItemList scrollList; + (scrollList = new UIItemList(1, UIWindow.TITLE_LABEL_HEIGHT, w-2, 100)).setItems(scrollItems).addToContainer(this); (deckMode = new UIToggleSet(4, 130, 90, 20) { protected void onToggle(String value) { midiEngine.setFocusedDeck(value == "A" ? 0 : 1); diff --git a/code/HeronLX.jar b/code/HeronLX.jar index 6b6d7c9..4f534db 100755 Binary files a/code/HeronLX.jar and b/code/HeronLX.jar differ