Search in sources :

Example 71 with ModeManager

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

the class AbstractTrackMode method drawRow4.

/**
 * Draw the row with track names.
 */
protected void drawRow4() {
    final SLMkIIIDisplay d = this.surface.getDisplay();
    final ITrackBank tb = this.model.getCurrentTrackBank();
    final Optional<ITrack> selectedTrack = tb.getSelectedItem();
    if (this.surface.isShiftPressed()) {
        this.drawRow4Shifted(d, selectedTrack.isPresent() ? selectedTrack.get() : EmptyTrack.INSTANCE);
        return;
    }
    if (this.surface.isLongPressed(ButtonID.ARROW_DOWN)) {
        final ModeManager modeManager = this.surface.getModeManager();
        for (int i = 0; i < 8; i++) {
            d.setCell(3, i, MODE_MENU[i]);
            d.setPropertyColor(i, 2, SLMkIIIColorManager.SLMKIII_GREEN);
            d.setPropertyValue(i, 1, modeManager.isActive(MODES[i]) ? 1 : 0);
        }
        return;
    }
    // Format track names
    for (int i = 0; i < 8; i++) {
        final ITrack t = tb.getItem(i);
        d.setCell(3, i, StringUtils.shortenAndFixASCII(t.getName(9), 9));
        final boolean exists = t.doesExist();
        int color;
        if (t.isActivated()) {
            final String colorIndex = DAWColor.getColorIndex(t.getColor());
            color = this.model.getColorManager().getColorIndex(colorIndex);
        } else
            color = SLMkIIIColorManager.SLMKIII_DARK_GREY;
        d.setPropertyColor(i, 2, color);
        d.setPropertyValue(i, 1, exists && t.isSelected() ? 1 : 0);
    }
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank) SLMkIIIDisplay(de.mossgrabers.controller.novation.slmkiii.controller.SLMkIIIDisplay) ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Example 72 with ModeManager

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

the class AbstractTrackMode method handleSendEffect.

/**
 * Handle the selection of a send effect.
 *
 * @param sendIndex The index of the send
 */
protected void handleSendEffect(final int sendIndex) {
    final ITrackBank tb = this.model.getCurrentTrackBank();
    if (tb == null || !tb.canEditSend(sendIndex))
        return;
    final Modes si = Modes.get(Modes.SEND1, sendIndex);
    final ModeManager modeManager = this.surface.getModeManager();
    modeManager.setActive(modeManager.isActive(si) ? Modes.TRACK : si);
}
Also used : Modes(de.mossgrabers.framework.mode.Modes) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank) ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Example 73 with ModeManager

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

the class PlayView method onButtonRow1.

/**
 * {@inheritDoc}
 */
@Override
public void onButtonRow1(final int index, final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    final ModeManager modeManager = this.surface.getModeManager();
    final Modes activeModeId = modeManager.getActiveID();
    if (Modes.VIEW_SELECT == activeModeId) {
        if (index == 0) {
            this.surface.getViewManager().setActive(Views.CONTROL);
            if (Modes.VOLUME.equals(modeManager.getPreviousID()))
                modeManager.restore();
            else
                modeManager.setActive(Modes.TRACK);
        } else
            modeManager.restore();
        this.surface.turnOffTransport();
        return;
    }
    if (!Modes.SESSION.equals(activeModeId))
        modeManager.setActive(Modes.SESSION);
    this.model.getSceneBank().getItem(index).launch();
}
Also used : Modes(de.mossgrabers.framework.mode.Modes) ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Example 74 with ModeManager

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

the class TransportControl method turnOffTransport.

private void turnOffTransport() {
    this.surface.turnOffTransport();
    final ModeManager modeManager = this.surface.getModeManager();
    if (modeManager.isActive(Modes.VIEW_SELECT))
        modeManager.restore();
}
Also used : ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Example 75 with ModeManager

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

the class ControlView method onButtonRow1Select.

/**
 * {@inheritDoc}
 */
@Override
public void onButtonRow1Select() {
    final ModeManager modeManager = this.surface.getModeManager();
    final boolean selectFixed = Modes.FUNCTIONS.equals(modeManager.getActiveID());
    modeManager.setActive(selectFixed ? Modes.FIXED : Modes.FUNCTIONS);
    this.model.getHost().showNotification(selectFixed ? "Fixed Length" : "Functions");
}
Also used : 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