use of de.mossgrabers.framework.featuregroup.ModeManager in project DrivenByMoss by git-moss.
the class AbstractTrackMode method drawRow4.
/**
* Draw the row with track names.
*/
protected void drawRow4() {
final SLMkIIIDisplay d = this.surface.getDisplay();
final ITrackBank tb = this.model.getCurrentTrackBank();
final Optional<ITrack> selectedTrack = tb.getSelectedItem();
if (this.surface.isShiftPressed()) {
this.drawRow4Shifted(d, selectedTrack.isPresent() ? selectedTrack.get() : EmptyTrack.INSTANCE);
return;
}
if (this.surface.isLongPressed(ButtonID.ARROW_DOWN)) {
final ModeManager modeManager = this.surface.getModeManager();
for (int i = 0; i < 8; i++) {
d.setCell(3, i, MODE_MENU[i]);
d.setPropertyColor(i, 2, SLMkIIIColorManager.SLMKIII_GREEN);
d.setPropertyValue(i, 1, modeManager.isActive(MODES[i]) ? 1 : 0);
}
return;
}
// Format track names
for (int i = 0; i < 8; i++) {
final ITrack t = tb.getItem(i);
d.setCell(3, i, StringUtils.shortenAndFixASCII(t.getName(9), 9));
final boolean exists = t.doesExist();
int color;
if (t.isActivated()) {
final String colorIndex = DAWColor.getColorIndex(t.getColor());
color = this.model.getColorManager().getColorIndex(colorIndex);
} else
color = SLMkIIIColorManager.SLMKIII_DARK_GREY;
d.setPropertyColor(i, 2, color);
d.setPropertyValue(i, 1, exists && t.isSelected() ? 1 : 0);
}
}
use of de.mossgrabers.framework.featuregroup.ModeManager in project DrivenByMoss by git-moss.
the class AbstractTrackMode method handleSendEffect.
/**
* Handle the selection of a send effect.
*
* @param sendIndex The index of the send
*/
protected void handleSendEffect(final int sendIndex) {
final ITrackBank tb = this.model.getCurrentTrackBank();
if (tb == null || !tb.canEditSend(sendIndex))
return;
final Modes si = Modes.get(Modes.SEND1, sendIndex);
final ModeManager modeManager = this.surface.getModeManager();
modeManager.setActive(modeManager.isActive(si) ? Modes.TRACK : si);
}
use of de.mossgrabers.framework.featuregroup.ModeManager in project DrivenByMoss by git-moss.
the class PlayView method onButtonRow1.
/**
* {@inheritDoc}
*/
@Override
public void onButtonRow1(final int index, final ButtonEvent event) {
if (event != ButtonEvent.DOWN)
return;
final ModeManager modeManager = this.surface.getModeManager();
final Modes activeModeId = modeManager.getActiveID();
if (Modes.VIEW_SELECT == activeModeId) {
if (index == 0) {
this.surface.getViewManager().setActive(Views.CONTROL);
if (Modes.VOLUME.equals(modeManager.getPreviousID()))
modeManager.restore();
else
modeManager.setActive(Modes.TRACK);
} else
modeManager.restore();
this.surface.turnOffTransport();
return;
}
if (!Modes.SESSION.equals(activeModeId))
modeManager.setActive(Modes.SESSION);
this.model.getSceneBank().getItem(index).launch();
}
use of de.mossgrabers.framework.featuregroup.ModeManager in project DrivenByMoss by git-moss.
the class TransportControl method turnOffTransport.
private void turnOffTransport() {
this.surface.turnOffTransport();
final ModeManager modeManager = this.surface.getModeManager();
if (modeManager.isActive(Modes.VIEW_SELECT))
modeManager.restore();
}
use of de.mossgrabers.framework.featuregroup.ModeManager in project DrivenByMoss by git-moss.
the class ControlView method onButtonRow1Select.
/**
* {@inheritDoc}
*/
@Override
public void onButtonRow1Select() {
final ModeManager modeManager = this.surface.getModeManager();
final boolean selectFixed = Modes.FUNCTIONS.equals(modeManager.getActiveID());
modeManager.setActive(selectFixed ? Modes.FIXED : Modes.FUNCTIONS);
this.model.getHost().showNotification(selectFixed ? "Fixed Length" : "Functions");
}
Aggregations