use of de.mossgrabers.framework.daw.IChannelBank in project DrivenByMoss by git-moss.
the class AbstractTrackMode method onSecondRow.
/**
* {@inheritDoc}
*/
@Override
public void onSecondRow(final int index, final ButtonEvent event) {
if (event != ButtonEvent.DOWN)
return;
final IChannelBank tb = this.model.getCurrentTrackBank();
final ITrack track = tb.getTrack(index);
if (this.surface.isPressed(PushControlSurface.PUSH_BUTTON_CLIP_STOP)) {
track.stop();
return;
}
final PushConfiguration config = this.surface.getConfiguration();
if (!this.isPush2 || config.isMuteLongPressed() || config.isSoloLongPressed() || config.isMuteSoloLocked()) {
if (config.isMuteState())
track.toggleMute();
else
track.toggleSolo();
return;
}
final ModeManager modeManager = this.surface.getModeManager();
switch(index) {
case 0:
if (modeManager.isActiveMode(Modes.MODE_VOLUME))
modeManager.setActiveMode(Modes.MODE_TRACK);
else
modeManager.setActiveMode(Modes.MODE_VOLUME);
break;
case 1:
if (modeManager.isActiveMode(Modes.MODE_PAN))
modeManager.setActiveMode(Modes.MODE_TRACK);
else
modeManager.setActiveMode(Modes.MODE_PAN);
break;
case 2:
if (config.isDisplayCrossfader()) {
if (modeManager.isActiveMode(Modes.MODE_CROSSFADER))
modeManager.setActiveMode(Modes.MODE_TRACK);
else
modeManager.setActiveMode(Modes.MODE_CROSSFADER);
}
break;
case 3:
if (!this.model.isEffectTrackBankActive()) {
config.setSendsAreToggled(!config.isSendsAreToggled());
if (!modeManager.isActiveMode(Modes.MODE_TRACK))
modeManager.setActiveMode(Integer.valueOf(Modes.MODE_SEND1.intValue() + (config.isSendsAreToggled() ? 4 : 0)));
}
break;
case 7:
if (!this.model.isEffectTrackBankActive())
this.model.getTrackBank().selectParent();
break;
default:
final int sendIndex = index - (config.isSendsAreToggled() ? 0 : 4);
if (tb.canEditSend(sendIndex)) {
final Integer si = Integer.valueOf(Modes.MODE_SEND1.intValue() + sendIndex);
modeManager.setActiveMode(modeManager.isActiveMode(si) ? Modes.MODE_TRACK : si);
}
break;
}
config.setDebugMode(modeManager.getActiveModeId());
}
use of de.mossgrabers.framework.daw.IChannelBank in project DrivenByMoss by git-moss.
the class CrossfaderMode method updateDisplay1.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay1() {
final Display d = this.surface.getDisplay();
final IChannelBank tb = this.model.getCurrentTrackBank();
final int upperBound = this.model.getValueChanger().getUpperBound();
for (int i = 0; i < 8; i++) {
final ITrack t = tb.getTrack(i);
d.setCell(0, i, t.doesExist() ? "Crossfdr" : "");
if (t.doesExist()) {
final boolean isA = "A".equals(t.getCrossfadeMode());
d.setCell(1, i, isA ? "A" : "B".equals(t.getCrossfadeMode()) ? " B" : " <> ");
d.setCell(2, i, isA ? 0 : "B".equals(t.getCrossfadeMode()) ? upperBound : upperBound / 2, Format.FORMAT_PAN);
} else {
d.clearCell(1, i);
d.clearCell(2, i);
}
}
d.done(0).done(1).done(2);
this.drawRow4();
}
use of de.mossgrabers.framework.daw.IChannelBank in project DrivenByMoss by git-moss.
the class PanMode method updateDisplay1.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay1() {
final Display d = this.surface.getDisplay();
final IChannelBank tb = this.model.getCurrentTrackBank();
for (int i = 0; i < 8; i++) {
final ITrack t = tb.getTrack(i);
d.setCell(0, i, t.doesExist() ? "Pan" : "").setCell(1, i, t.getPanStr(8));
if (t.doesExist())
d.setCell(2, i, t.getPan(), Format.FORMAT_PAN);
else
d.clearCell(2, i);
}
d.done(0).done(1).done(2);
this.drawRow4();
}
use of de.mossgrabers.framework.daw.IChannelBank in project DrivenByMoss by git-moss.
the class SendMode method updateDisplay2.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay2() {
this.updateTrackMenu();
final int sendIndex = this.getCurrentSendIndex();
final IChannelBank tb = this.model.getCurrentTrackBank();
final IChannelBank fxTrackBank = this.model.getEffectTrackBank();
final PushConfiguration config = this.surface.getConfiguration();
final PushDisplay display = (PushDisplay) this.surface.getDisplay();
final DisplayMessage message = display.createMessage();
final int sendOffset = config.isSendsAreToggled() ? 4 : 0;
for (int i = 0; i < 8; i++) {
final ITrack t = tb.getTrack(i);
// The menu item
String topMenu;
boolean topMenuSelected;
if (this.surface.isPressed(PushControlSurface.PUSH_BUTTON_CLIP_STOP)) {
topMenu = t.doesExist() ? "Stop Clip" : "";
topMenuSelected = t.isPlaying();
} else if (config.isMuteLongPressed() || config.isMuteSoloLocked() && config.isMuteState()) {
topMenu = t.doesExist() ? "Mute" : "";
topMenuSelected = t.isMute();
} else if (config.isSoloLongPressed() || config.isMuteSoloLocked() && config.isSoloState()) {
topMenu = t.doesExist() ? "Solo" : "";
topMenuSelected = t.isSolo();
} else {
topMenu = this.menu[i];
topMenuSelected = i > 3 && i - 4 + sendOffset == sendIndex || i == 7 && tb instanceof ITrackBank && ((ITrackBank) tb).hasParent();
}
final IValueChanger valueChanger = this.model.getValueChanger();
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 = t.getSend(sendPos);
sendName[j] = fxTrackBank == null ? send.getName() : fxTrackBank.getTrack(sendPos).getName();
valueStr[j] = send != null && sendIndex == sendPos && this.isKnobTouched[i] ? send.getDisplayedValue(8) : "";
value[j] = valueChanger.toDisplayValue(send != null ? send.getValue() : -1);
modulatedValue[j] = valueChanger.toDisplayValue(send != null ? send.getModulatedValue() : -1);
selected[j] = sendIndex == sendPos;
}
message.addSendsElement(topMenu, topMenuSelected, t.doesExist() ? t.getName() : "", t.getType(), t.getColor(), t.isSelected(), sendName, valueStr, value, modulatedValue, selected, false);
}
display.send(message);
}
use of de.mossgrabers.framework.daw.IChannelBank in project DrivenByMoss by git-moss.
the class TrackDetailsMode method getSelectedTrack.
private ITrack getSelectedTrack() {
final IChannelBank tb = this.model.getCurrentTrackBank();
final ITrack t = tb.getSelectedTrack();
if (t != null)
return t;
final IMasterTrack master = this.model.getMasterTrack();
return master.isSelected() ? master : null;
}
Aggregations