use of de.mossgrabers.framework.daw.data.IChannel in project DrivenByMoss by git-moss.
the class DeviceLayerModePan 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.changeLayerOrDrumPadPan(offset + index, value);
}
use of de.mossgrabers.framework.daw.data.IChannel in project DrivenByMoss by git-moss.
the class DeviceLayerModePan 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);
for (int i = 0; i < 8; i++) {
final IChannel layer = cd.getLayerOrDrumPad(offset + i);
d.setCell(0, i, layer.doesExist() ? "Pan" : "").setCell(1, i, layer.getPanStr(8));
if (layer.doesExist())
d.setCell(2, i, layer.getPan(), 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 DeviceLayerModeSend 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 int sendIndex = this.getCurrentSendIndex();
for (int i = 0; i < 8; i++) {
final IChannel layer = cd.getLayerOrDrumPad(offset + i);
final boolean exists = layer.doesExist();
final ISend send = layer.getSend(sendIndex);
d.setCell(0, i, exists ? send.getName() : "").setCell(1, i, send.getDisplayedValue(8));
if (exists)
d.setCell(2, i, send.getValue(), 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 OSCParser method parseLayerOrDrumpad.
private void parseLayerOrDrumpad(final ICursorDevice cursorDevice, final LinkedList<String> parts, final Object value) {
if (parts.isEmpty()) {
this.host.println("Missing Layer/Drumpad command.");
return;
}
final String command = parts.removeFirst();
try {
final int layerNo;
if ("selected".equals(command)) {
final IChannel selectedLayerOrDrumPad = cursorDevice.getSelectedLayerOrDrumPad();
layerNo = selectedLayerOrDrumPad == null ? -1 : selectedLayerOrDrumPad.getIndex();
} else {
layerNo = Integer.parseInt(command) - 1;
}
this.parseDeviceLayerValue(cursorDevice, layerNo, parts, value);
} catch (final NumberFormatException ex) {
switch(command) {
case "parent":
if (cursorDevice.doesExist()) {
cursorDevice.selectParent();
cursorDevice.selectChannel();
}
break;
case "+":
cursorDevice.nextLayerOrDrumPad();
break;
case "-":
cursorDevice.previousLayerOrDrumPad();
break;
case "page":
if (parts.isEmpty()) {
this.host.println("Missing Layer/Drumpad Page subcommand: " + command);
return;
}
if ("+".equals(parts.get(0)))
cursorDevice.nextLayerOrDrumPadBank();
else
cursorDevice.previousLayerOrDrumPadBank();
break;
default:
this.host.println("Unknown Layour/Drum command: " + command);
break;
}
}
}
use of de.mossgrabers.framework.daw.data.IChannel in project DrivenByMoss by git-moss.
the class ColorView method onGridNote.
/**
* {@inheritDoc}
*/
@Override
public void onGridNote(final int note, final int velocity) {
if (velocity == 0)
return;
final int color = note - 36;
if (color < BitwigColors.BITWIG_COLORS.length) {
final double[] entry = BitwigColors.getColorEntry(BitwigColors.BITWIG_COLORS[color]);
switch(this.mode) {
case MODE_TRACK:
final IChannelBank tb = this.model.getCurrentTrackBank();
final ITrack t = tb.getSelectedTrack();
if (t == null) {
final IMasterTrack master = this.model.getMasterTrack();
if (master.isSelected())
master.setColor(entry[0], entry[1], entry[2]);
} else
t.setColor(entry[0], entry[1], entry[2]);
break;
case MODE_LAYER:
final ICursorDevice cd = this.model.getCursorDevice();
final IChannel deviceChain = cd.getSelectedLayerOrDrumPad();
cd.setLayerOrDrumPadColor(deviceChain.getIndex(), entry[0], entry[1], entry[2]);
break;
case MODE_CLIP:
final ICursorClip clip = this.model.getCursorClip();
if (clip != null)
clip.setColor(entry[0], entry[1], entry[2]);
break;
}
}
this.surface.getViewManager().restoreView();
}
Aggregations