use of de.mossgrabers.framework.daw.data.bank.ITrackBank 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);
}
use of de.mossgrabers.framework.daw.data.bank.ITrackBank in project DrivenByMoss by git-moss.
the class AbstractSessionView method drawBirdsEyeGrid.
/**
* Aggregate the content of 8 pads to 1 pads for quick navigation through the clip matrix.
*/
protected void drawBirdsEyeGrid() {
final ITrackBank tb = this.model.getCurrentTrackBank();
final ISceneBank sceneBank = this.model.getSceneBank();
final int numTracks = tb.getPageSize();
final int numScenes = sceneBank.getPageSize();
final int sceneCount = sceneBank.getItemCount();
final int trackCount = tb.getItemCount();
final int maxScenePads = sceneCount / numScenes + (sceneCount % numScenes > 0 ? 1 : 0);
final int maxTrackPads = trackCount / numTracks + (trackCount % numTracks > 0 ? 1 : 0);
final int scenePosition = sceneBank.getScrollPosition();
final int trackPosition = tb.getItem(0).getPosition();
final int sceneSelection = scenePosition / numScenes + (scenePosition % numScenes > 0 ? 1 : 0);
final int trackSelection = trackPosition / numTracks + (trackPosition % numTracks > 0 ? 1 : 0);
final boolean flipSession = this.surface.getConfiguration().isFlipSession();
int selX = flipSession ? sceneSelection : trackSelection;
int selY = flipSession ? trackSelection : sceneSelection;
final int padsX = flipSession ? this.rows : this.columns;
final int padsY = flipSession ? this.columns : this.rows;
final int offsetX = selX / padsX * padsX;
final int offsetY = selY / padsY * padsY;
final int maxX = (flipSession ? maxScenePads : maxTrackPads) - offsetX;
final int maxY = (flipSession ? maxTrackPads : maxScenePads) - offsetY;
selX -= offsetX;
selY -= offsetY;
final IPadGrid padGrid = this.surface.getPadGrid();
for (int x = 0; x < this.columns; x++) {
final LightInfo rowColor = x < maxX ? this.birdColorHasContent : this.clipColorHasNoContent;
for (int y = 0; y < this.rows; y++) {
LightInfo color = y < maxY ? rowColor : this.clipColorHasNoContent;
if (selX == x && selY == y)
color = this.birdColorSelected;
padGrid.lightEx(x, y, color.getColor(), color.getBlinkColor(), color.isFast());
}
}
}
use of de.mossgrabers.framework.daw.data.bank.ITrackBank in project DrivenByMoss by git-moss.
the class LaunchkeyMk3VolumeMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
final ITextDisplay d = this.surface.getTextDisplay();
if (this.areKnobs) {
d.setCell(LaunchkeyMk3Display.SCREEN_ROW_BASE, 0, "Volume" + this.formatPageRange(" %d - %d"));
final ICursorTrack cursorTrack = this.model.getCursorTrack();
final String trackText = cursorTrack.doesExist() ? String.format("%d: %s", Integer.valueOf(cursorTrack.getPosition() + 1), cursorTrack.getName()) : "No sel. track";
d.setCell(LaunchkeyMk3Display.SCREEN_ROW_BASE + 1, 0, trackText);
}
final int row = this.areKnobs ? LaunchkeyMk3Display.SCREEN_ROW_POTS : LaunchkeyMk3Display.SCREEN_ROW_FADERS;
// Format track names
final ITrackBank tb = this.model.getCurrentTrackBank();
for (int i = 0; i < 8; i++) {
final ITrack t = tb.getItem(i);
final boolean exists = t.doesExist();
final int offset = i * 2;
d.setCell(row + offset, 0, exists ? String.format("%d: %s", Integer.valueOf(t.getPosition() + 1), t.getName()) : "No track");
d.setCell(row + offset + 1, 0, exists ? "Vol: " + t.getVolumeStr() : "");
}
// Add master fader
if (!this.areKnobs) {
final IMasterTrack masterTrack = this.model.getMasterTrack();
d.setCell(row + 16, 0, "Master");
d.setCell(row + 16 + 1, 0, "Vol: " + masterTrack.getVolumeStr());
}
d.allDone();
}
use of de.mossgrabers.framework.daw.data.bank.ITrackBank in project DrivenByMoss by git-moss.
the class LaunchkeyMiniMk3ControllerSetup method processProgramChangeAction.
private void processProgramChangeAction(final int value) {
final Modes modeID = this.getSurface().getModeManager().getActiveID();
if (modeID == null)
return;
switch(modeID) {
case VOLUME:
case PAN:
case SEND1:
case SEND2:
final ITrackBank currentTrackBank = this.model.getCurrentTrackBank();
if (value > 0)
currentTrackBank.selectNextPage();
else
currentTrackBank.selectPreviousPage();
this.mvHelper.notifySelectedTrack();
break;
case DEVICE_PARAMS:
final ICursorDevice cursorDevice = this.model.getCursorDevice();
final IParameterBank parameterBank = cursorDevice.getParameterBank();
if (value > 0)
parameterBank.selectNextItem();
else
parameterBank.selectPreviousItem();
this.mvHelper.notifySelectedParameterPage();
break;
default:
// Not used
break;
}
}
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 < 8; i++) {
final ITrack track = tb.getItem(i);
if (track.doesExist()) {
final boolean isSelected = track.isSelected();
final boolean hasSends = track.getSendBank().getItemCount() > 0;
// Volume
padGrid.light(92 + i, this.colorManager.getColorIndex(DAWColor.getColorIndex(track.getColor())));
// Panorama
padGrid.light(84 + i, isSelected ? LaunchpadColorManager.LAUNCHPAD_COLOR_SKY_HI : LaunchpadColorManager.LAUNCHPAD_COLOR_GREY_LO);
// Send 1
final int send1ColorID;
if (hasSends)
send1ColorID = isSelected ? LaunchpadColorManager.LAUNCHPAD_COLOR_ORCHID_HI : LaunchpadColorManager.LAUNCHPAD_COLOR_GREY_LO;
else
send1ColorID = LaunchpadColorManager.LAUNCHPAD_COLOR_BLACK;
padGrid.light(76 + i, send1ColorID);
// Send 2
final int send2ColorID;
if (hasSends)
send2ColorID = isSelected ? LaunchpadColorManager.LAUNCHPAD_COLOR_LIME_HI : LaunchpadColorManager.LAUNCHPAD_COLOR_GREY_LO;
else
send2ColorID = LaunchpadColorManager.LAUNCHPAD_COLOR_BLACK;
padGrid.light(68 + i, send2ColorID);
// Stop
padGrid.light(60 + i, this.surface.isPressed(ButtonID.get(ButtonID.PAD25, i)) ? LaunchpadColorManager.LAUNCHPAD_COLOR_RED : LaunchpadColorManager.LAUNCHPAD_COLOR_ROSE);
// Mute
padGrid.light(52 + i, track.isMute() ? LaunchpadColorManager.LAUNCHPAD_COLOR_GREY_LO : LaunchpadColorManager.LAUNCHPAD_COLOR_YELLOW_HI);
// Solo
padGrid.light(44 + i, track.isSolo() ? LaunchpadColorManager.LAUNCHPAD_COLOR_BLUE_HI : LaunchpadColorManager.LAUNCHPAD_COLOR_GREY_MD);
// Record Arm
padGrid.light(36 + i, track.isRecArm() ? LaunchpadColorManager.LAUNCHPAD_COLOR_RED_HI : LaunchpadColorManager.LAUNCHPAD_COLOR_GREY_LO);
} else {
padGrid.light(92 + i, LaunchpadColorManager.LAUNCHPAD_COLOR_BLACK);
padGrid.light(84 + i, LaunchpadColorManager.LAUNCHPAD_COLOR_BLACK);
padGrid.light(76 + i, LaunchpadColorManager.LAUNCHPAD_COLOR_BLACK);
padGrid.light(68 + i, LaunchpadColorManager.LAUNCHPAD_COLOR_BLACK);
padGrid.light(60 + i, LaunchpadColorManager.LAUNCHPAD_COLOR_BLACK);
padGrid.light(52 + i, LaunchpadColorManager.LAUNCHPAD_COLOR_BLACK);
padGrid.light(44 + i, LaunchpadColorManager.LAUNCHPAD_COLOR_BLACK);
padGrid.light(36 + i, LaunchpadColorManager.LAUNCHPAD_COLOR_BLACK);
}
}
}
Aggregations