use of de.mossgrabers.push.controller.DisplayMessage in project DrivenByMoss by git-moss.
the class TrackMode method updateDisplay2.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay2() {
final IChannelBank tb = this.model.getCurrentTrackBank();
final ITrack selectedTrack = tb.getSelectedTrack();
// Get the index at which to draw the Sends element
final int selectedIndex = selectedTrack == null ? -1 : selectedTrack.getIndex();
int sendsIndex = selectedTrack == null || this.model.isEffectTrackBankActive() ? -1 : selectedTrack.getIndex() + 1;
if (sendsIndex == 8)
sendsIndex = 6;
this.updateTrackMenu();
final PushConfiguration config = this.surface.getConfiguration();
final PushDisplay display = (PushDisplay) this.surface.getDisplay();
final DisplayMessage message = display.createMessage();
final boolean displayCrossfader = config.isDisplayCrossfader();
for (int i = 0; i < 8; i++) {
final ITrack t = tb.getTrack(i);
// The menu item
String topMenu;
boolean topMenuSelected;
if (this.surface.isPressed(PushControlSurface.PUSH_BUTTON_CLIP_STOP) && this.model.getHost().hasClips()) {
topMenu = t.doesExist() ? "Stop Clip" : "";
topMenuSelected = t.isPlaying();
} else if (config.isMuteLongPressed() || config.isMuteSoloLocked() && config.isMuteState()) {
topMenu = t.doesExist() ? "Mute" : "";
topMenuSelected = t.isMute();
} else if (config.isSoloLongPressed() || config.isMuteSoloLocked() && config.isSoloState()) {
topMenu = t.doesExist() ? "Solo" : "";
topMenuSelected = t.isSolo();
} else {
topMenu = this.menu[i];
topMenuSelected = i == 7 && tb instanceof ITrackBank && ((ITrackBank) tb).hasParent();
}
// Channel info
final String bottomMenu = t.doesExist() ? t.getName() : "";
final double[] bottomMenuColor = t.getColor();
final boolean isBottomMenuOn = t.isSelected();
final IValueChanger valueChanger = this.model.getValueChanger();
if (t.isSelected()) {
final int crossfadeMode = displayCrossfader ? t.getCrossfadeModeAsNumber() : -1;
message.addChannelElement(topMenu, topMenuSelected, bottomMenu, t.getType(), bottomMenuColor, isBottomMenuOn, valueChanger.toDisplayValue(t.getVolume()), valueChanger.toDisplayValue(t.getModulatedVolume()), this.isKnobTouched[0] ? t.getVolumeStr(8) : "", valueChanger.toDisplayValue(t.getPan()), valueChanger.toDisplayValue(t.getModulatedPan()), this.isKnobTouched[1] ? t.getPanStr(8) : "", valueChanger.toDisplayValue(config.isEnableVUMeters() ? t.getVu() : 0), t.isMute(), t.isSolo(), t.isRecArm(), crossfadeMode);
} else if (sendsIndex == i) {
final IChannelBank fxTrackBank = this.model.getEffectTrackBank();
final ITrack selTrack = tb.getTrack(selectedIndex);
final String[] sendName = new String[4];
final String[] valueStr = new String[4];
final int[] value = new int[4];
final int[] modulatedValue = new int[4];
final boolean[] selected = new boolean[4];
for (int j = 0; j < 4; j++) {
final int sendOffset = config.isSendsAreToggled() ? 4 : 0;
final int sendPos = sendOffset + j;
selected[j] = true;
sendName[j] = "";
valueStr[j] = "";
value[j] = 0;
if (selTrack == null)
continue;
final ISend send = selTrack.getSend(sendPos);
if (send == null)
continue;
sendName[j] = fxTrackBank == null ? send.getName() : fxTrackBank.getTrack(sendPos).getName();
valueStr[j] = send.doesExist() && this.isKnobTouched[4 + j] ? send.getDisplayedValue(8) : "";
value[j] = valueChanger.toDisplayValue(send.doesExist() ? send.getValue() : 0);
modulatedValue[j] = valueChanger.toDisplayValue(send.doesExist() ? send.getModulatedValue() : 0);
}
message.addSendsElement(topMenu, topMenuSelected, bottomMenu, t.getType(), bottomMenuColor, isBottomMenuOn, sendName, valueStr, value, modulatedValue, selected, true);
} else
message.addChannelSelectorElement(topMenu, topMenuSelected, bottomMenu, t.getType(), bottomMenuColor, isBottomMenuOn);
}
display.send(message);
}
use of de.mossgrabers.push.controller.DisplayMessage in project DrivenByMoss by git-moss.
the class FrameMode method updateDisplay2.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay2() {
final IApplication app = this.model.getApplication();
final PushDisplay display = (PushDisplay) this.surface.getDisplay();
final DisplayMessage message = display.createMessage();
for (int i = 0; i < FrameMode.ARRANGER1.length; i++) message.addOptionElement(app.isArrangeLayout() ? FrameMode.ARRANGER1[i] : app.isMixerLayout() ? FrameMode.MIXER1[i] : "", app.isArrangeLayout() ? FrameMode.ARRANGER2[i] : app.isMixerLayout() ? FrameMode.MIXER2[i] : "", this.getSecondRowButtonState(i) > 0, FrameMode.LAYOUTS1[i], FrameMode.LAYOUTS2[i], this.getFirstRowButtonState(i), false);
display.send(message);
}
use of de.mossgrabers.push.controller.DisplayMessage in project DrivenByMoss by git-moss.
the class InfoMode method updateDisplay2.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay2() {
final PushDisplay display = (PushDisplay) this.surface.getDisplay();
final DisplayMessage message = display.createMessage();
message.addOptionElement(" Firmware: " + this.surface.getMajorVersion() + "." + this.surface.getMinorVersion() + " Build " + this.surface.getBuildNumber(), "Setup", false, "", "", false, true);
message.addOptionElement("", "Info", true, "", "", false, true);
message.addEmptyElement();
message.addOptionElement("Board Revision: " + this.surface.getBoardRevision(), "", false, "", "", false, false);
message.addEmptyElement();
message.addOptionElement(" Serial Number: " + this.surface.getSerialNumber(), "", false, "", "", false, false);
message.addEmptyElement();
message.addEmptyElement();
display.send(message);
}
use of de.mossgrabers.push.controller.DisplayMessage in project DrivenByMoss by git-moss.
the class AccentMode method updateDisplay2.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay2() {
final int fixedAccentValue = this.surface.getConfiguration().getFixedAccentValue();
final IValueChanger valueChanger = this.model.getValueChanger();
final PushDisplay display = (PushDisplay) this.surface.getDisplay();
final DisplayMessage message = display.createMessage();
for (int i = 0; i < 8; i++) message.addParameterElement(i == 7 ? "Accent" : "", i == 7 ? valueChanger.toDisplayValue(valueChanger.toDAWValue(fixedAccentValue)) : 0, i == 7 ? Integer.toString(fixedAccentValue) : "", this.isKnobTouched[i], -1);
display.send(message);
}
Aggregations