Search in sources :

Example 36 with IChannel

use of de.mossgrabers.framework.daw.data.IChannel 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 37 with IChannel

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

the class DeviceLayerMode method updateSecondRow.

/**
 * {@inheritDoc}
 */
@Override
public void updateSecondRow() {
    final ICursorDevice cd = this.model.getCursorDevice();
    final PushConfiguration config = this.surface.getConfiguration();
    final boolean muteState = config.isMuteState();
    if (this.isPush2) {
        if (config.isMuteLongPressed() || config.isSoloLongPressed() || config.isMuteSoloLocked()) {
            // Drum Pad Bank has size of 16, layers only 8
            final int offset = getDrumPadIndex(cd);
            for (int i = 0; i < 8; i++) {
                final IChannel layer = cd.getLayerOrDrumPad(offset + i);
                int color = PushColors.PUSH2_COLOR_BLACK;
                if (layer.doesExist()) {
                    if (muteState) {
                        if (layer.isMute())
                            color = PushColors.PUSH2_COLOR2_AMBER_LO;
                    } else if (layer.isSolo())
                        color = PushColors.PUSH2_COLOR2_YELLOW_HI;
                }
                this.surface.updateButton(102 + i, color);
            }
            return;
        }
        final ModeManager modeManager = this.surface.getModeManager();
        this.surface.updateButton(102, modeManager.isActiveMode(Modes.MODE_DEVICE_LAYER_VOLUME) ? PushColors.PUSH2_COLOR2_WHITE : PushColors.PUSH2_COLOR_BLACK);
        this.surface.updateButton(103, modeManager.isActiveMode(Modes.MODE_DEVICE_LAYER_PAN) ? PushColors.PUSH2_COLOR2_WHITE : PushColors.PUSH2_COLOR_BLACK);
        this.surface.updateButton(104, PushColors.PUSH2_COLOR_BLACK);
        this.surface.updateButton(105, PushColors.PUSH2_COLOR_BLACK);
        this.surface.updateButton(106, modeManager.isActiveMode(config.isSendsAreToggled() ? Modes.MODE_DEVICE_LAYER_SEND5 : Modes.MODE_DEVICE_LAYER_SEND1) ? PushColors.PUSH2_COLOR2_WHITE : PushColors.PUSH2_COLOR_BLACK);
        this.surface.updateButton(107, modeManager.isActiveMode(config.isSendsAreToggled() ? Modes.MODE_DEVICE_LAYER_SEND6 : Modes.MODE_DEVICE_LAYER_SEND2) ? PushColors.PUSH2_COLOR2_WHITE : PushColors.PUSH2_COLOR_BLACK);
        this.surface.updateButton(108, modeManager.isActiveMode(config.isSendsAreToggled() ? Modes.MODE_DEVICE_LAYER_SEND7 : Modes.MODE_DEVICE_LAYER_SEND3) ? PushColors.PUSH2_COLOR2_WHITE : PushColors.PUSH2_COLOR_BLACK);
        this.surface.updateButton(109, modeManager.isActiveMode(config.isSendsAreToggled() ? Modes.MODE_DEVICE_LAYER_SEND8 : Modes.MODE_DEVICE_LAYER_SEND4) ? PushColors.PUSH2_COLOR2_WHITE : PushColors.PUSH2_COLOR_BLACK);
        return;
    }
    if (cd == null || !cd.hasLayers()) {
        this.disableSecondRow();
        this.surface.updateButton(109, this.isPush2 ? PushColors.PUSH2_COLOR2_WHITE : PushColors.PUSH1_COLOR2_WHITE);
        return;
    }
    final int offset = getDrumPadIndex(cd);
    for (int i = 0; i < 8; i++) {
        final IChannel dl = cd.getLayerOrDrumPad(offset + i);
        int color = PushColors.PUSH1_COLOR_BLACK;
        if (dl.doesExist()) {
            if (muteState) {
                if (!dl.isMute())
                    color = PushColors.PUSH1_COLOR2_YELLOW_HI;
            } else
                color = dl.isSolo() ? PushColors.PUSH1_COLOR2_BLUE_HI : PushColors.PUSH1_COLOR2_GREY_LO;
        }
        this.surface.updateButton(102 + i, color);
    }
}
Also used : PushConfiguration(de.mossgrabers.push.PushConfiguration) IChannel(de.mossgrabers.framework.daw.data.IChannel) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice) ModeManager(de.mossgrabers.framework.mode.ModeManager)

