Search in sources :

Example 66 with ModeManager

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

the class AbstractParametersMode method getButtonColorArrowUp.

protected int getButtonColorArrowUp(final ButtonID buttonID) {
    final ModeManager modeManager = this.surface.getModeManager();
    final boolean isDeviceParams = modeManager.isActive(Modes.DEVICE_PARAMS);
    switch(buttonID) {
        case ROW1_1:
            if (isDeviceParams && ((ParametersMode) modeManager.get(Modes.DEVICE_PARAMS)).isShowDevices())
                return SLMkIIIColorManager.SLMKIII_MINT;
            return SLMkIIIColorManager.SLMKIII_MINT_HALF;
        case ROW1_2:
            if (isDeviceParams && !((ParametersMode) modeManager.get(Modes.DEVICE_PARAMS)).isShowDevices())
                return SLMkIIIColorManager.SLMKIII_PURPLE;
            return SLMkIIIColorManager.SLMKIII_PURPLE_HALF;
        case ROW1_8:
            return modeManager.isActive(Modes.USER) ? SLMkIIIColorManager.SLMKIII_WHITE : SLMkIIIColorManager.SLMKIII_WHITE_HALF;
        default:
            return SLMkIIIColorManager.SLMKIII_BLACK;
    }
}
Also used : ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Example 67 with ModeManager

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

the class AbstractParametersMode method drawRow4ArrowUp.

/**
 * Draw the row with the mode selection.
 *
 * @param d The display
 */
protected void drawRow4ArrowUp(final SLMkIIIDisplay d) {
    final ModeManager modeManager = this.surface.getModeManager();
    for (int i = 0; i < 8; i++) {
        d.setCell(3, i, MODE_MENU[i]);
        boolean isActive = false;
        int color = SLMkIIIColorManager.SLMKIII_BLACK;
        final boolean isDeviceParams = modeManager.isActive(Modes.DEVICE_PARAMS);
        switch(i) {
            case 0:
                if (isDeviceParams && ((ParametersMode) modeManager.get(Modes.DEVICE_PARAMS)).isShowDevices())
                    isActive = true;
                color = SLMkIIIColorManager.SLMKIII_MINT;
                break;
            case 1:
                if (isDeviceParams && !((ParametersMode) modeManager.get(Modes.DEVICE_PARAMS)).isShowDevices())
                    isActive = true;
                color = SLMkIIIColorManager.SLMKIII_PURPLE;
                break;
            case 7:
                isActive = modeManager.isActive(Modes.USER);
                color = SLMkIIIColorManager.SLMKIII_WHITE;
                break;
            default:
                // Not used
                break;
        }
        d.setPropertyColor(i, 2, color);
        d.setPropertyValue(i, 1, isActive ? 1 : 0);
    }
}
Also used : ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Example 68 with ModeManager

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

the class AbstractParametersMode method onButtonArrowUp.

protected void onButtonArrowUp(final int index) {
    final ModeManager modeManager = this.surface.getModeManager();
    switch(index) {
        case 0:
            this.surface.getModeManager().setActive(Modes.DEVICE_PARAMS);
            ((ParametersMode) modeManager.get(Modes.DEVICE_PARAMS)).setShowDevices(true);
            break;
        case 1:
            this.surface.getModeManager().setActive(Modes.DEVICE_PARAMS);
            ((ParametersMode) modeManager.get(Modes.DEVICE_PARAMS)).setShowDevices(false);
            break;
        case 7:
            this.surface.getModeManager().setActive(Modes.USER);
            break;
        default:
            // Not used
            break;
    }
    this.surface.setTriggerConsumed(ButtonID.ARROW_UP);
}
Also used : ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Example 69 with ModeManager

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

the class DrumView method onButton.

/**
 * {@inheritDoc}
 */
@Override
public void onButton(final ButtonID buttonID, final ButtonEvent event, final int velocity) {
    if (!ButtonID.isSceneButton(buttonID) || event != ButtonEvent.DOWN)
        return;
    if (buttonID == ButtonID.SCENE1) {
        this.isPlayMode = !this.isPlayMode;
        this.updateNoteMapping();
        this.surface.getDisplay().notify(this.isPlayMode ? "Play / Select" : "Steps");
    } else {
        if (!this.isActive())
            return;
        final ModeManager modeManager = this.surface.getModeManager();
        if (modeManager.isActive(Modes.GROOVE))
            modeManager.restore();
        else
            modeManager.setActive(Modes.GROOVE);
    }
}
Also used : ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Example 70 with ModeManager

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

the class AbstractTrackMode method getButtonColor.

/**
 * {@inheritDoc}
 */
@Override
public int getButtonColor(final ButtonID buttonID) {
    final ITrackBank tb = this.model.getCurrentTrackBank();
    final Optional<ITrack> selectedTrack = tb.getSelectedItem();
    if (this.surface.isShiftPressed()) {
        switch(buttonID) {
            case ROW1_1:
                if (selectedTrack.isEmpty())
                    return SLMkIIIColorManager.SLMKIII_BLACK;
                return selectedTrack.get().isActivated() ? SLMkIIIColorManager.SLMKIII_RED : SLMkIIIColorManager.SLMKIII_RED_HALF;
            case ROW1_2:
                if (selectedTrack.isEmpty())
                    return SLMkIIIColorManager.SLMKIII_BLACK;
                return this.model.getCursorTrack().isPinned() ? SLMkIIIColorManager.SLMKIII_RED : SLMkIIIColorManager.SLMKIII_RED_HALF;
            case ROW1_3:
                if (selectedTrack.isEmpty())
                    return SLMkIIIColorManager.SLMKIII_BLACK;
                return SLMkIIIColorManager.SLMKIII_RED_HALF;
            case ROW1_4:
                return SLMkIIIColorManager.SLMKIII_BLACK;
            default:
                return SLMkIIIColorManager.SLMKIII_RED_HALF;
        }
    }
    final int index = buttonID.ordinal() - ButtonID.ROW1_1.ordinal();
    if (this.surface.isLongPressed(ButtonID.ARROW_DOWN)) {
        final ModeManager modeManager = this.surface.getModeManager();
        return modeManager.isActive(MODES[index]) ? SLMkIIIColorManager.SLMKIII_GREEN : SLMkIIIColorManager.SLMKIII_GREEN_HALF;
    }
    final ITrack t = tb.getItem(index);
    if (t.doesExist()) {
        if (t.isSelected()) {
            final String colorIndex = DAWColor.getColorIndex(t.getColor());
            return this.model.getColorManager().getColorIndex(colorIndex);
        }
        return SLMkIIIColorManager.SLMKIII_WHITE_HALF;
    }
    return SLMkIIIColorManager.SLMKIII_BLACK;
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank) 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