Search in sources :

Example 1 with MaschineSendSelectCommand

use of de.mossgrabers.controller.ni.maschine.mk3.command.trigger.MaschineSendSelectCommand in project DrivenByMoss by git-moss.

the class MaschineControllerSetup method registerDisplayButtons.

private void registerDisplayButtons(final MaschineControlSurface surface, final ModeManager modeManager) {
    if (!this.maschine.hasMCUDisplay())
        return;
    this.addButton(ButtonID.ROW2_1, "Volume", new ModeSelectCommand<>(this.model, surface, Modes.VOLUME), MaschineControlSurface.MODE_BUTTON_1, () -> modeManager.isActive(Modes.VOLUME));
    this.addButton(ButtonID.ROW2_2, "Pan", new ModeSelectCommand<>(this.model, surface, Modes.PAN), MaschineControlSurface.MODE_BUTTON_2, () -> modeManager.isActive(Modes.PAN));
    final MaschineSendSelectCommand sendSelectCommand = new MaschineSendSelectCommand(this.model, surface);
    this.addButton(ButtonID.ROW2_3, "Send -", (event, velocity) -> sendSelectCommand.executeShifted(event), MaschineControlSurface.MODE_BUTTON_3, () -> Modes.isSendMode(modeManager.getActiveID()));
    this.addButton(ButtonID.ROW2_4, "Send +", sendSelectCommand, MaschineControlSurface.MODE_BUTTON_4, () -> Modes.isSendMode(modeManager.getActiveID()));
    this.addButton(ButtonID.ROW2_5, "Pin", (event, velocity) -> {
        if (event != ButtonEvent.DOWN)
            return;
        if (modeManager.isActive(Modes.DEVICE_PARAMS))
            this.model.getCursorDevice().togglePinned();
        else
            this.model.getCursorTrack().togglePinned();
    }, MaschineControlSurface.MODE_BUTTON_5, () -> {
        if (modeManager.isActive(Modes.DEVICE_PARAMS))
            return this.model.getCursorDevice().isPinned();
        return this.model.getCursorTrack().isPinned();
    });
    this.addButton(ButtonID.ROW2_6, "Active", (event, velocity) -> {
        if (event != ButtonEvent.DOWN)
            return;
        if (modeManager.isActive(Modes.DEVICE_PARAMS))
            this.model.getCursorDevice().toggleEnabledState();
        else
            this.model.getCursorTrack().toggleIsActivated();
    }, MaschineControlSurface.MODE_BUTTON_6, () -> {
        if (modeManager.isActive(Modes.DEVICE_PARAMS))
            return this.model.getCursorDevice().isEnabled();
        final ITrack selectedTrack = this.model.getCursorTrack();
        return selectedTrack.doesExist() && selectedTrack.isActivated();
    });
    // This button is mapped as Note not CC since it requires at least 1 MCU button to make
    // the MCU display activate!
    this.addButton(ButtonID.ROW2_7, "User Params", new ModeSelectCommand<>(this.model, surface, Modes.USER), MaschineControlSurface.MODE_BUTTON_7, () -> modeManager.isActive(Modes.USER));
    this.addButton(ButtonID.ROW2_8, "Parameters", new ModeSelectCommand<>(this.model, surface, Modes.DEVICE_PARAMS), MaschineControlSurface.MODE_BUTTON_8, () -> modeManager.isActive(Modes.DEVICE_PARAMS));
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) MaschineSendSelectCommand(de.mossgrabers.controller.ni.maschine.mk3.command.trigger.MaschineSendSelectCommand)

Aggregations

MaschineSendSelectCommand (de.mossgrabers.controller.ni.maschine.mk3.command.trigger.MaschineSendSelectCommand)1 ITrack (de.mossgrabers.framework.daw.data.ITrack)1