Search in sources :

Example 31 with Modes

use of de.mossgrabers.framework.mode.Modes in project DrivenByMoss by git-moss.

the class PadModeSelectView method drawGrid.

/**
 * {@inheritDoc}
 */
@Override
public void drawGrid() {
    final IPadGrid pads = this.surface.getPadGrid();
    for (int x = 0; x < 8; x++) pads.lightEx(x, 0, LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_BLACK);
    final SessionView view = (SessionView) this.surface.getViewManager().get(Views.SESSION);
    final Modes padMode = view.getPadMode();
    pads.lightEx(0, 1, padMode == null ? LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_GREEN_HI : LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_GREEN_LO);
    pads.lightEx(1, 1, padMode == Modes.REC_ARM ? LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_RED_HI : LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_RED_LO);
    pads.lightEx(2, 1, padMode == Modes.TRACK_SELECT ? LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_WHITE : LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_GREY_LO);
    pads.lightEx(3, 1, padMode == Modes.MUTE ? LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_AMBER_HI : LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_AMBER_LO);
    pads.lightEx(4, 1, padMode == Modes.SOLO ? LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_YELLOW_HI : LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_YELLOW_LO);
    pads.lightEx(5, 1, padMode == Modes.STOP_CLIP ? LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_PINK_HI : LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_ROSE);
    pads.lightEx(6, 1, LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_BLACK);
    pads.lightEx(7, 1, LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_BLACK);
}
Also used : IPadGrid(de.mossgrabers.framework.controller.grid.IPadGrid) Modes(de.mossgrabers.framework.mode.Modes)

Example 32 with Modes

use of de.mossgrabers.framework.mode.Modes in project DrivenByMoss by git-moss.

the class PageCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final ButtonEvent event, final int velocity) {
    if (event != ButtonEvent.DOWN)
        return;
    final ModeManager modeManager = this.surface.getModeManager();
    final Modes mode = modeManager.getActiveID();
    switch(mode) {
        case DEVICE_PARAMS:
            final ICursorDevice cursorDevice = this.model.getCursorDevice();
            if (this.direction == Direction.LEFT)
                cursorDevice.selectPrevious();
            else
                cursorDevice.selectNext();
            this.mvHelper.notifySelectedDevice();
            break;
        case USER:
            final IParameterBank userBank = this.model.getUserParameterBank();
            if (this.direction == Direction.LEFT)
                userBank.selectPreviousPage();
            else
                userBank.selectNextPage();
            this.mvHelper.notifySelectedUserPage();
            break;
        case BROWSER:
            if (this.direction == Direction.LEFT)
                this.model.getBrowser().previousContentType();
            else
                this.model.getBrowser().nextContentType();
            break;
        default:
            final ITrack cursorTrack = this.model.getCursorTrack();
            if (!cursorTrack.doesExist())
                return;
            final ISlotBank slotBank = cursorTrack.getSlotBank();
            if (this.direction == Direction.LEFT) {
                if (this.surface.isShiftPressed()) {
                    this.surface.setStopConsumed();
                    slotBank.selectPreviousPage();
                } else
                    slotBank.selectPreviousItem();
            } else {
                if (this.surface.isShiftPressed()) {
                    this.surface.setStopConsumed();
                    slotBank.selectNextPage();
                } else
                    slotBank.selectNextItem();
            }
            break;
    }
}
Also used : Modes(de.mossgrabers.framework.mode.Modes) ISlotBank(de.mossgrabers.framework.daw.data.bank.ISlotBank) ITrack(de.mossgrabers.framework.daw.data.ITrack) IParameterBank(de.mossgrabers.framework.daw.data.bank.IParameterBank) ICursorDevice(de.mossgrabers.framework.daw.data.ICursorDevice) ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Example 33 with Modes

use of de.mossgrabers.framework.mode.Modes in project DrivenByMoss by git-moss.

the class MaschineSendSelectCommand method executeNormal.

/**
 * {@inheritDoc}
 */
@Override
public void executeNormal(final ButtonEvent event) {
    final ModeManager modeManager = this.surface.getModeManager();
    final Modes activeMode = modeManager.getActiveID();
    super.executeNormal(event);
    final Modes newMode = modeManager.getActiveID();
    if (activeMode == newMode)
        return;
    final int sendIndex = newMode.ordinal() - Modes.SEND1.ordinal();
    final Optional<ITrack> t = this.model.getCurrentTrackBank().getSelectedItem();
    if (t.isEmpty())
        return;
    final ISendBank sendBank = t.get().getSendBank();
    final ISend send = sendBank.getItem(sendIndex);
    if (send.doesExist())
        this.surface.getDisplay().notify("Send " + (sendIndex + 1) + ": " + send.getName());
}
Also used : Modes(de.mossgrabers.framework.mode.Modes) ITrack(de.mossgrabers.framework.daw.data.ITrack) ISend(de.mossgrabers.framework.daw.data.ISend) ISendBank(de.mossgrabers.framework.daw.data.bank.ISendBank) ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Example 34 with Modes

