use of de.mossgrabers.framework.daw.IChannelBank 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.IChannelBank in project DrivenByMoss by git-moss.
the class DeviceLayerMode method updateMenu.
protected void updateMenu() {
final IChannelBank fxTrackBank = this.model.getEffectTrackBank();
final PushConfiguration config = this.surface.getConfiguration();
final int sendOffset = config.isSendsAreToggled() ? 4 : 0;
for (int i = 0; i < 3; i++) this.menu[4 + i] = fxTrackBank.getTrack(sendOffset + i).getName();
this.menu[3] = config.isSendsAreToggled() ? "Sends 5-8" : "Sends 1-4";
}
use of de.mossgrabers.framework.daw.IChannelBank 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.IChannelBank in project DrivenByMoss by git-moss.
the class AbstractTrackMode method updateTrackMenu.
protected void updateTrackMenu() {
final PushConfiguration config = this.surface.getConfiguration();
final int sendOffset = config.isSendsAreToggled() ? 4 : 0;
if (this.model.isEffectTrackBankActive()) {
// No sends for FX tracks
for (int i = 3; i < 7; i++) this.menu[i] = " ";
return;
}
this.menu[2] = config.isDisplayCrossfader() ? "Crossfader" : " ";
final IChannelBank tb = this.model.getCurrentTrackBank();
for (int i = 0; i < 3; i++) {
this.menu[4 + i] = tb.getEditSendName(sendOffset + i);
if (this.menu[4 + i].isEmpty())
this.menu[4 + i] = " ";
}
this.menu[3] = config.isSendsAreToggled() ? "Sends 5-8" : "Sends 1-4";
this.menu[7] = tb instanceof ITrackBank && ((ITrackBank) tb).hasParent() ? "Up" : " ";
}
use of de.mossgrabers.framework.daw.IChannelBank in project DrivenByMoss by git-moss.
the class AbstractTrackMode method updateChannelDisplay.
// Push 2
// Called from sub-classes
protected void updateChannelDisplay(final int selectedMenu, final boolean isVolume, final boolean isPan) {
this.updateTrackMenu();
final PushConfiguration config = this.surface.getConfiguration();
final PushDisplay display = (PushDisplay) this.surface.getDisplay();
final DisplayMessage message = display.createMessage();
final IValueChanger valueChanger = this.model.getValueChanger();
final IChannelBank tb = this.model.getCurrentTrackBank();
final boolean displayCrossfader = config.isDisplayCrossfader();
for (int i = 0; i < 8; i++) {
final ITrack t = tb.getTrack(i);
// The menu item
String topMenu;
boolean isTopMenuOn;
if (this.surface.isPressed(PushControlSurface.PUSH_BUTTON_CLIP_STOP) && this.model.getHost().hasClips()) {
topMenu = t.doesExist() ? "Stop Clip" : "";
isTopMenuOn = t.isPlaying();
} else if (config.isMuteLongPressed() || config.isMuteSoloLocked() && config.isMuteState()) {
topMenu = t.doesExist() ? "Mute" : "";
isTopMenuOn = t.isMute();
} else if (config.isSoloLongPressed() || config.isMuteSoloLocked() && config.isSoloState()) {
topMenu = t.doesExist() ? "Solo" : "";
isTopMenuOn = t.isSolo();
} else {
topMenu = this.menu[i];
isTopMenuOn = i == selectedMenu - 1 || i == 7 && tb instanceof ITrackBank && ((ITrackBank) tb).hasParent();
}
final int crossfadeMode = displayCrossfader ? t.getCrossfadeModeAsNumber() : -1;
message.addChannelElement(selectedMenu, topMenu, isTopMenuOn, t.doesExist() ? t.getName(12) : "", t.getType(), t.getColor(), t.isSelected(), valueChanger.toDisplayValue(t.getVolume()), valueChanger.toDisplayValue(t.getModulatedVolume()), isVolume && this.isKnobTouched[i] ? t.getVolumeStr(8) : "", valueChanger.toDisplayValue(t.getPan()), valueChanger.toDisplayValue(t.getModulatedPan()), isPan && this.isKnobTouched[i] ? t.getPanStr() : "", valueChanger.toDisplayValue(config.isEnableVUMeters() ? t.getVu() : 0), t.isMute(), t.isSolo(), t.isRecArm(), crossfadeMode);
}
display.send(message);
}
Aggregations