use of de.mossgrabers.framework.daw.data.IChannel in project DrivenByMoss by git-moss.
the class DeviceLayerModeSend method onValueKnob.
/**
* {@inheritDoc}
*/
@Override
public void onValueKnob(final int index, final int value) {
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())
cd.changeLayerOrDrumPadSend(offset + index, this.getCurrentSendIndex(), value);
}
use of de.mossgrabers.framework.daw.data.IChannel 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.data.IChannel 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.data.IChannel in project DrivenByMoss by git-moss.
the class DeviceParamsMode method onFirstRow.
/**
* {@inheritDoc}
*/
@Override
public void onFirstRow(final int index, final ButtonEvent event) {
if (event == ButtonEvent.DOWN)
return;
if (event == ButtonEvent.UP) {
final ICursorDevice cd = this.model.getCursorDevice();
if (!cd.hasSelectedDevice())
return;
if (!this.showDevices) {
cd.setSelectedParameterPageInBank(index);
return;
}
if (cd.getPositionInBank() != index) {
cd.selectSibling(index);
return;
}
final ModeManager modeManager = this.surface.getModeManager();
if (!cd.hasLayers()) {
((DeviceParamsMode) modeManager.getMode(Modes.MODE_DEVICE_PARAMS)).setShowDevices(false);
return;
}
final IChannel layer = cd.getSelectedLayerOrDrumPad();
if (layer == null)
cd.selectLayerOrDrumPad(0);
modeManager.setActiveMode(Modes.MODE_DEVICE_LAYER);
return;
}
// LONG press - move upwards
this.surface.setButtonConsumed(PushControlSurface.PUSH_BUTTON_ROW1_1 + index);
this.moveUp();
}
use of de.mossgrabers.framework.daw.data.IChannel in project DrivenByMoss by git-moss.
the class LayerDetailsMode method updateFirstRow.
/**
* {@inheritDoc}
*/
@Override
public void updateFirstRow() {
final IChannel deviceChain = this.model.getCursorDevice().getSelectedLayerOrDrumPad();
if (deviceChain == null) {
this.disableFirstRow();
return;
}
final int off = this.isPush2 ? PushColors.PUSH2_COLOR_BLACK : PushColors.PUSH1_COLOR_BLACK;
this.surface.updateButton(20, deviceChain.isActivated() ? this.isPush2 ? PushColors.PUSH2_COLOR_YELLOW_MD : PushColors.PUSH1_COLOR_YELLOW_MD : this.isPush2 ? PushColors.PUSH2_COLOR_YELLOW_LO : PushColors.PUSH1_COLOR_YELLOW_LO);
this.surface.updateButton(21, off);
this.surface.updateButton(22, deviceChain.isMute() ? this.isPush2 ? PushColors.PUSH2_COLOR_ORANGE_HI : PushColors.PUSH1_COLOR_ORANGE_HI : this.isPush2 ? PushColors.PUSH2_COLOR_ORANGE_LO : PushColors.PUSH1_COLOR_ORANGE_LO);
this.surface.updateButton(23, deviceChain.isSolo() ? this.isPush2 ? PushColors.PUSH2_COLOR_ORANGE_HI : PushColors.PUSH1_COLOR_ORANGE_HI : this.isPush2 ? PushColors.PUSH2_COLOR_ORANGE_LO : PushColors.PUSH1_COLOR_ORANGE_LO);
this.surface.updateButton(24, off);
this.surface.updateButton(25, off);
this.surface.updateButton(26, off);
this.surface.updateButton(27, this.isPush2 ? PushColors.PUSH2_COLOR_GREEN_HI : PushColors.PUSH1_COLOR_GREEN_HI);
}
Aggregations