use of de.mossgrabers.framework.daw.INoteClip 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 ? LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_BLUE_HI : LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_BLUE_LO);
padGrid.lightEx(0, 1, clip.canScrollStepsBackwards() ? LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_LIME_HI : LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_LIME_LO);
padGrid.lightEx(1, 1, clip.canScrollStepsForwards() ? LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_LIME_HI : LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_LIME_LO);
padGrid.lightEx(2, 1, LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_BLACK);
padGrid.lightEx(3, 1, this.model.getTransport().isMetronomeOn() ? LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_RED_HI : LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_RED_LO);
padGrid.lightEx(4, 1, LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_BLACK);
padGrid.lightEx(5, 1, LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_BLACK);
padGrid.lightEx(6, 1, this.scales.canScrollDrumOctaveUp() ? LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_CYAN_HI : LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_CYAN_LO);
padGrid.lightEx(7, 1, this.scales.canScrollDrumOctaveDown() ? LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_CYAN_HI : LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_CYAN_LO);
}
use of de.mossgrabers.framework.daw.INoteClip 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);
}
use of de.mossgrabers.framework.daw.INoteClip in project DrivenByMoss by git-moss.
the class DrumConfigView method onGridNote.
/**
* {@inheritDoc}
*/
@Override
public void onGridNote(final int note, final int velocity) {
if (velocity == 0)
return;
final int index = note - 36;
final int col = index % 8;
final DrumView view = (DrumView) this.surface.getViewManager().get(Views.DRUM);
if (index / 8 == 1) {
view.setResolutionIndex(col);
return;
}
final INoteClip clip = view.getClip();
switch(col) {
case 0:
clip.scrollStepsPageBackwards();
this.mvHelper.notifyEditPage(clip);
break;
case 1:
clip.scrollStepsPageForward();
this.mvHelper.notifyEditPage(clip);
break;
default:
// Not used
break;
}
}
use of de.mossgrabers.framework.daw.INoteClip 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.INoteClip in project DrivenByMoss by git-moss.
the class DrumView method onGridNote.
/**
* {@inheritDoc}
*/
@Override
public void onGridNote(final int key, final int velocity) {
final int index = key - DRUM_START_KEY;
if (!this.model.canSelectedTrackHoldNotes())
return;
if (this.isGridEditor) {
if (velocity == 0)
return;
if (index < 8)
this.setResolutionIndex(index);
else {
final INoteClip clip = this.getClip();
if (index == 12)
clip.scrollStepsPageBackwards();
else if (index == 13)
clip.scrollStepsPageForward();
this.mvHelper.notifyEditPage(clip);
}
return;
}
if (this.isSequencerVisible) {
final int x = index % this.numColumns;
final int y = index / this.numColumns;
final int offsetY = this.scales.getDrumOffset();
if (this.isActive())
this.handleSequencerArea(index, x, y, offsetY, velocity);
return;
}
if (!this.isShifted) {
super.onGridNote(key, velocity);
return;
}
if (velocity == 0)
return;
switch(index) {
case 14:
this.onOctaveDown(ButtonEvent.DOWN);
break;
case 15:
this.onOctaveUp(ButtonEvent.DOWN);
break;
default:
// Not used
break;
}
this.updateNoteMapping();
}
Aggregations