use of de.mossgrabers.framework.daw.data.IDrumDevice in project DrivenByMoss by git-moss.
the class AbstractDrum64View method onOctaveUp.
/**
* {@inheritDoc}
*/
@Override
public void onOctaveUp(final ButtonEvent event) {
if (event != ButtonEvent.DOWN)
return;
this.clearPressedKeys();
final int oldDrumOctave = this.drumOctave;
this.drumOctave = Math.min(1, this.drumOctave + 1);
this.offsetY = DRUM_START_KEY + this.drumOctave * BLOCK_SIZE;
this.updateNoteMapping();
this.surface.getDisplay().notify(this.getDrumRangeText());
if (oldDrumOctave != this.drumOctave) {
final IDrumDevice drumDevice64 = this.model.getDrumDevice64();
final IDrumPadBank drumPadBank = drumDevice64.getDrumPadBank();
for (int i = 0; i < BLOCK_SIZE; i++) drumPadBank.scrollForwards();
}
}
use of de.mossgrabers.framework.daw.data.IDrumDevice 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.daw.data.IDrumDevice in project DrivenByMoss by git-moss.
the class PlayView method getDrumPadColor.
private int getDrumPadColor(final int index) {
final int offsetY = this.scales.getDrumOffset();
// Selected?
if (this.pressedKeys[offsetY + index] > 0 || this.selectedPad == index)
return SLControlSurface.MKII_BUTTON_STATE_ON;
// Exists and active?
final IDrumDevice primary = this.model.getDrumDevice();
final IDrumPadBank drumPadBank = primary.getDrumPadBank();
final boolean isSoloed = primary.hasDrumPads() && drumPadBank.hasSoloedPads();
final IChannel drumPad = drumPadBank.getItem(index);
if (!drumPad.doesExist() || !drumPad.isActivated())
return SLControlSurface.MKII_BUTTON_STATE_OFF;
// Muted or soloed?
if (drumPad.isMute() || isSoloed && !drumPad.isSolo())
return SLControlSurface.MKII_BUTTON_STATE_OFF;
return SLControlSurface.MKII_BUTTON_STATE_OFF;
}
use of de.mossgrabers.framework.daw.data.IDrumDevice 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();
}
use of de.mossgrabers.framework.daw.data.IDrumDevice 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));
}
}
Aggregations