Search in sources :

Example 46 with ModeManager

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

the class MasterCommand method executeShifted.

/**
 * {@inheritDoc}
 */
@Override
public void executeShifted(final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    this.model.toggleCurrentTrackBank();
    if (this.model.isEffectTrackBankActive()) {
        // No Sends on effect tracks
        final ModeManager modeManager = this.surface.getModeManager();
        final int mode = modeManager.getActiveModeId().intValue();
        if (mode >= Modes.MODE_SEND1.intValue() && mode <= Modes.MODE_SEND8.intValue())
            modeManager.setActiveMode(Modes.MODE_PAN);
    }
    final IChannelBank tb = this.model.getCurrentTrackBank();
    final ITrack track = tb.getSelectedTrack();
    if (track == null)
        tb.getTrack(0).select();
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) ModeManager(de.mossgrabers.framework.mode.ModeManager)

Example 47 with ModeManager

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

the class LaunchpadControllerSetup method createModes.

/**
 * {@inheritDoc}
 */
@Override
protected void createModes() {
    final LaunchpadControlSurface surface = this.getSurface();
    final ModeManager modeManager = surface.getModeManager();
    modeManager.registerMode(Modes.MODE_REC_ARM, new RecArmMode(surface, this.model));
    modeManager.registerMode(Modes.MODE_TRACK_SELECT, new TrackMode(surface, this.model));
    modeManager.registerMode(Modes.MODE_MUTE, new MuteMode(surface, this.model));
    modeManager.registerMode(Modes.MODE_SOLO, new SoloMode(surface, this.model));
    modeManager.registerMode(Modes.MODE_VOLUME, new VolumeMode(surface, this.model));
    modeManager.registerMode(Modes.MODE_PAN, new PanMode(surface, this.model));
    modeManager.registerMode(Modes.MODE_SENDS, new SendMode(surface, this.model));
    modeManager.registerMode(Modes.MODE_STOP_CLIP, new StopClipMode(surface, this.model));
}
Also used : TrackMode(de.mossgrabers.launchpad.mode.TrackMode) RecArmMode(de.mossgrabers.launchpad.mode.RecArmMode) SoloMode(de.mossgrabers.launchpad.mode.SoloMode) MuteMode(de.mossgrabers.launchpad.mode.MuteMode) StopClipMode(de.mossgrabers.launchpad.mode.StopClipMode) VolumeMode(de.mossgrabers.launchpad.mode.VolumeMode) SendMode(de.mossgrabers.launchpad.mode.SendMode) PanMode(de.mossgrabers.launchpad.mode.PanMode) LaunchpadControlSurface(de.mossgrabers.launchpad.controller.LaunchpadControlSurface) ModeManager(de.mossgrabers.framework.mode.ModeManager)

Example 48 with ModeManager

use of de.mossgrabers.framework.mode.ModeManager 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;
    final PushConfiguration config = this.surface.getConfiguration();
    if (!this.isPush2 || config.isMuteLongPressed() || config.isSoloLongPressed() || config.isMuteSoloLocked()) {
        final ICursorDevice cd = this.model.getCursorDevice();
        final int offset = getDrumPadIndex(cd);
        if (config.isMuteState())
            cd.toggleLayerOrDrumPadMute(offset + index);
        else
            cd.toggleLayerOrDrumPadSolo(offset + index);
        return;
    }
    final ModeManager modeManager = this.surface.getModeManager();
    IChannelBank fxTrackBank;
    switch(index) {
        case 0:
            if (modeManager.isActiveMode(Modes.MODE_DEVICE_LAYER_VOLUME))
                modeManager.setActiveMode(Modes.MODE_DEVICE_LAYER);
            else
                modeManager.setActiveMode(Modes.MODE_DEVICE_LAYER_VOLUME);
            break;
        case 1:
            if (modeManager.isActiveMode(Modes.MODE_DEVICE_LAYER_PAN))
                modeManager.setActiveMode(Modes.MODE_DEVICE_LAYER);
            else
                modeManager.setActiveMode(Modes.MODE_DEVICE_LAYER_PAN);
            break;
        case 2:
            // Not used
            break;
        case 3:
            if (!this.model.isEffectTrackBankActive()) {
                // Check if there are more than 4 FX channels
                if (!config.isSendsAreToggled()) {
                    fxTrackBank = this.model.getEffectTrackBank();
                    if (!fxTrackBank.getTrack(4).doesExist())
                        return;
                }
                config.setSendsAreToggled(!config.isSendsAreToggled());
                if (!modeManager.isActiveMode(Modes.MODE_DEVICE_LAYER))
                    modeManager.setActiveMode(Integer.valueOf(Modes.MODE_DEVICE_LAYER_SEND1.intValue() + (config.isSendsAreToggled() ? 4 : 0)));
            }
            break;
        case 7:
            this.moveUp();
            break;
        default:
            if (!this.model.isEffectTrackBankActive()) {
                final int sendOffset = config.isSendsAreToggled() ? 0 : 4;
                final int sendIndex = index - sendOffset;
                fxTrackBank = this.model.getEffectTrackBank();
                if (fxTrackBank.getTrack(sendIndex).doesExist()) {
                    final Integer si = Integer.valueOf(Modes.MODE_DEVICE_LAYER_SEND1.intValue() + sendIndex);
                    if (modeManager.isActiveMode(si))
                        modeManager.setActiveMode(Modes.MODE_DEVICE_LAYER);
                    else
                        modeManager.setActiveMode(si);
                }
            }
            break;
    }
}
Also used : PushConfiguration(de.mossgrabers.push.PushConfiguration) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice) ModeManager(de.mossgrabers.framework.mode.ModeManager)

