Search in sources :

Example 91 with IChannelBank

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

the class DeviceLayerMode method onValueKnobTouch.

/**
 * {@inheritDoc}
 */
@Override
public void onValueKnobTouch(final int index, final boolean isTouched) {
    final ICursorDevice cd = this.model.getCursorDevice();
    final IChannel l = cd.getSelectedLayerOrDrumPad();
    if (l == null)
        return;
    this.isKnobTouched[index] = isTouched;
    if (isTouched) {
        if (this.surface.isDeletePressed()) {
            this.surface.setButtonConsumed(this.surface.getDeleteButtonId());
            switch(index) {
                case 0:
                    cd.resetLayerOrDrumPadVolume(l.getIndex());
                    break;
                case 1:
                    cd.resetLayerOrDrumPadPan(l.getIndex());
                    break;
                default:
                    if (this.isPush2 && index < 4)
                        break;
                    final int sendIndex = index - (this.isPush2 ? this.surface.getConfiguration().isSendsAreToggled() ? 0 : 4 : 2);
                    cd.resetLayerSend(l.getIndex(), sendIndex);
                    break;
            }
            return;
        }
        switch(index) {
            case 0:
                this.surface.getDisplay().notify("Volume: " + l.getVolumeStr());
                break;
            case 1:
                this.surface.getDisplay().notify("Pan: " + l.getPanStr());
                break;
            default:
                if (this.isPush2 && index < 4)
                    break;
                final int sendIndex = index - (this.isPush2 ? this.surface.getConfiguration().isSendsAreToggled() ? 0 : 4 : 2);
                final IChannelBank fxTrackBank = this.model.getEffectTrackBank();
                final String name = fxTrackBank == null ? l.getSend(sendIndex).getName() : fxTrackBank.getTrack(sendIndex).getName();
                if (!name.isEmpty())
                    this.surface.getDisplay().notify("Send " + name + ": " + l.getSend(sendIndex).getDisplayedValue());
                break;
        }
    }
    switch(index) {
        case 0:
            cd.touchLayerOrDrumPadVolume(l.getIndex(), isTouched);
            break;
        case 1:
            cd.touchLayerOrDrumPadPan(l.getIndex(), isTouched);
            break;
        default:
            if (this.isPush2 && index < 4)
                break;
            final int sendIndex = index - (this.isPush2 ? this.surface.getConfiguration().isSendsAreToggled() ? 0 : 4 : 2);
            cd.touchLayerOrDrumPadSend(l.getIndex(), sendIndex, isTouched);
            break;
    }
    this.checkStopAutomationOnKnobRelease(isTouched);
}
Also used : IChannel(de.mossgrabers.framework.daw.data.IChannel) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice)

Example 92 with IChannelBank

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

the class DeviceLayerMode method updateMenu.

protected void updateMenu() {
    final IChannelBank fxTrackBank = this.model.getEffectTrackBank();
    final PushConfiguration config = this.surface.getConfiguration();
    final int sendOffset = config.isSendsAreToggled() ? 4 : 0;
    for (int i = 0; i < 3; i++) this.menu[4 + i] = fxTrackBank.getTrack(sendOffset + i).getName();
    this.menu[3] = config.isSendsAreToggled() ? "Sends 5-8" : "Sends 1-4";
}
Also used : PushConfiguration(de.mossgrabers.push.PushConfiguration) IChannelBank(de.mossgrabers.framework.daw.IChannelBank)

Example 93 with IChannelBank

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

the class DeviceLayerModeSend method onValueKnobTouch.

/**
 * {@inheritDoc}
 */
