use of de.mossgrabers.framework.daw.data.ISend in project DrivenByMoss by git-moss.
the class ChannelImpl method enableObservers.
/**
* {@inheritDoc}
*/
@Override
public void enableObservers(final boolean enable) {
this.channel.exists().setIsSubscribed(enable);
this.channel.name().setIsSubscribed(enable);
this.channel.isActivated().setIsSubscribed(enable);
this.channel.mute().setIsSubscribed(enable);
this.channel.solo().setIsSubscribed(enable);
this.channel.color().setIsSubscribed(enable);
this.volumeParameter.enableObservers(enable);
this.panParameter.enableObservers(enable);
for (final ISend send : this.sends) send.enableObservers(enable);
}
use of de.mossgrabers.framework.daw.data.ISend in project DrivenByMoss by git-moss.
the class SendsView method drawGrid.
/**
* {@inheritDoc}
*/
@Override
public void drawGrid() {
final ColorManager cm = this.model.getColorManager();
final IChannelBank tb = this.model.getCurrentTrackBank();
final IMidiOutput output = this.surface.getOutput();
for (int i = 0; i < 8; i++) {
final ITrack track = tb.getTrack(i);
final ISend send = track.getSend(this.selectedSend);
final int color = cm.getColor(BitwigColors.getColorIndex(track.getColor()));
if (this.trackColors[i] != color || !track.doesExist() || send.getName().isEmpty())
this.setupFader(i);
this.trackColors[i] = color;
output.sendCC(LaunchpadControlSurface.LAUNCHPAD_FADER_1 + i, send.getValue());
}
}
use of de.mossgrabers.framework.daw.data.ISend in project DrivenByMoss by git-moss.
the class TrackMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
if (!this.surface.getConfiguration().hasDisplay1())
return;
this.drawDisplay2();
if (!this.drawTrackHeader())
return;
final Display d = this.surface.getDisplay().clear();
final IChannelBank currentTrackBank = this.model.getCurrentTrackBank();
final ITrack selectedTrack = currentTrackBank.getSelectedTrack();
if (selectedTrack == null) {
d.notify("Please select a track...", true, false);
return;
}
final MCUConfiguration config = this.surface.getConfiguration();
final boolean displayTrackNames = this.surface.getConfiguration().isDisplayTrackNames();
if (!displayTrackNames) {
d.setCell(0, 0, "Volume");
d.setCell(0, 1, "Pan");
}
d.setCell(1, 0, selectedTrack.getVolumeStr(6));
d.setCell(1, 1, selectedTrack.getPanStr(6));
int sendStart = 2;
int sendCount = 6;
if (config.isDisplayCrossfader()) {
sendStart = 3;
sendCount = 5;
final String crossfadeMode = selectedTrack.getCrossfadeMode();
if (!displayTrackNames)
d.setCell(0, 2, "Crossfade");
d.setCell(1, 2, "A".equals(crossfadeMode) ? "A" : "B".equals(crossfadeMode) ? " B" : " <> ");
}
final boolean isEffectTrackBankActive = this.model.isEffectTrackBankActive();
for (int i = 0; i < sendCount; i++) {
final int pos = sendStart + i;
if (!isEffectTrackBankActive) {
final ISend send = selectedTrack.getSend(i);
if (send.doesExist()) {
if (!displayTrackNames)
d.setCell(0, pos, StringUtils.fixASCII(send.getName()));
d.setCell(1, pos, send.getDisplayedValue(6));
}
}
}
if (!displayTrackNames)
d.done(0);
d.done(1);
}
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 DisplayMessage message, final ICursorDevice cd, final IChannel l) {
final int sendIndex = this.getCurrentSendIndex();
final IChannelBank fxTrackBank = this.model.getEffectTrackBank();
this.updateMenu();
final PushConfiguration config = this.surface.getConfiguration();
// Drum Pad Bank has size of 16, layers only 8
final int offset = getDrumPadIndex(cd);
final int sendOffset = config.isSendsAreToggled() ? 4 : 0;
for (int i = 0; i < 8; i++) {
final IChannel layer = cd.getLayerOrDrumPad(offset + i);
// The menu item
String topMenu;
boolean topMenuSelected;
if (config.isMuteLongPressed() || config.isMuteSoloLocked() && config.isMuteState()) {
topMenu = layer.doesExist() ? "Mute" : "";
topMenuSelected = layer.isMute();
} else if (config.isSoloLongPressed() || config.isMuteSoloLocked() && config.isSoloState()) {
topMenu = layer.doesExist() ? "Solo" : "";
topMenuSelected = layer.isSolo();
} else {
topMenu = this.menu[i];
topMenuSelected = i > 3 && i - 4 + sendOffset == sendIndex;
}
// Channel info
final String[] sendName = new String[4];
final String[] valueStr = new String[4];
final int[] value = new int[4];
final int[] modulatedValue = new int[4];
final boolean[] selected = new boolean[4];
for (int j = 0; j < 4; j++) {
final int sendPos = sendOffset + j;
final ISend send = layer.getSend(sendPos);
sendName[j] = fxTrackBank == null ? send.getName() : fxTrackBank.getTrack(sendPos).getName();
valueStr[j] = send.doesExist() && sendIndex == sendPos && this.isKnobTouched[i] ? send.getDisplayedValue() : "";
value[j] = send.doesExist() ? send.getValue() : 0;
modulatedValue[j] = send.doesExist() ? send.getModulatedValue() : 0;
selected[j] = sendIndex == sendPos;
}
message.addSendsElement(topMenu, topMenuSelected, layer.doesExist() ? layer.getName() : "", ChannelType.LAYER, cd.getLayerOrDrumPad(offset + i).getColor(), layer.isSelected(), sendName, valueStr, value, modulatedValue, selected, false);
}
}
use of de.mossgrabers.framework.daw.data.ISend in project DrivenByMoss by git-moss.
the class SendMode method updateDisplay1.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay1() {
final Display d = this.surface.getDisplay();
final int sendIndex = this.getCurrentSendIndex();
final IChannelBank tb = this.model.getCurrentTrackBank();
for (int i = 0; i < 8; i++) {
final ITrack t = tb.getTrack(i);
if (t.doesExist()) {
final ISend send = t.getSend(sendIndex);
d.setCell(0, i, send.getName());
d.setCell(1, i, send.getDisplayedValue(8));
d.setCell(2, i, send.getValue(), Format.FORMAT_VALUE);
} else
d.clearColumn(i);
}
d.done(0).done(1).done(2);
this.drawRow4();
}
Aggregations