use of de.mossgrabers.framework.daw.data.ITrack in project DrivenByMoss by git-moss.
the class AbstractTrackMode method onButton.
/**
* {@inheritDoc}
*/
@Override
public void onButton(final int row, final int index, final ButtonEvent event) {
if (event != ButtonEvent.UP || row != 0)
return;
// Combination with Shift
if (this.surface.isShiftPressed()) {
this.onButtonShifted(index);
return;
}
// Combination with Arrow Down
if (this.surface.isLongPressed(ButtonID.ARROW_DOWN)) {
this.surface.getModeManager().setActive(MODES[index]);
this.surface.setTriggerConsumed(ButtonID.ARROW_DOWN);
return;
}
final ITrackBank tb = this.model.getCurrentTrackBank();
final ITrack track = tb.getItem(index);
// Combination with Duplicate
if (this.surface.isPressed(ButtonID.DUPLICATE)) {
this.surface.setTriggerConsumed(ButtonID.DUPLICATE);
track.duplicate();
return;
}
// Combination with Delete
if (this.surface.isPressed(ButtonID.DELETE)) {
this.surface.setTriggerConsumed(ButtonID.DELETE);
track.remove();
return;
}
// Select track or expand group
track.selectOrExpandGroup();
}
use of de.mossgrabers.framework.daw.data.ITrack in project DrivenByMoss by git-moss.
the class SLMkIIIVolumeMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
final SLMkIIIDisplay d = this.surface.getDisplay();
d.clear();
d.setCell(0, 8, "Volume");
final ITrackBank tb = this.model.getCurrentTrackBank();
for (int i = 0; i < 8; i++) {
final ITrack t = tb.getItem(i);
if (t.doesExist())
d.setCell(0, i, "Volume").setCell(1, i, t.getVolumeStr(9));
this.setColumnColors(d, i, t, SLMkIIIColorManager.SLMKIII_BLUE);
}
final ITrack cursorTrack = this.model.getCursorTrack();
d.setCell(1, 8, cursorTrack.doesExist() ? StringUtils.fixASCII(cursorTrack.getName(9)) : "");
this.drawRow4();
this.setButtonInfo(d);
d.allDone();
}
use of de.mossgrabers.framework.daw.data.ITrack in project DrivenByMoss by git-moss.
the class SLTrackMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
final ITrack cursorTrack = this.model.getCursorTrack();
final ITextDisplay d = this.surface.getTextDisplay().clearRow(0).clearRow(1);
if (!cursorTrack.doesExist()) {
d.setRow(0, " Please select a track... ").done(0).done(1);
return;
}
d.setCell(0, 0, "Volume").setCell(1, 0, cursorTrack.getVolumeStr(8)).setCell(0, 1, "Pan").setCell(1, 1, cursorTrack.getPanStr(8));
final int sendStart = 2;
final int sendCount = 6;
int pos;
final ISendBank sendBank = cursorTrack.getSendBank();
if (sendBank.getPageSize() > 0) {
for (int i = 0; i < sendCount; i++) {
pos = sendStart + i;
final ISend send = sendBank.getItem(i);
if (send.doesExist())
d.setCell(0, pos, send.getName(8)).setCell(1, pos, send.getDisplayedValue(8));
}
}
d.done(0).done(1);
}
use of de.mossgrabers.framework.daw.data.ITrack in project DrivenByMoss by git-moss.
the class AutoColorSetup method createObservers.
/**
* {@inheritDoc}
*/
@Override
protected void createObservers() {
super.createObservers();
// Update track colors if Auto Color is enabled in the settings
this.configuration.addSettingObserver(AutoColorConfiguration.ENABLE_AUTO_COLOR, () -> {
if (!this.configuration.isEnableAutoColor())
return;
final ITrackBank tb = this.model.getTrackBank();
for (int i = 0; i < tb.getPageSize(); i++) this.autoColor.matchTrackName(i, tb.getItem(i).getName());
});
// Monitor all color regular expression settings
final DAWColor[] colors = DAWColor.values();
for (int i = 0; i < colors.length; i++) {
final DAWColor color = colors[i];
this.configuration.addSettingObserver(Integer.valueOf(AutoColorConfiguration.COLOR_REGEX.intValue() + i), () -> this.autoColor.handleRegExChange(color, this.configuration.getColorRegExValue(color)));
}
// Add name observers to all tracks
final ITrackBank tb = this.model.getTrackBank();
for (int index = 0; index < tb.getPageSize(); index++) {
final int i = index;
final ITrack track = tb.getItem(index);
track.addNameObserver(name -> this.autoColor.matchTrackName(i, name));
track.addColorObserver(name -> this.autoColor.matchTrackName(i, track.getName()));
}
}
use of de.mossgrabers.framework.daw.data.ITrack in project DrivenByMoss by git-moss.
the class FaderAbsoluteCommand method execute.
/**
* {@inheritDoc}
*/
@Override
public void execute(final int value) {
final ITrackBank currentTrackBank = this.model.getCurrentTrackBank();
final ITrack track = currentTrackBank.getItem(this.index);
if (!track.doesExist())
return;
if (this.surface.isShiftPressed()) {
final int volume = track.getVolume();
this.surface.getDisplay().notify(getNotificationText(value, volume));
} else
track.setVolume(value);
}
Aggregations