Search in sources :

Example 36 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() {
    final IPadGrid padGrid = this.surface.getPadGrid();
    final IDrumDevice primary = this.model.getDrumDevice();
    if (this.isPlayMode) {
        for (int y = 0; y < 2; y++) {
            for (int x = 0; x < 8; x++) {
                final int index = 8 * y + x;
                padGrid.lightEx(x, 1 - y, this.getDrumPadColor(index, primary, false));
            }
        }
        return;
    }
    if (!this.isActive()) {
        padGrid.turnOff();
        return;
    }
    // Paint the sequencer steps
    final INoteClip clip = this.getClip();
    final int step = clip.getCurrentStep();
    final int hiStep = this.isInXRange(step) ? step % this.sequencerSteps : -1;
    final int offsetY = this.scales.getDrumOffset();
    final int editMidiChannel = this.configuration.getMidiEditChannel();
    final int selPad = this.getSelectedPad();
    final List<GridStep> editNotes = this.getEditNotes();
    for (int col = 0; col < DrumView.NUM_DISPLAY_COLS; col++) {
        final int noteRow = offsetY + selPad;
        final IStepInfo stepInfo = clip.getStep(editMidiChannel, col, noteRow);
        final boolean hilite = col == hiStep;
        final int x = col % GRID_COLUMNS;
        final int y = col / GRID_COLUMNS;
        final Optional<ColorEx> rowColor = this.getPadColor(primary, this.selectedPad);
        padGrid.lightEx(x, y, this.getStepColor(stepInfo, hilite, rowColor, editMidiChannel, col, noteRow, editNotes));
    }
}
Also used : IPadGrid(de.mossgrabers.framework.controller.grid.IPadGrid) IDrumDevice(de.mossgrabers.framework.daw.data.IDrumDevice) ColorEx(de.mossgrabers.framework.controller.color.ColorEx) GridStep(de.mossgrabers.framework.daw.data.GridStep) IStepInfo(de.mossgrabers.framework.daw.IStepInfo) INoteClip(de.mossgrabers.framework.daw.INoteClip)

Example 37 with IPadGrid

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

the class SessionView method drawGrid.

/**
 * {@inheritDoc}
 */
@Override
public void drawGrid() {
    super.drawGrid();
    if (this.isControlModeOff())
        return;
    final ITrackBank tb = this.model.getCurrentTrackBank();
    final IPadGrid pads = this.surface.getPadGrid();
    final boolean flipSession = this.configuration.isFlipSession();
    for (int x = 0; x < 8; x++) {
        final int padX = flipSession ? 7 : x;
        final int padY = flipSession ? x : 7;
        pads.lightEx(padX, padY, this.getModeColor(tb.getItem(x), x));
    }
}
Also used : IPadGrid(de.mossgrabers.framework.controller.grid.IPadGrid) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank)

Example 38 with IPadGrid

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

the class ShiftView method drawGrid.

/**
 * {@inheritDoc}
 */
@Override
public void drawGrid() {
    final IPadGrid padGrid = this.surface.getPadGrid();
    for (int i = 36; i < 92; i++) padGrid.light(i, MaschineColorManager.COLOR_BLACK);
    padGrid.light(92, MaschineColorManager.COLOR_RED_LO);
    padGrid.light(93, MaschineColorManager.COLOR_GREEN_LO);
    padGrid.light(94, MaschineColorManager.COLOR_LIME_LO);
    padGrid.light(95, MaschineColorManager.COLOR_LIME_LO);
    padGrid.light(96, MaschineColorManager.COLOR_MAGENTA_LO);
    padGrid.light(97, MaschineColorManager.COLOR_MAGENTA_LO);
    padGrid.light(98, MaschineColorManager.COLOR_ROSE);
    padGrid.light(99, MaschineColorManager.COLOR_ROSE);
}
Also used : IPadGrid(de.mossgrabers.framework.controller.grid.IPadGrid)

Example 39 with IPadGrid

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

the class SceneView method drawGrid.

/**
 * {@inheritDoc}
 */
@Override
public void drawGrid() {
    final IPadGrid padGrid = this.surface.getPadGrid();
    final ISceneBank sceneBank = this.model.getSceneBank();
    for (int i = 0; i < 16; i++) {
        final IScene item = sceneBank.getItem(i);
        final int x = i % 4;
        final int y = 3 - i / 4;
        if (item.doesExist()) {
            if (item.isSelected())
                padGrid.lightEx(x, y, MaschineColorManager.COLOR_WHITE);
            else
                padGrid.lightEx(x, y, DAWColor.getColorIndex(item.getColor()));
        } else
            padGrid.lightEx(x, y, AbstractFeatureGroup.BUTTON_COLOR_OFF);
    }
}
Also used : IPadGrid(de.mossgrabers.framework.controller.grid.IPadGrid) ISceneBank(de.mossgrabers.framework.daw.data.bank.ISceneBank) IScene(de.mossgrabers.framework.daw.data.IScene)

Example 40 with IPadGrid

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

the class DrumConfigView method drawGrid.

/**
 * {@inheritDoc}
 */
@Override
public void drawGrid() {
    final DrumView view = (DrumView) this.surface.getViewManager().get(Views.DRUM);
    final INoteClip clip = view.getClip();
    final IPadGrid padGrid = this.surface.getPadGrid();
    for (int x = 0; x < 8; x++) padGrid.lightEx(x, 0, view.getResolutionIndex() == x ? LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_BLUE_HI : LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_BLUE_LO);
    padGrid.lightEx(0, 1, clip.canScrollStepsBackwards() ? LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_LIME_HI : LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_LIME_LO);
    padGrid.lightEx(1, 1, clip.canScrollStepsForwards() ? LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_LIME_HI : LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_LIME_LO);
    padGrid.lightEx(2, 1, LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_BLACK);
    padGrid.lightEx(3, 1, LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_BLACK);
    padGrid.lightEx(4, 1, LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_BLACK);
    padGrid.lightEx(5, 1, LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_BLACK);
    padGrid.lightEx(6, 1, LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_BLACK);
    padGrid.lightEx(7, 1, LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_BLACK);
}
Also used : IPadGrid(de.mossgrabers.framework.controller.grid.IPadGrid) INoteClip(de.mossgrabers.framework.daw.INoteClip)

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