Search in sources :

Example 11 with ModeManager

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

the class MaschineSendSelectCommand method executeShifted.

/**
 * {@inheritDoc}
 */
@Override
public void executeShifted(final ButtonEvent event) {
    final ModeManager modeManager = this.surface.getModeManager();
    final Modes activeMode = modeManager.getActiveID();
    super.executeShifted(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 12 with ModeManager

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

the class KontrolProtocolControllerSetup method createModes.

/**
 * {@inheritDoc}
 */
@Override
protected void createModes() {
    final KontrolProtocolControlSurface surface = this.getSurface();
    final ModeManager modeManager = surface.getModeManager();
    final List<ContinuousID> controls = ContinuousID.createSequentialList(ContinuousID.KNOB1, 8);
    controls.addAll(ContinuousID.createSequentialList(ContinuousID.FADER1, 8));
    modeManager.register(Modes.VOLUME, new MixerMode(surface, this.model, controls));
    modeManager.register(Modes.SEND, new SendMode(surface, this.model, controls));
    modeManager.register(Modes.DEVICE_PARAMS, new ParamsMode(surface, this.model, controls));
}
Also used : ContinuousID(de.mossgrabers.framework.controller.ContinuousID) ParamsMode(de.mossgrabers.controller.ni.kontrol.mkii.mode.ParamsMode) SendMode(de.mossgrabers.controller.ni.kontrol.mkii.mode.SendMode) MixerMode(de.mossgrabers.controller.ni.kontrol.mkii.mode.MixerMode) KontrolProtocolControlSurface(de.mossgrabers.controller.ni.kontrol.mkii.controller.KontrolProtocolControlSurface) ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Example 13 with ModeManager

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

the class SLMkIIIControllerSetup method createModes.

/**
 * {@inheritDoc}
 */
@Override
protected void createModes() {
    final SLMkIIIControlSurface surface = this.getSurface();
    final ModeManager modeManager = surface.getModeManager();
    // Required for button combinations in modes
    this.addButton(ButtonID.DELETE, "Clear", NopCommand.INSTANCE, 15, SLMkIIIControlSurface.MKIII_CLEAR, () -> surface.isPressed(ButtonID.DELETE) ? SLMkIIIColorManager.SLMKIII_AMBER : SLMkIIIColorManager.SLMKIII_AMBER_HALF);
    modeManager.register(Modes.TRACK, new SLMkIIITrackMode(surface, this.model));
    modeManager.register(Modes.VOLUME, new SLMkIIIVolumeMode(surface, this.model));
    modeManager.register(Modes.PAN, new SLMkIIIPanMode(surface, this.model));
    for (int i = 0; i < 8; i++) modeManager.register(Modes.get(Modes.SEND1, i), new SLMkIIISendMode(i, surface, this.model));
    modeManager.register(Modes.DEVICE_PARAMS, new ParametersMode(surface, this.model));
    modeManager.register(Modes.BROWSER, new BrowserMode(surface, this.model));
    modeManager.register(Modes.USER, new UserMode(surface, this.model));
    modeManager.register(Modes.FUNCTIONS, new OptionsMode(surface, this.model));
    modeManager.register(Modes.GROOVE, new SequencerResolutionMode(surface, this.model));
    modeManager.register(Modes.NOTE, new NoteMode(surface, this.model));
}
Also used : NoteMode(de.mossgrabers.controller.novation.slmkiii.mode.NoteMode) SLMkIIIPanMode(de.mossgrabers.controller.novation.slmkiii.mode.track.SLMkIIIPanMode) SLMkIIIControlSurface(de.mossgrabers.controller.novation.slmkiii.controller.SLMkIIIControlSurface) ParametersMode(de.mossgrabers.controller.novation.slmkiii.mode.device.ParametersMode) OptionsMode(de.mossgrabers.controller.novation.slmkiii.mode.OptionsMode) SequencerResolutionMode(de.mossgrabers.controller.novation.slmkiii.mode.SequencerResolutionMode) BrowserMode(de.mossgrabers.controller.novation.slmkiii.mode.BrowserMode) SLMkIIITrackMode(de.mossgrabers.controller.novation.slmkiii.mode.track.SLMkIIITrackMode) UserMode(de.mossgrabers.controller.novation.slmkiii.mode.device.UserMode) SLMkIIIVolumeMode(de.mossgrabers.controller.novation.slmkiii.mode.track.SLMkIIIVolumeMode) ModeManager(de.mossgrabers.framework.featuregroup.ModeManager) SLMkIIISendMode(de.mossgrabers.controller.novation.slmkiii.mode.track.SLMkIIISendMode)

Example 14 with ModeManager

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

the class PlayView method onButtonRow2.

/**
 * {@inheritDoc}
 */
@Override
public void onButtonRow2(final int index, final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    final ModeManager modeManager = this.surface.getModeManager();
    final Modes cm = modeManager.getActiveID();
    if (!Modes.PLAY_OPTIONS.equals(cm))
        modeManager.setActive(Modes.PLAY_OPTIONS);
    switch(index) {
        // Down
        case 0:
            this.clearPressedKeys();
            this.scales.decDrumOctave();
            this.model.getDrumDevice().getDrumPadBank().selectPreviousPage();
            this.updateNoteMapping();
            this.surface.getDisplay().notify(this.scales.getDrumRangeText());
            break;
        // Up
        case 1:
            this.clearPressedKeys();
            this.scales.incDrumOctave();
            this.model.getDrumDevice().getDrumPadBank().selectNextPage();
            this.updateNoteMapping();
            this.surface.getDisplay().notify(this.scales.getDrumRangeText());
            break;
        case 2:
            this.changeResolution(0);
            this.surface.getDisplay().notify(Resolution.getNameAt(this.selectedResolutionIndex));
            break;
        case 3:
            this.changeResolution(127);
            this.surface.getDisplay().notify(Resolution.getNameAt(this.selectedResolutionIndex));
            break;
        case 4:
            this.changeScrollPosition(0);
            break;
        case 5:
            this.changeScrollPosition(127);
            break;
        case 6:
            break;
        // Toggle play / sequencer
        case 7:
            this.isPlayMode = !this.isPlayMode;
            this.surface.getDisplay().notify(this.isPlayMode ? "Play/Select" : "Sequence");
            this.updateNoteMapping();
            break;
        default:
            // Intentionally empty
            break;
    }
}
Also used : Modes(de.mossgrabers.framework.mode.Modes) ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Example 15 with ModeManager

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

the class MastertrackTouchCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final ButtonEvent event, final int velocity) {
    final boolean isTouched = event != ButtonEvent.UP;
    // Avoid accidentally leaving the browser
    final ModeManager modeManager = this.surface.getModeManager();
    if (modeManager.isActive(Modes.BROWSER))
        return;
    final IMasterTrack masterTrack = this.model.getMasterTrack();
    masterTrack.touchVolume(isTouched);
    if (this.surface.isDeletePressed()) {
        this.surface.setTriggerConsumed(ButtonID.DELETE);
        masterTrack.resetVolume();
        return;
    }
    final boolean isMasterMode = modeManager.isActive(Modes.MASTER);
    if (isTouched && isMasterMode)
        return;
    if (isTouched)
        modeManager.setTemporary(Modes.MASTER_TEMP);
    else if (!isMasterMode)
        modeManager.restore();
}
Also used : IMasterTrack(de.mossgrabers.framework.daw.data.IMasterTrack) 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