use of de.mossgrabers.framework.view.ViewManager in project DrivenByMoss by git-moss.
the class AbstractTrackCommand method onFaderModeButton.
protected void onFaderModeButton(final ButtonEvent event, final Integer view, final String notification) {
final ViewManager viewManager = this.surface.getViewManager();
switch(event) {
case DOWN:
if (viewManager.isActiveView(view)) {
viewManager.restoreView();
return;
}
this.temporaryView = false;
this.surface.getModeManager().setActiveMode(null);
viewManager.setActiveView(view);
this.surface.getDisplay().notify(notification);
break;
case LONG:
this.temporaryView = true;
break;
case UP:
if (this.temporaryView)
viewManager.restoreView();
break;
}
}
use of de.mossgrabers.framework.view.ViewManager 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.framework.view.ViewManager 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.framework.view.ViewManager in project DrivenByMoss by git-moss.
the class SelectNoteViewCommand method execute.
/**
* {@inheritDoc}
*/
@Override
public void execute(final ButtonEvent event) {
if (event != ButtonEvent.DOWN)
return;
final ViewManager viewManager = this.surface.getViewManager();
final IChannelBank tb = this.model.getCurrentTrackBank();
final ITrack sel = tb.getSelectedTrack();
if (sel == null) {
viewManager.setActiveView(Views.VIEW_SESSION);
return;
}
final boolean isShifted = this.surface.isShiftPressed();
if (Views.isNoteView(isShifted ? viewManager.getPreviousViewId() : viewManager.getActiveViewId())) {
if (isShifted)
this.seqSelect.executeNormal(event);
else
this.playSelect.executeNormal(event);
} else {
final Integer viewID = viewManager.getPreferredView(sel.getPosition());
if (viewID == null)
this.seqSelect.executeNormal(event);
else
viewManager.setActiveView(viewID);
}
viewManager.setPreferredView(sel.getPosition(), viewManager.getActiveViewId());
this.surface.getDisplay().notify(viewManager.getActiveView().getName());
}
use of de.mossgrabers.framework.view.ViewManager in project DrivenByMoss by git-moss.
the class SelectSessionViewCommand method execute.
/**
* {@inheritDoc}
*/
@Override
public void execute(final ButtonEvent event) {
if (event != ButtonEvent.DOWN)
return;
final ViewManager viewManager = this.surface.getViewManager();
if (viewManager.isActiveView(Views.VIEW_SESSION)) {
final Configuration configuration = this.surface.getConfiguration();
configuration.setFlipSession(!configuration.isFlipSession());
} else
viewManager.setActiveView(Views.VIEW_SESSION);
}
Aggregations