use of de.mossgrabers.framework.featuregroup.ViewManager in project DrivenByMoss by git-moss.
the class DrumConfigurationMode method onKnobValue.
/**
* {@inheritDoc}
*/
@Override
public void onKnobValue(final int index, final int value) {
if (!this.model.canSelectedTrackHoldNotes())
return;
final int idx = index < 0 ? this.selectedParam : index;
final Scales scales = this.model.getScales();
final boolean inc = this.model.getValueChanger().isIncrease(value);
final ViewManager viewManager = this.surface.getViewManager();
switch(idx) {
case 6:
case 7:
((DrumView) viewManager.get(Views.DRUM)).changeOctave(ButtonEvent.DOWN, inc, scales.getDrumDefaultOffset(), true, false);
viewManager.get(Views.DRUM).updateNoteMapping();
((INoteMode) this.surface.getModeManager().get(Modes.NOTE)).clearNotes();
break;
default:
// Not used
break;
}
}
use of de.mossgrabers.framework.featuregroup.ViewManager in project DrivenByMoss by git-moss.
the class MaschineJamSessionViewCommand method execute.
/**
* {@inheritDoc}
*/
@Override
public void execute(final ButtonEvent event, final int velocity) {
final ViewManager viewManager = this.surface.getViewManager();
final SessionView sessionView = (SessionView) viewManager.get(Views.SESSION);
final Configuration configuration = this.surface.getConfiguration();
if (event == ButtonEvent.UP) {
// Toggle Arrange and Mix panel layout
if (this.surface.isShiftPressed()) {
final IApplication application = this.model.getApplication();
final boolean isArrange = IApplication.PANEL_LAYOUT_ARRANGE.equals(application.getPanelLayout());
application.setPanelLayout(isArrange ? IApplication.PANEL_LAYOUT_MIX : IApplication.PANEL_LAYOUT_ARRANGE);
return;
}
if (viewManager.isActive(Views.SESSION)) {
// Disable birds-eye-view if active
if (sessionView.isBirdsEyeActive()) {
sessionView.setBirdsEyeActive(false);
this.notifyViewName(false, configuration.isFlipSession());
return;
}
// Flip clips
final boolean flipped = !configuration.isFlipSession();
configuration.setFlipSession(flipped);
this.notifyViewName(false, flipped);
return;
}
// Activate session view
viewManager.setActive(Views.SESSION);
this.notifyViewName(false, configuration.isFlipSession());
} else if (event == ButtonEvent.LONG) {
// Only trigger birds-eye-view if session view is already active
this.surface.setTriggerConsumed(ButtonID.SESSION);
sessionView.setBirdsEyeActive(true);
this.notifyViewName(true, configuration.isFlipSession());
}
}
use of de.mossgrabers.framework.featuregroup.ViewManager in project DrivenByMoss by git-moss.
the class MaschineJamStartSceneCommand method executeNormal.
/**
* {@inheritDoc}
*/
@Override
public void executeNormal(final ButtonEvent event) {
if (event != ButtonEvent.DOWN)
return;
final ViewManager viewManager = this.surface.getViewManager();
if (this.surface.isPressed(ButtonID.SEQUENCER)) {
this.surface.setTriggerConsumed(ButtonID.SEQUENCER);
if (SEQUENCER_VIEWS[this.index] != null) {
this.activatePreferredView(SEQUENCER_VIEWS[this.index]);
this.mvHelper.delayDisplay(() -> viewManager.getActive().getName());
}
return;
}
if (this.surface.isPressed(ButtonID.NOTE)) {
this.surface.setTriggerConsumed(ButtonID.NOTE);
if (PLAY_VIEWS[this.index] != null) {
this.activatePreferredView(PLAY_VIEWS[this.index]);
this.mvHelper.delayDisplay(() -> viewManager.getActive().getName());
}
return;
}
super.executeNormal(event);
}
use of de.mossgrabers.framework.featuregroup.ViewManager in project DrivenByMoss by git-moss.
the class AbstractControllerSetup method activateBrowserObserver.
/**
* De-/Activate the browser view depending on the browsers' active state.
*
* @param browserView The view to hide/show when the browser becomes de-/active
*/
protected void activateBrowserObserver(final Views browserView) {
this.model.getBrowser().addActiveObserver(isActive -> {
final ViewManager viewManager = this.getSurface().getViewManager();
if (isActive.booleanValue()) {
final Views previousViewId = viewManager.getPreviousID();
viewManager.setTemporary(browserView);
if (viewManager.getPreviousID() == Views.SHIFT)
viewManager.setPreviousID(previousViewId);
} else if (viewManager.isActive(browserView))
viewManager.restore();
});
}
use of de.mossgrabers.framework.featuregroup.ViewManager in project DrivenByMoss by git-moss.
the class ViewMultiSelectCommand method executeNormal.
/**
* {@inheritDoc}
*/
@Override
public void executeNormal(final ButtonEvent event) {
if (event != this.triggerEvent)
return;
final ViewManager viewManager = this.surface.getViewManager();
final Views activeViewId = viewManager.getActiveID();
int index = this.viewIds.indexOf(activeViewId) + 1;
if (index < 0 || index >= this.viewIds.size())
index = 0;
final Views viewId = this.viewIds.get(index);
if (viewManager.isActive(viewId))
return;
viewManager.setActive(viewId);
if (this.displayName)
this.surface.getDisplay().notify(viewManager.get(viewId).getName());
}
Aggregations