use of de.mossgrabers.framework.controller.grid.PadGrid in project DrivenByMoss by git-moss.
the class PlayView method drawGrid.
/**
* {@inheritDoc}
*/
@Override
public void drawGrid() {
final boolean isKeyboardEnabled = this.model.canSelectedTrackHoldNotes();
final PadGrid padGrid = this.surface.getPadGrid();
final ColorManager colorManager = this.model.getColorManager();
for (int i = 36; i < 52; i++) padGrid.light(i, isKeyboardEnabled ? this.pressedKeys[i] > 0 ? BeatstepColors.BEATSTEP_BUTTON_STATE_PINK : colorManager.getColor(this.scales.getColor(this.noteMap, i)) : BeatstepColors.BEATSTEP_BUTTON_STATE_OFF);
}
use of de.mossgrabers.framework.controller.grid.PadGrid in project DrivenByMoss by git-moss.
the class SequencerView method drawGrid.
/**
* {@inheritDoc}
*/
@Override
public void drawGrid() {
final PadGrid padGrid = this.surface.getPadGrid();
if (!this.model.canSelectedTrackHoldNotes()) {
padGrid.turnOff();
return;
}
if (this.isPlayMode) {
for (int i = 36; i < 52; i++) {
padGrid.light(i, this.pressedKeys[i] > 0 || this.selectedPad == i - 36 ? BeatstepColors.BEATSTEP_BUTTON_STATE_PINK : this.model.getColorManager().getColor(this.scales.getColor(this.noteMap, i)));
}
} else {
final ICursorClip clip = this.getClip();
// Paint the sequencer steps
final int step = clip.getCurrentStep();
final int hiStep = this.isInXRange(step) ? step % SequencerView.NUM_DISPLAY_COLS : -1;
for (int col = 0; col < SequencerView.NUM_DISPLAY_COLS; col++) {
final int isSet = clip.getStep(col, this.offsetY + this.selectedPad);
final boolean hilite = col == hiStep;
final int x = col % 8;
final int y = col / 8;
padGrid.lightEx(x, 1 - y, isSet > 0 ? hilite ? BeatstepColors.BEATSTEP_BUTTON_STATE_PINK : BeatstepColors.BEATSTEP_BUTTON_STATE_BLUE : hilite ? BeatstepColors.BEATSTEP_BUTTON_STATE_PINK : BeatstepColors.BEATSTEP_BUTTON_STATE_OFF);
}
}
}
use of de.mossgrabers.framework.controller.grid.PadGrid in project DrivenByMoss by git-moss.
the class SessionView method drawGrid.
/**
* {@inheritDoc}
*/
@Override
public void drawGrid() {
final Integer controlMode = this.surface.getModeManager().getActiveModeId();
final boolean isOff = controlMode == null;
final boolean flip = this.surface.getConfiguration().isFlipSession();
this.rows = isOff || flip ? 8 : 7;
this.columns = isOff || !flip ? 8 : 7;
super.drawGrid();
if (isOff)
return;
final IChannelBank tb = this.model.getCurrentTrackBank();
final PadGrid pads = this.surface.getPadGrid();
final ModeManager modeManager = this.surface.getModeManager();
for (int x = 0; x < this.columns; x++) {
final ITrack track = tb.getTrack(x);
final boolean exists = track.doesExist();
if (modeManager.isActiveMode(Modes.MODE_REC_ARM))
pads.lightEx(x, 7, exists ? track.isRecArm() ? LaunchpadColors.LAUNCHPAD_COLOR_RED_HI : LaunchpadColors.LAUNCHPAD_COLOR_RED_LO : LaunchpadColors.LAUNCHPAD_COLOR_BLACK);
else if (modeManager.isActiveMode(Modes.MODE_TRACK_SELECT))
pads.lightEx(x, 7, exists ? track.isSelected() ? LaunchpadColors.LAUNCHPAD_COLOR_GREEN_HI : LaunchpadColors.LAUNCHPAD_COLOR_GREEN_LO : LaunchpadColors.LAUNCHPAD_COLOR_BLACK);
else if (modeManager.isActiveMode(Modes.MODE_MUTE))
pads.lightEx(x, 7, exists ? track.isMute() ? LaunchpadColors.LAUNCHPAD_COLOR_YELLOW_HI : LaunchpadColors.LAUNCHPAD_COLOR_YELLOW_LO : LaunchpadColors.LAUNCHPAD_COLOR_BLACK);
else if (modeManager.isActiveMode(Modes.MODE_SOLO))
pads.lightEx(x, 7, exists ? track.isSolo() ? LaunchpadColors.LAUNCHPAD_COLOR_BLUE_HI : LaunchpadColors.LAUNCHPAD_COLOR_BLUE_LO : LaunchpadColors.LAUNCHPAD_COLOR_BLACK);
else if (modeManager.isActiveMode(Modes.MODE_STOP_CLIP))
pads.lightEx(x, 7, exists ? LaunchpadColors.LAUNCHPAD_COLOR_ROSE : LaunchpadColors.LAUNCHPAD_COLOR_BLACK);
}
}
use of de.mossgrabers.framework.controller.grid.PadGrid in project DrivenByMoss by git-moss.
the class ShiftView method drawGrid.
/**
* {@inheritDoc}
*/
@Override
public void drawGrid() {
final PadGrid padGrid = this.surface.getPadGrid();
if (this.surface.isPro()) {
for (int i = 36; i < 97; i++) padGrid.light(i, LaunchpadColors.LAUNCHPAD_COLOR_BLACK);
} else {
padGrid.light(36, LaunchpadColors.LAUNCHPAD_COLOR_RED);
padGrid.light(37, LaunchpadColors.LAUNCHPAD_COLOR_GREEN);
padGrid.light(38, LaunchpadColors.LAUNCHPAD_COLOR_YELLOW);
padGrid.light(39, LaunchpadColors.LAUNCHPAD_COLOR_BLUE);
padGrid.light(40, LaunchpadColors.LAUNCHPAD_COLOR_CYAN);
padGrid.light(41, LaunchpadColors.LAUNCHPAD_COLOR_SKY);
padGrid.light(42, LaunchpadColors.LAUNCHPAD_COLOR_ORCHID);
padGrid.light(43, LaunchpadColors.LAUNCHPAD_COLOR_ROSE);
padGrid.light(44, LaunchpadColors.LAUNCHPAD_COLOR_RED);
padGrid.light(45, LaunchpadColors.LAUNCHPAD_COLOR_ROSE);
for (int i = 46; i < 51; i++) padGrid.light(i, LaunchpadColors.LAUNCHPAD_COLOR_BLACK);
padGrid.light(51, LaunchpadColors.LAUNCHPAD_COLOR_RED);
padGrid.light(52, LaunchpadColors.LAUNCHPAD_COLOR_GREEN);
padGrid.light(53, LaunchpadColors.LAUNCHPAD_COLOR_GREEN_SPRING);
for (int i = 54; i < 60; i++) padGrid.light(i, LaunchpadColors.LAUNCHPAD_COLOR_BLACK);
padGrid.light(60, LaunchpadColors.LAUNCHPAD_COLOR_GREEN);
padGrid.light(61, LaunchpadColors.LAUNCHPAD_COLOR_GREEN_SPRING);
for (int i = 62; i < 68; i++) padGrid.light(i, LaunchpadColors.LAUNCHPAD_COLOR_BLACK);
padGrid.light(68, LaunchpadColors.LAUNCHPAD_COLOR_GREEN);
padGrid.light(69, LaunchpadColors.LAUNCHPAD_COLOR_BLACK);
for (int i = 70; i < 76; i++) padGrid.light(i, LaunchpadColors.LAUNCHPAD_COLOR_BLACK);
padGrid.light(76, LaunchpadColors.LAUNCHPAD_COLOR_GREEN);
padGrid.light(77, LaunchpadColors.LAUNCHPAD_COLOR_BLACK);
for (int i = 78; i < 84; i++) padGrid.light(i, LaunchpadColors.LAUNCHPAD_COLOR_BLACK);
padGrid.light(84, LaunchpadColors.LAUNCHPAD_COLOR_GREEN);
padGrid.light(85, LaunchpadColors.LAUNCHPAD_COLOR_GREEN_SPRING);
for (int i = 86; i < 92; i++) padGrid.light(i, LaunchpadColors.LAUNCHPAD_COLOR_BLACK);
padGrid.light(92, LaunchpadColors.LAUNCHPAD_COLOR_GREEN);
padGrid.light(93, LaunchpadColors.LAUNCHPAD_COLOR_GREEN_SPRING);
for (int i = 94; i < 97; i++) padGrid.light(i, LaunchpadColors.LAUNCHPAD_COLOR_BLACK);
}
padGrid.light(97, LaunchpadColors.LAUNCHPAD_COLOR_GREEN);
padGrid.light(98, LaunchpadColors.LAUNCHPAD_COLOR_GREEN_SPRING);
padGrid.light(99, LaunchpadColors.LAUNCHPAD_COLOR_TURQUOISE_CYAN);
}
use of de.mossgrabers.framework.controller.grid.PadGrid in project DrivenByMoss by git-moss.
the class DrumView8 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 % DrumView8.NUM_DISPLAY_COLS : -1;
for (int sound = 0; sound < 8; sound++) {
for (int col = 0; col < DrumView8.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;
y += sound;
padGrid.lightEx(x, 7 - y, isSet > 0 ? hilite ? LaunchpadColors.LAUNCHPAD_COLOR_GREEN_LO : LaunchpadColors.LAUNCHPAD_COLOR_BLUE_HI : hilite ? LaunchpadColors.LAUNCHPAD_COLOR_GREEN_HI : LaunchpadColors.LAUNCHPAD_COLOR_BLACK);
}
}
}
Aggregations