use of de.mossgrabers.framework.daw.ICursorDevice in project DrivenByMoss by git-moss.
the class DeviceLeftCommand method executeNormal.
/**
* {@inheritDoc}
*/
@Override
public void executeNormal(final ButtonEvent event) {
if (event != ButtonEvent.DOWN)
return;
final ICursorDevice cd = this.model.getCursorDevice();
final IChannel layer = cd.getSelectedLayerOrDrumPad();
if (!cd.hasLayers() || layer == null)
cd.selectPrevious();
else
cd.selectLayer(layer.getIndex() == 0 ? 0 : layer.getIndex() - 1);
}
use of de.mossgrabers.framework.daw.ICursorDevice in project DrivenByMoss by git-moss.
the class DeviceRightCommand method executeShifted.
/**
* {@inheritDoc}
*/
@Override
public void executeShifted(final ButtonEvent event) {
if (event != ButtonEvent.DOWN)
return;
// Enter layer
final ICursorDevice cd = this.model.getCursorDevice();
if (!cd.hasLayers())
return;
final IChannel layer = cd.getSelectedLayerOrDrumPad();
if (layer == null)
cd.selectLayerOrDrumPad(0);
else {
final IChannel dl = cd.getSelectedLayer();
if (dl != null) {
final int index = dl.getIndex();
cd.enterLayer(index);
cd.selectFirstDeviceInLayer(index);
}
}
}
use of de.mossgrabers.framework.daw.ICursorDevice in project DrivenByMoss by git-moss.
the class DeviceRightCommand method executeNormal.
/**
* {@inheritDoc}
*/
@Override
public void executeNormal(final ButtonEvent event) {
if (event != ButtonEvent.DOWN)
return;
final ICursorDevice cd = this.model.getCursorDevice();
final IChannel sel = cd.getSelectedLayer();
if (!cd.hasLayers() || sel == null)
cd.selectNext();
else {
final int index = sel.getIndex() + 1;
cd.selectLayer(index > 7 ? 7 : index);
}
}
use of de.mossgrabers.framework.daw.ICursorDevice in project DrivenByMoss by git-moss.
the class LaunchpadCursorCommand method updateArrowStates.
/**
* {@inheritDoc}
*/
@Override
protected void updateArrowStates() {
final IChannelBank tb = this.model.getCurrentTrackBank();
final ViewManager viewManager = this.surface.getViewManager();
if (viewManager.isActiveView(Views.VIEW_PLAY)) {
final Scales scales = this.model.getScales();
final int octave = scales.getOctave();
this.canScrollUp = octave < 3;
this.canScrollDown = octave > -3;
final int scale = scales.getScale().ordinal();
this.canScrollLeft = scale > 0;
this.canScrollRight = scale < Scale.values().length - 1;
return;
}
if (viewManager.isActiveView(Views.VIEW_DRUM)) {
final int octave = this.model.getScales().getDrumOctave();
this.canScrollUp = octave < 5;
this.canScrollDown = octave > -3;
this.canScrollLeft = this.model.getCursorClip().getEditPage() > 0;
// TODO API extension required - We do not know the number of steps
this.canScrollRight = true;
return;
}
if (viewManager.isActiveView(Views.VIEW_DRUM64)) {
final DrumView64 drumView64 = (DrumView64) viewManager.getView(Views.VIEW_DRUM64);
final int octave = drumView64.getDrumOctave();
this.canScrollUp = octave < 1;
this.canScrollDown = octave > -2;
this.canScrollLeft = false;
this.canScrollRight = false;
return;
}
if (viewManager.isActiveView(Views.VIEW_SEQUENCER) || viewManager.isActiveView(Views.VIEW_RAINDROPS)) {
final int octave = this.model.getScales().getOctave();
this.canScrollUp = octave < Scales.OCTAVE_RANGE;
this.canScrollDown = octave > -Scales.OCTAVE_RANGE;
this.canScrollLeft = this.model.getCursorClip().getEditPage() > 0;
// TODO API extension required - We do not know the number of steps
this.canScrollRight = true;
return;
}
if (viewManager.isActiveView(Views.VIEW_DEVICE)) {
final ICursorDevice cursorDevice = this.model.getCursorDevice();
this.canScrollUp = cursorDevice.canSelectNextFX();
this.canScrollDown = cursorDevice.canSelectPreviousFX();
this.canScrollLeft = cursorDevice.hasPreviousParameterPage();
this.canScrollRight = cursorDevice.hasNextParameterPage();
return;
}
if (viewManager.isActiveView(Views.VIEW_BROWSER)) {
final IBrowser browser = this.model.getBrowser();
final int index = browser.getSelectedContentTypeIndex();
this.canScrollUp = false;
this.canScrollDown = false;
this.canScrollLeft = index > 0;
this.canScrollRight = index < browser.getContentTypeNames().length - 1;
return;
}
if (viewManager.isActiveView(Views.VIEW_SHIFT) || viewManager.isActiveView(Views.VIEW_DRUM4) || viewManager.isActiveView(Views.VIEW_DRUM8)) {
this.canScrollUp = false;
this.canScrollDown = false;
this.canScrollLeft = false;
this.canScrollRight = false;
return;
}
// VIEW_SESSION, VIEW_VOLUME, VIEW_PAN, VIEW_SENDS
final ITrack sel = tb.getSelectedTrack();
final int selIndex = sel != null ? sel.getIndex() : -1;
this.canScrollLeft = selIndex > 0 || tb.canScrollTracksUp();
this.canScrollRight = selIndex >= 0 && selIndex < 7 && tb.getTrack(selIndex + 1).doesExist() || tb.canScrollTracksDown();
this.canScrollUp = tb.canScrollScenesUp();
this.canScrollDown = tb.canScrollScenesDown();
}
use of de.mossgrabers.framework.daw.ICursorDevice in project DrivenByMoss by git-moss.
the class LaunchpadCursorCommand method scrollRight.
/**
* {@inheritDoc}
*/
@SuppressWarnings("rawtypes")
@Override
protected void scrollRight() {
final ViewManager viewManager = this.surface.getViewManager();
if (viewManager.isActiveView(Views.VIEW_PLAY)) {
final Scales scales = this.model.getScales();
scales.nextScale();
final String name = scales.getScale().getName();
this.surface.getConfiguration().setScale(name);
this.surface.getDisplay().notify(name);
return;
}
if (viewManager.isActiveView(Views.VIEW_DEVICE)) {
final ICursorDevice cursorDevice = this.model.getCursorDevice();
cursorDevice.nextParameterPage();
this.surface.getDisplay().notify(cursorDevice.getSelectedParameterPageName());
return;
}
if (viewManager.isActiveView(Views.VIEW_BROWSER)) {
this.model.getBrowser().nextContentType();
return;
}
if (viewManager.isActiveView(Views.VIEW_SHIFT) || viewManager.isActiveView(Views.VIEW_DRUM64))
return;
// VIEW_SEQUENCER, VIEW_RAINDROPS, VIEW_DRUM, VIEW_DRUM4, VIEW_DRUM8
final View activeView = viewManager.getActiveView();
if (activeView instanceof AbstractSequencerView) {
((AbstractSequencerView) activeView).onRight(ButtonEvent.DOWN);
return;
}
// VIEW_SESSION, VIEW_VOLUME, VIEW_PAN, VIEW_SENDS
this.scrollTracksRight();
}
Aggregations