use of de.mossgrabers.framework.daw.data.IMasterTrack 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.data.IMasterTrack in project DrivenByMoss by git-moss.
the class VolumeView method onScene.
/**
* {@inheritDoc}
*/
@Override
public void onScene(final int scene, final ButtonEvent event) {
if (event != ButtonEvent.DOWN)
return;
final IMasterTrack track = this.model.getMasterTrack();
track.setVolume(Math.min(127, (7 - scene) * this.model.getValueChanger().getUpperBound() / 7));
}
use of de.mossgrabers.framework.daw.data.IMasterTrack in project DrivenByMoss by git-moss.
the class VolumeView method updateSceneButtons.
/**
* {@inheritDoc}
*/
@Override
public void updateSceneButtons() {
final ColorManager cm = this.model.getColorManager();
final IMasterTrack track = this.model.getMasterTrack();
final int sceneMax = 9 * track.getVolume() / this.model.getValueChanger().getUpperBound();
for (int i = 0; i < 8; i++) {
final int color = cm.getColor(BitwigColors.getColorIndex(track.getColor()));
this.surface.setButton(LaunchpadControlSurface.LAUNCHPAD_BUTTON_SCENE8 + 10 * i, i < sceneMax ? color : LaunchpadColors.LAUNCHPAD_COLOR_BLACK);
}
}
use of de.mossgrabers.framework.daw.data.IMasterTrack in project DrivenByMoss by git-moss.
the class MCUControllerSetup method updateVUandFaders.
private void updateVUandFaders() {
final double upperBound = this.valueChanger.getUpperBound();
final boolean enableVUMeters = this.configuration.isEnableVUMeters();
final boolean hasMotorFaders = this.configuration.hasMotorFaders();
final IChannelBank tb = this.model.getCurrentTrackBank();
IMidiOutput output;
for (int index = 0; index < this.numMCUDevices; index++) {
final MCUControlSurface surface = this.getSurface(index);
output = surface.getOutput();
final int extenderOffset = surface.getExtenderOffset();
for (int i = 0; i < 8; i++) {
final int channel = extenderOffset + i;
final ITrack track = tb.getTrack(channel);
// Update VU LEDs of channel
if (enableVUMeters) {
final int vu = track.getVu();
if (vu != this.vuValues[channel]) {
this.vuValues[channel] = vu;
final int scaledValue = (int) Math.round(vu * 12 / upperBound);
output.sendChannelAftertouch(0x10 * i + scaledValue, 0);
}
}
// Update motor fader of channel
if (hasMotorFaders)
this.updateFaders(output, i, channel, track);
}
}
final IMasterTrack masterTrack = this.model.getMasterTrack();
final MCUControlSurface surface = this.getSurface();
output = surface.getOutput();
// Stereo VU of master channel
if (enableVUMeters) {
int vu = masterTrack.getVuLeft();
if (vu != this.masterVuValues[0]) {
this.masterVuValues[0] = vu;
final int scaledValue = (int) Math.round(vu * 12 / upperBound);
output.sendChannelAftertouch(1, scaledValue, 0);
}
vu = masterTrack.getVuRight();
if (vu != this.masterVuValues[1]) {
this.masterVuValues[1] = vu;
final int scaledValue = (int) Math.round(vu * 12 / upperBound);
output.sendChannelAftertouch(1, 0x10 + scaledValue, 0);
}
}
// Update motor fader of master channel
if (hasMotorFaders) {
final int volume = surface.isShiftPressed() ? this.model.getTransport().getMetronomeVolume() : masterTrack.getVolume();
if (volume != this.masterFaderValue) {
this.masterFaderValue = volume;
output.sendPitchbend(8, volume % 127, volume / 127);
}
}
}
use of de.mossgrabers.framework.daw.data.IMasterTrack in project DrivenByMoss by git-moss.
the class MasterMode method updateKnobLEDs.
/**
* {@inheritDoc}
*/
@Override
protected void updateKnobLEDs() {
final IMasterTrack masterTrack = this.model.getMasterTrack();
final int upperBound = this.model.getValueChanger().getUpperBound();
this.surface.setKnobLED(0, MCUControlSurface.KNOB_LED_MODE_WRAP, masterTrack.getVolume(), upperBound);
this.surface.setKnobLED(1, MCUControlSurface.KNOB_LED_MODE_BOOST_CUT, masterTrack.getPan(), upperBound);
for (int i = 0; i < 6; i++) this.surface.setKnobLED(2 + i, MCUControlSurface.KNOB_LED_MODE_WRAP, 0, upperBound);
}
Aggregations