use of de.mossgrabers.framework.mode.Modes in project DrivenByMoss by git-moss.

the class ModeMultiSelectCommand method executeNormal.

/**
 * {@inheritDoc}
 */
@Override
public void executeNormal(final ButtonEvent event) {
    if (event != ButtonEvent.UP)
        return;
    final Modes activeModeId = this.modeManager.getActiveID();
    Modes newMode = this.currentModeID;
    // If coming from a mode not on the list, activate the last one
    if (this.currentModeID.equals(activeModeId)) {
        final ITrackBank trackBank = this.model.getTrackBank();
        int index = this.modeIds.indexOf(activeModeId);
        // If a send mode is selected check if the according send exists
        do {
            index++;
            if (index < 0 || index >= this.modeIds.size())
                index = 0;
            newMode = this.modeIds.get(index);
        } while (Modes.isSendMode(newMode) && !trackBank.canEditSend(newMode.ordinal() - Modes.SEND1.ordinal()));
    }
    this.activateMode(newMode);
}
Also used : Modes(de.mossgrabers.framework.mode.Modes) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank)

Example 35 with Modes

use of de.mossgrabers.framework.mode.Modes in project DrivenByMoss by git-moss.

the class LaunchkeyMiniMk3ControllerSetup method processProgramChangeAction.

private void processProgramChangeAction(final int value) {
    final Modes modeID = this.getSurface().getModeManager().getActiveID();
    if (modeID == null)
        return;
    switch(modeID) {
        case VOLUME:
        case PAN:
        case SEND1:
        case SEND2:
            final ITrackBank currentTrackBank = this.model.getCurrentTrackBank();
            if (value > 0)
                currentTrackBank.selectNextPage();
            else
                currentTrackBank.selectPreviousPage();
            this.mvHelper.notifySelectedTrack();
            break;
        case DEVICE_PARAMS:
            final ICursorDevice cursorDevice = this.model.getCursorDevice();
            final IParameterBank parameterBank = cursorDevice.getParameterBank();
            if (value > 0)
                parameterBank.selectNextItem();
            else
                parameterBank.selectPreviousItem();
            this.mvHelper.notifySelectedParameterPage();
            break;
        default:
            // Not used
            break;
    }
}
Also used : Modes(de.mossgrabers.framework.mode.Modes) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank) IParameterBank(de.mossgrabers.framework.daw.data.bank.IParameterBank) ICursorDevice(de.mossgrabers.framework.daw.data.ICursorDevice)

Aggregations

Modes (de.mossgrabers.framework.mode.Modes)35 ModeManager (de.mossgrabers.framework.featuregroup.ModeManager)22 ITrackBank (de.mossgrabers.framework.daw.data.bank.ITrackBank)13 ITrack (de.mossgrabers.framework.daw.data.ITrack)8 PushConfiguration (de.mossgrabers.controller.ableton.push.PushConfiguration)6 ICursorDevice (de.mossgrabers.framework.daw.data.ICursorDevice)5 ITransport (de.mossgrabers.framework.daw.ITransport)2 ISend (de.mossgrabers.framework.daw.data.ISend)2 IParameterBank (de.mossgrabers.framework.daw.data.bank.IParameterBank)2 ISendBank (de.mossgrabers.framework.daw.data.bank.ISendBank)2 GenericFlexiControlSurface (de.mossgrabers.controller.generic.controller.GenericFlexiControlSurface)1 MaschineControlSurface (de.mossgrabers.controller.ni.maschine.mk3.controller.MaschineControlSurface)1 StudioEncoderModeManager (de.mossgrabers.controller.ni.maschine.mk3.controller.StudioEncoderModeManager)1 P2ButtonCommand (de.mossgrabers.controller.novation.sl.command.trigger.P2ButtonCommand)1 DevicePresetsMode (de.mossgrabers.controller.novation.sl.mode.device.DevicePresetsMode)1 SLParameterMode (de.mossgrabers.controller.novation.sl.mode.device.SLParameterMode)1 ContinuousCommand (de.mossgrabers.framework.command.core.ContinuousCommand)1 PitchbendCommand (de.mossgrabers.framework.command.core.PitchbendCommand)1 TriggerCommand (de.mossgrabers.framework.command.core.TriggerCommand)1 IPadGrid (de.mossgrabers.framework.controller.grid.IPadGrid)1