use of de.mossgrabers.framework.daw.data.ISend in project DrivenByMoss by git-moss.
the class FireLayerMode method getSendLabel.
private static String getSendLabel(final ISendBank sendBank, final int index) {
final int pos = index + 1;
if (sendBank == null)
return "No FX " + pos;
final ISend send = sendBank.getItem(index);
if (!send.doesExist())
return "No FX " + pos;
return send.getName(4) + ": " + send.getDisplayedValue();
}
use of de.mossgrabers.framework.daw.data.ISend in project DrivenByMoss by git-moss.
the class DeviceLayerModeSend method updateDisplayElements.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplayElements(final IGraphicDisplay display, final Optional<ILayer> l) {
this.updateMenuItems(5 + this.sendIndex % 4);
final PushConfiguration config = this.surface.getConfiguration();
// Drum Pad Bank has size of 16, layers only 8
final int offset = this.getDrumPadIndex();
final int sendOffset = config.isSendsAreToggled() ? 4 : 0;
for (int i = 0; i < 8; i++) {
final IChannel layer = this.bank.getItem(offset + i);
final Pair<String, Boolean> pair = this.menu.get(i);
final String topMenu = pair.getKey();
final boolean isTopMenuOn = pair.getValue().booleanValue();
// Channel info
final SendData[] sendData = new SendData[4];
for (int j = 0; j < 4; j++) {
final int sendPos = sendOffset + j;
final ISend send = layer.getSendBank().getItem(sendPos);
final boolean exists = send.doesExist();
sendData[j] = new SendData(send.getName(), exists && this.sendIndex == sendPos && this.isKnobTouched[i] ? send.getDisplayedValue() : "", exists ? send.getValue() : 0, exists ? send.getModulatedValue() : 0, this.sendIndex == sendPos);
}
display.addSendsElement(topMenu, isTopMenuOn, layer.doesExist() ? layer.getName() : "", ChannelType.LAYER, this.bank.getItem(offset + i).getColor(), layer.isSelected(), sendData, false, layer.isActivated(), layer.isActivated());
}
}
use of de.mossgrabers.framework.daw.data.ISend in project DrivenByMoss by git-moss.
the class DeviceLayerMode method updateDisplayElements.
/**
* Update all 8 elements.
*
* @param display The display
* @param l The channel data
*/
protected void updateDisplayElements(final IGraphicDisplay display, final Optional<ILayer> l) {
// Drum Pad Bank has size of 16, layers only 8
final int offset = this.getDrumPadIndex();
// Get the index at which to draw the Sends element
int sendsIndex = l.isEmpty() ? -1 : l.get().getIndex() - offset + 1;
if (sendsIndex == 8)
sendsIndex = 6;
this.updateMenuItems(-1);
final PushConfiguration config = this.surface.getConfiguration();
for (int i = 0; i < 8; i++) {
final IChannel layer = this.bank.getItem(offset + i);
final Pair<String, Boolean> pair = this.menu.get(i);
final String topMenu = pair.getKey();
final boolean isTopMenuOn = pair.getValue().booleanValue();
// Channel info
final String bottomMenu = layer.doesExist() ? layer.getName(12) : "";
final ColorEx bottomMenuColor = layer.getColor();
final boolean isBottomMenuOn = layer.isSelected();
if (layer.isSelected()) {
final IValueChanger valueChanger = this.model.getValueChanger();
final boolean enableVUMeters = config.isEnableVUMeters();
final int vuR = valueChanger.toDisplayValue(enableVUMeters ? layer.getVuRight() : 0);
final int vuL = valueChanger.toDisplayValue(enableVUMeters ? layer.getVuLeft() : 0);
display.addChannelElement(topMenu, isTopMenuOn, bottomMenu, ChannelType.LAYER, bottomMenuColor, isBottomMenuOn, valueChanger.toDisplayValue(layer.getVolume()), valueChanger.toDisplayValue(layer.getModulatedVolume()), this.isKnobTouched[0] ? layer.getVolumeStr(8) : "", valueChanger.toDisplayValue(layer.getPan()), valueChanger.toDisplayValue(layer.getModulatedPan()), this.isKnobTouched[1] ? layer.getPanStr(8) : "", vuL, vuR, layer.isMute(), layer.isSolo(), false, layer.isActivated(), 0, false);
} else if (sendsIndex == i && l.isPresent()) {
final ITrackBank fxTrackBank = this.model.getEffectTrackBank();
final SendData[] sendData = new SendData[4];
for (int j = 0; j < 4; j++) {
final int sendOffset = config.isSendsAreToggled() ? 4 : 0;
final int sendPos = sendOffset + j;
final ISend send = l.get().getSendBank().getItem(sendPos);
final boolean doesExist = send.doesExist();
sendData[j] = new SendData(fxTrackBank == null ? send.getName() : fxTrackBank.getItem(sendPos).getName(), doesExist && this.isKnobTouched[4 + j] ? send.getDisplayedValue() : "", doesExist ? send.getValue() : 0, doesExist ? send.getModulatedValue() : 0, true);
}
display.addSendsElement(topMenu, isTopMenuOn, layer.doesExist() ? layer.getName() : "", ChannelType.LAYER, this.bank.getItem(offset + i).getColor(), layer.isSelected(), sendData, true, l.get().isActivated(), layer.isActivated());
} else
display.addChannelSelectorElement(topMenu, isTopMenuOn, bottomMenu, ChannelType.LAYER, bottomMenuColor, isBottomMenuOn, layer.isActivated());
}
}
use of de.mossgrabers.framework.daw.data.ISend in project DrivenByMoss by git-moss.
the class TrackHandler method getSendValue.
private int getSendValue(final int trackIndex, final int sendIndex) {
final Optional<ITrack> track = this.getTrack(trackIndex);
if (track.isEmpty())
return 0;
final ISendBank sendBank = track.get().getSendBank();
if (sendIndex >= sendBank.getPageSize())
return 0;
final ISend send = sendBank.getItem(sendIndex);
if (send == null)
return 0;
return send.getValue();
}
use of de.mossgrabers.framework.daw.data.ISend in project DrivenByMoss by git-moss.
the class TrackHandler method changeSendVolume.
private void changeSendVolume(final int trackIndex, final int sendIndex, final KnobMode knobMode, final MidiValue value) {
final Optional<ITrack> track = this.getTrack(trackIndex);
if (track.isEmpty())
return;
final ISendBank sendBank = track.get().getSendBank();
if (sendIndex >= sendBank.getPageSize())
return;
final ISend send = sendBank.getItem(sendIndex);
if (send == null)
return;
final int val = value.getValue();
if (isAbsolute(knobMode))
send.setValue(this.getAbsoluteValueChanger(value), val);
else
send.changeValue(this.getRelativeValueChanger(knobMode), val);
}
Aggregations