Search in sources :

Example 41 with IPadGrid

use of de.mossgrabers.framework.controller.grid.IPadGrid in project DrivenByMoss by git-moss.

the class PadModeSelectView method drawGrid.

/**
 * {@inheritDoc}
 */
@Override
public void drawGrid() {
    final IPadGrid pads = this.surface.getPadGrid();
    for (int x = 0; x < 8; x++) pads.lightEx(x, 0, LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_BLACK);
    final SessionView view = (SessionView) this.surface.getViewManager().get(Views.SESSION);
    final Modes padMode = view.getPadMode();
    pads.lightEx(0, 1, padMode == null ? LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_GREEN_HI : LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_GREEN_LO);
    pads.lightEx(1, 1, padMode == Modes.REC_ARM ? LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_RED_HI : LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_RED_LO);
    pads.lightEx(2, 1, padMode == Modes.TRACK_SELECT ? LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_WHITE : LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_GREY_LO);
    pads.lightEx(3, 1, padMode == Modes.MUTE ? LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_AMBER_HI : LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_AMBER_LO);
    pads.lightEx(4, 1, padMode == Modes.SOLO ? LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_YELLOW_HI : LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_YELLOW_LO);
    pads.lightEx(5, 1, padMode == Modes.STOP_CLIP ? LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_PINK_HI : LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_ROSE);
    pads.lightEx(6, 1, LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_BLACK);
    pads.lightEx(7, 1, LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_BLACK);
}
Also used : IPadGrid(de.mossgrabers.framework.controller.grid.IPadGrid) Modes(de.mossgrabers.framework.mode.Modes)

Example 42 with IPadGrid

use of de.mossgrabers.framework.controller.grid.IPadGrid in project DrivenByMoss by git-moss.

the class DrumView method drawShiftedGrid.

private void drawShiftedGrid() {
    final boolean isKeyboardEnabled = this.model.canSelectedTrackHoldNotes();
    final IPadGrid padGrid = this.surface.getPadGrid();
    for (int i = 36; i < 50; i++) padGrid.light(i, MaschineColorManager.COLOR_BLACK);
    for (int i = 50; i < 52; i++) padGrid.light(i, isKeyboardEnabled ? MaschineColorManager.COLOR_SKIN : MaschineColorManager.COLOR_BLACK);
}
Also used : IPadGrid(de.mossgrabers.framework.controller.grid.IPadGrid)

Example 43 with IPadGrid

use of de.mossgrabers.framework.controller.grid.IPadGrid in project DrivenByMoss by git-moss.

the class DrumView method drawGrid.

/**
 * {@inheritDoc}
 */
@Override
public void drawGrid() {
    if (this.isGridEditor) {
        final IPadGrid padGrid = this.surface.getPadGrid();
        for (int i = 0; i < 8; i++) padGrid.light(36 + i, this.getButtonColorID(ButtonID.get(ButtonID.SCENE1, 7 - i)));
        for (int i = 8; i < 12; i++) padGrid.light(36 + i, MaschineColorManager.COLOR_BLACK);
        for (int i = 12; i < 14; i++) padGrid.light(36 + i, MaschineColorManager.COLOR_BLUE);
        for (int i = 14; i < 16; i++) padGrid.light(36 + i, MaschineColorManager.COLOR_BLACK);
        return;
    }
    if (this.isSequencerVisible) {
        final INoteClip clip = this.getClip();
        final boolean isActive = this.isActive();
        final IDrumDevice primary = this.model.getDrumDevice();
        this.drawSequencerSteps(clip, isActive, this.scales.getDrumOffset() + this.selectedPad, this.getPadColor(primary, this.selectedPad), y -> 3 - y);
        return;
    }
    if (this.isShifted)
        this.drawShiftedGrid();
    else
        super.drawGrid();
}
Also used : IPadGrid(de.mossgrabers.framework.controller.grid.IPadGrid) IDrumDevice(de.mossgrabers.framework.daw.data.IDrumDevice) INoteClip(de.mossgrabers.framework.daw.INoteClip)

Example 44 with IPadGrid

use of de.mossgrabers.framework.controller.grid.IPadGrid in project DrivenByMoss by git-moss.

the class MuteView method drawGrid.

/**
 * {@inheritDoc}
 */
@Override
public void drawGrid() {
    final IPadGrid padGrid = this.surface.getPadGrid();
    final ITrackBank tb = this.model.getCurrentTrackBank();
    for (int i = 0; i < 16; i++) {
        final ITrack item = tb.getItem(i);
        final int x = i % 4;
        final int y = 3 - i / 4;
        if (item.doesExist()) {
            final int colorIndex = this.colorManager.getColorIndex(DAWColor.getColorIndex(item.getColor()));
            if (item.isMute())
                padGrid.lightEx(x, y, colorIndex, MaschineColorManager.COLOR_DARK_GREY, false);
            else
                padGrid.lightEx(x, y, colorIndex);
        } else
            padGrid.lightEx(x, y, AbstractFeatureGroup.BUTTON_COLOR_OFF);
    }
}
Also used : IPadGrid(de.mossgrabers.framework.controller.grid.IPadGrid) ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank)

