Search in sources :

Example 56 with ModeManager

use of de.mossgrabers.framework.featuregroup.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
    if (!this.cursorDevice.doesExist()) {
        this.surface.getButton(ButtonID.TRACK).trigger(ButtonEvent.DOWN);
        return;
    }
    this.setMode(Modes.DEVICE_PARAMS);
    this.cursorDevice.selectChannel();
    final ModeManager modeManager = this.surface.getModeManager();
    ((DeviceParamsMode) modeManager.get(Modes.DEVICE_PARAMS)).setShowDevices(true);
}
Also used : ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Example 57 with ModeManager

use of de.mossgrabers.framework.featuregroup.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;
    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)

Example 58 with ModeManager

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

the class TrackCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final ButtonEvent event, final int velocity) {
    if (event != ButtonEvent.DOWN)
        return;
    final PushConfiguration config = this.surface.getConfiguration();
    if (this.surface.isShiftPressed()) {
        config.setVUMetersEnabled(!config.isEnableVUMeters());
        return;
    }
    final ModeManager modeManager = this.surface.getModeManager();
    final Modes currentMode = modeManager.getActiveID();
    if (currentMode != null) {
        if (config.isPush2()) {
            if (Modes.TRACK.equals(currentMode) || Modes.VOLUME.equals(currentMode) || Modes.CROSSFADER.equals(currentMode) || Modes.PAN.equals(currentMode)) {
                this.model.toggleCurrentTrackBank();
            } else if (currentMode.ordinal() >= Modes.SEND1.ordinal() && currentMode.ordinal() <= Modes.SEND8.ordinal()) {
                modeManager.setActive(Modes.TRACK);
                this.model.toggleCurrentTrackBank();
            } else
                modeManager.setActive(config.getCurrentMixMode());
        } else {
            // Layer mode selection for Push 1
            if (this.surface.isSelectPressed() && Modes.isLayerMode(currentMode)) {
                modeManager.setActive(Modes.DEVICE_LAYER);
                return;
            }
            if (Modes.TRACK.equals(currentMode))
                this.model.toggleCurrentTrackBank();
            else
                modeManager.setActive(Modes.TRACK);
        }
    } else
        modeManager.setActive(Modes.TRACK);
    config.setDebugMode(modeManager.getActiveID());
    final ITrackBank tb = this.model.getCurrentTrackBank();
    final Optional<ITrack> track = tb.getSelectedItem();
    if (track.isEmpty())
        tb.getItem(0).select();
}
Also used : PushConfiguration(de.mossgrabers.controller.ableton.push.PushConfiguration) Modes(de.mossgrabers.framework.mode.Modes) ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank) ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Example 59 with ModeManager

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

the class FaderTouchCommand method executeNormal.

/**
 * {@inheritDoc}
 */
@Override
public void executeNormal(final ButtonEvent event) {
    final HUIConfiguration configuration = this.surface.getConfiguration();
    final ModeManager modeManager = this.surface.getModeManager();
    if (event == ButtonEvent.DOWN)
        modeManager.setActive(Modes.VOLUME);
    else if (event == ButtonEvent.UP)
        modeManager.restore();
    if (configuration.isTouchChannel())
        super.executeNormal(event);
}
Also used : HUIConfiguration(de.mossgrabers.controller.mackie.hui.HUIConfiguration) ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Example 60 with ModeManager

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

the class ModeSwitcher method scrollDown.

/**
 * Scroll downwards through the modes.
 */
public void scrollDown() {
    final ModeManager modeManager = this.surface.getModeManager();
    final Modes activeModeId = modeManager.getActiveID();
    if (Modes.PAN == activeModeId) {
        modeManager.setActive(Modes.DEVICE_PARAMS);
        this.surface.getDisplay().notify("Parameters");
    } else if (Modes.VOLUME == activeModeId) {
        modeManager.setActive(Modes.PAN);
        this.surface.getDisplay().notify("Panorama");
    } else if (Modes.TRACK == activeModeId) {
        modeManager.setActive(Modes.VOLUME);
        this.surface.getDisplay().notify("Volume");
    } else {
        modeManager.setActive(Modes.TRACK);
        this.surface.getDisplay().notify("Track");
    }
}
Also used : Modes(de.mossgrabers.framework.mode.Modes) ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Aggregations

ModeManager (de.mossgrabers.framework.featuregroup.ModeManager)90 Modes (de.mossgrabers.framework.mode.Modes)22 ITrack (de.mossgrabers.framework.daw.data.ITrack)15 ITrackBank (de.mossgrabers.framework.daw.data.bank.ITrackBank)15 ViewManager (de.mossgrabers.framework.featuregroup.ViewManager)11 ICursorDevice (de.mossgrabers.framework.daw.data.ICursorDevice)10 PushConfiguration (de.mossgrabers.controller.ableton.push.PushConfiguration)6 MaschineControlSurface (de.mossgrabers.controller.ni.maschine.mk3.controller.MaschineControlSurface)4 StudioEncoderModeManager (de.mossgrabers.controller.ni.maschine.mk3.controller.StudioEncoderModeManager)4 EditNoteMode (de.mossgrabers.controller.ni.maschine.mk3.mode.EditNoteMode)4 StepState (de.mossgrabers.framework.daw.StepState)4 INoteMode (de.mossgrabers.framework.mode.INoteMode)4 IMode (de.mossgrabers.framework.featuregroup.IMode)3 NoteMode (de.mossgrabers.controller.akai.apc.mode.NoteMode)2 MCUConfiguration (de.mossgrabers.controller.mackie.mcu.MCUConfiguration)2 SLControlSurface (de.mossgrabers.controller.novation.sl.controller.SLControlSurface)2 SLMkIIIControlSurface (de.mossgrabers.controller.novation.slmkiii.controller.SLMkIIIControlSurface)2 SLMkIIIDisplay (de.mossgrabers.controller.novation.slmkiii.controller.SLMkIIIDisplay)2 IHwRelativeKnob (de.mossgrabers.framework.controller.hardware.IHwRelativeKnob)2 INoteClip (de.mossgrabers.framework.daw.INoteClip)2