Search in sources :

Example 6 with PadGrid

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

the class AbstractPlayView method drawGrid.

/**
 * {@inheritDoc}
 */
@Override
public void drawGrid() {
    final boolean isKeyboardEnabled = this.model.canSelectedTrackHoldNotes();
    final boolean isRecording = this.model.hasRecordingState();
    final IChannelBank tb = this.model.getCurrentTrackBank();
    final ITrack selectedTrack = tb.getSelectedTrack();
    final PadGrid gridPad = this.surface.getPadGrid();
    for (int i = this.scales.getStartNote(); i < this.scales.getEndNote(); i++) gridPad.light(i, this.getGridColor(isKeyboardEnabled, isRecording, selectedTrack, i));
}
Also used : PadGrid(de.mossgrabers.framework.controller.grid.PadGrid) ITrack(de.mossgrabers.framework.daw.data.ITrack) IChannelBank(de.mossgrabers.framework.daw.IChannelBank)

Example 7 with PadGrid

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

the class BrowserView method drawGrid.

/**
 * {@inheritDoc}
 */
@Override
public void drawGrid() {
    final PadGrid padGrid = this.surface.getPadGrid();
    padGrid.light(36, LaunchpadColors.LAUNCHPAD_COLOR_RED);
    padGrid.light(37, LaunchpadColors.LAUNCHPAD_COLOR_BLACK);
    for (int i = 38; i < 42; i++) padGrid.light(i, LaunchpadColors.LAUNCHPAD_COLOR_ORCHID_LO);
    padGrid.light(42, LaunchpadColors.LAUNCHPAD_COLOR_BLACK);
    padGrid.light(43, LaunchpadColors.LAUNCHPAD_COLOR_GREEN_HI);
    for (int i = 44; i < 52; i++) padGrid.light(i, LaunchpadColors.LAUNCHPAD_COLOR_BLACK);
    for (int i = 52; i < 60; i++) padGrid.light(i, COLUMN_COLORS[i - 52]);
    for (int i = 60; i < 68; i++) padGrid.light(i, COLUMN_COLORS[i - 60]);
    for (int i = 68; i < 76; i++) padGrid.light(i, COLUMN_COLORS[i - 68]);
    for (int i = 76; i < 84; i++) padGrid.light(i, COLUMN_COLORS[i - 76]);
    for (int i = 84; i < 100; i++) padGrid.light(i, LaunchpadColors.LAUNCHPAD_COLOR_BLACK);
}
Also used : PadGrid(de.mossgrabers.framework.controller.grid.PadGrid)

Example 8 with PadGrid

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

the class DrumView4 method drawGrid.

/**
 * {@inheritDoc}
 */
@Override
public void drawGrid() {
    final PadGrid padGrid = this.surface.getPadGrid();
    if (!this.model.canSelectedTrackHoldNotes()) {
        padGrid.turnOff();
        return;
    }
    // Clip length/loop area
    final ICursorClip clip = this.getClip();
    final int step = clip.getCurrentStep();
    // Paint the sequencer steps
    final int hiStep = this.isInXRange(step) ? step % DrumView4.NUM_DISPLAY_COLS : -1;
    for (int sound = 0; sound < 4; sound++) {
        for (int col = 0; col < DrumView4.NUM_DISPLAY_COLS; col++) {
            final int isSet = clip.getStep(col, this.offsetY + this.selectedPad + sound + this.soundOffset);
            final boolean hilite = col == hiStep;
            final int x = col % 8;
            int y = col / 8;
            if (col < 8)
                y += 5;
            y += sound;
            padGrid.lightEx(x, 8 - y, isSet > 0 ? hilite ? LaunchpadColors.LAUNCHPAD_COLOR_GREEN_LO : LaunchpadColors.LAUNCHPAD_COLOR_BLUE_HI : hilite ? LaunchpadColors.LAUNCHPAD_COLOR_GREEN_HI : LaunchpadColors.LAUNCHPAD_COLOR_BLACK);
        }
    }
}
Also used : PadGrid(de.mossgrabers.framework.controller.grid.PadGrid) ICursorClip(de.mossgrabers.framework.daw.ICursorClip)

Example 9 with PadGrid

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

the class PrgChangeView method drawGrid.

/**
 * {@inheritDoc}
 */
@Override
public void drawGrid() {
    final int[] colors = this.isToggled ? this.yellows : this.greens;
    final int selPad = this.isToggled ? this.programNumber >= 64 ? this.programNumber - 64 : -1 : this.programNumber < 64 ? this.programNumber : -1;
    final PadGrid gridPad = this.surface.getPadGrid();
    final boolean isPush2 = this.surface.getConfiguration().isPush2();
    final int red = isPush2 ? PushColors.PUSH2_COLOR2_RED : PushColors.PUSH1_COLOR2_RED;
    for (int i = 36; i < 100; i++) {
        final int pad = i - 36;
        final int row = pad / 8;
        gridPad.light(i, selPad == pad ? red : colors[row], -1, false);
    }
}
Also used : PadGrid(de.mossgrabers.framework.controller.grid.PadGrid)

Example 10 with PadGrid

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

the class DeviceView method drawGrid.

/**
 * {@inheritDoc}
 */
@Override
public void drawGrid() {
    final ICursorDevice cd = this.model.getCursorDevice();
    final int offset = cd.getSelectedParameterPage() / 8 * 8;
    final PadGrid padGrid = this.surface.getPadGrid();
    for (int i = 0; i < 8; i++) padGrid.light(44 + i, offset + i == cd.getSelectedParameterPage() ? BeatstepColors.BEATSTEP_BUTTON_STATE_BLUE : BeatstepColors.BEATSTEP_BUTTON_STATE_OFF);
    padGrid.light(36, cd.isEnabled() ? BeatstepColors.BEATSTEP_BUTTON_STATE_RED : BeatstepColors.BEATSTEP_BUTTON_STATE_OFF);
    padGrid.light(37, BeatstepColors.BEATSTEP_BUTTON_STATE_BLUE);
    padGrid.light(38, BeatstepColors.BEATSTEP_BUTTON_STATE_BLUE);
    padGrid.light(39, BeatstepColors.BEATSTEP_BUTTON_STATE_RED);
    padGrid.light(40, BeatstepColors.BEATSTEP_BUTTON_STATE_RED);
    padGrid.light(41, BeatstepColors.BEATSTEP_BUTTON_STATE_OFF);
    padGrid.light(42, BeatstepColors.BEATSTEP_BUTTON_STATE_BLUE);
    padGrid.light(43, BeatstepColors.BEATSTEP_BUTTON_STATE_BLUE);
}
Also used : PadGrid(de.mossgrabers.framework.controller.grid.PadGrid) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice)

Aggregations

PadGrid (de.mossgrabers.framework.controller.grid.PadGrid)20 ICursorClip (de.mossgrabers.framework.daw.ICursorClip)5 ITrack (de.mossgrabers.framework.daw.data.ITrack)4 IChannelBank (de.mossgrabers.framework.daw.IChannelBank)3 ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)2 ITransport (de.mossgrabers.framework.daw.ITransport)2 ColorManager (de.mossgrabers.framework.controller.color.ColorManager)1 ModeManager (de.mossgrabers.framework.mode.ModeManager)1