Search in sources :

Example 16 with DisplayMessage

use of de.mossgrabers.push.controller.DisplayMessage 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);
}
Also used : ITransport(de.mossgrabers.framework.daw.ITransport) PushDisplay(de.mossgrabers.push.controller.PushDisplay) DisplayMessage(de.mossgrabers.push.controller.DisplayMessage)

Example 17 with DisplayMessage

use of de.mossgrabers.push.controller.DisplayMessage 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);
}
Also used : PushConfiguration(de.mossgrabers.push.PushConfiguration) ITrack(de.mossgrabers.framework.daw.data.ITrack) IValueChanger(de.mossgrabers.framework.controller.IValueChanger) ITrackBank(de.mossgrabers.framework.daw.ITrackBank) PushDisplay(de.mossgrabers.push.controller.PushDisplay) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) DisplayMessage(de.mossgrabers.push.controller.DisplayMessage)

Example 18 with DisplayMessage

use of de.mossgrabers.push.controller.DisplayMessage 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);
}
Also used : IChannel(de.mossgrabers.framework.daw.data.IChannel) PushDisplay(de.mossgrabers.push.controller.PushDisplay) DisplayMessage(de.mossgrabers.push.controller.DisplayMessage)

Example 19 with DisplayMessage

use of de.mossgrabers.push.controller.DisplayMessage 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);
}
Also used : PushConfiguration(de.mossgrabers.push.PushConfiguration) ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.ITrackBank) IValueChanger(de.mossgrabers.framework.controller.IValueChanger) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) PushDisplay(de.mossgrabers.push.controller.PushDisplay) ISend(de.mossgrabers.framework.daw.data.ISend) DisplayMessage(de.mossgrabers.push.controller.DisplayMessage)

Example 20 with DisplayMessage

use of de.mossgrabers.push.controller.DisplayMessage in project DrivenByMoss by git-moss.

the class TrackDetailsMode method updateDisplay2.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay2() {
    final PushDisplay display = (PushDisplay) this.surface.getDisplay();
    final DisplayMessage message = display.createMessage();
    final ITrack deviceChain = this.getSelectedTrack();
    if (deviceChain == null)
        message.setMessage(3, "Please select a track...");
    else {
        message.addOptionElement("Track: " + deviceChain.getName(), "", false, "", "Active", deviceChain.isActivated(), false);
        message.addOptionElement("", "", false, "", "Rec Arm", deviceChain.isRecArm(), false);
        message.addOptionElement("", "", false, "", "Mute", deviceChain.isMute(), false);
        message.addOptionElement("", "", false, "", "Solo", deviceChain.isSolo(), false);
        message.addOptionElement("", "", false, "", "Monitor", deviceChain.isMonitor(), false);
        message.addOptionElement("", "", false, "", "Auto Monitor", deviceChain.isAutoMonitor(), false);
        final boolean hasPinning = this.model.getHost().hasPinning();
        message.addOptionElement("", "", false, "", hasPinning ? "Pin Track" : "", hasPinning && this.model.isCursorTrackPinned(), false);
        message.addOptionElement("", "", false, "", "Select Color", false, false);
    }
    display.send(message);
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) PushDisplay(de.mossgrabers.push.controller.PushDisplay) DisplayMessage(de.mossgrabers.push.controller.DisplayMessage)

Aggregations

DisplayMessage (de.mossgrabers.push.controller.DisplayMessage)24 PushDisplay (de.mossgrabers.push.controller.PushDisplay)24 IValueChanger (de.mossgrabers.framework.controller.IValueChanger)6 IChannelBank (de.mossgrabers.framework.daw.IChannelBank)5 ITrack (de.mossgrabers.framework.daw.data.ITrack)5 PushConfiguration (de.mossgrabers.push.PushConfiguration)5 ITrackBank (de.mossgrabers.framework.daw.ITrackBank)3 ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)2 IParameter (de.mossgrabers.framework.daw.data.IParameter)2 ISend (de.mossgrabers.framework.daw.data.ISend)2 ViewManager (de.mossgrabers.framework.view.ViewManager)2 IApplication (de.mossgrabers.framework.daw.IApplication)1 IBrowser (de.mossgrabers.framework.daw.IBrowser)1 ICursorClip (de.mossgrabers.framework.daw.ICursorClip)1 ITransport (de.mossgrabers.framework.daw.ITransport)1 IBrowserColumn (de.mossgrabers.framework.daw.data.IBrowserColumn)1 IBrowserColumnItem (de.mossgrabers.framework.daw.data.IBrowserColumnItem)1 IChannel (de.mossgrabers.framework.daw.data.IChannel)1 IMasterTrack (de.mossgrabers.framework.daw.data.IMasterTrack)1 Scale (de.mossgrabers.framework.scale.Scale)1