Search in sources :

Example 41 with IChannel

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

the class DeviceLayerModeSend method onValueKnob.

/**
 * {@inheritDoc}
 */
@Override
public void onValueKnob(final int index, final int value) {
    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())
        cd.changeLayerOrDrumPadSend(offset + index, this.getCurrentSendIndex(), value);
}
Also used : IChannel(de.mossgrabers.framework.daw.data.IChannel) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice)

Example 42 with IChannel

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

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

the class DeviceLayerModeVolume method updateDisplay1.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay1() {
    final Display d = this.surface.getDisplay();
    final ICursorDevice cd = this.model.getCursorDevice();
    // Drum Pad Bank has size of 16, layers only 8
    final int offset = getDrumPadIndex(cd);
    final PushConfiguration config = this.surface.getConfiguration();
    for (int i = 0; i < 8; i++) {
        final IChannel layer = cd.getLayerOrDrumPad(offset + i);
        d.setCell(0, i, layer.doesExist() ? "Volume" : "").setCell(1, i, layer.getVolumeStr(8));
        if (layer.doesExist())
            d.setCell(2, i, config.isEnableVUMeters() ? layer.getVu() : layer.getVolume(), Format.FORMAT_VALUE);
        else
            d.clearCell(2, i);
    }
    d.done(0).done(1).done(2);
    this.drawRow4(d, cd);
}
Also used : PushConfiguration(de.mossgrabers.push.PushConfiguration) IChannel(de.mossgrabers.framework.daw.data.IChannel) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice) Display(de.mossgrabers.framework.controller.display.Display)

Example 44 with IChannel

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

the class DeviceParamsMode method onFirstRow.

/**
 * {@inheritDoc}
 */
@Override
public void onFirstRow(final int index, final ButtonEvent event) {
    if (event == ButtonEvent.DOWN)
        return;
    if (event == ButtonEvent.UP) {
        final ICursorDevice cd = this.model.getCursorDevice();
        if (!cd.hasSelectedDevice())
            return;
        if (!this.showDevices) {
            cd.setSelectedParameterPageInBank(index);
            return;
        }
        if (cd.getPositionInBank() != index) {
            cd.selectSibling(index);
            return;
        }
        final ModeManager modeManager = this.surface.getModeManager();
        if (!cd.hasLayers()) {
            ((DeviceParamsMode) modeManager.getMode(Modes.MODE_DEVICE_PARAMS)).setShowDevices(false);
            return;
        }
        final IChannel layer = cd.getSelectedLayerOrDrumPad();
        if (layer == null)
            cd.selectLayerOrDrumPad(0);
        modeManager.setActiveMode(Modes.MODE_DEVICE_LAYER);
        return;
    }
    // LONG press - move upwards
    this.surface.setButtonConsumed(PushControlSurface.PUSH_BUTTON_ROW1_1 + index);
    this.moveUp();
}
Also used : IChannel(de.mossgrabers.framework.daw.data.IChannel) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice) ModeManager(de.mossgrabers.framework.mode.ModeManager)

Example 45 with IChannel

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

the class LayerDetailsMode method updateFirstRow.

/**
 * {@inheritDoc}
 */
@Override
public void updateFirstRow() {
    final IChannel deviceChain = this.model.getCursorDevice().getSelectedLayerOrDrumPad();
    if (deviceChain == null) {
        this.disableFirstRow();
        return;
    }
    final int off = this.isPush2 ? PushColors.PUSH2_COLOR_BLACK : PushColors.PUSH1_COLOR_BLACK;
    this.surface.updateButton(20, deviceChain.isActivated() ? this.isPush2 ? PushColors.PUSH2_COLOR_YELLOW_MD : PushColors.PUSH1_COLOR_YELLOW_MD : this.isPush2 ? PushColors.PUSH2_COLOR_YELLOW_LO : PushColors.PUSH1_COLOR_YELLOW_LO);
    this.surface.updateButton(21, off);
    this.surface.updateButton(22, deviceChain.isMute() ? this.isPush2 ? PushColors.PUSH2_COLOR_ORANGE_HI : PushColors.PUSH1_COLOR_ORANGE_HI : this.isPush2 ? PushColors.PUSH2_COLOR_ORANGE_LO : PushColors.PUSH1_COLOR_ORANGE_LO);
    this.surface.updateButton(23, deviceChain.isSolo() ? this.isPush2 ? PushColors.PUSH2_COLOR_ORANGE_HI : PushColors.PUSH1_COLOR_ORANGE_HI : this.isPush2 ? PushColors.PUSH2_COLOR_ORANGE_LO : PushColors.PUSH1_COLOR_ORANGE_LO);
    this.surface.updateButton(24, off);
    this.surface.updateButton(25, off);
    this.surface.updateButton(26, off);
    this.surface.updateButton(27, this.isPush2 ? PushColors.PUSH2_COLOR_GREEN_HI : PushColors.PUSH1_COLOR_GREEN_HI);
}
Also used : IChannel(de.mossgrabers.framework.daw.data.IChannel)

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