Search in sources :

Example 11 with MaschineConfiguration

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

the class MainKnobRowModeCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final int value) {
    if (this.surface.isPressed(ButtonID.SCENE1)) {
        this.switchPage(ButtonID.SCENE1, this.model.getSceneBank(), value);
        return;
    }
    if (this.surface.isPressed(ButtonID.CLIP)) {
        final Optional<ITrack> selectedTrack = this.model.getCurrentTrackBank().getSelectedItem();
        if (selectedTrack.isPresent())
            this.switchPage(ButtonID.CLIP, selectedTrack.get().getSlotBank(), value);
        return;
    }
    if (this.surface.isPressed(ButtonID.TRACK)) {
        this.switchPage(ButtonID.TRACK, this.model.getCurrentTrackBank(), value);
        return;
    }
    if (this.surface.isPressed(ButtonID.SOLO)) {
        this.switchPage(ButtonID.SOLO, this.model.getCurrentTrackBank(), value);
        return;
    }
    if (this.surface.isPressed(ButtonID.MUTE)) {
        this.switchPage(ButtonID.MUTE, this.model.getCurrentTrackBank(), value);
        return;
    }
    if (this.surface.isPressed(ButtonID.ACCENT)) {
        final int speed = this.model.getValueChanger().decode(value);
        this.surface.setTriggerConsumed(ButtonID.ACCENT);
        final MaschineConfiguration configuration = this.surface.getConfiguration();
        final int v = Math.min(Math.max(1, configuration.getFixedAccentValue() + speed), 127);
        configuration.setFixedAccentValue(v);
        this.surface.getDisplay().notify("Fixed Accent: " + v);
        return;
    }
    super.execute(value);
}
Also used : MaschineConfiguration(de.mossgrabers.controller.ni.maschine.mk3.MaschineConfiguration) ITrack(de.mossgrabers.framework.daw.data.ITrack)

Example 12 with MaschineConfiguration

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

the class PlayConfigurationMode method update.

private void update() {
    this.surface.getViewManager().get(Views.PLAY).updateNoteMapping();
    final MaschineConfiguration config = this.surface.getConfiguration();
    final Scales scales = this.model.getScales();
    config.setScale(scales.getScale().getName());
    config.setScaleBase(Scales.BASES.get(scales.getScaleOffset()));
    config.setScaleLayout(scales.getScaleLayout().getName());
}
Also used : MaschineConfiguration(de.mossgrabers.controller.ni.maschine.mk3.MaschineConfiguration) Scales(de.mossgrabers.framework.scale.Scales)

Aggregations

MaschineConfiguration (de.mossgrabers.controller.ni.maschine.mk3.MaschineConfiguration)10 RibbonMode (de.mossgrabers.controller.ni.maschine.core.RibbonMode)3 TouchstripCommand (de.mossgrabers.controller.ni.maschine.mk3.command.continuous.TouchstripCommand)2 MaschineControlSurface (de.mossgrabers.controller.ni.maschine.mk3.controller.MaschineControlSurface)2 StudioEncoderModeManager (de.mossgrabers.controller.ni.maschine.mk3.controller.StudioEncoderModeManager)2 IHost (de.mossgrabers.framework.daw.IHost)2 ITrack (de.mossgrabers.framework.daw.data.ITrack)2 ModeManager (de.mossgrabers.framework.featuregroup.ModeManager)2 ViewManager (de.mossgrabers.framework.featuregroup.ViewManager)2 MaschineMonitorEncoderCommand (de.mossgrabers.controller.ni.maschine.core.command.trigger.MaschineMonitorEncoderCommand)1 MainKnobRowModeCommand (de.mossgrabers.controller.ni.maschine.mk3.command.continuous.MainKnobRowModeCommand)1 AddDeviceCommand (de.mossgrabers.controller.ni.maschine.mk3.command.trigger.AddDeviceCommand)1 KeyboardCommand (de.mossgrabers.controller.ni.maschine.mk3.command.trigger.KeyboardCommand)1 MaschineSelectButtonCommand (de.mossgrabers.controller.ni.maschine.mk3.command.trigger.MaschineSelectButtonCommand)1 MaschineStopCommand (de.mossgrabers.controller.ni.maschine.mk3.command.trigger.MaschineStopCommand)1 PadModeCommand (de.mossgrabers.controller.ni.maschine.mk3.command.trigger.PadModeCommand)1 ProjectButtonCommand (de.mossgrabers.controller.ni.maschine.mk3.command.trigger.ProjectButtonCommand)1 RibbonCommand (de.mossgrabers.controller.ni.maschine.mk3.command.trigger.RibbonCommand)1 SwingCommand (de.mossgrabers.controller.ni.maschine.mk3.command.trigger.SwingCommand)1 TempoCommand (de.mossgrabers.controller.ni.maschine.mk3.command.trigger.TempoCommand)1