use of de.mossgrabers.framework.daw.data.ITrack in project DrivenByMoss by git-moss.
the class MuteCommand method execute.
/**
* {@inheritDoc}
*/
@Override
public void execute(final ButtonEvent event) {
// Update for key combinations
this.surface.getViewManager().getActiveView().updateNoteMapping();
final PushConfiguration config = this.surface.getConfiguration();
if (!config.isPush2()) {
config.setTrackState(TrackState.MUTE);
return;
}
// Toggle mute lock mode
if (this.surface.isShiftPressed()) {
if (event == ButtonEvent.UP)
config.setMuteSoloLocked(!config.isMuteSoloLocked());
return;
}
// Behaviour like Push 1
if (config.isMuteSoloLocked()) {
config.setTrackState(TrackState.MUTE);
return;
}
if (event == ButtonEvent.DOWN) {
config.setIsMuteLongPressed(false);
return;
}
if (event == ButtonEvent.LONG) {
config.setIsMuteLongPressed(true);
config.setTrackState(TrackState.MUTE);
return;
}
if (config.isMuteLongPressed()) {
config.setIsMuteLongPressed(false);
return;
}
final Integer activeModeId = this.surface.getModeManager().getActiveModeId();
if (Modes.isTrackMode(activeModeId)) {
final IChannelBank tb = this.model.getCurrentTrackBank();
final ITrack selTrack = tb.getSelectedTrack();
if (selTrack != null)
selTrack.toggleMute();
} else if (Modes.isLayerMode(activeModeId)) {
final ICursorDevice cd = this.model.getCursorDevice();
final IChannel layer = cd.getSelectedLayerOrDrumPad();
if (layer != null)
cd.toggleLayerOrDrumPadMute(layer.getIndex());
} else if (activeModeId == Modes.MODE_MASTER)
this.model.getMasterTrack().toggleMute();
}
use of de.mossgrabers.framework.daw.data.ITrack in project DrivenByMoss by git-moss.
the class SoloCommand method execute.
/**
* {@inheritDoc}
*/
@Override
public void execute(final ButtonEvent event) {
// Update for key combinations
this.surface.getViewManager().getActiveView().updateNoteMapping();
final PushConfiguration config = this.surface.getConfiguration();
if (!config.isPush2()) {
config.setTrackState(TrackState.SOLO);
return;
}
// Toggle solo lock mode
if (this.surface.isShiftPressed()) {
if (event == ButtonEvent.UP)
config.setMuteSoloLocked(!config.isMuteSoloLocked());
return;
}
// Behaviour like Push 1
if (config.isMuteSoloLocked()) {
config.setTrackState(TrackState.SOLO);
return;
}
if (event == ButtonEvent.DOWN) {
config.setIsSoloLongPressed(false);
return;
}
if (event == ButtonEvent.LONG) {
config.setIsSoloLongPressed(true);
config.setTrackState(TrackState.SOLO);
return;
}
if (config.isSoloLongPressed()) {
config.setIsSoloLongPressed(false);
return;
}
final Integer activeModeId = this.surface.getModeManager().getActiveModeId();
if (Modes.isTrackMode(activeModeId)) {
final IChannelBank tb = this.model.getCurrentTrackBank();
final ITrack selTrack = tb.getSelectedTrack();
if (selTrack != null)
selTrack.toggleSolo();
} else if (Modes.isLayerMode(activeModeId)) {
final ICursorDevice cd = this.model.getCursorDevice();
final IChannel layer = cd.getSelectedLayerOrDrumPad();
if (layer != null)
cd.toggleLayerOrDrumPadSolo(layer.getIndex());
} else if (activeModeId == Modes.MODE_MASTER)
this.model.getMasterTrack().toggleSolo();
}
use of de.mossgrabers.framework.daw.data.ITrack in project DrivenByMoss by git-moss.
the class TrackMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
final IChannelBank currentTrackBank = this.model.getCurrentTrackBank();
final ITrack t = currentTrackBank.getSelectedTrack();
final Display d = this.surface.getDisplay();
if (t == null) {
d.setRow(0, " Please select a track... ").clearRow(2).done(2);
return;
}
d.setCell(0, 0, "Volume").setCell(2, 0, t.getVolumeStr(8)).setCell(0, 1, "Pan").setCell(2, 1, t.getPanStr(8));
int sendStart = 2;
int sendCount = 6;
if (this.surface.getConfiguration().isDisplayCrossfader()) {
sendStart = 3;
sendCount = 5;
final String crossfadeMode = t.getCrossfadeMode();
d.setCell(0, 2, "Crossfdr").setCell(2, 2, "A".equals(crossfadeMode) ? "A" : "B".equals(crossfadeMode) ? " B" : " <> ");
}
final IChannelBank fxTrackBank = this.model.getEffectTrackBank();
int pos;
if (fxTrackBank != null) {
final boolean isFX = this.model.isEffectTrackBankActive();
for (int i = 0; i < sendCount; i++) {
final ITrack fxTrack = fxTrackBank.getTrack(i);
final boolean isEmpty = isFX || !fxTrack.doesExist();
pos = sendStart + i;
d.setCell(0, pos, isEmpty ? "" : fxTrack.getName()).setCell(2, pos, isEmpty ? "" : t.getSend(i).getDisplayedValue(8));
}
if (isFX)
d.setCell(0, 7, t.getName());
} else {
for (int i = 0; i < sendCount; i++) {
pos = sendStart + i;
final ISend send = t.getSend(i);
d.setCell(0, pos, send.getName(8)).setCell(2, pos, send.getDisplayedValue(8));
}
}
d.done(0).done(2);
}
use of de.mossgrabers.framework.daw.data.ITrack in project DrivenByMoss by git-moss.
the class SendMode method updateDisplay1.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay1(final ITextDisplay display) {
final ITrackBank tb = this.model.getCurrentTrackBank();
for (int i = 0; i < 8; i++) {
final ITrack t = tb.getItem(i);
if (t.doesExist()) {
final ISend send = t.getSendBank().getItem(this.sendIndex);
display.setCell(0, i, send.getName());
display.setCell(1, i, send.getDisplayedValue(8));
display.setCell(2, i, send.getValue(), Format.FORMAT_VALUE);
}
}
this.drawRow4(display);
}
use of de.mossgrabers.framework.daw.data.ITrack in project DrivenByMoss by git-moss.
the class SendMode method updateDisplay2.
/**
* {@inheritDoc}
*/
@SuppressWarnings("null")
@Override
public void updateDisplay2(final IGraphicDisplay display) {
this.updateTrackMenu(5 + this.sendIndex % 4);
final ITrackBank tb = this.model.getCurrentTrackBank();
final IValueChanger valueChanger = this.model.getValueChanger();
final int sendOffset = this.surface.getConfiguration().isSendsAreToggled() ? 4 : 0;
for (int i = 0; i < 8; i++) {
final ITrack t = tb.getItem(i);
final SendData[] sendData = new SendData[4];
for (int j = 0; j < 4; j++) {
final int sendPos = sendOffset + j;
final ISend send = t.getSendBank().getItem(sendPos);
final boolean exists = send != null && send.doesExist();
sendData[j] = new SendData(exists ? send.getName() : " ", exists && this.sendIndex == sendPos && this.isKnobTouched[i] ? send.getDisplayedValue(8) : "", valueChanger.toDisplayValue(exists ? send.getValue() : -1), valueChanger.toDisplayValue(exists ? send.getModulatedValue() : -1), this.sendIndex == sendPos);
}
final Pair<String, Boolean> pair = this.menu.get(i);
display.addSendsElement(pair.getKey(), pair.getValue().booleanValue(), t.doesExist() ? t.getName() : "", this.updateType(t), t.getColor(), t.isSelected(), sendData, false, t.isActivated(), t.isActivated());
}
}
Aggregations