use of de.mossgrabers.framework.daw.data.IChannel in project DrivenByMoss by git-moss.
the class DeviceLayerMode method onValueKnobTouch.
/**
* {@inheritDoc}
*/
@Override
public void onValueKnobTouch(final int index, final boolean isTouched) {
final ICursorDevice cd = this.model.getCursorDevice();
final IChannel l = cd.getSelectedLayerOrDrumPad();
if (l == null)
return;
this.isKnobTouched[index] = isTouched;
if (isTouched) {
if (this.surface.isDeletePressed()) {
this.surface.setButtonConsumed(this.surface.getDeleteButtonId());
switch(index) {
case 0:
cd.resetLayerOrDrumPadVolume(l.getIndex());
break;
case 1:
cd.resetLayerOrDrumPadPan(l.getIndex());
break;
default:
if (this.isPush2 && index < 4)
break;
final int sendIndex = index - (this.isPush2 ? this.surface.getConfiguration().isSendsAreToggled() ? 0 : 4 : 2);
cd.resetLayerSend(l.getIndex(), sendIndex);
break;
}
return;
}
switch(index) {
case 0:
this.surface.getDisplay().notify("Volume: " + l.getVolumeStr());
break;
case 1:
this.surface.getDisplay().notify("Pan: " + l.getPanStr());
break;
default:
if (this.isPush2 && index < 4)
break;
final int sendIndex = index - (this.isPush2 ? this.surface.getConfiguration().isSendsAreToggled() ? 0 : 4 : 2);
final IChannelBank fxTrackBank = this.model.getEffectTrackBank();
final String name = fxTrackBank == null ? l.getSend(sendIndex).getName() : fxTrackBank.getTrack(sendIndex).getName();
if (!name.isEmpty())
this.surface.getDisplay().notify("Send " + name + ": " + l.getSend(sendIndex).getDisplayedValue());
break;
}
}
switch(index) {
case 0:
cd.touchLayerOrDrumPadVolume(l.getIndex(), isTouched);
break;
case 1:
cd.touchLayerOrDrumPadPan(l.getIndex(), isTouched);
break;
default:
if (this.isPush2 && index < 4)
break;
final int sendIndex = index - (this.isPush2 ? this.surface.getConfiguration().isSendsAreToggled() ? 0 : 4 : 2);
cd.touchLayerOrDrumPadSend(l.getIndex(), sendIndex, isTouched);
break;
}
this.checkStopAutomationOnKnobRelease(isTouched);
}
use of de.mossgrabers.framework.daw.data.IChannel in project DrivenByMoss by git-moss.
the class DeviceLayerMode method updateSecondRow.
/**
* {@inheritDoc}
*/
@Override
public void updateSecondRow() {
final ICursorDevice cd = this.model.getCursorDevice();
final PushConfiguration config = this.surface.getConfiguration();
final boolean muteState = config.isMuteState();
if (this.isPush2) {
if (config.isMuteLongPressed() || config.isSoloLongPressed() || config.isMuteSoloLocked()) {
// 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);
int color = PushColors.PUSH2_COLOR_BLACK;
if (layer.doesExist()) {
if (muteState) {
if (layer.isMute())
color = PushColors.PUSH2_COLOR2_AMBER_LO;
} else if (layer.isSolo())
color = PushColors.PUSH2_COLOR2_YELLOW_HI;
}
this.surface.updateButton(102 + i, color);
}
return;
}
final ModeManager modeManager = this.surface.getModeManager();
this.surface.updateButton(102, modeManager.isActiveMode(Modes.MODE_DEVICE_LAYER_VOLUME) ? PushColors.PUSH2_COLOR2_WHITE : PushColors.PUSH2_COLOR_BLACK);
this.surface.updateButton(103, modeManager.isActiveMode(Modes.MODE_DEVICE_LAYER_PAN) ? PushColors.PUSH2_COLOR2_WHITE : PushColors.PUSH2_COLOR_BLACK);
this.surface.updateButton(104, PushColors.PUSH2_COLOR_BLACK);
this.surface.updateButton(105, PushColors.PUSH2_COLOR_BLACK);
this.surface.updateButton(106, modeManager.isActiveMode(config.isSendsAreToggled() ? Modes.MODE_DEVICE_LAYER_SEND5 : Modes.MODE_DEVICE_LAYER_SEND1) ? PushColors.PUSH2_COLOR2_WHITE : PushColors.PUSH2_COLOR_BLACK);
this.surface.updateButton(107, modeManager.isActiveMode(config.isSendsAreToggled() ? Modes.MODE_DEVICE_LAYER_SEND6 : Modes.MODE_DEVICE_LAYER_SEND2) ? PushColors.PUSH2_COLOR2_WHITE : PushColors.PUSH2_COLOR_BLACK);
this.surface.updateButton(108, modeManager.isActiveMode(config.isSendsAreToggled() ? Modes.MODE_DEVICE_LAYER_SEND7 : Modes.MODE_DEVICE_LAYER_SEND3) ? PushColors.PUSH2_COLOR2_WHITE : PushColors.PUSH2_COLOR_BLACK);
this.surface.updateButton(109, modeManager.isActiveMode(config.isSendsAreToggled() ? Modes.MODE_DEVICE_LAYER_SEND8 : Modes.MODE_DEVICE_LAYER_SEND4) ? PushColors.PUSH2_COLOR2_WHITE : PushColors.PUSH2_COLOR_BLACK);
return;
}
if (cd == null || !cd.hasLayers()) {
this.disableSecondRow();
this.surface.updateButton(109, this.isPush2 ? PushColors.PUSH2_COLOR2_WHITE : PushColors.PUSH1_COLOR2_WHITE);
return;
}
final int offset = getDrumPadIndex(cd);
for (int i = 0; i < 8; i++) {
final IChannel dl = cd.getLayerOrDrumPad(offset + i);
int color = PushColors.PUSH1_COLOR_BLACK;
if (dl.doesExist()) {
if (muteState) {
if (!dl.isMute())
color = PushColors.PUSH1_COLOR2_YELLOW_HI;
} else
color = dl.isSolo() ? PushColors.PUSH1_COLOR2_BLUE_HI : PushColors.PUSH1_COLOR2_GREY_LO;
}
this.surface.updateButton(102 + i, color);
}
}
use of de.mossgrabers.framework.daw.data.IChannel in project DrivenByMoss by git-moss.
the class DeviceLayerMode method drawRow4.
/**
* Draw the fourth row.
*
* @param d The display
* @param cd The cursor device
*/
protected void drawRow4(final Display d, final ICursorDevice cd) {
// 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);
final String n = StringUtils.shortenAndFixASCII(layer.getName(), layer.isSelected() ? 7 : 8);
d.setCell(3, i, layer.isSelected() ? PushDisplay.RIGHT_ARROW + n : n);
}
d.allDone();
}
use of de.mossgrabers.framework.daw.data.IChannel in project DrivenByMoss by git-moss.
the class DeviceLayerMode method updateFirstRow.
/**
* {@inheritDoc}
*/
@Override
public void updateFirstRow() {
final ICursorDevice cd = this.model.getCursorDevice();
if (cd == null || !cd.hasLayers()) {
this.disableFirstRow();
return;
}
final int offset = getDrumPadIndex(cd);
for (int i = 0; i < 8; i++) {
final IChannel dl = cd.getLayerOrDrumPad(offset + i);
this.surface.updateButton(20 + i, dl.doesExist() && dl.isActivated() ? dl.isSelected() ? this.isPush2 ? PushColors.PUSH2_COLOR_ORANGE_HI : PushColors.PUSH1_COLOR_ORANGE_HI : this.isPush2 ? PushColors.PUSH2_COLOR_YELLOW_LO : PushColors.PUSH1_COLOR_YELLOW_LO : this.isPush2 ? PushColors.PUSH2_COLOR_BLACK : PushColors.PUSH1_COLOR_BLACK);
}
}
use of de.mossgrabers.framework.daw.data.IChannel in project DrivenByMoss by git-moss.
the class DeviceLayerModePan 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.resetLayerOrDrumPadPan(offset + index);
return;
}
this.surface.getDisplay().notify("Pan: " + layer.getPanStr());
}
cd.touchLayerOrDrumPadPan(layer.getIndex(), isTouched);
this.checkStopAutomationOnKnobRelease(isTouched);
}
Aggregations