Search in sources :

Example 11 with ILayer

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

the class DeviceLayerRightCommand method executeNormal.

/**
 * {@inheritDoc}
 */
@Override
public void executeNormal(final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    final ICursorDevice cd = this.model.getCursorDevice();
    final IChannelBank<ILayer> bank = cd.getLayerBank();
    final Optional<ILayer> sel = bank.getSelectedItem();
    if (!cd.hasLayers() || sel.isEmpty())
        cd.selectNext();
    else
        bank.selectNextItem();
}
Also used : ILayer(de.mossgrabers.framework.daw.data.ILayer) ICursorDevice(de.mossgrabers.framework.daw.data.ICursorDevice)

Example 12 with ILayer

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

the class DeviceLayerRightCommand method executeShifted.

/**
 * {@inheritDoc}
 */
@Override
public void executeShifted(final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    // Enter layer
    final ICursorDevice cd = this.model.getCursorDevice();
    if (!cd.hasLayers())
        return;
    final IChannelBank<ILayer> bank = cd.getLayerBank();
    final Optional<ILayer> layer = bank.getSelectedItem();
    if (layer.isEmpty())
        bank.getItem(0).select();
    else
        layer.get().enter();
}
Also used : ILayer(de.mossgrabers.framework.daw.data.ILayer) ICursorDevice(de.mossgrabers.framework.daw.data.ICursorDevice)

Example 13 with ILayer

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

the class DeviceLayerLeftCommand method canExecute.

/**
 * Check if the command can be executed.
 *
 * @return True if it can
 */
public boolean canExecute() {
    if (this.surface.isShiftPressed())
        return true;
    final ICursorDevice cd = this.model.getCursorDevice();
    final IChannelBank<ILayer> bank = cd.getLayerBank();
    final Optional<ILayer> layer = bank.getSelectedItem();
    return cd.hasLayers() && layer.isPresent() ? bank.canScrollBackwards() : cd.canSelectPreviousFX();
}
Also used : ILayer(de.mossgrabers.framework.daw.data.ILayer) ICursorDevice(de.mossgrabers.framework.daw.data.ICursorDevice)

Example 14 with ILayer

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

the class DeviceLayerMode method onSecondRow.

/**
 * {@inheritDoc}
 */
@Override
public void onSecondRow(final int index, final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    if (!this.isPush2 || this.configuration.isMuteLongPressed() || this.configuration.isSoloLongPressed() || this.configuration.isMuteSoloLocked()) {
        final int offset = this.getDrumPadIndex();
        final ILayer layer = this.bank.getItem(offset + index);
        if (this.configuration.isMuteState())
            layer.toggleMute();
        else
            layer.toggleSolo();
        return;
    }
    final ModeManager modeManager = this.surface.getModeManager();
    ITrackBank fxTrackBank;
    switch(index) {
        case 0:
            if (modeManager.isActive(Modes.DEVICE_LAYER_VOLUME))
                this.setMode(Modes.DEVICE_LAYER);
            else
                this.setMode(Modes.DEVICE_LAYER_VOLUME);
            break;
        case 1:
            if (modeManager.isActive(Modes.DEVICE_LAYER_PAN))
                this.setMode(Modes.DEVICE_LAYER);
            else
                this.setMode(Modes.DEVICE_LAYER_PAN);
            break;
        case 2:
            // Not used
            break;
        case 3:
            if (this.model.isEffectTrackBankActive())
                return;
            // Check if there are more than 4 FX channels
            if (!this.configuration.isSendsAreToggled()) {
                fxTrackBank = this.model.getEffectTrackBank();
                if (fxTrackBank == null || !fxTrackBank.getItem(4).doesExist())
                    return;
            }
            this.configuration.setSendsAreToggled(!this.configuration.isSendsAreToggled());
            this.bindControls();
            if (!modeManager.isActive(Modes.DEVICE_LAYER))
                this.setMode(Modes.get(Modes.DEVICE_LAYER_SEND1, this.configuration.isSendsAreToggled() ? 4 : 0));
            break;
        case 7:
            if (this.surface.isShiftPressed())
                this.handleSendEffect(this.configuration.isSendsAreToggled() ? 7 : 3);
            else
                this.moveUp();
            break;
        default:
            this.handleSendEffect(index - (this.configuration.isSendsAreToggled() ? 0 : 4));
            break;
    }
}
Also used : ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank) ILayer(de.mossgrabers.framework.daw.data.ILayer) ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Aggregations

ILayer (de.mossgrabers.framework.daw.data.ILayer)14 ICursorDevice (de.mossgrabers.framework.daw.data.ICursorDevice)8 IChannel (de.mossgrabers.framework.daw.data.IChannel)3 ISpecificDevice (de.mossgrabers.framework.daw.data.ISpecificDevice)3 ISendBank (de.mossgrabers.framework.daw.data.bank.ISendBank)3 IGraphicDisplay (de.mossgrabers.framework.controller.display.IGraphicDisplay)2 ISend (de.mossgrabers.framework.daw.data.ISend)2 ModeManager (de.mossgrabers.framework.featuregroup.ModeManager)2 TitleChannelsComponent (de.mossgrabers.controller.akai.fire.graphics.canvas.component.TitleChannelsComponent)1 TitleValueComponent (de.mossgrabers.controller.akai.fire.graphics.canvas.component.TitleValueComponent)1 IBrowser (de.mossgrabers.framework.daw.IBrowser)1 IMasterTrack (de.mossgrabers.framework.daw.data.IMasterTrack)1 ITrack (de.mossgrabers.framework.daw.data.ITrack)1 ILayerBank (de.mossgrabers.framework.daw.data.bank.ILayerBank)1 ITrackBank (de.mossgrabers.framework.daw.data.bank.ITrackBank)1