use of de.mossgrabers.framework.view.ViewManager in project DrivenByMoss by git-moss.
the class LaunchpadCursorCommand method scrollLeft.
/**
* {@inheritDoc}
*/
@SuppressWarnings("rawtypes")
@Override
protected void scrollLeft() {
final ViewManager viewManager = this.surface.getViewManager();
if (viewManager.isActiveView(Views.VIEW_PLAY)) {
final Scales scales = this.model.getScales();
scales.prevScale();
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.previousParameterPage();
this.surface.getDisplay().notify(cursorDevice.getSelectedParameterPageName());
return;
}
if (viewManager.isActiveView(Views.VIEW_BROWSER)) {
this.model.getBrowser().previousContentType();
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).onLeft(ButtonEvent.DOWN);
return;
}
// VIEW_SESSION, VIEW_VOLUME, VIEW_PAN, VIEW_SENDS
this.scrollTracksLeft();
}
use of de.mossgrabers.framework.view.ViewManager in project DrivenByMoss by git-moss.
the class SelectDeviceViewCommand 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_BROWSER)) {
this.model.getBrowser().stopBrowsing(false);
viewManager.setActiveView(Views.VIEW_DEVICE);
return;
}
if (viewManager.isActiveView(Views.VIEW_DEVICE)) {
if (this.surface.isShiftPressed() || !this.model.getCursorDevice().hasSelectedDevice())
this.model.getBrowser().browseToInsertAfterDevice();
else
this.model.getBrowser().browseForPresets();
this.startRetries = 0;
this.activateBrowserView();
return;
}
viewManager.setActiveView(Views.VIEW_DEVICE);
}
use of de.mossgrabers.framework.view.ViewManager in project DrivenByMoss by git-moss.
the class LaunchpadControllerSetup method updateIndication.
private void updateIndication() {
final ViewManager viewManager = this.getSurface().getViewManager();
final boolean isVolume = viewManager.isActiveView(Views.VIEW_VOLUME);
final boolean isPan = viewManager.isActiveView(Views.VIEW_PAN);
final boolean isSends = viewManager.isActiveView(Views.VIEW_SENDS);
final boolean isDevice = viewManager.isActiveView(Views.VIEW_DEVICE);
final ITrackBank tb = this.model.getTrackBank();
final IChannelBank tbe = this.model.getEffectTrackBank();
final ICursorDevice cursorDevice = this.model.getCursorDevice();
final View view = viewManager.getActiveView();
final int selSend = view instanceof SendsView ? ((SendsView) view).getSelectedSend() : -1;
final boolean isSession = view instanceof SessionView && !isVolume && !isPan && !isSends;
final boolean isEffect = this.model.isEffectTrackBankActive();
tb.setIndication(!isEffect && isSession);
tbe.setIndication(isEffect && isSession);
for (int i = 0; i < 8; i++) {
final ITrack track = tb.getTrack(i);
track.setVolumeIndication(!isEffect && isVolume);
track.setPanIndication(!isEffect && isPan);
for (int j = 0; j < 8; j++) track.getSend(j).setIndication(!isEffect && isSends && selSend == j);
final ITrack fxTrack = tbe.getTrack(i);
fxTrack.setVolumeIndication(isEffect && isVolume);
fxTrack.setPanIndication(isEffect && isPan);
cursorDevice.indicateParameter(i, isDevice);
}
}
use of de.mossgrabers.framework.view.ViewManager in project DrivenByMoss by git-moss.
the class NoteViewSelectMode method activateView.
private void activateView(final Integer viewID) {
if (viewID == null)
return;
final ViewManager viewManager = this.surface.getViewManager();
if (viewManager.getView(viewID) == null)
return;
viewManager.setActiveView(viewID);
final ITrack selectedTrack = this.model.getCurrentTrackBank().getSelectedTrack();
if (selectedTrack != null)
viewManager.setPreferredView(selectedTrack.getPosition(), viewID);
this.surface.getModeManager().restoreMode();
}
use of de.mossgrabers.framework.view.ViewManager in project DrivenByMoss by git-moss.
the class NoteViewSelectMode method updateDisplay2.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay2() {
final ViewManager viewManager = this.surface.getViewManager();
final PushDisplay display = (PushDisplay) this.surface.getDisplay();
final DisplayMessage message = display.createMessage();
for (int i = 0; i < VIEWS.length; i++) {
String menuBottomName = "";
if (VIEWS[i] != null) {
final View view = viewManager.getView(VIEWS[i]);
if (view != null)
menuBottomName = view.getName();
}
final String menuTopName = VIEWS_TOP[i] == null ? "" : viewManager.getView(VIEWS_TOP[i]).getName();
final boolean isMenuBottomSelected = VIEWS[i] != null && viewManager.isActiveView(VIEWS[i]);
final boolean isMenuTopSelected = VIEWS_TOP[i] != null && viewManager.isActiveView(VIEWS_TOP[i]);
message.addOptionElement("", menuTopName, isMenuTopSelected, i == 0 ? "Note view" : "", menuBottomName, isMenuBottomSelected, false);
}
display.send(message);
}
Aggregations