use of de.mossgrabers.framework.daw.data.ITrack in project DrivenByMoss by git-moss.
the class TrackMode method updateKnobLEDs.
/**
* {@inheritDoc}
*/
@Override
protected void updateKnobLEDs() {
final IChannelBank tb = this.model.getCurrentTrackBank();
final int upperBound = this.model.getValueChanger().getUpperBound();
final ITrack t = tb.getSelectedTrack();
if (t == null) {
for (int i = 0; i < 8; i++) this.surface.setKnobLED(i, MCUControlSurface.KNOB_LED_MODE_WRAP, 0, upperBound);
return;
}
this.surface.setKnobLED(0, MCUControlSurface.KNOB_LED_MODE_WRAP, t.getVolume(), upperBound);
this.surface.setKnobLED(1, MCUControlSurface.KNOB_LED_MODE_BOOST_CUT, t.getPan(), upperBound);
final boolean displayCrossfader = this.surface.getConfiguration().isDisplayCrossfader();
final int start = displayCrossfader ? 3 : 2;
final int end = displayCrossfader ? 5 : 6;
if (displayCrossfader) {
final String crossfadeMode = t.getCrossfadeMode();
this.surface.setKnobLED(2, MCUControlSurface.KNOB_LED_MODE_SINGLE_DOT, "A".equals(crossfadeMode) ? 1 : "B".equals(crossfadeMode) ? 127 : 64, upperBound);
}
final boolean isEffectTrackBankActive = this.model.isEffectTrackBankActive();
for (int i = 0; i < end; i++) this.surface.setKnobLED(start + i, MCUControlSurface.KNOB_LED_MODE_WRAP, isEffectTrackBankActive ? 0 : t.getSend(i).getValue(), upperBound);
}
use of de.mossgrabers.framework.daw.data.ITrack in project DrivenByMoss by git-moss.
the class VolumeMode method updateKnobLEDs.
/**
* {@inheritDoc}
*/
@Override
protected void updateKnobLEDs() {
final IChannelBank tb = this.model.getCurrentTrackBank();
final int upperBound = this.model.getValueChanger().getUpperBound();
final int extenderOffset = this.surface.getExtenderOffset();
for (int i = 0; i < 8; i++) {
final ITrack t = tb.getTrack(extenderOffset + i);
this.surface.setKnobLED(i, MCUControlSurface.KNOB_LED_MODE_WRAP, t.getVolume(), upperBound);
}
}
use of de.mossgrabers.framework.daw.data.ITrack in project DrivenByMoss by git-moss.
the class LeftCommand method execute.
/**
* {@inheritDoc}
*/
@Override
public void execute(final ButtonEvent event) {
final IChannelBank tb = this.model.getCurrentTrackBank();
final ITrack sel = tb.getSelectedTrack();
final int index = sel == null ? 0 : sel.getIndex() - 1;
final View view = this.surface.getViewManager().getActiveView();
if (index == -1 || this.surface.isShiftPressed()) {
if (!tb.canScrollTracksUp())
return;
tb.scrollTracksPageUp();
final int newSel = index == -1 || sel == null ? 7 : sel.getIndex();
this.surface.scheduleTask(() -> view.selectTrack(newSel), 75);
return;
}
view.selectTrack(index);
}
use of de.mossgrabers.framework.daw.data.ITrack in project DrivenByMoss by git-moss.
the class SelectNoteViewCommand method execute.
/**
* {@inheritDoc}
*/
@Override
public void execute(final ButtonEvent event) {
if (event != ButtonEvent.DOWN)
return;
final ViewManager viewManager = this.surface.getViewManager();
final IChannelBank tb = this.model.getCurrentTrackBank();
final ITrack sel = tb.getSelectedTrack();
if (sel == null) {
viewManager.setActiveView(Views.VIEW_SESSION);
return;
}
final boolean isShifted = this.surface.isShiftPressed();
if (Views.isNoteView(isShifted ? viewManager.getPreviousViewId() : viewManager.getActiveViewId())) {
if (isShifted)
this.seqSelect.executeNormal(event);
else
this.playSelect.executeNormal(event);
} else {
final Integer viewID = viewManager.getPreferredView(sel.getPosition());
if (viewID == null)
this.seqSelect.executeNormal(event);
else
viewManager.setActiveView(viewID);
}
viewManager.setPreferredView(sel.getPosition(), viewManager.getActiveViewId());
this.surface.getDisplay().notify(viewManager.getActiveView().getName());
}
use of de.mossgrabers.framework.daw.data.ITrack in project DrivenByMoss by git-moss.
the class BaseMode method updateFirstRow.
/**
* {@inheritDoc}
*/
@Override
public void updateFirstRow() {
final IChannelBank tb = this.model.getCurrentTrackBank();
final int extenderOffset = this.surface.getExtenderOffset();
for (int i = 0; i < 8; i++) {
final ITrack track = tb.getTrack(extenderOffset + i);
this.surface.updateButton(MCUControlSurface.MCU_ARM1 + i, track.isRecArm() ? MCUControllerSetup.MCU_BUTTON_STATE_ON : MCUControllerSetup.MCU_BUTTON_STATE_OFF);
this.surface.updateButton(MCUControlSurface.MCU_SOLO1 + i, track.isSolo() ? MCUControllerSetup.MCU_BUTTON_STATE_ON : MCUControllerSetup.MCU_BUTTON_STATE_OFF);
this.surface.updateButton(MCUControlSurface.MCU_MUTE1 + i, track.isMute() ? MCUControllerSetup.MCU_BUTTON_STATE_ON : MCUControllerSetup.MCU_BUTTON_STATE_OFF);
this.surface.updateButton(MCUControlSurface.MCU_SELECT1 + i, track.isSelected() ? MCUControllerSetup.MCU_BUTTON_STATE_ON : MCUControllerSetup.MCU_BUTTON_STATE_OFF);
}
this.updateKnobLEDs();
}
Aggregations