use of de.mossgrabers.framework.daw.data.bank.ISendBank in project DrivenByMoss by git-moss.
the class DeviceLayerMode method onKnobTouch.
/**
* {@inheritDoc}
*/
@Override
public void onKnobTouch(final int index, final boolean isTouched) {
final Optional<ILayer> channelOpt = this.bank.getSelectedItem();
if (channelOpt.isEmpty())
return;
final ILayer channel = channelOpt.get();
this.isKnobTouched[index] = isTouched;
final ISendBank sendBank = channel.getSendBank();
if (isTouched && this.surface.isDeletePressed()) {
this.surface.setTriggerConsumed(ButtonID.DELETE);
switch(index) {
case 0:
channel.resetVolume();
break;
case 1:
channel.resetPan();
break;
default:
if (!this.isPush2 || index >= 4)
sendBank.getItem(this.getSendIndex(index)).resetValue();
break;
}
return;
}
switch(index) {
case 0:
channel.touchVolume(isTouched);
break;
case 1:
channel.touchPan(isTouched);
break;
default:
if (!this.isPush2 || index >= 4)
sendBank.getItem(this.getSendIndex(index)).touchValue(isTouched);
break;
}
this.checkStopAutomationOnKnobRelease(isTouched);
}
use of de.mossgrabers.framework.daw.data.bank.ISendBank in project DrivenByMoss by git-moss.
the class TrackMode method updateDisplay1.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay1(final ITextDisplay display) {
final ITrackBank tb = this.model.getCurrentTrackBank();
final Optional<ITrack> track = tb.getSelectedItem();
if (track.isEmpty())
display.setRow(1, " Please selecta track... ");
else {
final ITrack t = track.get();
final PushConfiguration config = this.surface.getConfiguration();
final int upperBound = this.model.getValueChanger().getUpperBound();
final String volValueStr = config.isEnableVUMeters() ? Push1Display.formatValue(t.getVolume(), t.getVu(), upperBound) : Push1Display.formatValue(t.getVolume(), upperBound);
display.setCell(0, 0, "Volume").setCell(1, 0, t.getVolumeStr(8)).setCell(2, 0, volValueStr);
display.setCell(0, 1, "Pan").setCell(1, 1, t.getPanStr(8)).setCell(2, 1, t.getPan(), Format.FORMAT_PAN);
final int sendStart = 2;
final int sendCount = 6;
final boolean isEffectTrackBankActive = this.model.isEffectTrackBankActive();
final ISendBank sendBank = t.getSendBank();
for (int i = 0; i < sendCount; i++) {
final int pos = sendStart + i;
if (!isEffectTrackBankActive) {
final ISend send = sendBank.getItem(i);
if (send.doesExist())
display.setCell(0, pos, send.getName()).setCell(1, pos, send.getDisplayedValue(8)).setCell(2, pos, send.getValue(), Format.FORMAT_VALUE);
}
}
}
this.drawRow4(display);
}
use of de.mossgrabers.framework.daw.data.bank.ISendBank in project DrivenByMoss by git-moss.
the class ControlMode method sendTrackData.
/**
* Send the track data.
*
* @param d The display
* @param trackIndex The index of the track to which the clips belong
* @param track The track
*/
private static void sendTrackData(final ACVSDisplay d, final int trackIndex, final ITrack track) {
d.setRow(ACVSDisplay.ITEM_ID_TRACK_HEADER_FIRST + trackIndex, track.getName());
d.setColor(ACVSDisplay.ITEM_ID_TRACK_HEADER_FIRST + trackIndex, track.getColor());
d.setRow(ACVSDisplay.ITEM_ID_TRACK_FADER_LEVEL_FIRST + trackIndex, track.getVolumeStr());
// ITEM_ID_TRACK_PEAK_LEVEL_FIRST - not showing up
d.setRow(ACVSDisplay.ITEM_ID_TRACK_PAN_FIRST + trackIndex, track.getPanStr());
d.setScreenItem(ScreenItem.get(ScreenItem.TRACK1_SELECT, trackIndex), track.isSelected() ? 127 : 0);
d.setScreenItem(ScreenItem.get(ScreenItem.TRACK1_TYPE, trackIndex), getTrackType(track));
d.setScreenItem(ScreenItem.get(ScreenItem.TRACK1_SOLO, trackIndex), track.isSolo() ? 127 : 0);
d.setScreenItem(ScreenItem.get(ScreenItem.TRACK1_MUTE, trackIndex), track.isMute() ? 127 : 0);
d.setScreenItem(ScreenItem.get(ScreenItem.TRACK1_SOLOMUTE, trackIndex), track.isMutedBySolo() ? 127 : 0);
// TRACK1_CUE - not supported
d.setScreenItem(ScreenItem.get(ScreenItem.TRACK1_CROSSFADER, trackIndex), getCrossfade(track.getCrossfadeParameter().getValue()));
d.setScreenItem(ScreenItem.get(ScreenItem.TRACK1_REC_ARM, trackIndex), track.isRecArm() ? 127 : 0);
d.setScreenItem(ScreenItem.get(ScreenItem.TRACK1_LEVEL, trackIndex), track.getVolume());
d.setScreenItem(ScreenItem.get(ScreenItem.TRACK1_PAN, trackIndex), track.getPan());
d.setScreenItem(ScreenItem.get(ScreenItem.TRACK1_VU_LEFT, trackIndex), track.getVuLeft());
d.setScreenItem(ScreenItem.get(ScreenItem.TRACK1_VU_RIGHT, trackIndex), track.getVuRight());
d.setScreenItem(ScreenItem.get(ScreenItem.TRACK1_VU_PEAK_LEFT, trackIndex), track.getVuPeakLeft());
d.setScreenItem(ScreenItem.get(ScreenItem.TRACK1_VU_PEAK_RIGHT, trackIndex), track.getVuPeakRight());
final ISendBank sendBank = track.getSendBank();
final ISend send1 = sendBank.getItem(0);
final ISend send2 = sendBank.getItem(1);
final ISend send3 = sendBank.getItem(2);
final ISend send4 = sendBank.getItem(3);
d.setRow(ACVSDisplay.ITEM_ID_TRACK_SEND1_FIRST + trackIndex, send1.getName());
d.setRow(ACVSDisplay.ITEM_ID_TRACK_SEND2_FIRST + trackIndex, send2.getName());
d.setRow(ACVSDisplay.ITEM_ID_TRACK_SEND3_FIRST + trackIndex, send3.getName());
d.setRow(ACVSDisplay.ITEM_ID_TRACK_SEND4_FIRST + trackIndex, send4.getName());
d.setScreenItem(ScreenItem.get(ScreenItem.TRACK1_SEND1_LEVEL, trackIndex), send1.getValue());
d.setScreenItem(ScreenItem.get(ScreenItem.TRACK1_SEND2_LEVEL, trackIndex), send2.getValue());
d.setScreenItem(ScreenItem.get(ScreenItem.TRACK1_SEND3_LEVEL, trackIndex), send3.getValue());
d.setScreenItem(ScreenItem.get(ScreenItem.TRACK1_SEND4_LEVEL, trackIndex), send4.getValue());
}
use of de.mossgrabers.framework.daw.data.bank.ISendBank in project DrivenByMoss by git-moss.
the class MaschineSendSelectCommand method executeShifted.
/**
* {@inheritDoc}
*/
@Override
public void executeShifted(final ButtonEvent event) {
final ModeManager modeManager = this.surface.getModeManager();
final Modes activeMode = modeManager.getActiveID();
super.executeShifted(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.daw.data.bank.ISendBank in project DrivenByMoss by git-moss.
the class SLTrackMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
final ITrack cursorTrack = this.model.getCursorTrack();
final ITextDisplay d = this.surface.getTextDisplay().clearRow(0).clearRow(1);
if (!cursorTrack.doesExist()) {
d.setRow(0, " Please select a track... ").done(0).done(1);
return;
}
d.setCell(0, 0, "Volume").setCell(1, 0, cursorTrack.getVolumeStr(8)).setCell(0, 1, "Pan").setCell(1, 1, cursorTrack.getPanStr(8));
final int sendStart = 2;
final int sendCount = 6;
int pos;
final ISendBank sendBank = cursorTrack.getSendBank();
if (sendBank.getPageSize() > 0) {
for (int i = 0; i < sendCount; i++) {
pos = sendStart + i;
final ISend send = sendBank.getItem(i);
if (send.doesExist())
d.setCell(0, pos, send.getName(8)).setCell(1, pos, send.getDisplayedValue(8));
}
}
d.done(0).done(1);
}
Aggregations