use of de.mossgrabers.framework.view.ViewManager in project DrivenByMoss by git-moss.
the class ShiftView method activateBrowserView.
private void activateBrowserView() {
final ViewManager viewManager = this.surface.getViewManager();
final Integer previousViewId = viewManager.getPreviousViewId();
viewManager.setActiveView(Views.VIEW_BROWSER);
viewManager.setPreviousView(previousViewId);
}
use of de.mossgrabers.framework.view.ViewManager in project DrivenByMoss by git-moss.
the class BeatstepControllerSetup method updateIndication.
private void updateIndication() {
final BeatstepControlSurface surface = this.getSurface();
final ViewManager viewManager = surface.getViewManager();
final boolean isTrack = viewManager.isActiveView(Views.VIEW_TRACK);
final boolean isDevice = viewManager.isActiveView(Views.VIEW_DEVICE);
final boolean isSession = viewManager.isActiveView(Views.VIEW_SESSION);
final IMasterTrack mt = this.model.getMasterTrack();
mt.setVolumeIndication(!isDevice);
final ITrackBank tb = this.model.getTrackBank();
final ITrack selectedTrack = tb.getSelectedTrack();
final IChannelBank tbe = this.model.getEffectTrackBank();
final ITrack selectedFXTrack = tbe.getSelectedTrack();
final ICursorDevice cursorDevice = this.model.getCursorDevice();
final boolean isEffect = this.model.isEffectTrackBankActive();
tb.setIndication(!isEffect && isSession);
tbe.setIndication(isEffect && isSession);
for (int i = 0; i < 8; i++) {
final boolean hasTrackSel = selectedTrack != null && selectedTrack.getIndex() == i;
final ITrack track = tb.getTrack(i);
track.setVolumeIndication(!isEffect && hasTrackSel && !isDevice);
track.setPanIndication(!isEffect && hasTrackSel && !isDevice);
for (int j = 0; j < 6; j++) track.getSend(j).setIndication(!isEffect && hasTrackSel && isTrack);
final boolean hasFXTrackSel = selectedFXTrack != null && selectedFXTrack.getIndex() == i;
final ITrack fxTrack = tbe.getTrack(i);
fxTrack.setVolumeIndication(isEffect && hasFXTrackSel && isTrack);
fxTrack.setPanIndication(isEffect && hasFXTrackSel && isTrack);
cursorDevice.indicateParameter(i, isDevice);
}
}
use of de.mossgrabers.framework.view.ViewManager in project DrivenByMoss by git-moss.
the class BeatstepControllerSetup method handleTrackChange.
/**
* Handle a track selection change.
*
* @param index The index of the track
* @param isSelected Has the track been selected?
*/
private void handleTrackChange(final int index, final boolean isSelected) {
if (!isSelected)
return;
final ViewManager viewManager = this.getSurface().getViewManager();
if (viewManager.isActiveView(Views.VIEW_PLAY))
viewManager.getActiveView().updateNoteMapping();
// Reset drum octave because the drum pad bank is also reset
this.scales.setDrumOctave(0);
if (viewManager.isActiveView(Views.VIEW_DRUM))
viewManager.getView(Views.VIEW_DRUM).updateNoteMapping();
}
use of de.mossgrabers.framework.view.ViewManager in project DrivenByMoss by git-moss.
the class ViewMultiSelectCommand method executeNormal.
/**
* {@inheritDoc}
*/
@Override
public void executeNormal(final ButtonEvent event) {
if (event != ButtonEvent.DOWN)
return;
final ViewManager viewManager = this.surface.getViewManager();
final Integer activeViewId = viewManager.getActiveViewId();
int index = this.viewIds.indexOf(activeViewId) + 1;
if (index < 0 || index >= this.viewIds.size())
index = 0;
viewManager.setActiveView(this.viewIds.get(index));
}
use of de.mossgrabers.framework.view.ViewManager in project DrivenByMoss by git-moss.
the class MCUControllerSetup method registerContinuousCommands.
/**
* {@inheritDoc}
*/
@Override
protected void registerContinuousCommands() {
MCUControlSurface surface = this.getSurface();
ViewManager viewManager = surface.getViewManager();
viewManager.registerContinuousCommand(Commands.CONT_COMMAND_PLAY_POSITION, new PlayPositionTempoCommand(this.model, surface));
surface.assignContinuousCommand(MCUControlSurface.MCU_CC_JOG, 1, Commands.CONT_COMMAND_PLAY_POSITION);
for (int index = 0; index < this.numMCUDevices; index++) {
surface = this.getSurface(index);
viewManager = surface.getViewManager();
for (int i = 0; i < 8; i++) {
final Integer commandID = Integer.valueOf(Commands.CONT_COMMAND_KNOB1.intValue() + i);
viewManager.registerContinuousCommand(commandID, new KnobRowModeCommand<>(i, this.model, surface));
surface.assignContinuousCommand(MCUControlSurface.MCU_CC_VPOT1 + i, 1, commandID);
}
}
}
Aggregations