use of de.mossgrabers.framework.daw.data.bank.IParameterBank in project DrivenByMoss by git-moss.
the class ParametersMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
final SLMkIIIDisplay d = this.surface.getDisplay();
d.clear();
final ICursorDevice cd = this.model.getCursorDevice();
if (!cd.doesExist()) {
d.setBlock(1, 1, " Please select or").setBlock(1, 2, "add a device.");
d.setCell(0, 8, "No device");
d.hideAllElements();
// Row 4
this.drawRow4(d, cd, null);
} else {
final IParameterPageBank parameterPageBank = cd.getParameterPageBank();
final Optional<String> selectedPage = parameterPageBank.getSelectedItem();
d.setCell(0, 8, cd.getName(9)).setCell(1, 8, selectedPage.isPresent() ? selectedPage.get() : "");
// Row 1 & 2
for (int i = 0; i < 8; i++) {
final IParameterBank parameterBank = cd.getParameterBank();
final IParameter param = parameterBank.getItem(i);
d.setCell(0, i, param.doesExist() ? StringUtils.fixASCII(param.getName(9)) : "").setCell(1, i, param.getDisplayedValue(9));
final int color = param.doesExist() ? SLMkIIIColorManager.SLMKIII_PURPLE : SLMkIIIColorManager.SLMKIII_BLACK;
d.setPropertyColor(i, 0, color);
d.setPropertyColor(i, 1, color);
}
// Row 4
this.drawRow4(d, cd, parameterPageBank);
}
this.setButtonInfo(d);
d.allDone();
}
use of de.mossgrabers.framework.daw.data.bank.IParameterBank in project DrivenByMoss by git-moss.
the class ParameterView method drawGrid.
/**
* {@inheritDoc}
*/
@Override
public void drawGrid() {
final IPadGrid padGrid = this.surface.getPadGrid();
for (int i = 8; i < 12; i++) padGrid.lightEx(i % 4, 3 - i / 4, AbstractFeatureGroup.BUTTON_COLOR_OFF);
final ICursorDevice cursorDevice = this.model.getCursorDevice();
final boolean doesExist = cursorDevice.doesExist();
padGrid.lightEx(0, 0, doesExist && cursorDevice.canSelectPreviousFX() ? MaschineColorManager.COLOR_ROSE : MaschineColorManager.COLOR_BLACK);
padGrid.lightEx(1, 0, doesExist && cursorDevice.canSelectNextFX() ? MaschineColorManager.COLOR_ROSE : MaschineColorManager.COLOR_BLACK);
final IParameterBank parameterBank = cursorDevice.getParameterBank();
padGrid.lightEx(2, 0, doesExist && parameterBank.canScrollBackwards() ? MaschineColorManager.COLOR_SKIN : MaschineColorManager.COLOR_BLACK);
padGrid.lightEx(3, 0, doesExist && parameterBank.canScrollForwards() ? MaschineColorManager.COLOR_SKIN : MaschineColorManager.COLOR_BLACK);
final SelectedDeviceMode<?, ?> deviceMode = (SelectedDeviceMode<?, ?>) this.surface.getModeManager().get(Modes.DEVICE_PARAMS);
for (int i = 0; i < 8; i++) {
final int x = i % 4;
final int y = 2 + i / 4;
final IParameter item = parameterBank.getItem(i);
if (item.doesExist()) {
final int color = MaschineColorManager.PARAM_COLORS.get(i).intValue();
if (i == deviceMode.getSelectedParameter())
padGrid.lightEx(x, y, color, MaschineColorManager.COLOR_WHITE, false);
else
padGrid.lightEx(x, y, color);
} else
padGrid.lightEx(x, y, AbstractFeatureGroup.BUTTON_COLOR_OFF);
}
}
use of de.mossgrabers.framework.daw.data.bank.IParameterBank in project DrivenByMoss by git-moss.
the class PageCommand method execute.
/**
* {@inheritDoc}
*/
@Override
public void execute(final ButtonEvent event, final int velocity) {
if (event != ButtonEvent.DOWN)
return;
final ModeManager modeManager = this.surface.getModeManager();
final Modes mode = modeManager.getActiveID();
switch(mode) {
case DEVICE_PARAMS:
final ICursorDevice cursorDevice = this.model.getCursorDevice();
if (this.direction == Direction.LEFT)
cursorDevice.selectPrevious();
else
cursorDevice.selectNext();
this.mvHelper.notifySelectedDevice();
break;
case USER:
final IParameterBank userBank = this.model.getUserParameterBank();
if (this.direction == Direction.LEFT)
userBank.selectPreviousPage();
else
userBank.selectNextPage();
this.mvHelper.notifySelectedUserPage();
break;
case BROWSER:
if (this.direction == Direction.LEFT)
this.model.getBrowser().previousContentType();
else
this.model.getBrowser().nextContentType();
break;
default:
final ITrack cursorTrack = this.model.getCursorTrack();
if (!cursorTrack.doesExist())
return;
final ISlotBank slotBank = cursorTrack.getSlotBank();
if (this.direction == Direction.LEFT) {
if (this.surface.isShiftPressed()) {
this.surface.setStopConsumed();
slotBank.selectPreviousPage();
} else
slotBank.selectPreviousItem();
} else {
if (this.surface.isShiftPressed()) {
this.surface.setStopConsumed();
slotBank.selectNextPage();
} else
slotBank.selectNextItem();
}
break;
}
}
use of de.mossgrabers.framework.daw.data.bank.IParameterBank in project DrivenByMoss by git-moss.
the class LaunchkeyMk3ParameterMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
final ITextDisplay d = this.surface.getTextDisplay();
if (this.areKnobs) {
// Display device and current parameter page
final StringBuilder sb = new StringBuilder();
if (this.cursorDevice.doesExist())
sb.append(this.cursorDevice.getName(8)).append(' ').append(this.cursorDevice.getParameterPageBank().getSelectedItem());
else
sb.append("No device");
d.setCell(LaunchkeyMk3Display.SCREEN_ROW_BASE, 0, sb.toString());
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 IParameterBank parameterBank = this.cursorDevice.getParameterBank();
for (int i = 0; i < 8; i++) {
final IParameter item = parameterBank.getItem(i);
final boolean exists = item.doesExist();
final int offset = i * 2;
d.setCell(row + offset, 0, exists ? item.getName() : "No parameter");
d.setCell(row + offset + 1, 0, exists ? item.getDisplayedValue() : "");
}
// 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.IParameterBank 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;
}
}
Aggregations