use of de.mossgrabers.framework.mode.Modes in project DrivenByMoss by git-moss.
the class PadModeSelectView method drawGrid.
/**
* {@inheritDoc}
*/
@Override
public void drawGrid() {
final IPadGrid pads = this.surface.getPadGrid();
for (int x = 0; x < 8; x++) pads.lightEx(x, 0, LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_BLACK);
final SessionView view = (SessionView) this.surface.getViewManager().get(Views.SESSION);
final Modes padMode = view.getPadMode();
pads.lightEx(0, 1, padMode == null ? LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_GREEN_HI : LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_GREEN_LO);
pads.lightEx(1, 1, padMode == Modes.REC_ARM ? LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_RED_HI : LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_RED_LO);
pads.lightEx(2, 1, padMode == Modes.TRACK_SELECT ? LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_WHITE : LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_GREY_LO);
pads.lightEx(3, 1, padMode == Modes.MUTE ? LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_AMBER_HI : LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_AMBER_LO);
pads.lightEx(4, 1, padMode == Modes.SOLO ? LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_YELLOW_HI : LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_YELLOW_LO);
pads.lightEx(5, 1, padMode == Modes.STOP_CLIP ? LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_PINK_HI : LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_ROSE);
pads.lightEx(6, 1, LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_BLACK);
pads.lightEx(7, 1, LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_BLACK);
}
use of de.mossgrabers.framework.mode.Modes in project DrivenByMoss by git-moss.
the class PageCommand method execute.
/**
* {@inheritDoc}
*/
@Override
public void execute(final ButtonEvent event, final int velocity) {
if (event != ButtonEvent.DOWN)
return;
final ModeManager modeManager = this.surface.getModeManager();
final Modes mode = modeManager.getActiveID();
switch(mode) {
case DEVICE_PARAMS:
final ICursorDevice cursorDevice = this.model.getCursorDevice();
if (this.direction == Direction.LEFT)
cursorDevice.selectPrevious();
else
cursorDevice.selectNext();
this.mvHelper.notifySelectedDevice();
break;
case USER:
final IParameterBank userBank = this.model.getUserParameterBank();
if (this.direction == Direction.LEFT)
userBank.selectPreviousPage();
else
userBank.selectNextPage();
this.mvHelper.notifySelectedUserPage();
break;
case BROWSER:
if (this.direction == Direction.LEFT)
this.model.getBrowser().previousContentType();
else
this.model.getBrowser().nextContentType();
break;
default:
final ITrack cursorTrack = this.model.getCursorTrack();
if (!cursorTrack.doesExist())
return;
final ISlotBank slotBank = cursorTrack.getSlotBank();
if (this.direction == Direction.LEFT) {
if (this.surface.isShiftPressed()) {
this.surface.setStopConsumed();
slotBank.selectPreviousPage();
} else
slotBank.selectPreviousItem();
} else {
if (this.surface.isShiftPressed()) {
this.surface.setStopConsumed();
slotBank.selectNextPage();
} else
slotBank.selectNextItem();
}
break;
}
}
use of de.mossgrabers.framework.mode.Modes in project DrivenByMoss by git-moss.
the class MaschineSendSelectCommand method executeNormal.
/**
* {@inheritDoc}
*/
@Override
public void executeNormal(final ButtonEvent event) {
final ModeManager modeManager = this.surface.getModeManager();
final Modes activeMode = modeManager.getActiveID();
super.executeNormal(event);
final Modes newMode = modeManager.getActiveID();
if (activeMode == newMode)
return;
final int sendIndex = newMode.ordinal() - Modes.SEND1.ordinal();
final Optional<ITrack> t = this.model.getCurrentTrackBank().getSelectedItem();
if (t.isEmpty())
return;
final ISendBank sendBank = t.get().getSendBank();
final ISend send = sendBank.getItem(sendIndex);
if (send.doesExist())
this.surface.getDisplay().notify("Send " + (sendIndex + 1) + ": " + send.getName());
}
use of de.mossgrabers.framework.mode.Modes in project DrivenByMoss by git-moss.
the class ModeMultiSelectCommand method executeNormal.
/**
* {@inheritDoc}
*/
@Override
public void executeNormal(final ButtonEvent event) {
if (event != ButtonEvent.UP)
return;
final Modes activeModeId = this.modeManager.getActiveID();
Modes newMode = this.currentModeID;
// If coming from a mode not on the list, activate the last one
if (this.currentModeID.equals(activeModeId)) {
final ITrackBank trackBank = this.model.getTrackBank();
int index = this.modeIds.indexOf(activeModeId);
// If a send mode is selected check if the according send exists
do {
index++;
if (index < 0 || index >= this.modeIds.size())
index = 0;
newMode = this.modeIds.get(index);
} while (Modes.isSendMode(newMode) && !trackBank.canEditSend(newMode.ordinal() - Modes.SEND1.ordinal()));
}
this.activateMode(newMode);
}
use of de.mossgrabers.framework.mode.Modes in project DrivenByMoss by git-moss.
the class LaunchkeyMiniMk3ControllerSetup method processProgramChangeAction.
private void processProgramChangeAction(final int value) {
final Modes modeID = this.getSurface().getModeManager().getActiveID();
if (modeID == null)
return;
switch(modeID) {
case VOLUME:
case PAN:
case SEND1:
case SEND2:
final ITrackBank currentTrackBank = this.model.getCurrentTrackBank();
if (value > 0)
currentTrackBank.selectNextPage();
else
currentTrackBank.selectPreviousPage();
this.mvHelper.notifySelectedTrack();
break;
case DEVICE_PARAMS:
final ICursorDevice cursorDevice = this.model.getCursorDevice();
final IParameterBank parameterBank = cursorDevice.getParameterBank();
if (value > 0)
parameterBank.selectNextItem();
else
parameterBank.selectPreviousItem();
this.mvHelper.notifySelectedParameterPage();
break;
default:
// Not used
break;
}
}
Aggregations