use of de.mossgrabers.framework.view.ViewManager in project DrivenByMoss by git-moss.
the class SessionViewSelectMode method updateDisplay1.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay1() {
final Display d = this.surface.getDisplay();
final ViewManager viewManager = this.surface.getViewManager();
d.clear().setBlock(1, 0, "Session view:");
for (int i = 0; i < VIEWS.length; i++) {
if (VIEWS[i] != null)
d.setCell(3, i, (this.isSelected(viewManager, i) ? PushDisplay.RIGHT_ARROW : "") + VIEW_NAMES[i]);
}
d.allDone();
}
use of de.mossgrabers.framework.view.ViewManager in project DrivenByMoss by git-moss.
the class SessionViewSelectMode method updateFirstRow.
/**
* {@inheritDoc}
*/
@Override
public void updateFirstRow() {
final ColorManager colorManager = this.model.getColorManager();
final ViewManager viewManager = this.surface.getViewManager();
for (int i = 0; i < 8; i++) this.surface.updateButton(20 + i, colorManager.getColor(VIEWS[i] == null ? AbstractMode.BUTTON_COLOR_OFF : this.isSelected(viewManager, i) ? AbstractMode.BUTTON_COLOR_HI : AbstractMode.BUTTON_COLOR_ON));
}
use of de.mossgrabers.framework.view.ViewManager in project DrivenByMoss by git-moss.
the class SelectPlayViewCommand method execute.
/**
* {@inheritDoc}
*/
@Override
public void execute(final ButtonEvent event) {
if (event != ButtonEvent.DOWN)
return;
final ViewManager viewManager = this.surface.getViewManager();
if (Views.isSessionView(viewManager.getActiveViewId())) {
final IChannelBank tb = this.model.getCurrentTrackBank();
final ITrack selectedTrack = tb.getSelectedTrack();
if (selectedTrack == null) {
this.surface.getDisplay().notify("Please select a track first.");
return;
}
final Integer preferredView = viewManager.getPreferredView(selectedTrack.getPosition());
viewManager.setActiveView(preferredView == null ? Views.VIEW_PLAY : preferredView);
return;
}
final ModeManager modeManager = this.surface.getModeManager();
if (modeManager.isActiveMode(Modes.MODE_VIEW_SELECT))
modeManager.restoreMode();
else
modeManager.setActiveMode(Modes.MODE_VIEW_SELECT);
}
use of de.mossgrabers.framework.view.ViewManager in project DrivenByMoss by git-moss.
the class LayoutCommand method executeNormal.
/**
* {@inheritDoc}
*/
@Override
public void executeNormal(final ButtonEvent event) {
if (event != ButtonEvent.DOWN)
return;
final ViewManager viewManager = this.surface.getViewManager();
if (viewManager.isActiveView(Views.VIEW_PLAY))
viewManager.setActiveView(Views.VIEW_PIANO);
else if (viewManager.isActiveView(Views.VIEW_PIANO))
viewManager.setActiveView(this.model.getHost().hasClips() ? Views.VIEW_DRUM64 : Views.VIEW_PLAY);
else if (viewManager.isActiveView(Views.VIEW_DRUM64))
viewManager.setActiveView(Views.VIEW_PLAY);
else if (viewManager.isActiveView(Views.VIEW_SEQUENCER))
viewManager.setActiveView(Views.VIEW_RAINDROPS);
else if (viewManager.isActiveView(Views.VIEW_RAINDROPS))
viewManager.setActiveView(Views.VIEW_DRUM);
else if (viewManager.isActiveView(Views.VIEW_DRUM))
viewManager.setActiveView(Views.VIEW_DRUM4);
else if (viewManager.isActiveView(Views.VIEW_DRUM4))
viewManager.setActiveView(Views.VIEW_DRUM8);
else if (viewManager.isActiveView(Views.VIEW_DRUM8))
viewManager.setActiveView(Views.VIEW_SEQUENCER);
else {
final PushConfiguration configuration = this.surface.getConfiguration();
if (viewManager.isActiveView(Views.VIEW_SESSION)) {
if (configuration.isFlipSession())
viewManager.setActiveView(Views.VIEW_SCENE_PLAY);
else
configuration.setFlipSession(true);
} else if (viewManager.isActiveView(Views.VIEW_SCENE_PLAY)) {
configuration.setFlipSession(false);
viewManager.setActiveView(Views.VIEW_SESSION);
}
}
}
use of de.mossgrabers.framework.view.ViewManager in project DrivenByMoss by git-moss.
the class SLControllerSetup method createViews.
/**
* {@inheritDoc}
*/
@Override
protected void createViews() {
final SLControlSurface surface = this.getSurface();
final ViewManager viewManager = surface.getViewManager();
viewManager.registerView(Views.VIEW_PLAY, new PlayView(surface, this.model));
viewManager.registerView(Views.VIEW_CONTROL, new ControlView(surface, this.model));
}
Aggregations