use of de.mossgrabers.framework.daw.IChannelBank in project DrivenByMoss by git-moss.
the class TrackView method scrollTracksRight.
private void scrollTracksRight() {
final IChannelBank tb = this.model.getCurrentTrackBank();
if (!tb.canScrollTracksDown())
return;
final ITrack sel = tb.getSelectedTrack();
final int index = sel == null ? 0 : sel.getIndex() + 1;
tb.scrollTracksPageDown();
final int newSel = index == 8 || sel == null ? 0 : sel.getIndex();
this.surface.scheduleTask(() -> this.selectTrack(newSel), 100);
}
use of de.mossgrabers.framework.daw.IChannelBank in project DrivenByMoss by git-moss.
the class TrackView method onKnob.
/**
* {@inheritDoc}
*/
@Override
public void onKnob(final int index, final int value) {
if (index < 12) {
this.extensions.onTrackKnob(index, value);
return;
}
final IChannelBank tb = this.model.getCurrentTrackBank();
final ITrack selectedTrack = tb.getSelectedTrack();
if (selectedTrack == null)
return;
switch(index) {
// Send 5 - 6
case 12:
case 13:
if (tb instanceof ITrackBank)
selectedTrack.getSend(index - 8).changeValue(value);
break;
case 14:
// Not used
break;
// Crossfader
case 15:
this.model.getTransport().changeCrossfade(value);
break;
}
}
use of de.mossgrabers.framework.daw.IChannelBank in project DrivenByMoss by git-moss.
the class TrackView method scrollTracksLeft.
private void scrollTracksLeft() {
final IChannelBank tb = this.model.getCurrentTrackBank();
if (!tb.canScrollTracksUp())
return;
final ITrack sel = tb.getSelectedTrack();
final int index = sel == null ? 0 : sel.getIndex() - 1;
tb.scrollTracksPageUp();
final int newSel = index == -1 || sel == null ? 7 : sel.getIndex();
this.surface.scheduleTask(() -> this.selectTrack(newSel), 100);
}
use of de.mossgrabers.framework.daw.IChannelBank in project DrivenByMoss by git-moss.
the class BeatstepControllerSetup method updateIndication.
private void updateIndication() {
final BeatstepControlSurface surface = this.getSurface();
final ViewManager viewManager = surface.getViewManager();
final boolean isTrack = viewManager.isActiveView(Views.VIEW_TRACK);
final boolean isDevice = viewManager.isActiveView(Views.VIEW_DEVICE);
final boolean isSession = viewManager.isActiveView(Views.VIEW_SESSION);
final IMasterTrack mt = this.model.getMasterTrack();
mt.setVolumeIndication(!isDevice);
final ITrackBank tb = this.model.getTrackBank();
final ITrack selectedTrack = tb.getSelectedTrack();
final IChannelBank tbe = this.model.getEffectTrackBank();
final ITrack selectedFXTrack = tbe.getSelectedTrack();
final ICursorDevice cursorDevice = this.model.getCursorDevice();
final boolean isEffect = this.model.isEffectTrackBankActive();
tb.setIndication(!isEffect && isSession);
tbe.setIndication(isEffect && isSession);
for (int i = 0; i < 8; i++) {
final boolean hasTrackSel = selectedTrack != null && selectedTrack.getIndex() == i;
final ITrack track = tb.getTrack(i);
track.setVolumeIndication(!isEffect && hasTrackSel && !isDevice);
track.setPanIndication(!isEffect && hasTrackSel && !isDevice);
for (int j = 0; j < 6; j++) track.getSend(j).setIndication(!isEffect && hasTrackSel && isTrack);
final boolean hasFXTrackSel = selectedFXTrack != null && selectedFXTrack.getIndex() == i;
final ITrack fxTrack = tbe.getTrack(i);
fxTrack.setVolumeIndication(isEffect && hasFXTrackSel && isTrack);
fxTrack.setPanIndication(isEffect && hasFXTrackSel && isTrack);
cursorDevice.indicateParameter(i, isDevice);
}
}
use of de.mossgrabers.framework.daw.IChannelBank in project DrivenByMoss by git-moss.
the class ModelImpl method canConvertClip.
/**
* {@inheritDoc}
*/
@Override
public boolean canConvertClip() {
final IChannelBank tb = this.getCurrentTrackBank();
final ITrack selectedTrack = tb.getSelectedTrack();
if (selectedTrack == null)
return false;
final ISlot[] slots = selectedTrack.getSelectedSlots();
if (slots.length == 0)
return false;
for (final ISlot slot : slots) {
if (slot.hasContent())
return true;
}
return false;
}
Aggregations