Example 45 with IPadGrid

use of de.mossgrabers.framework.controller.grid.IPadGrid in project DrivenByMoss by git-moss.

the class ParameterView method drawGrid.

/**
 * {@inheritDoc}
 */
@Override
public void drawGrid() {
    final IPadGrid padGrid = this.surface.getPadGrid();
    for (int i = 8; i < 12; i++) padGrid.lightEx(i % 4, 3 - i / 4, AbstractFeatureGroup.BUTTON_COLOR_OFF);
    final ICursorDevice cursorDevice = this.model.getCursorDevice();
    final boolean doesExist = cursorDevice.doesExist();
    padGrid.lightEx(0, 0, doesExist && cursorDevice.canSelectPreviousFX() ? MaschineColorManager.COLOR_ROSE : MaschineColorManager.COLOR_BLACK);
    padGrid.lightEx(1, 0, doesExist && cursorDevice.canSelectNextFX() ? MaschineColorManager.COLOR_ROSE : MaschineColorManager.COLOR_BLACK);
    final IParameterBank parameterBank = cursorDevice.getParameterBank();
    padGrid.lightEx(2, 0, doesExist && parameterBank.canScrollBackwards() ? MaschineColorManager.COLOR_SKIN : MaschineColorManager.COLOR_BLACK);
    padGrid.lightEx(3, 0, doesExist && parameterBank.canScrollForwards() ? MaschineColorManager.COLOR_SKIN : MaschineColorManager.COLOR_BLACK);
    final SelectedDeviceMode<?, ?> deviceMode = (SelectedDeviceMode<?, ?>) this.surface.getModeManager().get(Modes.DEVICE_PARAMS);
    for (int i = 0; i < 8; i++) {
        final int x = i % 4;
        final int y = 2 + i / 4;
        final IParameter item = parameterBank.getItem(i);
        if (item.doesExist()) {
            final int color = MaschineColorManager.PARAM_COLORS.get(i).intValue();
            if (i == deviceMode.getSelectedParameter())
                padGrid.lightEx(x, y, color, MaschineColorManager.COLOR_WHITE, false);
            else
                padGrid.lightEx(x, y, color);
        } else
            padGrid.lightEx(x, y, AbstractFeatureGroup.BUTTON_COLOR_OFF);
    }
}
Also used : IPadGrid(de.mossgrabers.framework.controller.grid.IPadGrid) IParameter(de.mossgrabers.framework.daw.data.IParameter) IParameterBank(de.mossgrabers.framework.daw.data.bank.IParameterBank) SelectedDeviceMode(de.mossgrabers.framework.mode.device.SelectedDeviceMode) ICursorDevice(de.mossgrabers.framework.daw.data.ICursorDevice)

Aggregations

IPadGrid (de.mossgrabers.framework.controller.grid.IPadGrid)50 INoteClip (de.mossgrabers.framework.daw.INoteClip)13 ITrack (de.mossgrabers.framework.daw.data.ITrack)11 ITrackBank (de.mossgrabers.framework.daw.data.bank.ITrackBank)10 IStepInfo (de.mossgrabers.framework.daw.IStepInfo)7 GridStep (de.mossgrabers.framework.daw.data.GridStep)7 IDrumDevice (de.mossgrabers.framework.daw.data.IDrumDevice)7 ColorEx (de.mossgrabers.framework.controller.color.ColorEx)4 ITransport (de.mossgrabers.framework.daw.ITransport)3 ICursorDevice (de.mossgrabers.framework.daw.data.ICursorDevice)3 INoteRepeat (de.mossgrabers.framework.daw.midi.INoteRepeat)3 StepState (de.mossgrabers.framework.daw.StepState)2 IScene (de.mossgrabers.framework.daw.data.IScene)2 IParameterPageBank (de.mossgrabers.framework.daw.data.bank.IParameterPageBank)2 ISceneBank (de.mossgrabers.framework.daw.data.bank.ISceneBank)2 Views (de.mossgrabers.framework.view.Views)2 LaunchpadConfiguration (de.mossgrabers.controller.novation.launchpad.LaunchpadConfiguration)1 LightInfo (de.mossgrabers.framework.controller.grid.LightInfo)1 DAWColor (de.mossgrabers.framework.daw.DAWColor)1 IHost (de.mossgrabers.framework.daw.IHost)1