use of de.mossgrabers.framework.daw.data.IMasterTrack in project DrivenByMoss by git-moss.
the class SLControllerSetup method updateIndication.
private void updateIndication() {
final SLControlSurface surface = this.getSurface();
final Integer mode = surface.getModeManager().getActiveModeId();
final IMasterTrack mt = this.model.getMasterTrack();
mt.setVolumeIndication(Modes.MODE_MASTER.equals(mode));
mt.setPanIndication(Modes.MODE_MASTER.equals(mode));
final ITrackBank tb = this.model.getTrackBank();
final IChannelBank tbe = this.model.getEffectTrackBank();
final boolean isEffect = this.model.isEffectTrackBankActive();
final boolean isVolume = Modes.MODE_VOLUME.equals(mode);
final ICursorDevice cursorDevice = this.model.getCursorDevice();
final ITrack selectedTrack = tb.getSelectedTrack();
for (int i = 0; i < 8; i++) {
final boolean hasTrackSel = selectedTrack != null && selectedTrack.getIndex() == i && Modes.MODE_TRACK.equals(mode);
final ITrack track = tb.getTrack(i);
track.setVolumeIndication(!isEffect && (isVolume || hasTrackSel));
track.setPanIndication(!isEffect && hasTrackSel);
for (int j = 0; j < 6; j++) track.getSend(j).setIndication(!isEffect && hasTrackSel);
final ITrack fxTrack = tbe.getTrack(i);
fxTrack.setVolumeIndication(isEffect);
fxTrack.setPanIndication(isEffect);
cursorDevice.indicateParameter(i, true);
}
}
use of de.mossgrabers.framework.daw.data.IMasterTrack in project DrivenByMoss by git-moss.
the class FaderCommand method execute.
/**
* {@inheritDoc}
*/
@Override
public void execute(final int value) {
final IMasterTrack masterTrack = this.model.getMasterTrack();
if (masterTrack.isSelected()) {
if (this.index == 0)
masterTrack.setVolume(value);
} else
this.model.getCurrentTrackBank().getTrack(this.index).setVolume(value);
final ModeManager modeManager = this.surface.getModeManager();
if (!modeManager.isActiveMode(Modes.MODE_VOLUME))
modeManager.setActiveMode(Modes.MODE_VOLUME);
}
use of de.mossgrabers.framework.daw.data.IMasterTrack in project DrivenByMoss by git-moss.
the class BeatstepControllerSetup method updateIndication.
protected void updateIndication() {
final BeatstepControlSurface surface = this.getSurface();
final ViewManager viewManager = surface.getViewManager();
final boolean isTrack = viewManager.isActive(Views.TRACK);
final boolean isDevice = viewManager.isActive(Views.DEVICE);
final boolean isSession = viewManager.isActive(Views.SESSION);
final IMasterTrack mt = this.model.getMasterTrack();
mt.setVolumeIndication(!isDevice);
final ITrackBank tb = this.model.getTrackBank();
final Optional<ITrack> selectedTrack = tb.getSelectedItem();
final ITrackBank tbe = this.model.getEffectTrackBank();
final ICursorDevice cursorDevice = this.model.getCursorDevice();
final boolean isEffect = this.model.isEffectTrackBankActive();
tb.setIndication(!isEffect && isSession);
if (tbe != null)
tbe.setIndication(isEffect && isSession);
final IParameterBank parameterBank = cursorDevice.getParameterBank();
for (int i = 0; i < 8; i++) {
final boolean hasTrackSel = selectedTrack.isPresent() && selectedTrack.get().getIndex() == i;
final ITrack track = tb.getItem(i);
track.setVolumeIndication(!isEffect && hasTrackSel && !isDevice);
track.setPanIndication(!isEffect && hasTrackSel && !isDevice);
final ISendBank sendBank = track.getSendBank();
for (int j = 0; j < 6; j++) sendBank.getItem(j).setIndication(!isEffect && hasTrackSel && isTrack);
if (tbe != null) {
final Optional<ITrack> selectedFXTrack = tbe.getSelectedItem();
final boolean hasFXTrackSel = selectedFXTrack.isPresent() && selectedFXTrack.get().getIndex() == i;
final ITrack fxTrack = tbe.getItem(i);
fxTrack.setVolumeIndication(isEffect && hasFXTrackSel && isTrack);
fxTrack.setPanIndication(isEffect && hasFXTrackSel && isTrack);
}
parameterBank.getItem(i).setIndication(isDevice);
}
}
use of de.mossgrabers.framework.daw.data.IMasterTrack in project DrivenByMoss by git-moss.
the class MasterMode method getButtonColor.
/**
* {@inheritDoc}
*/
@Override
public int getButtonColor(final ButtonID buttonID) {
int index = this.isButtonRow(0, buttonID);
if (index >= 0) {
final ColorManager colorManager = this.model.getColorManager();
final boolean isPush2 = this.surface.getConfiguration().isPush2();
if (index == 0)
return this.getTrackButtonColor();
if (index < 4 || index == 5)
return colorManager.getColorIndex(AbstractFeatureGroup.BUTTON_COLOR_OFF);
if (index > 5)
return colorManager.getColorIndex(AbstractFeatureGroup.BUTTON_COLOR_ON);
final int red = isPush2 ? PushColorManager.PUSH2_COLOR_RED_HI : PushColorManager.PUSH1_COLOR_RED_HI;
return this.model.getApplication().isEngineActive() ? colorManager.getColorIndex(AbstractFeatureGroup.BUTTON_COLOR_ON) : red;
}
index = this.isButtonRow(1, buttonID);
if (index >= 0) {
final int off = this.isPush2 ? PushColorManager.PUSH2_COLOR_BLACK : PushColorManager.PUSH1_COLOR_BLACK;
if (this.isPush2 || index > 0)
return off;
final boolean muteState = this.surface.getConfiguration().isMuteState();
final IMasterTrack master = this.model.getMasterTrack();
if (muteState)
return master.isMute() ? off : PushColorManager.PUSH1_COLOR2_YELLOW_HI;
return master.isSolo() ? PushColorManager.PUSH1_COLOR2_BLUE_HI : PushColorManager.PUSH1_COLOR2_GREY_LO;
}
return super.getButtonColor(buttonID);
}
use of de.mossgrabers.framework.daw.data.IMasterTrack in project DrivenByMoss by git-moss.
the class BaseMode method drawDisplay2.
protected void drawDisplay2() {
if (!this.surface.getConfiguration().hasDisplay2())
return;
final ITrackBank tb = this.getTrackBank();
// Format track names
final ITextDisplay d2 = this.surface.getTextDisplay(1);
final int extenderOffset = this.getExtenderOffset();
final boolean isMainDevice = this.surface.isMainDevice();
for (int i = 0; i < 8; i++) {
final ITrack t = tb.getItem(extenderOffset + i);
d2.setCell(0, i, StringUtils.shortenAndFixASCII(t.getName(), isMainDevice ? 6 : 7));
}
if (isMainDevice)
d2.setCell(0, 8, "Maste");
d2.done(0);
d2.clearRow(1);
if (isMainDevice) {
final IMasterTrack masterTrack = this.model.getMasterTrack();
final ICursorDevice cursorDevice = this.model.getCursorDevice();
final ITrack selectedTrack;
if (masterTrack.isSelected())
selectedTrack = masterTrack;
else {
final Optional<ITrack> selectedItem = tb.getSelectedItem();
selectedTrack = selectedItem.isPresent() ? selectedItem.get() : EmptyTrack.INSTANCE;
}
d2.setBlock(1, 0, "Sel. track:").setBlock(1, 1, selectedTrack == null ? "None" : StringUtils.shortenAndFixASCII(selectedTrack.getName(), 11));
d2.setBlock(1, 2, "Sel. devce:").setBlock(1, 3, cursorDevice.doesExist() ? StringUtils.shortenAndFixASCII(cursorDevice.getName(), 11) : "None");
}
d2.done(1);
}
Aggregations