use of de.mossgrabers.framework.daw.data.IChannel in project DrivenByMoss by git-moss.
the class DeviceLayerModeSend method updateDisplayElements.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplayElements(final DisplayMessage message, final ICursorDevice cd, final IChannel l) {
final int sendIndex = this.getCurrentSendIndex();
final IChannelBank fxTrackBank = this.model.getEffectTrackBank();
this.updateMenu();
final PushConfiguration config = this.surface.getConfiguration();
// Drum Pad Bank has size of 16, layers only 8
final int offset = getDrumPadIndex(cd);
final int sendOffset = config.isSendsAreToggled() ? 4 : 0;
for (int i = 0; i < 8; i++) {
final IChannel layer = cd.getLayerOrDrumPad(offset + i);
// The menu item
String topMenu;
boolean topMenuSelected;
if (config.isMuteLongPressed() || config.isMuteSoloLocked() && config.isMuteState()) {
topMenu = layer.doesExist() ? "Mute" : "";
topMenuSelected = layer.isMute();
} else if (config.isSoloLongPressed() || config.isMuteSoloLocked() && config.isSoloState()) {
topMenu = layer.doesExist() ? "Solo" : "";
topMenuSelected = layer.isSolo();
} else {
topMenu = this.menu[i];
topMenuSelected = i > 3 && i - 4 + sendOffset == sendIndex;
}
// Channel info
final String[] sendName = new String[4];
final String[] valueStr = new String[4];
final int[] value = new int[4];
final int[] modulatedValue = new int[4];
final boolean[] selected = new boolean[4];
for (int j = 0; j < 4; j++) {
final int sendPos = sendOffset + j;
final ISend send = layer.getSend(sendPos);
sendName[j] = fxTrackBank == null ? send.getName() : fxTrackBank.getTrack(sendPos).getName();
valueStr[j] = send.doesExist() && sendIndex == sendPos && this.isKnobTouched[i] ? send.getDisplayedValue() : "";
value[j] = send.doesExist() ? send.getValue() : 0;
modulatedValue[j] = send.doesExist() ? send.getModulatedValue() : 0;
selected[j] = sendIndex == sendPos;
}
message.addSendsElement(topMenu, topMenuSelected, layer.doesExist() ? layer.getName() : "", ChannelType.LAYER, cd.getLayerOrDrumPad(offset + i).getColor(), layer.isSelected(), sendName, valueStr, value, modulatedValue, selected, false);
}
}
use of de.mossgrabers.framework.daw.data.IChannel in project DrivenByMoss by git-moss.
the class DeviceLayerModeVolume 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;
if (isTouched) {
if (this.surface.isDeletePressed()) {
this.surface.setButtonConsumed(this.surface.getDeleteButtonId());
cd.resetLayerOrDrumPadVolume(offset + index);
return;
}
this.surface.getDisplay().notify("Volume: " + layer.getVolumeStr());
}
cd.touchLayerOrDrumPadVolume(layer.getIndex(), isTouched);
this.checkStopAutomationOnKnobRelease(isTouched);
}
use of de.mossgrabers.framework.daw.data.IChannel in project DrivenByMoss by git-moss.
the class DeviceLayerModeVolume 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.changeLayerOrDrumPadVolume(offset + index, value);
}
use of de.mossgrabers.framework.daw.data.IChannel in project DrivenByMoss by git-moss.
the class LayerDetailsMode method updateDisplay1.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay1() {
final Display d = this.surface.getDisplay();
final IChannel deviceChain = this.model.getCursorDevice().getSelectedLayerOrDrumPad();
if (deviceChain == null)
d.setRow(1, " Please selecta layer... ").clearRow(0).clearRow(2).done(0).done(2);
else {
d.clearRow(0).clearRow(1).setBlock(0, 0, "Layer: " + deviceChain.getName());
d.setCell(2, 0, "Active").setCell(3, 0, deviceChain.isActivated() ? "On" : "Off");
d.setCell(2, 1, "");
d.setCell(3, 1, "");
d.setCell(2, 2, "Mute").setCell(3, 2, deviceChain.isMute() ? "On" : "Off");
d.setCell(2, 3, "Solo").setCell(3, 3, deviceChain.isSolo() ? "On" : "Off");
d.setCell(2, 4, "");
d.setCell(3, 4, "");
d.setCell(2, 5, "");
d.setCell(3, 5, "");
d.clearCell(2, 6).clearCell(3, 6);
d.setCell(2, 7, "Select").setCell(3, 7, "Color").done(0).done(1).done(2).done(3);
}
}
use of de.mossgrabers.framework.daw.data.IChannel in project DrivenByMoss by git-moss.
the class DeviceLayerMode method updateDisplay1.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay1() {
final Display d = this.surface.getDisplay().clear();
final ICursorDevice cd = this.model.getCursorDevice();
if (!cd.hasSelectedDevice()) {
d.setBlock(1, 0, " Select").setBlock(1, 1, "a device or press").setBlock(1, 2, "'Add Effect'... ").allDone();
return;
}
final boolean noLayers = cd.hasLayers() && cd.hasZeroLayers();
if (noLayers) {
d.setBlock(1, 1, " Please create").setBlock(1, 2, cd.hasDrumPads() ? "a Drum Pad..." : "a Device Layer...");
} else {
final IChannel l = cd.getSelectedLayerOrDrumPad();
if (l != null) {
d.setCell(0, 0, "Volume").setCell(1, 0, l.getVolumeStr(8)).setCell(2, 0, this.surface.getConfiguration().isEnableVUMeters() ? l.getVu() : l.getVolume(), Format.FORMAT_VALUE);
d.setCell(0, 1, "Pan").setCell(1, 1, l.getPanStr(8)).setCell(2, 1, l.getPan(), Format.FORMAT_PAN);
final IChannelBank fxTrackBank = this.model.getEffectTrackBank();
if (fxTrackBank == null) {
for (int i = 0; i < 6; i++) {
final int pos = 2 + i;
final ISend send = l.getSend(i);
d.setCell(0, pos, send.getName()).setCell(1, pos, send.getDisplayedValue(8)).setCell(2, pos, send.getValue(), Format.FORMAT_VALUE);
}
} else {
final boolean isFX = this.model.isEffectTrackBankActive();
for (int i = 0; i < 6; i++) {
final ITrack fxTrack = fxTrackBank.getTrack(i);
final boolean isEmpty = isFX || !fxTrack.doesExist();
final int pos = 2 + i;
if (isEmpty) {
d.clearCell(0, pos);
d.clearCell(2, pos);
} else {
final ISend send = l.getSend(i);
d.setCell(0, pos, fxTrack.getName()).setCell(1, pos, send.getDisplayedValue(8));
d.setCell(2, pos, send.getValue(), Format.FORMAT_VALUE);
}
}
}
}
}
this.drawRow4(d, cd);
}
Aggregations