use of de.mossgrabers.framework.daw.data.bank.ISendBank in project DrivenByMoss by git-moss.
the class GenericFlexiControllerSetup method updateIndication.
protected void updateIndication() {
final Set<FlexiCommand> commands = this.configuration.getMappedCommands();
final FlexiCommand[] allCommands = FlexiCommand.values();
final ITrackBank trackBank = this.model.getTrackBank();
final Optional<ITrack> selectedTrack = trackBank.getSelectedItem();
for (int i = 0; i < trackBank.getPageSize(); i++) {
final boolean hasTrackSel = selectedTrack.isPresent() && selectedTrack.get().getIndex() == i;
final ITrack track = trackBank.getItem(i);
track.setVolumeIndication(this.testVolumeIndication(commands, allCommands, i, hasTrackSel));
track.setPanIndication(this.testPanIndication(commands, allCommands, i, hasTrackSel));
final ISendBank sendBank = track.getSendBank();
final int sendPageSize = sendBank.getPageSize();
for (int j = 0; j < sendPageSize; j++) sendBank.getItem(j).setIndication(this.testSendIndication(commands, allCommands, i, hasTrackSel, sendPageSize, j));
}
final IMasterTrack masterTrack = this.model.getMasterTrack();
masterTrack.setVolumeIndication(commands.contains(FlexiCommand.MASTER_SET_VOLUME));
masterTrack.setPanIndication(commands.contains(FlexiCommand.MASTER_SET_PANORAMA));
final IParameterBank parameterBank = this.model.getCursorDevice().getParameterBank();
for (int i = 0; i < parameterBank.getPageSize(); i++) parameterBank.getItem(i).setIndication(this.testParameterIndication(commands, allCommands, i));
}
use of de.mossgrabers.framework.daw.data.bank.ISendBank in project DrivenByMoss by git-moss.
the class FireTrackMixerMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
this.updateMode();
final IGraphicDisplay display = this.surface.getGraphicsDisplay();
final ITrackBank trackBank = this.model.getCurrentTrackBank();
final Optional<ITrack> trackOptional = trackBank.getSelectedItem();
String label = "None";
if (trackOptional.isPresent()) {
final ITrack track = trackOptional.get();
label = track.getPosition() + 1 + ": " + track.getName(9);
}
final int size = trackBank.getPageSize();
final boolean[] selected = new boolean[size];
final int[] values = new int[size];
final boolean isMode = this.isAnyKnobTouched() || !this.model.getTransport().isPlaying();
if (isMode) {
switch(this.selectedParameter) {
case VOLUME:
for (int i = 0; i < size; i++) {
final IChannel channel = trackBank.getItem(i);
selected[i] = channel.isSelected();
values[i] = channel.getVolume();
}
break;
case PAN:
for (int i = 0; i < size; i++) {
final IChannel channel = trackBank.getItem(i);
selected[i] = channel.isSelected();
values[i] = channel.getPan();
}
break;
case SEND1:
case SEND2:
case SEND3:
case SEND4:
case SEND5:
case SEND6:
final int sendIndex = this.selectedParameter.ordinal() - Modes.SEND1.ordinal();
for (int i = 0; i < size; i++) {
final IChannel channel = trackBank.getItem(i);
selected[i] = channel.isSelected();
final ISendBank sendBank = channel.getSendBank();
if (sendBank != null) {
final ISend send = sendBank.getItem(sendIndex);
if (send.doesExist())
values[i] = send.getValue();
}
}
break;
default:
// Not used
break;
}
} else {
for (int i = 0; i < size; i++) {
final IChannel channel = trackBank.getItem(i);
selected[i] = channel.isSelected();
values[i] = channel.getVu();
}
}
display.addElement(new TitleChannelsComponent(label, selected, values, this.selectedParameter == Modes.PAN && isMode));
display.send();
}
use of de.mossgrabers.framework.daw.data.bank.ISendBank in project DrivenByMoss by git-moss.
the class SendParameterProvider method get.
/**
* {@inheritDoc}
*/
@Override
public IParameter get(final int index) {
if (this.sendIndex == -1) {
final Optional<ITrack> track = this.bank.getSelectedItem();
if (track.isEmpty())
return EmptyParameter.INSTANCE;
final ISendBank sendBank = track.get().getSendBank();
return sendBank.getItemCount() > 0 ? sendBank.getItem(index) : EmptyParameter.INSTANCE;
}
final ISendBank sendBank = this.bank.getItem(index).getSendBank();
return sendBank.getItemCount() == 0 ? EmptyParameter.INSTANCE : sendBank.getItem(this.sendIndex);
}
use of de.mossgrabers.framework.daw.data.bank.ISendBank in project DrivenByMoss by git-moss.
the class FireLayerMixerMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
this.updateMode();
final IGraphicDisplay display = this.surface.getGraphicsDisplay();
final ISpecificDevice cd = this.model.getDrumDevice();
final ILayerBank layerBank = cd.getLayerBank();
final Optional<ILayer> channelOptional = layerBank.getSelectedItem();
String label = "None";
if (channelOptional.isPresent()) {
final IChannel channel = channelOptional.get();
label = channel.getPosition() + 1 + ": " + channel.getName(9);
}
final int size = layerBank.getPageSize();
final boolean[] selected = new boolean[size];
final int[] values = new int[size];
final boolean isMode = this.isAnyKnobTouched() || !this.model.getTransport().isPlaying();
if (isMode) {
switch(this.selectedParameter) {
case VOLUME:
for (int i = 0; i < size; i++) {
final IChannel channel = layerBank.getItem(i);
selected[i] = channel.isSelected();
values[i] = channel.getVolume();
}
break;
case PAN:
for (int i = 0; i < size; i++) {
final IChannel channel = layerBank.getItem(i);
selected[i] = channel.isSelected();
values[i] = channel.getPan();
}
break;
case SEND1:
case SEND2:
case SEND3:
case SEND4:
case SEND5:
case SEND6:
final int sendIndex = this.selectedParameter.ordinal() - Modes.SEND1.ordinal();
for (int i = 0; i < size; i++) {
final IChannel channel = layerBank.getItem(i);
selected[i] = channel.isSelected();
final ISendBank sendBank = channel.getSendBank();
if (sendBank != null) {
final ISend send = sendBank.getItem(sendIndex);
if (send.doesExist())
values[i] = send.getValue();
}
}
break;
default:
// Not used
break;
}
} else {
for (int i = 0; i < size; i++) {
final IChannel channel = layerBank.getItem(i);
selected[i] = channel.isSelected();
values[i] = channel.getVu();
}
}
display.addElement(new TitleChannelsComponent(label, selected, values, this.selectedParameter == Modes.PAN && isMode));
display.send();
}
use of de.mossgrabers.framework.daw.data.bank.ISendBank in project DrivenByMoss by git-moss.
the class TrackMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
final ITrackBank currentTrackBank = this.model.getCurrentTrackBank();
final Optional<ITrack> t = currentTrackBank.getSelectedItem();
final Kontrol1Display d = (Kontrol1Display) this.surface.getDisplay();
d.clear();
if (t.isEmpty()) {
d.setCell(0, 3, " PLEASE").setCell(0, 4, "SELECT A").setCell(0, 5, "TRACK").allDone();
return;
}
final boolean isEffectTrackBankActive = this.model.isEffectTrackBankActive();
final ITrack track = t.get();
d.setCell(0, 0, (isEffectTrackBankActive ? "TR-FX " : "TRACK ") + (track.getPosition() + 1)).setCell(1, 0, StringUtils.shortenAndFixASCII(track.getName(), 8).toUpperCase(Locale.US));
d.setCell(0, 1, "VOLUME").setCell(1, 1, getSecondLineText(track)).setCell(0, 2, "PAN").setCell(1, 2, track.getPanStr(8));
d.setBar(1, this.surface.getContinuous(ContinuousID.KNOB1).isTouched(), track.getVolume());
d.setPanBar(2, this.surface.getContinuous(ContinuousID.KNOB2).isTouched(), track.getPan());
if (!isEffectTrackBankActive) {
final ISendBank sendBank = track.getSendBank();
for (int i = 0; i < 6; i++) {
final int pos = 3 + i;
final ISend sendData = sendBank.getItem(i);
d.setCell(0, pos, StringUtils.shortenAndFixASCII(sendData.getName(8), 8).toUpperCase(Locale.US)).setCell(1, pos, sendData.getDisplayedValue(8));
d.setBar(pos, this.surface.getContinuous(ContinuousID.get(ContinuousID.KNOB3, i)).isTouched() && sendData.doesExist(), sendData.getValue());
}
}
d.allDone();
}
Aggregations