Search in sources :

Example 6 with PushConfiguration

use of de.mossgrabers.push.PushConfiguration in project DrivenByMoss by git-moss.

the class PanSendCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    final IChannelBank fxTrackBank = this.model.getEffectTrackBank();
    final ModeManager modeManager = this.surface.getModeManager();
    final Integer currentMode = modeManager.getActiveModeId();
    // Layer mode selection for Push 1
    Integer mode;
    final PushConfiguration config = this.surface.getConfiguration();
    if (!config.isPush2() && this.surface.isSelectPressed() && Modes.isLayerMode(currentMode)) {
        if (this.model.isEffectTrackBankActive()) {
            // No Sends on FX tracks
            mode = Modes.MODE_DEVICE_LAYER_PAN;
        } else {
            mode = Integer.valueOf(currentMode.intValue() + 1);
            // Wrap
            if (mode.intValue() < Modes.MODE_DEVICE_LAYER_PAN.intValue() || mode.intValue() > Modes.MODE_DEVICE_LAYER_SEND6.intValue())
                mode = Modes.MODE_DEVICE_LAYER_PAN;
            // Check if Send channel exists
            if (mode.intValue() >= Modes.MODE_DEVICE_LAYER_SEND1.intValue() && mode.intValue() <= Modes.MODE_DEVICE_LAYER_SEND6.intValue() && fxTrackBank != null && !fxTrackBank.getTrack(mode.intValue() - Modes.MODE_DEVICE_LAYER_SEND1.intValue()).doesExist())
                mode = Modes.MODE_DEVICE_LAYER_PAN;
        }
        modeManager.setActiveMode(mode);
        return;
    }
    if (this.model.isEffectTrackBankActive()) {
        // No Sends on FX tracks
        mode = Modes.MODE_PAN;
    } else {
        mode = Integer.valueOf(currentMode.intValue() + 1);
        // Wrap
        if (mode.intValue() < Modes.MODE_PAN.intValue() || mode.intValue() > Modes.MODE_SEND6.intValue())
            mode = Modes.MODE_PAN;
        // Check if Send channel exists
        if (mode.intValue() >= Modes.MODE_SEND1.intValue() && mode.intValue() <= Modes.MODE_SEND6.intValue() && fxTrackBank != null && !fxTrackBank.getTrack(mode.intValue() - Modes.MODE_SEND1.intValue()).doesExist())
            mode = Modes.MODE_PAN;
    }
    modeManager.setActiveMode(mode);
}
Also used : PushConfiguration(de.mossgrabers.push.PushConfiguration) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) ModeManager(de.mossgrabers.framework.mode.ModeManager)

Example 7 with PushConfiguration

use of de.mossgrabers.push.PushConfiguration in project DrivenByMoss by git-moss.

the class AccentCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final ButtonEvent event) {
    switch(event) {
        case DOWN:
            this.quitAccentMode = false;
            break;
        case LONG:
            this.quitAccentMode = true;
            this.surface.getModeManager().setActiveMode(Modes.MODE_ACCENT);
            break;
        case UP:
            if (this.quitAccentMode)
                this.surface.getModeManager().restoreMode();
            else {
                final PushConfiguration config = this.surface.getConfiguration();
                config.setAccentEnabled(!config.isAccentActive());
            }
            break;
    }
}
Also used : PushConfiguration(de.mossgrabers.push.PushConfiguration)

Example 8 with PushConfiguration

use of de.mossgrabers.push.PushConfiguration in project DrivenByMoss by git-moss.

the class LayoutCommand method executeNormal.

/**
 * {@inheritDoc}
 */
@Override
public void executeNormal(final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    final ViewManager viewManager = this.surface.getViewManager();
    if (viewManager.isActiveView(Views.VIEW_PLAY))
        viewManager.setActiveView(Views.VIEW_PIANO);
    else if (viewManager.isActiveView(Views.VIEW_PIANO))
        viewManager.setActiveView(this.model.getHost().hasClips() ? Views.VIEW_DRUM64 : Views.VIEW_PLAY);
    else if (viewManager.isActiveView(Views.VIEW_DRUM64))
        viewManager.setActiveView(Views.VIEW_PLAY);
    else if (viewManager.isActiveView(Views.VIEW_SEQUENCER))
        viewManager.setActiveView(Views.VIEW_RAINDROPS);
    else if (viewManager.isActiveView(Views.VIEW_RAINDROPS))
        viewManager.setActiveView(Views.VIEW_DRUM);
    else if (viewManager.isActiveView(Views.VIEW_DRUM))
        viewManager.setActiveView(Views.VIEW_DRUM4);
    else if (viewManager.isActiveView(Views.VIEW_DRUM4))
        viewManager.setActiveView(Views.VIEW_DRUM8);
    else if (viewManager.isActiveView(Views.VIEW_DRUM8))
        viewManager.setActiveView(Views.VIEW_SEQUENCER);
    else {
        final PushConfiguration configuration = this.surface.getConfiguration();
        if (viewManager.isActiveView(Views.VIEW_SESSION)) {
            if (configuration.isFlipSession())
                viewManager.setActiveView(Views.VIEW_SCENE_PLAY);
            else
                configuration.setFlipSession(true);
        } else if (viewManager.isActiveView(Views.VIEW_SCENE_PLAY)) {
            configuration.setFlipSession(false);
            viewManager.setActiveView(Views.VIEW_SESSION);
        }
    }
}
Also used : PushConfiguration(de.mossgrabers.push.PushConfiguration) ViewManager(de.mossgrabers.framework.view.ViewManager)