Example 38 with IChannel

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

the class DeviceLayerMode method drawRow4.

/**
 * Draw the fourth row.
 *
 * @param d The display
 * @param cd The cursor device
 */
protected void drawRow4(final Display d, final ICursorDevice cd) {
    // Drum Pad Bank has size of 16, layers only 8
    final int offset = getDrumPadIndex(cd);
    for (int i = 0; i < 8; i++) {
        final IChannel layer = cd.getLayerOrDrumPad(offset + i);
        final String n = StringUtils.shortenAndFixASCII(layer.getName(), layer.isSelected() ? 7 : 8);
        d.setCell(3, i, layer.isSelected() ? PushDisplay.RIGHT_ARROW + n : n);
    }
    d.allDone();
}
Also used : IChannel(de.mossgrabers.framework.daw.data.IChannel)

Example 39 with IChannel

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

the class DeviceLayerMode method updateFirstRow.

/**
 * {@inheritDoc}
 */
@Override
public void updateFirstRow() {
    final ICursorDevice cd = this.model.getCursorDevice();
    if (cd == null || !cd.hasLayers()) {
        this.disableFirstRow();
        return;
    }
    final int offset = getDrumPadIndex(cd);
    for (int i = 0; i < 8; i++) {
        final IChannel dl = cd.getLayerOrDrumPad(offset + i);
        this.surface.updateButton(20 + i, dl.doesExist() && dl.isActivated() ? dl.isSelected() ? this.isPush2 ? PushColors.PUSH2_COLOR_ORANGE_HI : PushColors.PUSH1_COLOR_ORANGE_HI : this.isPush2 ? PushColors.PUSH2_COLOR_YELLOW_LO : PushColors.PUSH1_COLOR_YELLOW_LO : this.isPush2 ? PushColors.PUSH2_COLOR_BLACK : PushColors.PUSH1_COLOR_BLACK);
    }
}
Also used : IChannel(de.mossgrabers.framework.daw.data.IChannel) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice)

Example 40 with IChannel

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

the class DeviceLayerModePan 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;
    if (isTouched) {
        if (this.surface.isDeletePressed()) {
            this.surface.setButtonConsumed(this.surface.getDeleteButtonId());
            cd.resetLayerOrDrumPadPan(offset + index);
            return;
        }
        this.surface.getDisplay().notify("Pan: " + layer.getPanStr());
    }
    cd.touchLayerOrDrumPadPan(layer.getIndex(), isTouched);
    this.checkStopAutomationOnKnobRelease(isTouched);
}
Also used : IChannel(de.mossgrabers.framework.daw.data.IChannel) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice)

Aggregations

IChannel (de.mossgrabers.framework.daw.data.IChannel)57 ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)25 IChannelBank (de.mossgrabers.framework.daw.IChannelBank)9 ISend (de.mossgrabers.framework.daw.data.ISend)9 PushConfiguration (de.mossgrabers.push.PushConfiguration)7 ITrack (de.mossgrabers.framework.daw.data.ITrack)6 Display (de.mossgrabers.framework.controller.display.Display)5 IDrumPadBank (de.mossgrabers.framework.daw.data.bank.IDrumPadBank)5 ModeManager (de.mossgrabers.framework.mode.ModeManager)4 IGraphicDisplay (de.mossgrabers.framework.controller.display.IGraphicDisplay)3 ILayer (de.mossgrabers.framework.daw.data.ILayer)3 ISpecificDevice (de.mossgrabers.framework.daw.data.ISpecificDevice)3 ISendBank (de.mossgrabers.framework.daw.data.bank.ISendBank)3 PushDisplay (de.mossgrabers.push.controller.PushDisplay)3 PushConfiguration (de.mossgrabers.controller.ableton.push.PushConfiguration)2 TitleChannelsComponent (de.mossgrabers.controller.akai.fire.graphics.canvas.component.TitleChannelsComponent)2 IValueChanger (de.mossgrabers.framework.controller.IValueChanger)2 IValueChanger (de.mossgrabers.framework.controller.valuechanger.IValueChanger)2 ICursorClip (de.mossgrabers.framework.daw.ICursorClip)2 ITrackBank (de.mossgrabers.framework.daw.data.bank.ITrackBank)2