use of de.mossgrabers.launchpad.view.DrumView64 in project DrivenByMoss by git-moss.
the class LaunchpadControllerSetup method createViews.
/**
* {@inheritDoc}
*/
@Override
protected void createViews() {
final LaunchpadControlSurface surface = this.getSurface();
final ViewManager viewManager = surface.getViewManager();
viewManager.registerView(Views.VIEW_BROWSER, new BrowserView(surface, this.model));
viewManager.registerView(Views.VIEW_DEVICE, new DeviceView(surface, this.model));
viewManager.registerView(Views.VIEW_DRUM, new DrumView(surface, this.model));
viewManager.registerView(Views.VIEW_DRUM4, new DrumView4(surface, this.model));
viewManager.registerView(Views.VIEW_DRUM8, new DrumView8(surface, this.model));
viewManager.registerView(Views.VIEW_PAN, new PanView(surface, this.model));
viewManager.registerView(Views.VIEW_DRUM64, new DrumView64(surface, this.model));
viewManager.registerView(Views.VIEW_PLAY, new PlayView(surface, this.model));
viewManager.registerView(Views.VIEW_RAINDROPS, new RaindropsView(surface, this.model));
viewManager.registerView(Views.VIEW_SENDS, new SendsView(surface, this.model));
viewManager.registerView(Views.VIEW_SEQUENCER, new SequencerView(surface, this.model));
viewManager.registerView(Views.VIEW_SESSION, new SessionView(surface, this.model));
viewManager.registerView(Views.VIEW_VOLUME, new VolumeView(surface, this.model));
viewManager.registerView(Views.VIEW_SHIFT, new ShiftView(surface, this.model));
}
use of de.mossgrabers.launchpad.view.DrumView64 in project DrivenByMoss by git-moss.
the class LaunchpadCursorCommand method scrollUp.
/**
* {@inheritDoc}
*/
@Override
protected void scrollUp() {
final ViewManager viewManager = this.surface.getViewManager();
if (viewManager.isActiveView(Views.VIEW_PLAY)) {
((PlayView) viewManager.getView(Views.VIEW_PLAY)).onOctaveUp(ButtonEvent.DOWN);
return;
}
if (viewManager.isActiveView(Views.VIEW_DRUM)) {
((DrumView) viewManager.getView(Views.VIEW_DRUM)).onOctaveUp(ButtonEvent.DOWN);
return;
}
if (viewManager.isActiveView(Views.VIEW_DRUM64)) {
((DrumView64) viewManager.getView(Views.VIEW_DRUM64)).onOctaveUp(ButtonEvent.DOWN);
return;
}
if (viewManager.isActiveView(Views.VIEW_SEQUENCER)) {
((SequencerView) viewManager.getView(Views.VIEW_SEQUENCER)).onOctaveUp(ButtonEvent.DOWN);
return;
}
if (viewManager.isActiveView(Views.VIEW_RAINDROPS)) {
((RaindropsView) viewManager.getView(Views.VIEW_RAINDROPS)).onOctaveUp(ButtonEvent.DOWN);
return;
}
if (viewManager.isActiveView(Views.VIEW_DEVICE)) {
this.model.getCursorDevice().selectNext();
return;
}
if (viewManager.isActiveView(Views.VIEW_BROWSER) || viewManager.isActiveView(Views.VIEW_SHIFT) || viewManager.isActiveView(Views.VIEW_DRUM4) || viewManager.isActiveView(Views.VIEW_DRUM8))
return;
// VIEW_SESSION, VIEW_VOLUME, VIEW_PAN, VIEW_SENDS
super.scrollUp();
// TODO could be used for layer navigation
// VIEW_DEVICE
}
use of de.mossgrabers.launchpad.view.DrumView64 in project DrivenByMoss by git-moss.
the class LaunchpadCursorCommand method scrollDown.
/**
* {@inheritDoc}
*/
@Override
protected void scrollDown() {
final ViewManager viewManager = this.surface.getViewManager();
if (viewManager.isActiveView(Views.VIEW_PLAY)) {
((PlayView) viewManager.getView(Views.VIEW_PLAY)).onOctaveDown(ButtonEvent.DOWN);
return;
}
if (viewManager.isActiveView(Views.VIEW_DRUM)) {
((DrumView) viewManager.getView(Views.VIEW_DRUM)).onOctaveDown(ButtonEvent.DOWN);
return;
}
if (viewManager.isActiveView(Views.VIEW_DRUM64)) {
((DrumView64) viewManager.getView(Views.VIEW_DRUM64)).onOctaveDown(ButtonEvent.DOWN);
return;
}
if (viewManager.isActiveView(Views.VIEW_SEQUENCER)) {
((SequencerView) viewManager.getView(Views.VIEW_SEQUENCER)).onOctaveDown(ButtonEvent.DOWN);
return;
}
if (viewManager.isActiveView(Views.VIEW_RAINDROPS)) {
((RaindropsView) viewManager.getView(Views.VIEW_RAINDROPS)).onOctaveDown(ButtonEvent.DOWN);
return;
}
if (viewManager.isActiveView(Views.VIEW_DEVICE)) {
this.model.getCursorDevice().selectPrevious();
return;
}
if (viewManager.isActiveView(Views.VIEW_BROWSER) || viewManager.isActiveView(Views.VIEW_SHIFT) || viewManager.isActiveView(Views.VIEW_DRUM4) || viewManager.isActiveView(Views.VIEW_DRUM8))
return;
// VIEW_SESSION, VIEW_VOLUME, VIEW_PAN, VIEW_SENDS
super.scrollDown();
// TODO could be used for layer navigation
// VIEW_DEVICE
}
use of de.mossgrabers.launchpad.view.DrumView64 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();
}
Aggregations