use of de.mossgrabers.framework.mode.Modes in project DrivenByMoss by git-moss.
the class ShiftView method onSelectTrack.
/**
* {@inheritDoc}
*/
@Override
public void onSelectTrack(final int index, final ButtonEvent event) {
if (event != ButtonEvent.DOWN)
return;
final ITrackBank tb = this.model.getCurrentTrackBank();
final ModeManager modeManager = this.surface.getModeManager();
switch(index) {
case 0:
tb.getSceneBank().selectPreviousPage();
break;
case 1:
tb.getSceneBank().selectNextPage();
break;
case 2:
tb.selectPreviousPage();
break;
case 3:
tb.selectNextPage();
break;
case 4:
modeManager.setActive(Modes.VOLUME);
this.surface.getConfiguration().setFaderCtrl("Volume");
this.surface.getDisplay().notify("Volume");
break;
case 5:
modeManager.setActive(Modes.PAN);
this.surface.getConfiguration().setFaderCtrl("Pan");
this.surface.getDisplay().notify("Pan");
break;
case 6:
if (this.model.isEffectTrackBankActive())
return;
Modes mode = Modes.get(modeManager.getActiveID(), 1);
// Wrap
if (!Modes.isSendMode(mode))
mode = Modes.SEND1;
// Check if Send channel exists
if (Modes.isSendMode(mode) && tb.canEditSend(mode.ordinal() - Modes.SEND1.ordinal()))
mode = Modes.SEND1;
modeManager.setActive(mode);
final String name = "Send " + (mode.ordinal() - Modes.SEND1.ordinal() + 1);
this.surface.getConfiguration().setFaderCtrl(name);
this.surface.getDisplay().notify(name);
break;
case 7:
if (modeManager.isActive(Modes.DEVICE_PARAMS))
this.model.getBrowser().replace(this.model.getCursorDevice());
else {
modeManager.setActive(Modes.DEVICE_PARAMS);
this.surface.getConfiguration().setFaderCtrl("Device");
this.surface.getDisplay().notify("Device");
}
break;
default:
// Not used
break;
}
}
use of de.mossgrabers.framework.mode.Modes in project DrivenByMoss by git-moss.
the class ControlMode method sendAdditionalForceParameters.
/**
* Send additional parameters specific to the Force model.
*
* @param d The display
*/
private void sendAdditionalForceParameters(final ACVSDisplay d) {
final Modes activeMode = this.surface.getTrackModeManager().getActiveID();
final int modeColor = MODE_COLORS.getOrDefault(activeMode, Integer.valueOf(ACVSColorManager.COLOR_BLACK)).intValue();
for (int trackIndex = 0; trackIndex < 8; trackIndex++) {
final ITrack track = this.model.getTrackBank().getItem(trackIndex);
int color;
if (this.surface.isShiftPressed()) {
if (LaunchQuantization.values()[trackIndex] == this.model.getTransport().getDefaultLaunchQuantization())
color = ACVSColorManager.COLOR_SILVER;
else
color = ACVSColorManager.COLOR_BLACK;
} else {
if (!track.doesExist())
color = ACVSColorManager.COLOR_BLACK;
else
color = track.isSelected() ? ACVSColorManager.COLOR_SILVER : this.colorManager.getColorIndex(DAWColor.getColorIndex(track.getColor()));
}
d.setScreenItem(ScreenItem.get(ScreenItem.FORCE_TRACK1_COLOR, trackIndex), color);
switch(activeMode) {
case CROSSFADE_MODE_A:
final double value1 = this.model.getValueChanger().toNormalizedValue(track.getCrossfadeParameter().getValue());
color = value1 < 0.1 ? modeColor : ACVSColorManager.COLOR_BLACK;
break;
case CROSSFADE_MODE_B:
final double value2 = this.model.getValueChanger().toNormalizedValue(track.getCrossfadeParameter().getValue());
color = value2 > 0.9 ? modeColor : ACVSColorManager.COLOR_BLACK;
break;
case MUTE:
color = track.isMute() ? modeColor : ACVSColorManager.COLOR_BLACK;
break;
case SOLO:
color = track.isSolo() ? modeColor : ACVSColorManager.COLOR_BLACK;
break;
case REC_ARM:
color = track.isRecArm() ? modeColor : ACVSColorManager.COLOR_BLACK;
break;
case STOP_CLIP:
default:
color = modeColor;
break;
}
d.setScreenItem(ScreenItem.get(ScreenItem.FORCE_TRACK1_ASSIGN, trackIndex), color);
}
}
use of de.mossgrabers.framework.mode.Modes in project DrivenByMoss by git-moss.
the class SelectTrackSendOrClipLengthCommand method executeNormal.
/**
* {@inheritDoc}
*/
@Override
public void executeNormal(final ButtonEvent event) {
if (event != ButtonEvent.UP)
return;
final ModeManager modeManager = this.surface.getModeManager();
if (this.surface.isPressed(ButtonID.SEND1)) {
final Modes sendModeId = Modes.get(Modes.SEND1, this.index);
this.surface.setTriggerConsumed(ButtonID.SEND1);
// Keep the send step selection in sync
if (this.surface.isMkII())
((ModeMultiSelectCommand<?, ?>) this.surface.getButton(ButtonID.SEND1).getCommand()).activateMode(sendModeId);
else
modeManager.setActive(sendModeId);
// Display the sends name
String modeName = "Send " + (this.index + 1) + ": ";
final ITrackBank trackBank = this.model.getTrackBank();
Optional<ITrack> selectedTrack = trackBank.getSelectedItem();
if (selectedTrack.isEmpty()) {
final ITrack item = trackBank.getItem(0);
selectedTrack = item.doesExist() ? Optional.of(item) : Optional.empty();
}
if (selectedTrack.isEmpty())
modeName += "-";
else
modeName += selectedTrack.get().getSendBank().getItem(this.index).getName();
this.surface.getDisplay().notify(modeName);
return;
}
if (this.surface.isMkII() && this.surface.isPressed(ButtonID.SEND2)) {
modeManager.setActive(Modes.USER);
this.surface.setTriggerConsumed(ButtonID.USER);
modeManager.get(Modes.USER).selectItemPage(this.index);
return;
}
this.model.getCurrentTrackBank().getItem(this.index).selectOrExpandGroup();
}
use of de.mossgrabers.framework.mode.Modes in project DrivenByMoss by git-moss.
the class TrackCommand method execute.
/**
* {@inheritDoc}
*/
@Override
public void execute(final ButtonEvent event, final int velocity) {
if (event != ButtonEvent.DOWN)
return;
final PushConfiguration config = this.surface.getConfiguration();
if (this.surface.isShiftPressed()) {
config.setVUMetersEnabled(!config.isEnableVUMeters());
return;
}
final ModeManager modeManager = this.surface.getModeManager();
final Modes currentMode = modeManager.getActiveID();
if (currentMode != null) {
if (config.isPush2()) {
if (Modes.TRACK.equals(currentMode) || Modes.VOLUME.equals(currentMode) || Modes.CROSSFADER.equals(currentMode) || Modes.PAN.equals(currentMode)) {
this.model.toggleCurrentTrackBank();
} else if (currentMode.ordinal() >= Modes.SEND1.ordinal() && currentMode.ordinal() <= Modes.SEND8.ordinal()) {
modeManager.setActive(Modes.TRACK);
this.model.toggleCurrentTrackBank();
} else
modeManager.setActive(config.getCurrentMixMode());
} else {
// Layer mode selection for Push 1
if (this.surface.isSelectPressed() && Modes.isLayerMode(currentMode)) {
modeManager.setActive(Modes.DEVICE_LAYER);
return;
}
if (Modes.TRACK.equals(currentMode))
this.model.toggleCurrentTrackBank();
else
modeManager.setActive(Modes.TRACK);
}
} else
modeManager.setActive(Modes.TRACK);
config.setDebugMode(modeManager.getActiveID());
final ITrackBank tb = this.model.getCurrentTrackBank();
final Optional<ITrack> track = tb.getSelectedItem();
if (track.isEmpty())
tb.getItem(0).select();
}
use of de.mossgrabers.framework.mode.Modes in project DrivenByMoss by git-moss.
the class ModeSwitcher method scrollDown.
/**
* Scroll downwards through the modes.
*/
public void scrollDown() {
final ModeManager modeManager = this.surface.getModeManager();
final Modes activeModeId = modeManager.getActiveID();
if (Modes.PAN == activeModeId) {
modeManager.setActive(Modes.DEVICE_PARAMS);
this.surface.getDisplay().notify("Parameters");
} else if (Modes.VOLUME == activeModeId) {
modeManager.setActive(Modes.PAN);
this.surface.getDisplay().notify("Panorama");
} else if (Modes.TRACK == activeModeId) {
modeManager.setActive(Modes.VOLUME);
this.surface.getDisplay().notify("Volume");
} else {
modeManager.setActive(Modes.TRACK);
this.surface.getDisplay().notify("Track");
}
}
Aggregations