use of de.mossgrabers.push.controller.PushDisplay in project DrivenByMoss by git-moss.
the class RibbonMode method updateDisplay2.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay2() {
final PushConfiguration config = this.surface.getConfiguration();
final String ribbonModeCC = Integer.toString(config.getRibbonModeCCVal());
final int ribbonMode = config.getRibbonMode();
final PushDisplay display = (PushDisplay) this.surface.getDisplay();
final DisplayMessage message = display.createMessage();
for (int i = 0; i < 7; i++) message.addOptionElement(i == 0 ? "CC Quick Select" : "", RibbonMode.CC_QUICK_SELECT[i], false, i == 0 ? "Function" : "", RibbonMode.FUNCTION[i], i < RibbonMode.FUNCTION_IDS.length && ribbonMode == RibbonMode.FUNCTION_IDS[i], false);
message.addParameterElement("Midi CC", -1, ribbonModeCC, this.isKnobTouched[5], -1);
display.send(message);
return;
}
use of de.mossgrabers.push.controller.PushDisplay in project DrivenByMoss by git-moss.
the class TransportMode method updateDisplay2.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay2() {
final ITransport transport = this.model.getTransport();
final String preroll = transport.getPreroll();
final double tempo = transport.getTempo();
final PushDisplay display = (PushDisplay) this.surface.getDisplay();
final DisplayMessage message = display.createMessage();
message.addOptionElement("Play Metronome during Pre-Roll?", transport.isPrerollMetronomeEnabled() ? "Yes" : "No", transport.isPrerollMetronomeEnabled(), "Pre-roll", "None", preroll == ITransport.PREROLL_NONE, false);
message.addOptionElement("", "", false, "", "1 Bar", preroll == ITransport.PREROLL_1_BAR, false);
message.addOptionElement("", "", false, "", "2 Bars", preroll == ITransport.PREROLL_2_BARS, false);
message.addOptionElement("", "", false, "", "4 Bars", preroll == ITransport.PREROLL_4_BARS, false);
message.addParameterElement("Tempo", (int) this.convertTempo(tempo), transport.formatTempo(tempo), this.isKnobTouched[0], -1);
message.addOptionElement(" Time Sig.", "", false, " " + transport.getNumerator() + " / " + transport.getDenominator(), "", false, false);
message.addOptionElement(" Play Position", "", false, " " + transport.getPositionText(), "", false, false);
message.addOptionElement("", "", false, "", "", false, false);
display.send(message);
}
use of de.mossgrabers.push.controller.PushDisplay in project DrivenByMoss by git-moss.
the class AbstractTrackMode method updateChannelDisplay.
// Push 2
// Called from sub-classes
protected void updateChannelDisplay(final int selectedMenu, final boolean isVolume, final boolean isPan) {
this.updateTrackMenu();
final PushConfiguration config = this.surface.getConfiguration();
final PushDisplay display = (PushDisplay) this.surface.getDisplay();
final DisplayMessage message = display.createMessage();
final IValueChanger valueChanger = this.model.getValueChanger();
final IChannelBank tb = this.model.getCurrentTrackBank();
final boolean displayCrossfader = config.isDisplayCrossfader();
for (int i = 0; i < 8; i++) {
final ITrack t = tb.getTrack(i);
// The menu item
String topMenu;
boolean isTopMenuOn;
if (this.surface.isPressed(PushControlSurface.PUSH_BUTTON_CLIP_STOP) && this.model.getHost().hasClips()) {
topMenu = t.doesExist() ? "Stop Clip" : "";
isTopMenuOn = t.isPlaying();
} else if (config.isMuteLongPressed() || config.isMuteSoloLocked() && config.isMuteState()) {
topMenu = t.doesExist() ? "Mute" : "";
isTopMenuOn = t.isMute();
} else if (config.isSoloLongPressed() || config.isMuteSoloLocked() && config.isSoloState()) {
topMenu = t.doesExist() ? "Solo" : "";
isTopMenuOn = t.isSolo();
} else {
topMenu = this.menu[i];
isTopMenuOn = i == selectedMenu - 1 || i == 7 && tb instanceof ITrackBank && ((ITrackBank) tb).hasParent();
}
final int crossfadeMode = displayCrossfader ? t.getCrossfadeModeAsNumber() : -1;
message.addChannelElement(selectedMenu, topMenu, isTopMenuOn, t.doesExist() ? t.getName(12) : "", t.getType(), t.getColor(), t.isSelected(), valueChanger.toDisplayValue(t.getVolume()), valueChanger.toDisplayValue(t.getModulatedVolume()), isVolume && this.isKnobTouched[i] ? t.getVolumeStr(8) : "", valueChanger.toDisplayValue(t.getPan()), valueChanger.toDisplayValue(t.getModulatedPan()), isPan && this.isKnobTouched[i] ? t.getPanStr() : "", valueChanger.toDisplayValue(config.isEnableVUMeters() ? t.getVu() : 0), t.isMute(), t.isSolo(), t.isRecArm(), crossfadeMode);
}
display.send(message);
}
use of de.mossgrabers.push.controller.PushDisplay in project DrivenByMoss by git-moss.
the class LayerDetailsMode method updateDisplay2.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay2() {
final PushDisplay display = (PushDisplay) this.surface.getDisplay();
final DisplayMessage message = display.createMessage();
final IChannel deviceChain = this.model.getCursorDevice().getSelectedLayerOrDrumPad();
if (deviceChain == null)
message.setMessage(3, "Please select a layer...");
else {
message.addOptionElement("Layer: " + deviceChain.getName(), "", false, "", "Active", deviceChain.isActivated(), false);
message.addEmptyElement();
message.addOptionElement("", "", false, "", "Mute", deviceChain.isMute(), false);
message.addOptionElement("", "", false, "", "Solo", deviceChain.isSolo(), false);
message.addEmptyElement();
message.addEmptyElement();
message.addEmptyElement();
message.addOptionElement("", "", false, "", "Select Color", false, false);
}
display.send(message);
}
use of de.mossgrabers.push.controller.PushDisplay in project DrivenByMoss by git-moss.
the class SendMode method updateDisplay2.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay2() {
this.updateTrackMenu();
final int sendIndex = this.getCurrentSendIndex();
final IChannelBank tb = this.model.getCurrentTrackBank();
final IChannelBank fxTrackBank = this.model.getEffectTrackBank();
final PushConfiguration config = this.surface.getConfiguration();
final PushDisplay display = (PushDisplay) this.surface.getDisplay();
final DisplayMessage message = display.createMessage();
final int sendOffset = config.isSendsAreToggled() ? 4 : 0;
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)) {
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 > 3 && i - 4 + sendOffset == sendIndex || i == 7 && tb instanceof ITrackBank && ((ITrackBank) tb).hasParent();
}
final IValueChanger valueChanger = this.model.getValueChanger();
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 sendPos = sendOffset + j;
final ISend send = t.getSend(sendPos);
sendName[j] = fxTrackBank == null ? send.getName() : fxTrackBank.getTrack(sendPos).getName();
valueStr[j] = send != null && sendIndex == sendPos && this.isKnobTouched[i] ? send.getDisplayedValue(8) : "";
value[j] = valueChanger.toDisplayValue(send != null ? send.getValue() : -1);
modulatedValue[j] = valueChanger.toDisplayValue(send != null ? send.getModulatedValue() : -1);
selected[j] = sendIndex == sendPos;
}
message.addSendsElement(topMenu, topMenuSelected, t.doesExist() ? t.getName() : "", t.getType(), t.getColor(), t.isSelected(), sendName, valueStr, value, modulatedValue, selected, false);
}
display.send(message);
}
Aggregations