@Override
public void onValueKnobTouch(final int index, final boolean isTouched) {
    this.isKnobTouched[index] = isTouched;
    final ICursorDevice cd = this.model.getCursorDevice();
    // Drum Pad Bank has size of 16, layers only 8
    final int offset = getDrumPadIndex(cd);
    final IChannel layer = cd.getLayerOrDrumPad(offset + index);
    if (!layer.doesExist())
        return;
    final int sendIndex = this.getCurrentSendIndex();
    if (isTouched) {
        if (this.surface.isDeletePressed()) {
            this.surface.setButtonConsumed(this.surface.getDeleteButtonId());
            cd.resetLayerOrDrumPadSend(offset + index, sendIndex);
            return;
        }
        final IChannelBank fxTrackBank = this.model.getEffectTrackBank();
        final String name = fxTrackBank == null ? layer.getSend(sendIndex).getName() : fxTrackBank.getTrack(sendIndex).getName();
        if (!name.isEmpty())
            this.surface.getDisplay().notify("Send " + name + ": " + layer.getSend(sendIndex).getDisplayedValue());
    }
    cd.touchLayerOrDrumPadSend(offset + index, sendIndex, isTouched);
    this.checkStopAutomationOnKnobRelease(isTouched);
}
Also used : IChannel(de.mossgrabers.framework.daw.data.IChannel) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice)

Example 94 with IChannelBank

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

the class AbstractTrackMode method updateTrackMenu.

protected void updateTrackMenu() {
    final PushConfiguration config = this.surface.getConfiguration();
    final int sendOffset = config.isSendsAreToggled() ? 4 : 0;
    if (this.model.isEffectTrackBankActive()) {
        // No sends for FX tracks
        for (int i = 3; i < 7; i++) this.menu[i] = " ";
        return;
    }
    this.menu[2] = config.isDisplayCrossfader() ? "Crossfader" : " ";
    final IChannelBank tb = this.model.getCurrentTrackBank();
    for (int i = 0; i < 3; i++) {
        this.menu[4 + i] = tb.getEditSendName(sendOffset + i);
        if (this.menu[4 + i].isEmpty())
            this.menu[4 + i] = " ";
    }
    this.menu[3] = config.isSendsAreToggled() ? "Sends 5-8" : "Sends 1-4";
    this.menu[7] = tb instanceof ITrackBank && ((ITrackBank) tb).hasParent() ? "Up" : " ";
}
Also used : PushConfiguration(de.mossgrabers.push.PushConfiguration) ITrackBank(de.mossgrabers.framework.daw.ITrackBank) IChannelBank(de.mossgrabers.framework.daw.IChannelBank)

Example 95 with IChannelBank

use of de.mossgrabers.framework.daw.IChannelBank 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)

Aggregations

IChannelBank (de.mossgrabers.framework.daw.IChannelBank)114 ITrack (de.mossgrabers.framework.daw.data.ITrack)92 ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)22 ITrackBank (de.mossgrabers.framework.daw.ITrackBank)20 ModeManager (de.mossgrabers.framework.mode.ModeManager)20 PushConfiguration (de.mossgrabers.push.PushConfiguration)19 Display (de.mossgrabers.framework.controller.display.Display)18 ISend (de.mossgrabers.framework.daw.data.ISend)11 ViewManager (de.mossgrabers.framework.view.ViewManager)10 PushDisplay (de.mossgrabers.push.controller.PushDisplay)10 IChannel (de.mossgrabers.framework.daw.data.IChannel)9 IMasterTrack (de.mossgrabers.framework.daw.data.IMasterTrack)7 ISlot (de.mossgrabers.framework.daw.data.ISlot)7 IValueChanger (de.mossgrabers.framework.controller.IValueChanger)5 View (de.mossgrabers.framework.view.View)5 DisplayMessage (de.mossgrabers.push.controller.DisplayMessage)5 ITransport (de.mossgrabers.framework.daw.ITransport)4 IMidiOutput (de.mossgrabers.framework.daw.midi.IMidiOutput)4 ColorManager (de.mossgrabers.framework.controller.color.ColorManager)3 PadGrid (de.mossgrabers.framework.controller.grid.PadGrid)3