use of de.mossgrabers.framework.daw.data.bank.ITrackBank in project DrivenByMoss by git-moss.
the class MixView method drawGrid.
/**
* {@inheritDoc}
*/
@Override
public void drawGrid() {
final IPadGrid padGrid = this.surface.getPadGrid();
final ITrackBank tb = this.model.getCurrentTrackBank();
for (int i = 0; i < tb.getPageSize(); i++) {
final ITrack track = tb.getItem(i);
if (track.doesExist()) {
// Select
final int colorIndex = this.colorManager.getColorIndex(DAWColor.getColorIndex(track.getColor()));
if (track.isSelected())
padGrid.lightEx(i, 0, colorIndex, FireColorManager.FIRE_COLOR_WHITE, false);
else
padGrid.lightEx(i, 0, colorIndex);
// Mute
padGrid.lightEx(i, 1, track.isMute() ? FireColorManager.FIRE_COLOR_ORANGE : FireColorManager.FIRE_COLOR_DARKER_ORANGE);
// Solo
padGrid.lightEx(i, 2, track.isSolo() ? FireColorManager.FIRE_COLOR_YELLOW : FireColorManager.FIRE_COLOR_DARKER_YELLOW);
// Record Arm
padGrid.lightEx(i, 3, track.isRecArm() ? FireColorManager.FIRE_COLOR_RED : FireColorManager.FIRE_COLOR_DARKER_RED);
} else {
padGrid.lightEx(i, 3, FireColorManager.FIRE_COLOR_BLACK);
padGrid.lightEx(i, 2, FireColorManager.FIRE_COLOR_BLACK);
padGrid.lightEx(i, 1, FireColorManager.FIRE_COLOR_BLACK);
padGrid.lightEx(i, 0, FireColorManager.FIRE_COLOR_BLACK);
}
}
}
use of de.mossgrabers.framework.daw.data.bank.ITrackBank in project DrivenByMoss by git-moss.
the class FxTrackHandler method getTrack.
private Optional<ITrack> getTrack(final int trackIndex) {
final ITrackBank tb = this.model.getEffectTrackBank();
if (trackIndex < 0)
return tb.getSelectedItem();
final ITrack track = tb.getItem(trackIndex);
return track.doesExist() ? Optional.of(track) : Optional.empty();
}
use of de.mossgrabers.framework.daw.data.bank.ITrackBank in project DrivenByMoss by git-moss.
the class TrackView method onGridNote.
/**
* {@inheritDoc}
*/
@Override
public void onGridNote(final int note, final int velocity) {
if (velocity == 0)
return;
final ITrackBank tb = this.model.getCurrentTrackBank();
int track;
final Optional<ITrack> selectedTrack = tb.getSelectedItem();
int index;
switch(note - 36) {
// Toggle Activate
case 0:
if (selectedTrack.isPresent())
selectedTrack.get().toggleIsActivated();
break;
// Track left
case 1:
index = selectedTrack.isEmpty() ? 0 : selectedTrack.get().getIndex() - 1;
if (index == -1 || this.surface.isShiftPressed())
tb.selectPreviousPage();
else
this.selectTrack(index);
break;
// Track right
case 2:
index = selectedTrack.isEmpty() ? 0 : selectedTrack.get().getIndex() + 1;
if (index == 8 || this.surface.isShiftPressed())
tb.selectNextPage();
else
this.selectTrack(index);
break;
// Move down
case 3:
if (selectedTrack.isPresent())
selectedTrack.get().enter();
break;
// Move up
case 4:
tb.selectParent();
break;
// Unused
case 5:
break;
// Track Page down
case 6:
tb.selectPreviousPage();
break;
// Track Page up
case 7:
tb.selectNextPage();
break;
default:
track = note - 36 - 8;
this.selectTrack(track);
break;
}
}
use of de.mossgrabers.framework.daw.data.bank.ITrackBank in project DrivenByMoss by git-moss.
the class TrackView method drawGrid.
/**
* {@inheritDoc}
*/
@Override
public void drawGrid() {
final ITrackBank tb = this.model.getCurrentTrackBank();
final IPadGrid padGrid = this.surface.getPadGrid();
for (int i = 0; i < 8; i++) padGrid.light(44 + i, tb.getItem(i).isSelected() ? BeatstepColorManager.BEATSTEP_BUTTON_STATE_BLUE : BeatstepColorManager.BEATSTEP_BUTTON_STATE_OFF);
final Optional<ITrack> sel = tb.getSelectedItem();
padGrid.light(36, sel.isPresent() && sel.get().isActivated() ? BeatstepColorManager.BEATSTEP_BUTTON_STATE_RED : BeatstepColorManager.BEATSTEP_BUTTON_STATE_OFF);
padGrid.light(37, BeatstepColorManager.BEATSTEP_BUTTON_STATE_BLUE);
padGrid.light(38, BeatstepColorManager.BEATSTEP_BUTTON_STATE_BLUE);
padGrid.light(39, BeatstepColorManager.BEATSTEP_BUTTON_STATE_RED);
padGrid.light(40, BeatstepColorManager.BEATSTEP_BUTTON_STATE_RED);
padGrid.light(41, BeatstepColorManager.BEATSTEP_BUTTON_STATE_OFF);
padGrid.light(42, BeatstepColorManager.BEATSTEP_BUTTON_STATE_BLUE);
padGrid.light(43, BeatstepColorManager.BEATSTEP_BUTTON_STATE_BLUE);
}
use of de.mossgrabers.framework.daw.data.bank.ITrackBank in project DrivenByMoss by git-moss.
the class StopClipCommand method executeShifted.
/**
* {@inheritDoc}
*/
@Override
public void executeShifted(final ButtonEvent event) {
if (event != ButtonEvent.DOWN)
return;
final ITrackBank currentTrackBank = this.model.getCurrentTrackBank();
final Optional<ITrack> track = this.index == -1 ? currentTrackBank.getSelectedItem() : Optional.of(currentTrackBank.getItem(this.index));
if (track.isPresent())
track.get().returnToArrangement();
}
Aggregations