Search in sources :

Example 21 with PushDisplay

use of de.mossgrabers.push.controller.PushDisplay 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)

Example 22 with PushDisplay

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

the class TrackMode method onValueKnobTouch.

/**
 * {@inheritDoc}
 */
@Override
public void onValueKnobTouch(final int index, final boolean isTouched) {
    final IChannelBank tb = this.model.getCurrentTrackBank();
    final ITrack selectedTrack = tb.getSelectedTrack();
    if (selectedTrack == null)
        return;
    this.isKnobTouched[index] = isTouched;
    final PushConfiguration config = this.surface.getConfiguration();
    if (this.isPush2) {
        if (isTouched) {
            if (this.surface.isDeletePressed()) {
                this.surface.setButtonConsumed(PushControlSurface.PUSH_BUTTON_DELETE);
                switch(index) {
                    case 0:
                        selectedTrack.resetVolume();
                        break;
                    case 1:
                        selectedTrack.resetPan();
                        break;
                    case 2:
                        selectedTrack.setCrossfadeMode("AB");
                        break;
                    case 3:
                        // Not used
                        break;
                    default:
                        selectedTrack.getSend(index - 4).resetValue();
                        break;
                }
                return;
            }
            final PushDisplay display = (PushDisplay) this.surface.getDisplay();
            switch(index) {
                case 0:
                    display.notify("Volume: " + selectedTrack.getVolumeStr(8));
                    break;
                case 1:
                    display.notify("Pan: " + selectedTrack.getPanStr(8));
                    break;
                case 2:
                    display.notify("Crossfader: " + selectedTrack.getCrossfadeMode());
                    break;
                case 3:
                    // Not used
                    break;
                default:
                    final int sendIndex = index - 4;
                    final IChannelBank fxTrackBank = this.model.getEffectTrackBank();
                    final String name = fxTrackBank == null ? selectedTrack.getSend(sendIndex).getName() : fxTrackBank.getTrack(sendIndex).getName();
                    if (name.length() > 0)
                        display.notify("Send " + name + ": " + selectedTrack.getSend(sendIndex).getDisplayedValue(8));
                    break;
            }
        }
        switch(index) {
            case 0:
                selectedTrack.touchVolume(isTouched);
                break;
            case 1:
                selectedTrack.touchPan(isTouched);
                break;
            case 2:
            case 3:
                // Not used
                break;
            default:
                final int sendIndex = index - 4;
                selectedTrack.getSend(sendIndex).touchValue(isTouched);
                break;
        }
        this.checkStopAutomationOnKnobRelease(isTouched);
        return;
    }
    if (isTouched) {
        if (this.surface.isDeletePressed()) {
            this.surface.setButtonConsumed(PushControlSurface.PUSH_BUTTON_DELETE);
            switch(index) {
                case 0:
                    selectedTrack.resetVolume();
                    break;
                case 1:
                    selectedTrack.resetPan();
                    break;
                case 2:
                    if (config.isDisplayCrossfader())
                        selectedTrack.setCrossfadeMode("AB");
                    else
                        selectedTrack.getSend(0).resetValue();
                    break;
                default:
                    selectedTrack.getSend(index - (config.isDisplayCrossfader() ? 3 : 2)).resetValue();
                    break;
            }
            return;
        }
        final PushDisplay display = (PushDisplay) this.surface.getDisplay();
        switch(index) {
            case 0:
                display.notify("Volume: " + selectedTrack.getVolumeStr(8));
                break;
            case 1:
                display.notify("Pan: " + selectedTrack.getPanStr(8));
                break;
            case 2:
                if (config.isDisplayCrossfader())
                    display.notify("Crossfader: " + selectedTrack.getCrossfadeMode());
                else {
                    final int sendIndex = 0;
                    final IChannelBank fxTrackBank = this.model.getEffectTrackBank();
                    final String name = fxTrackBank == null ? selectedTrack.getSend(sendIndex).getName() : fxTrackBank.getTrack(sendIndex).getName();
                    if (name.length() > 0)
                        display.notify("Send " + name + ": " + selectedTrack.getSend(sendIndex).getDisplayedValue(8));
                }
                break;
            default:
                final int sendIndex = index - (config.isDisplayCrossfader() ? 3 : 2);
                final IChannelBank fxTrackBank = this.model.getEffectTrackBank();
                final String name = fxTrackBank == null ? selectedTrack.getSend(sendIndex).getName() : fxTrackBank.getTrack(sendIndex).getName();
                if (name.length() > 0)
                    display.notify("Send " + name + ": " + selectedTrack.getSend(sendIndex).getDisplayedValue(8));
                break;
        }
    }
    switch(index) {
        case 0:
            selectedTrack.touchVolume(isTouched);
            break;
        case 1:
            selectedTrack.touchPan(isTouched);
            break;
        case 2:
            if (!config.isDisplayCrossfader())
                selectedTrack.getSend(0).touchValue(isTouched);
            break;
        default:
            final int sendIndex = index - (config.isDisplayCrossfader() ? 3 : 2);
            selectedTrack.getSend(sendIndex).touchValue(isTouched);
            break;
    }
    this.checkStopAutomationOnKnobRelease(isTouched);
}
Also used : PushConfiguration(de.mossgrabers.push.PushConfiguration) ITrack(de.mossgrabers.framework.daw.data.ITrack) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) PushDisplay(de.mossgrabers.push.controller.PushDisplay)

Example 23 with PushDisplay

use of de.mossgrabers.push.controller.PushDisplay 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);
}
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 24 with PushDisplay

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

Example 25 with PushDisplay

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

Aggregations

PushDisplay (de.mossgrabers.push.controller.PushDisplay)26 DisplayMessage (de.mossgrabers.push.controller.DisplayMessage)24 IValueChanger (de.mossgrabers.framework.controller.IValueChanger)6 IChannelBank (de.mossgrabers.framework.daw.IChannelBank)6 ITrack (de.mossgrabers.framework.daw.data.ITrack)6 PushConfiguration (de.mossgrabers.push.PushConfiguration)6 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