use of de.mossgrabers.push.controller.PushDisplay in project DrivenByMoss by git-moss.
the class DeviceParamsMode method updateDisplay2.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay2() {
final PushDisplay display = (PushDisplay) this.surface.getDisplay();
final DisplayMessage message = display.createMessage();
final ICursorDevice cd = this.model.getCursorDevice();
if (!cd.hasSelectedDevice()) {
for (int i = 0; i < 8; i++) message.addOptionElement(i == 2 ? "Please select a device or press 'Add Device'..." : "", i == 7 ? "Up" : "", true, "", "", false, true);
display.send(message);
return;
}
final IChannelBank tb = this.model.getCurrentTrackBank();
final String color = tb.getSelectedTrackColorEntry();
final IValueChanger valueChanger = this.model.getValueChanger();
final String[] pages = cd.getParameterPageNames();
final int page = Math.min(Math.max(0, cd.getSelectedParameterPage()), pages.length - 1);
final int start = page / 8 * 8;
final boolean hasPinning = this.model.getHost().hasPinning();
for (int i = 0; i < 8; i++) {
boolean isTopMenuOn;
switch(i) {
case 0:
isTopMenuOn = cd.isEnabled();
break;
case 1:
isTopMenuOn = cd.isParameterPageSectionVisible();
break;
case 2:
isTopMenuOn = cd.isExpanded();
break;
case 4:
isTopMenuOn = !this.showDevices;
break;
case 5:
isTopMenuOn = hasPinning && cd.isPinned();
break;
case 6:
isTopMenuOn = cd.isWindowOpen();
break;
case 7:
isTopMenuOn = true;
break;
default:
// Not used
isTopMenuOn = false;
break;
}
String bottomMenu;
final String bottomMenuIcon = "";
boolean isBottomMenuOn;
if (this.showDevices) {
bottomMenu = cd.doesSiblingExist(i) ? cd.getSiblingDeviceName(i, 12) : "";
isBottomMenuOn = i == cd.getPositionInBank();
} else {
final int index = start + i;
bottomMenu = index < pages.length ? pages[index] : "";
if (bottomMenu.length() > 12)
bottomMenu = bottomMenu.substring(0, 12);
isBottomMenuOn = index == page;
}
final double[] bottomMenuColor = BitwigColors.getColorEntry(color);
final IParameter param = cd.getFXParam(i);
final boolean exists = param.doesExist();
final String parameterName = exists ? param.getName(9) : "";
final int parameterValue = valueChanger.toDisplayValue(exists ? param.getValue() : 0);
final String parameterValueStr = exists ? param.getDisplayedValue(8) : "";
final boolean parameterIsActive = this.isKnobTouched[i];
final int parameterModulatedValue = valueChanger.toDisplayValue(exists ? param.getModulatedValue() : -1);
message.addParameterElement(i != 5 || hasPinning ? MENU[i] : "", isTopMenuOn, bottomMenu, bottomMenuIcon, bottomMenuColor, isBottomMenuOn, parameterName, parameterValue, parameterValueStr, parameterIsActive, parameterModulatedValue);
}
display.send(message);
}
use of de.mossgrabers.push.controller.PushDisplay in project DrivenByMoss by git-moss.
the class ClipMode method updateDisplay2.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay2() {
final ICursorClip clip = this.model.getCursorClip();
final PushDisplay display = (PushDisplay) this.surface.getDisplay();
final DisplayMessage message = display.createMessage();
final IChannelBank tb = this.model.getCurrentTrackBank();
final ITrack t0 = tb.getTrack(0);
final ITrack t1 = tb.getTrack(1);
final ITrack t2 = tb.getTrack(2);
final ITrack t3 = tb.getTrack(3);
final ITrack t4 = tb.getTrack(4);
final ITrack t5 = tb.getTrack(5);
final ITrack t6 = tb.getTrack(6);
final ITrack t7 = tb.getTrack(7);
message.addParameterElement("", false, t0.getName(), t0.getType(), t0.getColor(), t0.isSelected(), "Play Start", -1, this.formatMeasures(clip.getPlayStart(), 1), this.isKnobTouched[0], -1);
message.addParameterElement("", false, t1.getName(), t1.getType(), t1.getColor(), t1.isSelected(), "Play End", -1, this.formatMeasures(clip.getPlayEnd(), 1), this.isKnobTouched[1], -1);
message.addParameterElement("", false, t2.getName(), t2.getType(), t2.getColor(), t2.isSelected(), "Loop Start", -1, this.formatMeasures(clip.getLoopStart(), 1), this.isKnobTouched[2], -1);
message.addParameterElement("", false, t3.getName(), t3.getType(), t3.getColor(), t3.isSelected(), "Loop Lngth", -1, this.formatMeasures(clip.getLoopLength(), 0), this.isKnobTouched[3], -1);
message.addParameterElement("", false, t4.getName(), t4.getType(), t4.getColor(), t4.isSelected(), "Loop", -1, clip.isLoopEnabled() ? "On" : "Off", this.isKnobTouched[4], -1);
message.addParameterElement("", false, t5.getName(), t5.getType(), t5.getColor(), t5.isSelected(), "", -1, "", false, -1);
message.addParameterElement("", false, t6.getName(), t6.getType(), t6.getColor(), t6.isSelected(), "Shuffle", -1, clip.isShuffleEnabled() ? "On" : "Off", this.isKnobTouched[6], -1);
message.addParameterElement("Select color", false, t7.getName(), t7.getType(), t7.getColor(), t7.isSelected(), "Accent", -1, clip.getFormattedAccent(), this.isKnobTouched[7], -1);
display.send(message);
}
use of de.mossgrabers.push.controller.PushDisplay in project DrivenByMoss by git-moss.
the class MasterMode method updateDisplay2.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay2() {
final IMasterTrack master = this.model.getMasterTrack();
final IValueChanger valueChanger = this.model.getValueChanger();
final PushDisplay display = (PushDisplay) this.surface.getDisplay();
final DisplayMessage message = display.createMessage();
message.addChannelElement("Volume", false, master.getName(), ChannelType.MASTER, master.getColor(), master.isSelected(), valueChanger.toDisplayValue(master.getVolume()), valueChanger.toDisplayValue(master.getModulatedVolume()), this.isKnobTouched[0] ? master.getVolumeStr(8) : "", valueChanger.toDisplayValue(master.getPan()), valueChanger.toDisplayValue(master.getModulatedPan()), this.isKnobTouched[1] ? master.getPanStr(8) : "", valueChanger.toDisplayValue(this.surface.getConfiguration().isEnableVUMeters() ? master.getVu() : 0), master.isMute(), master.isSolo(), master.isRecArm(), 0);
for (int i = 1; i < 4; i++) {
message.addChannelSelectorElement(i == 1 ? "Pan" : "", false, "", null, new double[] { 0.0, 0.0, 0.0 }, false);
}
message.addOptionElement("", "", false, "Audio Engine", this.model.getApplication().isEngineActive() ? "Active" : "Off", false, false);
message.addOptionElement("", "", false, "", "", false, false);
message.addOptionElement("Project:", "", false, this.model.getProject().getName(), "Previous", false, false);
message.addOptionElement("", "", false, "", "Next", false, false);
display.send(message);
}
use of de.mossgrabers.push.controller.PushDisplay in project DrivenByMoss by git-moss.
the class PushControllerSetup method createDisplay.
protected PushDisplay createDisplay(final IMidiOutput output) {
final PushDisplay display = new PushDisplay(this.model.getHost(), this.isPush2, this.valueChanger.getUpperBound(), output);
display.setCommunicationPort(this.configuration.getSendPort());
return display;
}
use of de.mossgrabers.push.controller.PushDisplay in project DrivenByMoss by git-moss.
the class ScaleLayoutMode method updateDisplay2.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay2() {
final int sl = this.scales.getScaleLayout().ordinal();
final int pos = sl / 2;
final String[] names = ScaleLayout.getNames();
final PushDisplay display = (PushDisplay) this.surface.getDisplay();
final DisplayMessage message = display.createMessage();
for (int i = 0; i < names.length; i += 2) message.addOptionElement("", "", false, i == 0 ? "Scale layout" : "", names[i].replace(" ^", ""), pos == i / 2, false);
message.addOptionElement("", "", false, "", "", false, false);
message.addOptionElement("", "", false, "", "", false, false);
message.addOptionElement("", "", false, "", sl % 2 == 0 ? "Horizontal" : "Vertical", false, false);
display.send(message);
}
Aggregations