X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=_UIImplementation.pde;h=03379ce81d072740ccefc56b05c700f3cd4aa6ae;hb=1f42cce70281d4d70378a2be362f6cb2c6d5f45f;hp=3d4940fe2a615b16a23f18eeab1b734bd41dd0db;hpb=78a44a1ba9c18a8293e1a3445938a2dd7469015c;p=SugarCubes.git diff --git a/_UIImplementation.pde b/_UIImplementation.pde index 3d4940f..03379ce 100644 --- a/_UIImplementation.pde +++ b/_UIImplementation.pde @@ -95,9 +95,9 @@ class UICrossfader extends UIWindow { for (LXTransition t : transitions) { items.add(new TransitionScrollItem(t)); } - new UIScrollList(1, titleHeight, w-2, 60).setItems(items).addToContainer(this); - new UIParameterSlider(4, titleHeight + 66, w-10, 24).setParameter(lx.engine.getDeck(1).getCrossfader()).addToContainer(this); - new UIToggleSet(4, 122, w-10, 20) { + new UIScrollList(1, titleHeight, w-2, 120).setItems(items).addToContainer(this); + new UIParameterSlider(4, titleHeight + 126, w-10, 24).setParameter(lx.engine.getDeck(1).getCrossfader()).addToContainer(this); + new UIToggleSet(4, 182, w-10, 20) { protected void onToggle(String value) { displayMode = value; } @@ -220,21 +220,39 @@ class UIOutput extends UIWindow { public UIOutput(float x, float y, float w, float h) { super("OUTPUT", x, y, w, h); float yp = titleHeight; + + final UIScrollList outputs = new UIScrollList(1, titleHeight, w-2, 80); + + List items = new ArrayList(); for (final PandaDriver panda : pandaBoards) { - final UIButton button = new UIButton(4, yp, w-10, 20) { - protected void onToggle(boolean active) { - panda.setEnabled(active); - } - }.setLabel(panda.ip); - button.addToContainer(this); + items.add(new PandaScrollItem(panda)); panda.setListener(new PandaDriver.Listener() { public void onToggle(boolean active) { - button.setActive(active); + outputs.redraw(); } }); - yp += 24; } - } + outputs.setItems(items).addToContainer(this); + } + + class PandaScrollItem extends AbstractScrollItem { + final PandaDriver panda; + PandaScrollItem(PandaDriver panda) { + this.panda = panda; + } + + public String getLabel() { + return panda.ip; + } + + public boolean isSelected() { + return panda.isEnabled(); + } + + public void select() { + panda.toggle(); + } + } } class UITempo extends UIWindow {