use of de.mossgrabers.framework.daw.data.bank.ITrackBank in project DrivenByMoss by git-moss.
the class AbstractTrackMode method updateSoloMenu.
protected void updateSoloMenu() {
final ITrackBank tb = this.model.getCurrentTrackBank();
for (int i = 0; i < 8; i++) {
final ITrack t = tb.getItem(i);
this.menu.get(i).set(t.doesExist() ? "Solo" : "", Boolean.valueOf(t.isSolo()));
}
}
use of de.mossgrabers.framework.daw.data.bank.ITrackBank in project DrivenByMoss by git-moss.
the class AbstractTrackMode method drawRow4.
protected void drawRow4(final ITextDisplay d) {
final ITrackBank tb = this.model.getCurrentTrackBank();
final Optional<ITrack> selTrack = tb.getSelectedItem();
// Format track names
final int selIndex = selTrack.isEmpty() ? -1 : selTrack.get().getIndex();
for (int i = 0; i < 8; i++) {
final boolean isSel = i == selIndex;
final ITrack t = tb.getItem(i);
String trackName = t.getName();
if (t.doesExist() && t.isGroup())
trackName = (t.isGroupExpanded() ? Push1Display.THREE_ROWS : Push1Display.FOLDER) + trackName;
final String n = StringUtils.shortenAndFixASCII(trackName, isSel ? 7 : 8);
d.setCell(3, i, isSel ? Push1Display.SELECT_ARROW + n : n);
}
}
use of de.mossgrabers.framework.daw.data.bank.ITrackBank in project DrivenByMoss by git-moss.
the class AbstractTrackMode method onSecondRow.
/**
* {@inheritDoc}
*/
@Override
public void onSecondRow(final int index, final ButtonEvent event) {
if (event != ButtonEvent.DOWN)
return;
final ITrackBank tb = this.model.getCurrentTrackBank();
final ITrack track = tb.getItem(index);
if (this.surface.isPressed(ButtonID.STOP_CLIP)) {
track.stop();
return;
}
final PushConfiguration config = this.surface.getConfiguration();
if (!this.isPush2 || config.isMuteLongPressed() || config.isSoloLongPressed() || config.isMuteSoloLocked()) {
if (config.isMuteState())
track.toggleMute();
else
track.toggleSolo();
return;
}
final ModeManager modeManager = this.surface.getModeManager();
switch(index) {
case 0:
if (modeManager.isActive(Modes.VOLUME))
modeManager.setActive(Modes.TRACK);
else
modeManager.setActive(Modes.VOLUME);
break;
case 1:
if (modeManager.isActive(Modes.PAN))
modeManager.setActive(Modes.TRACK);
else
modeManager.setActive(Modes.PAN);
break;
case 2:
if (modeManager.isActive(Modes.CROSSFADER))
modeManager.setActive(Modes.TRACK);
else
modeManager.setActive(Modes.CROSSFADER);
break;
case 3:
if (!this.model.isEffectTrackBankActive()) {
config.setSendsAreToggled(!config.isSendsAreToggled());
if (!modeManager.isActive(Modes.TRACK))
modeManager.setActive(Modes.get(Modes.SEND1, config.isSendsAreToggled() ? 4 : 0));
}
break;
case 7:
if (!this.model.isEffectTrackBankActive()) {
if (this.lastSendIsAccessible())
this.handleSendEffect(config.isSendsAreToggled() ? 7 : 3);
else
this.model.getTrackBank().selectParent();
}
break;
default:
this.handleSendEffect(index - (config.isSendsAreToggled() ? 0 : 4));
break;
}
config.setDebugMode(modeManager.getActiveID());
}
use of de.mossgrabers.framework.daw.data.bank.ITrackBank in project DrivenByMoss by git-moss.
the class SessionMode method updateDisplay1Clips.
private void updateDisplay1Clips(final ITextDisplay display) {
final ITrackBank tb = this.model.getCurrentTrackBank();
final int numTracks = tb.getPageSize();
final int numScenes = tb.getSceneBank().getPageSize();
final boolean flipSession = this.surface.getConfiguration().isFlipSession();
final int maxCols = flipSession ? numScenes : numTracks;
int maxRows = flipSession ? numTracks : numScenes;
if (this.rowDisplayMode != RowDisplayMode.ALL)
maxRows = maxRows / 2;
for (int col = 0; col < maxCols; col++) {
for (int row = 0; row < maxRows; row++) {
int x = flipSession ? row : col;
int y = flipSession ? col : row;
if (this.rowDisplayMode == RowDisplayMode.LOWER) {
if (flipSession)
x += maxRows;
else
y += maxRows;
}
final ITrack track = tb.getItem(x);
final ISlot slot = track.getSlotBank().getItem(y);
if (!slot.doesExist())
continue;
String name = slot.getName(8);
if (track.isGroup()) {
if (name.isEmpty())
name = "Scene " + (slot.getPosition() + 1);
} else {
// https://github.com/teotigraphix/Framework4Bitwig/issues/193
if (name.isEmpty()) {
final ColorEx color = slot.getColor();
if (color.getRed() != 0 || color.getGreen() != 0 || color.getBlue() != 0)
name = "--------";
}
}
if (slot.isSelected())
name = Push1Display.SELECT_ARROW + name;
else if (slot.isPlaying())
name = ">" + name;
else if (slot.isPlayingQueued() || slot.isRecordingQueued())
name = ")" + name;
else if (track.isRecArm() || slot.isRecording())
name = "*" + name;
else if (slot.hasContent())
name = Push1Display.RIGHT_ARROW + name;
else
name = Push1Display.DEGREE + name;
display.setCell(row, col, StringUtils.shortenAndFixASCII(name, 8));
}
}
}
use of de.mossgrabers.framework.daw.data.bank.ITrackBank in project DrivenByMoss by git-moss.
the class SessionMode method updateDisplay2Clips.
private void updateDisplay2Clips(final IGraphicDisplay display) {
final ITrackBank tb = this.model.getCurrentTrackBank();
final int numTracks = tb.getPageSize();
final int numScenes = tb.getSceneBank().getPageSize();
final boolean flipSession = this.surface.getConfiguration().isFlipSession();
final int maxCols = flipSession ? numScenes : numTracks;
int maxRows = flipSession ? numTracks : numScenes;
if (this.rowDisplayMode != RowDisplayMode.ALL)
maxRows = maxRows / 2;
for (int col = 0; col < maxCols; col++) {
final List<Pair<ITrack, ISlot>> slots = new ArrayList<>(maxRows);
for (int row = 0; row < maxRows; row++) {
int x = flipSession ? row : col;
int y = flipSession ? col : row;
if (this.rowDisplayMode == RowDisplayMode.LOWER) {
if (flipSession)
x += maxRows;
else
y += maxRows;
}
final ITrack track = tb.getItem(x);
slots.add(new Pair<>(track, track.getSlotBank().getItem(y)));
}
display.addSlotListElement(slots);
}
}
Aggregations