use of de.mossgrabers.framework.daw.data.IChannel in project DrivenByMoss by git-moss.
the class LayerDetailsMode method updateDisplay2.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay2() {
final PushDisplay display = (PushDisplay) this.surface.getDisplay();
final DisplayMessage message = display.createMessage();
final IChannel deviceChain = this.model.getCursorDevice().getSelectedLayerOrDrumPad();
if (deviceChain == null)
message.setMessage(3, "Please select a layer...");
else {
message.addOptionElement("Layer: " + deviceChain.getName(), "", false, "", "Active", deviceChain.isActivated(), false);
message.addEmptyElement();
message.addOptionElement("", "", false, "", "Mute", deviceChain.isMute(), false);
message.addOptionElement("", "", false, "", "Solo", deviceChain.isSolo(), false);
message.addEmptyElement();
message.addEmptyElement();
message.addEmptyElement();
message.addOptionElement("", "", false, "", "Select Color", false, false);
}
display.send(message);
}
use of de.mossgrabers.framework.daw.data.IChannel in project DrivenByMoss by git-moss.
the class LayerDetailsMode method onFirstRow.
/**
* {@inheritDoc}
*/
@Override
public void onFirstRow(final int index, final ButtonEvent event) {
if (event != ButtonEvent.UP)
return;
final IChannel deviceChain = this.model.getCursorDevice().getSelectedLayerOrDrumPad();
if (deviceChain == null)
return;
switch(index) {
case 0:
this.model.getCursorDevice().toggleLayerOrDrumPadIsActivated(deviceChain.getIndex());
break;
case 2:
this.model.getCursorDevice().toggleLayerOrDrumPadMute(deviceChain.getIndex());
break;
case 3:
this.model.getCursorDevice().toggleLayerOrDrumPadSolo(deviceChain.getIndex());
break;
case 7:
final ViewManager viewManager = this.surface.getViewManager();
((ColorView) viewManager.getView(Views.VIEW_COLOR)).setMode(ColorView.SelectMode.MODE_LAYER);
viewManager.setActiveView(Views.VIEW_COLOR);
break;
default:
// Not used
break;
}
}
use of de.mossgrabers.framework.daw.data.IChannel in project DrivenByMoss by git-moss.
the class FireLayerMode method onKnobTouch.
/**
* {@inheritDoc}
*/
@Override
public void onKnobTouch(final int index, final boolean isTouched) {
this.selectedParameter = this.surface.isPressed(ButtonID.ALT) ? ALT_MODES[index] : MODES[index];
this.isKnobTouched[index] = isTouched;
final ISpecificDevice cd = this.model.getDrumDevice();
final Optional<ILayer> channelOptional = cd.getLayerBank().getSelectedItem();
if (!channelOptional.isPresent())
return;
final IChannel channel = channelOptional.get();
switch(this.selectedParameter) {
case VOLUME:
if (isTouched && this.surface.isDeletePressed())
channel.resetVolume();
channel.touchVolume(isTouched);
break;
case PAN:
if (isTouched && this.surface.isDeletePressed())
channel.resetPan();
channel.touchPan(isTouched);
break;
case SEND1:
case SEND2:
case SEND3:
case SEND4:
case SEND5:
case SEND6:
final int sendIndex = this.selectedParameter.ordinal() - Modes.SEND1.ordinal();
final ISend item = channel.getSendBank().getItem(sendIndex);
if (isTouched && this.surface.isDeletePressed())
item.resetValue();
item.touchValue(isTouched);
break;
default:
// No more
break;
}
}
use of de.mossgrabers.framework.daw.data.IChannel in project DrivenByMoss by git-moss.
the class FireLayerMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
this.updateMode();
final IGraphicDisplay display = this.surface.getGraphicsDisplay();
String desc = "Select";
String label = "a drum pad";
int value = -1;
int vuLeft = -1;
int vuRight = -1;
boolean isPan = false;
final ISpecificDevice cd = this.model.getDrumDevice();
final Optional<ILayer> channelOptional = cd.getLayerBank().getSelectedItem();
if (channelOptional.isPresent()) {
final IChannel channel = channelOptional.get();
vuLeft = channel.getVuLeft();
vuRight = channel.getVuRight();
desc = channel.getPosition() + 1 + ": " + channel.getName(9);
final ISendBank sendBank = channel.getSendBank();
switch(this.selectedParameter) {
case VOLUME:
label = "Vol: " + channel.getVolumeStr();
value = channel.getVolume();
break;
case PAN:
label = "Pan: " + channel.getPanStr();
value = channel.getPan();
isPan = true;
break;
case SEND1:
case SEND2:
case SEND3:
case SEND4:
case SEND5:
case SEND6:
final int sendIndex = this.selectedParameter.ordinal() - Modes.SEND1.ordinal();
label = getSendLabel(sendBank, sendIndex);
value = getSendValue(sendBank, sendIndex);
break;
default:
label = "Select a track";
break;
}
}
display.addElement(new TitleValueComponent(desc, label, value, vuLeft, vuRight, isPan));
display.send();
}
use of de.mossgrabers.framework.daw.data.IChannel in project DrivenByMoss by git-moss.
the class AbstractDrumView method getDrumPadColor.
protected String getDrumPadColor(final int index, final IDrumDevice primary, final boolean isRecording) {
final int offsetY = this.scales.getDrumOffset();
// Playing note?
if (this.keyManager.isKeyPressed(offsetY + index))
return isRecording ? AbstractDrumView.COLOR_PAD_RECORD : AbstractDrumView.COLOR_PAD_PLAY;
// Selected?
if (this.selectedPad == index)
return AbstractDrumView.COLOR_PAD_SELECTED;
// Exists and active?
final IDrumPadBank drumPadBank = primary.getDrumPadBank();
final IChannel drumPad = drumPadBank.getItem(index);
if (!drumPad.doesExist() || !drumPad.isActivated())
return this.surface.getConfiguration().isTurnOffEmptyDrumPads() ? AbstractDrumView.COLOR_PAD_OFF : AbstractDrumView.COLOR_PAD_NO_CONTENT;
// Muted or soloed?
if (drumPad.isMute() || drumPadBank.hasSoloedPads() && !drumPad.isSolo())
return AbstractDrumView.COLOR_PAD_MUTED;
return this.getPadContentColor(drumPad);
}
Aggregations