use of de.mossgrabers.framework.daw.ICursorDevice in project DrivenByMoss by git-moss.
the class DeviceLayerModeSend method onValueKnobTouch.
/**
* {@inheritDoc}
*/
@Override
public void onValueKnobTouch(final int index, final boolean isTouched) {
this.isKnobTouched[index] = isTouched;
final ICursorDevice cd = this.model.getCursorDevice();
// Drum Pad Bank has size of 16, layers only 8
final int offset = getDrumPadIndex(cd);
final IChannel layer = cd.getLayerOrDrumPad(offset + index);
if (!layer.doesExist())
return;
final int sendIndex = this.getCurrentSendIndex();
if (isTouched) {
if (this.surface.isDeletePressed()) {
this.surface.setButtonConsumed(this.surface.getDeleteButtonId());
cd.resetLayerOrDrumPadSend(offset + index, sendIndex);
return;
}
final IChannelBank fxTrackBank = this.model.getEffectTrackBank();
final String name = fxTrackBank == null ? layer.getSend(sendIndex).getName() : fxTrackBank.getTrack(sendIndex).getName();
if (!name.isEmpty())
this.surface.getDisplay().notify("Send " + name + ": " + layer.getSend(sendIndex).getDisplayedValue());
}
cd.touchLayerOrDrumPadSend(offset + index, sendIndex, isTouched);
this.checkStopAutomationOnKnobRelease(isTouched);
}
use of de.mossgrabers.framework.daw.ICursorDevice in project DrivenByMoss by git-moss.
the class DeviceLayerModeVolume method updateDisplay1.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay1() {
final Display d = this.surface.getDisplay();
final ICursorDevice cd = this.model.getCursorDevice();
// Drum Pad Bank has size of 16, layers only 8
final int offset = getDrumPadIndex(cd);
final PushConfiguration config = this.surface.getConfiguration();
for (int i = 0; i < 8; i++) {
final IChannel layer = cd.getLayerOrDrumPad(offset + i);
d.setCell(0, i, layer.doesExist() ? "Volume" : "").setCell(1, i, layer.getVolumeStr(8));
if (layer.doesExist())
d.setCell(2, i, config.isEnableVUMeters() ? layer.getVu() : layer.getVolume(), Format.FORMAT_VALUE);
else
d.clearCell(2, i);
}
d.done(0).done(1).done(2);
this.drawRow4(d, cd);
}
use of de.mossgrabers.framework.daw.ICursorDevice in project DrivenByMoss by git-moss.
the class DeviceParamsMode method updateSecondRow.
/**
* {@inheritDoc}
*/
@Override
public void updateSecondRow() {
final int white = this.isPush2 ? PushColors.PUSH2_COLOR2_WHITE : PushColors.PUSH1_COLOR2_WHITE;
final ICursorDevice cd = this.model.getCursorDevice();
if (!cd.hasSelectedDevice()) {
this.disableSecondRow();
this.surface.updateButton(109, white);
return;
}
final int green = this.isPush2 ? PushColors.PUSH2_COLOR2_GREEN : PushColors.PUSH1_COLOR2_GREEN;
final int grey = this.isPush2 ? PushColors.PUSH2_COLOR2_GREY_LO : PushColors.PUSH1_COLOR2_GREY_LO;
final int orange = this.isPush2 ? PushColors.PUSH2_COLOR2_ORANGE : PushColors.PUSH1_COLOR2_ORANGE;
final int off = this.isPush2 ? PushColors.PUSH2_COLOR_BLACK : PushColors.PUSH1_COLOR_BLACK;
final int turquoise = this.isPush2 ? PushColors.PUSH2_COLOR2_TURQUOISE_HI : PushColors.PUSH1_COLOR2_TURQUOISE_HI;
this.surface.updateButton(102, cd.isEnabled() ? green : grey);
this.surface.updateButton(103, cd.isParameterPageSectionVisible() ? orange : white);
this.surface.updateButton(104, cd.isExpanded() ? orange : white);
this.surface.updateButton(105, off);
this.surface.updateButton(106, this.showDevices ? white : orange);
this.surface.updateButton(107, this.model.getHost().hasPinning() ? cd.isPinned() ? turquoise : grey : off);
this.surface.updateButton(108, cd.isWindowOpen() ? turquoise : grey);
this.surface.updateButton(109, white);
}
use of de.mossgrabers.framework.daw.ICursorDevice in project DrivenByMoss by git-moss.
the class DeviceParamsMode method updateFirstRow.
/**
* {@inheritDoc}
*/
@Override
public void updateFirstRow() {
final ICursorDevice cd = this.model.getCursorDevice();
if (!cd.hasSelectedDevice()) {
this.disableFirstRow();
return;
}
final int selectedColor = this.isPush2 ? PushColors.PUSH2_COLOR_ORANGE_HI : PushColors.PUSH1_COLOR_ORANGE_HI;
final int existsColor = this.isPush2 ? PushColors.PUSH2_COLOR_YELLOW_LO : PushColors.PUSH1_COLOR_YELLOW_LO;
final int offColor = this.isPush2 ? PushColors.PUSH2_COLOR_BLACK : PushColors.PUSH1_COLOR_BLACK;
if (this.showDevices) {
for (int i = 0; i < 8; i++) this.surface.updateButton(20 + i, cd.doesSiblingExist(i) ? i == cd.getPositionInBank() ? selectedColor : existsColor : offColor);
} else {
final String[] pages = cd.getParameterPageNames();
final int page = Math.min(Math.max(0, cd.getSelectedParameterPage()), pages.length - 1);
final int start = page / 8 * 8;
for (int i = 0; i < 8; i++) {
final int index = start + i;
this.surface.updateButton(20 + i, index < pages.length ? index == page ? selectedColor : existsColor : offColor);
}
}
}
use of de.mossgrabers.framework.daw.ICursorDevice in project DrivenByMoss by git-moss.
the class DeviceParamsMode method updateDisplay1.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay1() {
final Display d = this.surface.getDisplay().clear();
final ICursorDevice cd = this.model.getCursorDevice();
if (!cd.hasSelectedDevice()) {
d.clear().setBlock(1, 0, " Select").setBlock(1, 1, "a device or press").setBlock(1, 2, "'Add Effect'... ").allDone();
return;
}
// Row 1 & 2
for (int i = 0; i < 8; i++) {
final IParameter param = cd.getFXParam(i);
d.setCell(0, i, param.doesExist() ? StringUtils.fixASCII(param.getName()) : "").setCell(1, i, param.getDisplayedValue(8));
}
// Row 3
d.setBlock(2, 0, "Selected Device:").setBlock(2, 1, cd.getName());
// Row 4
if (this.showDevices) {
for (int i = 0; i < 8; i++) d.setCell(3, i, cd.doesSiblingExist(i) ? (i == cd.getPositionInBank() ? PushDisplay.RIGHT_ARROW : "") + cd.getSiblingDeviceName(i) : "");
} else {
final String[] pages = cd.getParameterPageNames();
final int page = Math.min(Math.max(0, cd.getSelectedParameterPage()), pages.length - 1);
final int start = page / 8 * 8;
for (int i = 0; i < 8; i++) {
final int index = start + i;
d.setCell(3, i, index < pages.length ? (index == page ? PushDisplay.RIGHT_ARROW : "") + pages[index] : "");
}
}
d.allDone();
}
Aggregations