Search in sources :

Example 86 with ModeManager

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

the class Kontrol1ControllerSetup method createModes.

/**
 * {@inheritDoc}
 */
@Override
protected void createModes() {
    final Kontrol1ControlSurface surface = this.getSurface();
    final ModeManager modeManager = surface.getModeManager();
    modeManager.register(Modes.TRACK, new TrackMode(surface, this.model));
    modeManager.register(Modes.VOLUME, new VolumeMode(surface, this.model));
    modeManager.register(Modes.DEVICE_PARAMS, new ParamsMode(surface, this.model));
    modeManager.register(Modes.BROWSER, new BrowseMode(surface, this.model));
    modeManager.register(Modes.SCALES, new ScaleMode(surface, this.model));
}
Also used : TrackMode(de.mossgrabers.controller.ni.kontrol.mki.mode.track.TrackMode) ParamsMode(de.mossgrabers.controller.ni.kontrol.mki.mode.device.ParamsMode) Kontrol1ControlSurface(de.mossgrabers.controller.ni.kontrol.mki.controller.Kontrol1ControlSurface) VolumeMode(de.mossgrabers.controller.ni.kontrol.mki.mode.track.VolumeMode) BrowseMode(de.mossgrabers.controller.ni.kontrol.mki.mode.device.BrowseMode) ScaleMode(de.mossgrabers.controller.ni.kontrol.mki.mode.ScaleMode) ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Example 87 with ModeManager

use of de.mossgrabers.framework.featuregroup.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.getActiveID().ordinal();
        if (mode >= Modes.SEND1.ordinal() && mode <= Modes.SEND8.ordinal())
            modeManager.setActive(Modes.PAN);
    }
    // Make sure that a track is selected
    if (!this.model.getCursorTrack().doesExist())
        this.model.getCurrentTrackBank().getItem(0).select();
}
Also used : ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Example 88 with ModeManager

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

the class MoveTrackBankCommand method executeNormal.

/**
 * {@inheritDoc}
 */
@Override
public void executeNormal(final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    final ModeManager modeManager = this.surface.getModeManager();
    if (modeManager.isActive(this.deviceMode)) {
        final ICursorDevice cursorDevice = this.model.getCursorDevice();
        if (this.moveBy1) {
            this.handleBankMovement(cursorDevice.getParameterBank());
            return;
        }
        if (this.moveLeft)
            cursorDevice.selectPrevious();
        else
            cursorDevice.selectNext();
        return;
    }
    if (modeManager.isActive(Modes.MARKERS)) {
        this.handleBankMovement(this.model.getMarkerBank());
        return;
    }
    this.handleBankMovement(this.model.getCurrentTrackBank());
}
Also used : ICursorDevice(de.mossgrabers.framework.daw.data.ICursorDevice) ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Example 89 with ModeManager

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

the class LaunchkeyMiniMk3ControllerSetup method createModes.

/**
 * {@inheritDoc}
 */
@Override
protected void createModes() {
    final LaunchkeyMiniMk3ControlSurface surface = this.getSurface();
    final ModeManager modeManager = surface.getModeManager();
    final BooleanSupplier offSupplier = () -> false;
    modeManager.register(Modes.VOLUME, new TrackVolumeMode<>(surface, this.model, true, AbstractMode.DEFAULT_KNOB_IDS, offSupplier));
    modeManager.register(Modes.PAN, new TrackPanMode<>(surface, this.model, true, AbstractMode.DEFAULT_KNOB_IDS, offSupplier));
    modeManager.register(Modes.SEND1, new TrackSendMode<>(0, surface, this.model, true, AbstractMode.DEFAULT_KNOB_IDS, offSupplier));
    modeManager.register(Modes.SEND2, new TrackSendMode<>(1, surface, this.model, true, AbstractMode.DEFAULT_KNOB_IDS, offSupplier));
    modeManager.register(Modes.DEVICE_PARAMS, new ParameterMode<>(surface, this.model, true, AbstractMode.DEFAULT_KNOB_IDS, offSupplier));
    modeManager.register(Modes.USER, new UserMode<>(surface, this.model, true, ContinuousID.createSequentialList(ContinuousID.DEVICE_KNOB1, 8), offSupplier));
}
Also used : LaunchkeyMiniMk3ControlSurface(de.mossgrabers.controller.novation.launchkey.mini.controller.LaunchkeyMiniMk3ControlSurface) BooleanSupplier(java.util.function.BooleanSupplier) ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Example 90 with ModeManager

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

the class SLControllerSetup method startup.

/**
 * {@inheritDoc}
 */
@Override
public void startup() {
    final SLControlSurface surface = this.getSurface();
    // Initialize 2nd display
    final ModeManager modeManager = surface.getModeManager();
    modeManager.get(Modes.VOLUME).updateDisplay();
    surface.getViewManager().setActive(Views.CONTROL);
    modeManager.setActive(Modes.TRACK);
}
Also used : SLControlSurface(de.mossgrabers.controller.novation.sl.controller.SLControlSurface) 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