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));
}
}
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));
}
}
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);
}
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);
}
}
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);
}
Aggregations