Search in sources :

Example 21 with ITrackBank

use of de.mossgrabers.framework.daw.ITrackBank 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 22 with ITrackBank

use of de.mossgrabers.framework.daw.ITrackBank 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 23 with ITrackBank

use of de.mossgrabers.framework.daw.ITrackBank in project DrivenByMoss by git-moss.

the class SLControllerSetup method updateIndication.

private void updateIndication() {
    final SLControlSurface surface = this.getSurface();
    final Integer mode = surface.getModeManager().getActiveModeId();
    final IMasterTrack mt = this.model.getMasterTrack();
    mt.setVolumeIndication(Modes.MODE_MASTER.equals(mode));
    mt.setPanIndication(Modes.MODE_MASTER.equals(mode));
    final ITrackBank tb = this.model.getTrackBank();
    final IChannelBank tbe = this.model.getEffectTrackBank();
    final boolean isEffect = this.model.isEffectTrackBankActive();
    final boolean isVolume = Modes.MODE_VOLUME.equals(mode);
    final ICursorDevice cursorDevice = this.model.getCursorDevice();
    final ITrack selectedTrack = tb.getSelectedTrack();
    for (int i = 0; i < 8; i++) {
        final boolean hasTrackSel = selectedTrack != null && selectedTrack.getIndex() == i && Modes.MODE_TRACK.equals(mode);
        final ITrack track = tb.getTrack(i);
        track.setVolumeIndication(!isEffect && (isVolume || hasTrackSel));
        track.setPanIndication(!isEffect && hasTrackSel);
        for (int j = 0; j < 6; j++) track.getSend(j).setIndication(!isEffect && hasTrackSel);
        final ITrack fxTrack = tbe.getTrack(i);
        fxTrack.setVolumeIndication(isEffect);
        fxTrack.setPanIndication(isEffect);
        cursorDevice.indicateParameter(i, true);
    }
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.ITrackBank) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) SLControlSurface(de.mossgrabers.sl.controller.SLControlSurface) IMasterTrack(de.mossgrabers.framework.daw.data.IMasterTrack) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice)

Example 24 with ITrackBank

use of de.mossgrabers.framework.daw.ITrackBank 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 25 with ITrackBank

use of de.mossgrabers.framework.daw.ITrackBank in project DrivenByMoss by git-moss.

the class TrackKnobRowCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final int value) {
    final ModeManager modeManager = this.surface.getModeManager();
    Integer cm = modeManager.getActiveModeId();
    if (cm != Modes.MODE_TRACK && cm != Modes.MODE_MASTER) {
        modeManager.setActiveMode(Modes.MODE_TRACK);
        cm = Modes.MODE_TRACK;
    }
    if (cm == Modes.MODE_MASTER) {
        if (this.index == 0)
            this.model.getMasterTrack().setVolume(value);
        else if (this.index == 1)
            this.model.getMasterTrack().setPan(value);
        return;
    }
    final IChannelBank tb = this.model.getCurrentTrackBank();
    final ITrack track = tb.getSelectedTrack();
    if (track == null)
        return;
    switch(this.index) {
        // Volume
        case 0:
            track.setVolume(value);
            break;
        // Pan
        case 1:
            track.setPan(value);
            break;
        case 2:
            if (this.surface.getConfiguration().isDisplayCrossfader())
                track.setCrossfadeModeAsNumber(value == 0 ? 0 : value == 127 ? 2 : 1);
            else if (tb instanceof ITrackBank)
                track.getSend(0).setValue(value);
            break;
        // Send 1 - 5
        default:
            if (tb instanceof ITrackBank)
                track.getSend(this.index - (this.surface.getConfiguration().isDisplayCrossfader() ? 3 : 2)).setValue(value);
            break;
    }
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.ITrackBank) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) ModeManager(de.mossgrabers.framework.mode.ModeManager)

Aggregations

ITrackBank (de.mossgrabers.framework.daw.ITrackBank)25 IChannelBank (de.mossgrabers.framework.daw.IChannelBank)20 ITrack (de.mossgrabers.framework.daw.data.ITrack)18 ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)7 PushConfiguration (de.mossgrabers.push.PushConfiguration)5 ModeManager (de.mossgrabers.framework.mode.ModeManager)4 ViewManager (de.mossgrabers.framework.view.ViewManager)4 IValueChanger (de.mossgrabers.framework.controller.IValueChanger)3 DisplayMessage (de.mossgrabers.push.controller.DisplayMessage)3 PushDisplay (de.mossgrabers.push.controller.PushDisplay)3 IMasterTrack (de.mossgrabers.framework.daw.data.IMasterTrack)2 ISend (de.mossgrabers.framework.daw.data.ISend)2 PushControlSurface (de.mossgrabers.push.controller.PushControlSurface)2 APCControlSurface (de.mossgrabers.apc.controller.APCControlSurface)1 APCminiControlSurface (de.mossgrabers.apcmini.controller.APCminiControlSurface)1 BeatstepControlSurface (de.mossgrabers.beatstep.controller.BeatstepControlSurface)1 IApplication (de.mossgrabers.framework.daw.IApplication)1 ISlot (de.mossgrabers.framework.daw.data.ISlot)1 SceneView (de.mossgrabers.framework.view.SceneView)1 View (de.mossgrabers.framework.view.View)1