use of de.mossgrabers.framework.featuregroup.ModeManager in project DrivenByMoss by git-moss.
the class ControlView method onButtonRow1.
/**
* {@inheritDoc}
*/
@Override
public void onButtonRow1(final int index, final ButtonEvent event) {
if (event != ButtonEvent.DOWN)
return;
final ModeManager modeManager = this.surface.getModeManager();
Modes activeModeId = modeManager.getActiveID();
if (Modes.VIEW_SELECT == activeModeId) {
if (index == 1) {
this.surface.getViewManager().setActive(Views.PLAY);
if (Modes.VOLUME.equals(modeManager.getPreviousID()))
modeManager.restore();
else
modeManager.setActive(Modes.SESSION);
} else
modeManager.restore();
this.surface.turnOffTransport();
return;
}
if (!Modes.FUNCTIONS.equals(activeModeId) && !Modes.FIXED.equals(activeModeId)) {
modeManager.setActive(Modes.FUNCTIONS);
activeModeId = Modes.FUNCTIONS;
}
if (Modes.FIXED.equals(activeModeId)) {
this.surface.getConfiguration().setNewClipLength(index);
return;
}
switch(index) {
// Undo
case 0:
this.model.getApplication().undo();
break;
// Redo
case 1:
this.model.getApplication().redo();
break;
// Delete
case 2:
this.model.getApplication().deleteSelection();
break;
// Double
case 3:
this.model.getApplication().duplicate();
break;
// New
case 4:
this.newCommand.execute();
break;
// Open the VST window
case 5:
this.model.getCursorDevice().toggleWindowOpen();
break;
// Metronome
case 6:
this.model.getTransport().toggleMetronome();
break;
// Tap Tempo on MKII
case 7:
this.model.getTransport().tapTempo();
break;
default:
// Not used
break;
}
}
use of de.mossgrabers.framework.featuregroup.ModeManager in project DrivenByMoss by git-moss.
the class ControlView method onButtonRow2Select.
/**
* {@inheritDoc}
*/
@Override
public void onButtonRow2Select() {
final ModeManager modeManager = this.surface.getModeManager();
final boolean selectFrame = Modes.TRACK_DETAILS.equals(modeManager.getActiveID());
modeManager.setActive(selectFrame ? Modes.FRAME : Modes.TRACK_DETAILS);
this.model.getHost().showNotification(selectFrame ? "Layouts & Panels" : "Track & Device");
}
use of de.mossgrabers.framework.featuregroup.ModeManager in project DrivenByMoss by git-moss.
the class ButtonRowSelectCommand method execute.
/**
* {@inheritDoc}
*/
@Override
public void execute(final ButtonEvent event, final int velocity) {
if (event != ButtonEvent.DOWN)
return;
final IView view = this.surface.getViewManager().getActive();
if (view == null)
return;
final ModeManager modeManager = this.surface.getModeManager();
switch(this.row) {
case 0:
((SLView) view).onButtonRow1Select();
break;
case 1:
modeManager.setActive(Modes.DEVICE_PARAMS);
this.model.getHost().showNotification("Device Parameters");
break;
case 2:
((SLView) view).onButtonRow2Select();
break;
case 3:
modeManager.setActive(Modes.TRACK);
this.model.getHost().showNotification("Track");
break;
case 4:
break;
case 5:
case 6:
case 7:
modeManager.setActive(Modes.VOLUME);
this.model.getHost().showNotification("Volume");
break;
default:
// Intentionally empty
break;
}
}
use of de.mossgrabers.framework.featuregroup.ModeManager 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;
switch(buttonID) {
case SCENE6:
this.model.toggleCurrentTrackBank();
final boolean isEffectTrackBank = this.model.isEffectTrackBankActive();
if (isEffectTrackBank) {
// No Sends on effect tracks
final ModeManager modeManager = this.surface.getModeManager();
if (Modes.isSendMode(modeManager.getActiveID()))
modeManager.setActive(Modes.VOLUME);
}
this.surface.getDisplay().notify(isEffectTrackBank ? "Effect Tracks" : "Instrument/Audio Tracks");
break;
case SCENE7:
this.model.getCursorDevice().toggleWindowOpen();
break;
case SCENE8:
this.model.getCurrentTrackBank().stop();
break;
default:
final int index = buttonID.ordinal() - ButtonID.SCENE1.ordinal();
this.surface.setTrackState(index);
final String softKeys = APCminiConfiguration.SOFT_KEYS_OPTIONS.get(index);
this.surface.getConfiguration().setSoftKeys(softKeys);
this.surface.getDisplay().notify(softKeys);
break;
}
}
use of de.mossgrabers.framework.featuregroup.ModeManager 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());
}
}
}
Aggregations