use of de.mossgrabers.framework.daw.data.bank.ISceneBank in project DrivenByMoss by git-moss.
the class CursorCommand method updateArrowStates.
/**
* {@inheritDoc}
*/
@Override
protected void updateArrowStates() {
final ISceneBank sceneBank = this.getSceneBank();
this.canScrollUp = sceneBank.canScrollBackwards();
this.canScrollDown = sceneBank.canScrollForwards();
final IMode mode = this.surface.getModeManager().getActive();
final boolean shiftPressed = this.surface.isShiftPressed();
this.canScrollLeft = mode != null && (shiftPressed ? mode.hasPreviousItemPage() : mode.hasPreviousItem());
this.canScrollRight = mode != null && (shiftPressed ? mode.hasNextItemPage() : mode.hasNextItem());
}
use of de.mossgrabers.framework.daw.data.bank.ISceneBank in project DrivenByMoss by git-moss.
the class AbstractSessionView method onGridNoteBirdsEyeView.
/**
* Handle pad presses in the birds eye view (session page selection).
*
* @param x The x position of the pad
* @param y The y position of the pad
* @param yOffset Optional offset in y-direction
*/
protected void onGridNoteBirdsEyeView(final int x, final int y, final int yOffset) {
final ITrackBank tb = this.model.getCurrentTrackBank();
final ISceneBank sceneBank = tb.getSceneBank();
final boolean flip = this.surface.getConfiguration().isFlipSession();
// Calculate page offsets
final int numTracks = tb.getPageSize();
final int numScenes = sceneBank.getPageSize();
final int trackPosition = tb.getItem(0).getPosition() / numTracks;
final int scenePosition = sceneBank.getScrollPosition() / numScenes;
final int selX = flip ? scenePosition : trackPosition;
final int selY = flip ? trackPosition : scenePosition;
final int padsX = flip ? this.rows : this.columns;
final int padsY = flip ? this.columns : this.rows + yOffset;
final int offsetX = selX / padsX * padsX;
final int offsetY = selY / padsY * padsY;
tb.scrollTo(offsetX * numTracks + (flip ? y : x) * padsX);
sceneBank.scrollTo(offsetY * numScenes + (flip ? x : y) * padsY);
}
use of de.mossgrabers.framework.daw.data.bank.ISceneBank in project DrivenByMoss by git-moss.
the class SessionView method onGridNote.
/**
* {@inheritDoc}
*/
@Override
public void onGridNote(final int note, final int velocity) {
final int index = note - 36;
final int t = index % this.columns;
final int s = this.rows - 1 - index / this.columns;
final ITrackBank tb = this.model.getCurrentTrackBank();
// Birds-eye-view navigation
if (this.isBirdsEyeActive()) {
final ISceneBank sceneBank = tb.getSceneBank();
// Calculate page offsets
final int numTracks = tb.getPageSize();
final int numScenes = sceneBank.getPageSize();
final int trackPosition = tb.getItem(0).getPosition() / numTracks;
final int scenePosition = sceneBank.getScrollPosition() / numScenes;
final int selX = trackPosition;
final int selY = scenePosition;
final int padsX = this.columns;
final int padsY = this.rows;
final int offsetX = selX / padsX * padsX;
final int offsetY = selY / padsY * padsY;
tb.scrollTo(offsetX * numTracks + t * padsX);
sceneBank.scrollTo(offsetY * numScenes + s * padsY);
return;
}
// Duplicate a clip
final ITrack track = tb.getItem(t);
if (this.isButtonCombination(ButtonID.DUPLICATE)) {
if (track.doesExist())
track.getSlotBank().getItem(s).duplicate();
return;
}
// Stop clip with normal stop button
if (this.isButtonCombination(ButtonID.STOP)) {
track.stop();
return;
}
super.onGridNote(note, velocity);
}
Aggregations