Example 9 with PushConfiguration

use of de.mossgrabers.push.PushConfiguration in project DrivenByMoss by git-moss.

the class MuteCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final ButtonEvent event) {
    // Update for key combinations
    this.surface.getViewManager().getActiveView().updateNoteMapping();
    final PushConfiguration config = this.surface.getConfiguration();
    if (!config.isPush2()) {
        config.setTrackState(TrackState.MUTE);
        return;
    }
    // Toggle mute lock mode
    if (this.surface.isShiftPressed()) {
        if (event == ButtonEvent.UP)
            config.setMuteSoloLocked(!config.isMuteSoloLocked());
        return;
    }
    // Behaviour like Push 1
    if (config.isMuteSoloLocked()) {
        config.setTrackState(TrackState.MUTE);
        return;
    }
    if (event == ButtonEvent.DOWN) {
        config.setIsMuteLongPressed(false);
        return;
    }
    if (event == ButtonEvent.LONG) {
        config.setIsMuteLongPressed(true);
        config.setTrackState(TrackState.MUTE);
        return;
    }
    if (config.isMuteLongPressed()) {
        config.setIsMuteLongPressed(false);
        return;
    }
    final Integer activeModeId = this.surface.getModeManager().getActiveModeId();
    if (Modes.isTrackMode(activeModeId)) {
        final IChannelBank tb = this.model.getCurrentTrackBank();
        final ITrack selTrack = tb.getSelectedTrack();
        if (selTrack != null)
            selTrack.toggleMute();
    } else if (Modes.isLayerMode(activeModeId)) {
        final ICursorDevice cd = this.model.getCursorDevice();
        final IChannel layer = cd.getSelectedLayerOrDrumPad();
        if (layer != null)
            cd.toggleLayerOrDrumPadMute(layer.getIndex());
    } else if (activeModeId == Modes.MODE_MASTER)
        this.model.getMasterTrack().toggleMute();
}
Also used : PushConfiguration(de.mossgrabers.push.PushConfiguration) IChannel(de.mossgrabers.framework.daw.data.IChannel) ITrack(de.mossgrabers.framework.daw.data.ITrack) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice)

Example 10 with PushConfiguration

use of de.mossgrabers.push.PushConfiguration in project DrivenByMoss by git-moss.

the class SoloCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final ButtonEvent event) {
    // Update for key combinations
    this.surface.getViewManager().getActiveView().updateNoteMapping();
    final PushConfiguration config = this.surface.getConfiguration();
    if (!config.isPush2()) {
        config.setTrackState(TrackState.SOLO);
        return;
    }
    // Toggle solo lock mode
    if (this.surface.isShiftPressed()) {
        if (event == ButtonEvent.UP)
            config.setMuteSoloLocked(!config.isMuteSoloLocked());
        return;
    }
    // Behaviour like Push 1
    if (config.isMuteSoloLocked()) {
        config.setTrackState(TrackState.SOLO);
        return;
    }
    if (event == ButtonEvent.DOWN) {
        config.setIsSoloLongPressed(false);
        return;
    }
    if (event == ButtonEvent.LONG) {
        config.setIsSoloLongPressed(true);
        config.setTrackState(TrackState.SOLO);
        return;
    }
    if (config.isSoloLongPressed()) {
        config.setIsSoloLongPressed(false);
        return;
    }
    final Integer activeModeId = this.surface.getModeManager().getActiveModeId();
    if (Modes.isTrackMode(activeModeId)) {
        final IChannelBank tb = this.model.getCurrentTrackBank();
        final ITrack selTrack = tb.getSelectedTrack();
        if (selTrack != null)
            selTrack.toggleSolo();
    } else if (Modes.isLayerMode(activeModeId)) {
        final ICursorDevice cd = this.model.getCursorDevice();
        final IChannel layer = cd.getSelectedLayerOrDrumPad();
        if (layer != null)
            cd.toggleLayerOrDrumPadSolo(layer.getIndex());
    } else if (activeModeId == Modes.MODE_MASTER)
        this.model.getMasterTrack().toggleSolo();
}
Also used : PushConfiguration(de.mossgrabers.push.PushConfiguration) IChannel(de.mossgrabers.framework.daw.data.IChannel) ITrack(de.mossgrabers.framework.daw.data.ITrack) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice)

Aggregations

PushConfiguration (de.mossgrabers.push.PushConfiguration)33 IChannelBank (de.mossgrabers.framework.daw.IChannelBank)19 ITrack (de.mossgrabers.framework.daw.data.ITrack)14 PushDisplay (de.mossgrabers.push.controller.PushDisplay)8 IChannel (de.mossgrabers.framework.daw.data.IChannel)7 ModeManager (de.mossgrabers.framework.mode.ModeManager)7 IValueChanger (de.mossgrabers.framework.controller.IValueChanger)6 ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)5 ITrackBank (de.mossgrabers.framework.daw.ITrackBank)5 ISend (de.mossgrabers.framework.daw.data.ISend)5 DisplayMessage (de.mossgrabers.push.controller.DisplayMessage)5 Display (de.mossgrabers.framework.controller.display.Display)4 ViewManager (de.mossgrabers.framework.view.ViewManager)1