Search in sources :

Example 1 with IChannel

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

the class DeviceView method onGridNote.

/**
 * {@inheritDoc}
 */
@Override
public void onGridNote(final int note, final int velocity) {
    if (velocity == 0)
        return;
    if (!this.model.hasSelectedDevice())
        return;
    final ICursorDevice cd = this.model.getCursorDevice();
    IChannel sel;
    int index;
    IChannel dl;
    int bank;
    int offset;
    switch(note - 36) {
        // Toggle device on/off
        case 0:
            cd.toggleEnabledState();
            break;
        // Device Left
        case 1:
            if (this.isLayer) {
                sel = cd.getSelectedLayer();
                index = sel == null || sel.getIndex() == 0 ? 0 : sel.getIndex() - 1;
                cd.selectLayer(index);
            } else
                cd.selectPrevious();
            break;
        // Device Right
        case 2:
            if (this.isLayer) {
                sel = cd.getSelectedLayer();
                index = sel == null ? 0 : sel.getIndex() + 1;
                cd.selectLayer(index > 7 ? 7 : index);
            } else
                cd.selectNext();
            break;
        // Enter layer
        case 3:
            if (!cd.hasLayers())
                return;
            dl = cd.getSelectedLayerOrDrumPad();
            if (this.isLayer) {
                if (dl != null) {
                    cd.enterLayerOrDrumPad(dl.getIndex());
                    cd.selectFirstDeviceInLayerOrDrumPad(dl.getIndex());
                }
            } else if (dl == null)
                cd.selectLayerOrDrumPad(0);
            this.isLayer = !this.isLayer;
            break;
        // Exit layer
        case 4:
            if (this.isLayer)
                this.isLayer = false;
            else {
                if (cd.isNested()) {
                    cd.selectParent();
                    cd.selectChannel();
                    this.isLayer = true;
                }
            }
            break;
        case 5:
            // Intentionally empty
            break;
        // Param bank down
        case 6:
            cd.setSelectedParameterPage(Math.max(cd.getSelectedParameterPage() - 8, 0));
            break;
        // Param bank page up
        case 7:
            cd.setSelectedParameterPage(Math.min(cd.getSelectedParameterPage() + 8, cd.getParameterPageNames().length - 1));
            break;
        default:
            bank = note - 36 - 8;
            offset = cd.getSelectedParameterPage() / 8 * 8;
            cd.setSelectedParameterPage(offset + bank);
            break;
    }
}
Also used : IChannel(de.mossgrabers.framework.daw.data.IChannel) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice)

Example 2 with IChannel

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

the class DeviceLeftCommand method executeShifted.

/**
 * {@inheritDoc}
 */
@Override
public void executeShifted(final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    // Exit layer
    final ICursorDevice cd = this.model.getCursorDevice();
    final IChannel layer = cd.getSelectedLayerOrDrumPad();
    if (!cd.hasLayers() || layer == null) {
        if (cd.isNested()) {
            cd.selectParent();
            cd.selectChannel();
        }
    } else
        layer.setSelected(false);
}
Also used : IChannel(de.mossgrabers.framework.daw.data.IChannel) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice)

Example 3 with IChannel

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

the class CursorDeviceImpl method nextLayer.

/**
 * {@inheritDoc}
 */
@Override
public void nextLayer() {
    final IChannel sel = this.getSelectedLayer();
    final int index = sel == null ? 0 : sel.getIndex() + 1;
    if (index == this.numDeviceLayers)
        this.nextLayerBank();
    else
        this.selectLayer(index);
}
Also used : IChannel(de.mossgrabers.framework.daw.data.IChannel)

Example 4 with IChannel

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

the class CursorDeviceImpl method previousLayer.

/**
 * {@inheritDoc}
 */
@Override
public void previousLayer() {
    final IChannel sel = this.getSelectedLayer();
    final int index = sel == null ? 0 : sel.getIndex() - 1;
    if (index == -1)
        this.previousLayerBank();
    else
        this.selectLayer(index);
}
Also used : IChannel(de.mossgrabers.framework.daw.data.IChannel)

Example 5 with IChannel

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

the class CursorDeviceImpl method nextDrumPad.

/**
 * {@inheritDoc}
 */
@Override
public void nextDrumPad() {
    final IChannel sel = this.getSelectedDrumPad();
    int index = sel == null ? 0 : sel.getIndex() + 1;
    while (index < this.numDrumPadLayers - 1 && !this.getDrumPad(index).doesExist()) index++;
    if (index == this.numDrumPadLayers)
        this.nextDrumPadBank();
    else
        this.selectDrumPad(index);
}
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