use of de.mossgrabers.framework.daw.data.bank.ITrackBank in project DrivenByMoss by git-moss.
the class FxTrackHandler method scrollTrackLeft.
private void scrollTrackLeft(final boolean switchBank) {
final ITrackBank tb = this.model.getCurrentTrackBank();
final Optional<ITrack> sel = tb.getSelectedItem();
final int index = sel.isEmpty() ? 0 : sel.get().getIndex() - 1;
if (index == -1 || switchBank) {
tb.selectPreviousPage();
return;
}
tb.getItem(index).select();
}
use of de.mossgrabers.framework.daw.data.bank.ITrackBank in project DrivenByMoss by git-moss.
the class FxTrackHandler method scrollTrackRight.
private void scrollTrackRight(final boolean switchBank) {
final ITrackBank tb = this.model.getCurrentTrackBank();
final Optional<ITrack> sel = tb.getSelectedItem();
final int index = sel.isEmpty() ? 0 : sel.get().getIndex() + 1;
if (index == 8 || switchBank) {
tb.selectNextPage();
return;
}
tb.getItem(index).select();
}
use of de.mossgrabers.framework.daw.data.bank.ITrackBank in project DrivenByMoss by git-moss.
the class TrackHandler method scrollTrackLeft.
private void scrollTrackLeft(final boolean switchBank) {
final ITrackBank tb = this.model.getCurrentTrackBank();
final Optional<ITrack> sel = tb.getSelectedItem();
final int index = sel.isEmpty() ? 0 : sel.get().getIndex() - 1;
if (index == -1 || switchBank) {
tb.selectPreviousPage();
return;
}
tb.getItem(index).select();
}
use of de.mossgrabers.framework.daw.data.bank.ITrackBank 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.ITrackBank in project DrivenByMoss by git-moss.
the class TrackView method onKnob.
/**
* {@inheritDoc}
*/
@Override
public void onKnob(final int index, final int value, final boolean isTurnedRight) {
if (index < 12) {
this.extensions.onTrackKnob(index, value, isTurnedRight);
return;
}
final ITrackBank tb = this.model.getCurrentTrackBank();
final Optional<ITrack> selectedTrack = tb.getSelectedItem();
if (selectedTrack.isEmpty())
return;
switch(index) {
// Send 5 - 6
case 12:
case 13:
if (!this.model.isEffectTrackBankActive())
selectedTrack.get().getSendBank().getItem(index - 8).changeValue(value);
break;
case 14:
// Not used
break;
// Crossfader
case 15:
this.model.getTransport().changeCrossfade(value);
break;
default:
// Not used
break;
}
}
Aggregations