use of de.mossgrabers.framework.daw.data.ISend 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.ISend in project DrivenByMoss by git-moss.
the class SendsView method setupFader.
/**
* {@inheritDoc}
*/
@Override
public void setupFader(final int index) {
final ITrack track = this.model.getCurrentTrackBank().getItem(index);
final int color = this.colorManager.getColorIndex(DAWColor.getColorIndex(track.getColor()));
this.surface.setupFader(index, color, false);
final ISend send = track.getSendBank().getItem(this.selectedSend);
this.surface.setFaderValue(index, send.getValue());
}
use of de.mossgrabers.framework.daw.data.ISend in project DrivenByMoss by git-moss.
the class MixView method getButtonColor.
/**
* {@inheritDoc}
*/
@Override
public int getButtonColor(final ButtonID buttonID) {
final int index = 7 - (buttonID.ordinal() - ButtonID.SCENE1.ordinal());
int color = 0;
int value = 0;
final Optional<ITrack> track = this.model.getCurrentTrackBank().getSelectedItem();
if (track.isPresent()) {
switch(this.faderMode) {
default:
case VOLUME:
value = track.get().getVolume();
color = LaunchpadColorManager.LAUNCHPAD_COLOR_CYAN;
break;
case PAN:
value = track.get().getPan();
color = LaunchpadColorManager.LAUNCHPAD_COLOR_SKY_HI;
break;
case SEND1:
final ISend send1 = track.get().getSendBank().getItem(0);
value = send1.doesExist() ? send1.getValue() : 0;
color = LaunchpadColorManager.LAUNCHPAD_COLOR_ORCHID_HI;
break;
case SEND2:
final ISend send2 = track.get().getSendBank().getItem(1);
value = send2.doesExist() ? send2.getValue() : 0;
color = LaunchpadColorManager.LAUNCHPAD_COLOR_LIME_HI;
break;
}
}
this.fader.setup(color, this.faderMode == FaderMode.PAN);
this.fader.setValue(value);
return this.fader.getColorState(index);
}
use of de.mossgrabers.framework.daw.data.ISend in project DrivenByMoss by git-moss.
the class ModeMultiSelectCommand method getSendModeNotification.
/**
* Build the information text for a send channel.
*
* @param modeID The ID of the send mode
* @param modeName The name of the mode
* @param trackBank The track bank from which to get more effect info
* @return The text
*/
public static String getSendModeNotification(final Modes modeID, final String modeName, final ITrackBank trackBank) {
final int sendIndex = modeID.ordinal() - Modes.SEND1.ordinal();
String sendModeName = modeName + " " + (sendIndex + 1);
Optional<ITrack> selectedTrack = trackBank.getSelectedItem();
if (selectedTrack.isEmpty()) {
final ITrack item = trackBank.getItem(0);
selectedTrack = item.doesExist() ? Optional.of(item) : Optional.empty();
}
if (selectedTrack.isPresent()) {
sendModeName += ": ";
final ISend send = selectedTrack.get().getSendBank().getItem(sendIndex);
sendModeName += send.doesExist() ? send.getName() : "-";
}
return sendModeName;
}
use of de.mossgrabers.framework.daw.data.ISend in project DrivenByMoss by git-moss.
the class TrackSendMode method onKnobTouch.
/**
* {@inheritDoc}
*/
@Override
public void onKnobTouch(final int index, final boolean isTouched) {
final Optional<ITrack> track = this.getTrack(index);
if (track.isEmpty())
return;
final ISend item = track.get().getSendBank().getItem(this.sendIndex);
if (!item.doesExist())
return;
if (isTouched && this.surface.isDeletePressed()) {
this.surface.setTriggerConsumed(ButtonID.DELETE);
item.resetValue();
}
item.touchValue(isTouched);
}
Aggregations