use of de.mossgrabers.framework.featuregroup.ViewManager in project DrivenByMoss by git-moss.
the class SelectPlayViewCommand method executeNormal.
/**
* {@inheritDoc}
*/
@Override
public void executeNormal(final ButtonEvent event) {
if (event != ButtonEvent.DOWN)
return;
final ITrack cursorTrack = this.model.getCursorTrack();
// Restore the previous play view if coming from one not on the list
final ViewManager viewManager = this.surface.getViewManager();
final Views activeViewId = viewManager.getActiveID();
if (cursorTrack.doesExist() && !this.allViewIds.contains(activeViewId)) {
final Views viewID = viewManager.getPreferredView(cursorTrack.getPosition());
if (viewID != null) {
viewManager.setActive(viewID);
this.surface.getDisplay().notify(viewManager.get(viewID).getName());
return;
}
}
super.executeNormal(event);
// Store the newly selected view for the current track
if (cursorTrack.doesExist())
viewManager.setPreferredView(cursorTrack.getPosition(), viewManager.getActiveID());
}
use of de.mossgrabers.framework.featuregroup.ViewManager in project DrivenByMoss by git-moss.
the class PlaySelectCommand method executeNormal.
/**
* {@inheritDoc}}
*/
@Override
public void executeNormal(final ButtonEvent event) {
if (this.surface.isPressed(ButtonID.ALT)) {
this.model.getCursorClip().quantize(1);
this.surface.getDisplay().notify("Quantize");
return;
}
super.executeNormal(event);
final ITrack cursorTrack = this.model.getCursorTrack();
if (cursorTrack.doesExist()) {
final ViewManager viewManager = this.surface.getViewManager();
viewManager.setPreferredView(cursorTrack.getPosition(), viewManager.getActiveID());
}
}
use of de.mossgrabers.framework.featuregroup.ViewManager in project DrivenByMoss by git-moss.
the class StepSequencerSelectCommand method executeNormal.
/**
* {@inheritDoc}}
*/
@Override
public void executeNormal(final ButtonEvent event) {
final ModeManager modeManager = this.surface.getModeManager();
// Toggle note mode
if (this.surface.isPressed(ButtonID.ALT)) {
if (event == ButtonEvent.DOWN) {
this.surface.setTriggerConsumed(ButtonID.ALT);
if (modeManager.isActive(Modes.NOTE))
modeManager.restore();
else
modeManager.setActive(Modes.NOTE);
this.surface.getDisplay().notify("Edit Notes: " + (modeManager.isActive(Modes.NOTE) ? "On" : "Off"));
((INoteMode) modeManager.get(Modes.NOTE)).clearNotes();
}
return;
}
super.executeNormal(event);
if (event == ButtonEvent.UP) {
((INoteMode) modeManager.get(Modes.NOTE)).clearNotes();
final ITrack cursorTrack = this.model.getCursorTrack();
if (cursorTrack.doesExist()) {
final ViewManager viewManager = this.surface.getViewManager();
viewManager.setPreferredView(cursorTrack.getPosition(), viewManager.getActiveID());
}
}
}
use of de.mossgrabers.framework.featuregroup.ViewManager in project DrivenByMoss by git-moss.
the class ShiftView method onButton.
/**
* {@inheritDoc}
*/
@Override
public void onButton(final ButtonID buttonID, final ButtonEvent event, final int velocity) {
if (!ButtonID.isSceneButton(buttonID) || event != ButtonEvent.DOWN)
return;
final int index = buttonID.ordinal() - ButtonID.SCENE1.ordinal();
final ViewManager viewManager = this.surface.getViewManager();
if (viewManager.getActiveIDIgnoreTemporary() == Views.SESSION && VIEW_IDS[index] == Views.SESSION)
((SessionView) viewManager.get(Views.SESSION)).toggleBirdsEyeView();
else
viewManager.setActive(VIEW_IDS[index]);
this.surface.getDisplay().notify(viewManager.get(VIEW_IDS[index]).getName());
if (Views.SESSION.equals(VIEW_IDS[index]))
return;
final ITrack cursorTrack = this.model.getCursorTrack();
if (cursorTrack.doesExist())
viewManager.setPreferredView(cursorTrack.getPosition(), VIEW_IDS[index]);
}
use of de.mossgrabers.framework.featuregroup.ViewManager in project DrivenByMoss by git-moss.
the class DrumSequencerSelectCommand method executeNormal.
/**
* {@inheritDoc}}
*/
@Override
public void executeNormal(final ButtonEvent event) {
final ModeManager modeManager = this.surface.getModeManager();
// Toggle note mode
if (this.surface.isPressed(ButtonID.ALT)) {
if (event == ButtonEvent.DOWN) {
this.surface.setTriggerConsumed(ButtonID.ALT);
if (modeManager.isActive(Modes.NOTE))
modeManager.restore();
else
modeManager.setActive(Modes.NOTE);
this.surface.getDisplay().notify("Edit Notes: " + (modeManager.isActive(Modes.NOTE) ? "On" : "Off"));
((INoteMode) modeManager.get(Modes.NOTE)).clearNotes();
}
return;
}
super.executeNormal(event);
if (event == ButtonEvent.UP) {
((INoteMode) modeManager.get(Modes.NOTE)).clearNotes();
final ITrack cursorTrack = this.model.getCursorTrack();
if (cursorTrack.doesExist()) {
final ViewManager viewManager = this.surface.getViewManager();
viewManager.setPreferredView(cursorTrack.getPosition(), viewManager.getActiveID());
}
}
}
Aggregations