Example 49 with ModeManager

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

the class DeviceLayerMode 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;
        final int offset = getDrumPadIndex(cd);
        final IChannel layer = cd.getLayerOrDrumPad(offset + index);
        if (!layer.doesExist())
            return;
        final int layerIndex = layer.getIndex();
        if (!layer.isSelected()) {
            cd.selectLayerOrDrumPad(layerIndex);
            return;
        }
        cd.enterLayerOrDrumPad(layer.getIndex());
        cd.selectFirstDeviceInLayerOrDrumPad(layer.getIndex());
        final ModeManager modeManager = this.surface.getModeManager();
        modeManager.setActiveMode(Modes.MODE_DEVICE_PARAMS);
        ((DeviceParamsMode) modeManager.getMode(Modes.MODE_DEVICE_PARAMS)).setShowDevices(true);
        return;
    }
    // LONG press
    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 50 with ModeManager

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

the class DeviceLayerMode method moveUp.

/**
 * Move up the hierarchy.
 */
protected void moveUp() {
    // There is no device on the track move upwards to the track view
    final ICursorDevice cd = this.model.getCursorDevice();
    if (!cd.hasSelectedDevice()) {
        this.surface.getViewManager().getActiveView().executeTriggerCommand(Commands.COMMAND_TRACK, ButtonEvent.DOWN);
        return;
    }
    final ModeManager modeManager = this.surface.getModeManager();
    modeManager.setActiveMode(Modes.MODE_DEVICE_PARAMS);
    cd.selectChannel();
    ((DeviceParamsMode) modeManager.getMode(Modes.MODE_DEVICE_PARAMS)).setShowDevices(true);
}
Also used : ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice) ModeManager(de.mossgrabers.framework.mode.ModeManager)

Aggregations

ModeManager (de.mossgrabers.framework.mode.ModeManager)67 IChannelBank (de.mossgrabers.framework.daw.IChannelBank)20 ITrack (de.mossgrabers.framework.daw.data.ITrack)18 ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)9 ViewManager (de.mossgrabers.framework.view.ViewManager)7 PushConfiguration (de.mossgrabers.push.PushConfiguration)7 View (de.mossgrabers.framework.view.View)6 SceneView (de.mossgrabers.framework.view.SceneView)5 PushControlSurface (de.mossgrabers.push.controller.PushControlSurface)5 ITrackBank (de.mossgrabers.framework.daw.ITrackBank)4 IChannel (de.mossgrabers.framework.daw.data.IChannel)4 ITransport (de.mossgrabers.framework.daw.ITransport)3 DeviceBrowserMode (de.mossgrabers.push.mode.device.DeviceBrowserMode)3 DeviceParamsMode (de.mossgrabers.push.mode.device.DeviceParamsMode)3 APCControlSurface (de.mossgrabers.apc.controller.APCControlSurface)2 APCminiControlSurface (de.mossgrabers.apcmini.controller.APCminiControlSurface)2 ICursorClip (de.mossgrabers.framework.daw.ICursorClip)2 IMasterTrack (de.mossgrabers.framework.daw.data.IMasterTrack)2 AbstractSequencerView (de.mossgrabers.framework.view.AbstractSequencerView)2 LaunchpadControlSurface (de.mossgrabers.launchpad.controller.LaunchpadControlSurface)2