use of de.mossgrabers.framework.daw.data.IMasterTrack in project DrivenByMoss by git-moss.
the class MasterMode method updateDisplay2.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay2(final IGraphicDisplay display) {
final IMasterTrack master = this.model.getMasterTrack();
final IProject project = this.model.getProject();
final IValueChanger valueChanger = this.model.getValueChanger();
final boolean enableVUMeters = this.surface.getConfiguration().isEnableVUMeters();
final int vuR = valueChanger.toDisplayValue(enableVUMeters ? master.getVuRight() : 0);
final int vuL = valueChanger.toDisplayValue(enableVUMeters ? master.getVuLeft() : 0);
final ICursorTrack cursorTrack = this.model.getCursorTrack();
display.addChannelElement(TAG_VOLUME, false, master.getName(), ChannelType.MASTER, master.getColor(), master.isSelected(), valueChanger.toDisplayValue(master.getVolume()), valueChanger.toDisplayValue(master.getModulatedVolume()), this.isKnobTouched[0] ? master.getVolumeStr(8) : "", valueChanger.toDisplayValue(master.getPan()), valueChanger.toDisplayValue(master.getModulatedPan()), this.isKnobTouched[1] ? master.getPanStr(8) : "", vuL, vuR, master.isMute(), master.isSolo(), master.isRecArm(), master.isActivated(), 0, master.isSelected() && cursorTrack.isPinned());
display.addChannelSelectorElement("Pan", false, "", null, ColorEx.BLACK, false, master.isActivated());
if (this.model.getHost().supports(Capability.CUE_VOLUME)) {
display.addChannelElement("Cue Volume", false, "Cue", ChannelType.MASTER, ColorEx.GRAY, false, valueChanger.toDisplayValue(project.getCueVolume()), -1, this.isKnobTouched[2] ? project.getCueVolumeStr(8) : "", valueChanger.toDisplayValue(project.getCueMix()), -1, this.isKnobTouched[3] ? project.getCueMixStr(8) : "", 0, 0, false, false, false, true, 0, false);
display.addChannelSelectorElement("Cue Mix", false, "", null, ColorEx.BLACK, false, true);
} else {
display.addOptionElement("", "", false, "", "", false, false);
display.addOptionElement("", "", false, "", "", false, false);
}
display.addOptionElement("", "", false, "Audio Engine", this.model.getApplication().isEngineActive() ? "Active" : "Off", false, false);
display.addOptionElement("", "", false, "", "", false, false);
display.addOptionElement("Project:", "", false, this.model.getProject().getName(), "Previous", false, false);
display.addOptionElement("", "", false, "", "Next", false, false);
}
use of de.mossgrabers.framework.daw.data.IMasterTrack in project DrivenByMoss by git-moss.
the class MasterMode method setActive.
private void setActive(final boolean enable) {
final IMasterTrack mt = this.model.getMasterTrack();
mt.setVolumeIndication(enable);
mt.setPanIndication(enable);
}
use of de.mossgrabers.framework.daw.data.IMasterTrack in project DrivenByMoss by git-moss.
the class ACVSMasterCommand method execute.
/**
* {@inheritDoc}
*/
@Override
public void execute(final ButtonEvent event, final int velocity) {
if (event != ButtonEvent.DOWN)
return;
final IMasterTrack masterTrack = this.model.getMasterTrack();
final ITrackBank trackBank = this.model.getTrackBank();
if (masterTrack.isSelected())
trackBank.selectItemAtPosition(this.position);
else {
final Optional<ITrack> selectedTrack = trackBank.getSelectedItem();
this.position = selectedTrack.isPresent() ? selectedTrack.get().getPosition() : 0;
masterTrack.select();
}
}
use of de.mossgrabers.framework.daw.data.IMasterTrack in project DrivenByMoss by git-moss.
the class ColorView method onGridNote.
/**
* {@inheritDoc}
*/
@Override
public void onGridNote(final int note, final int velocity) {
if (velocity > 0)
return;
final int offset = this.page * this.pageSize;
final int color = offset + note - 36;
final DAWColor[] dawColors = DAWColor.values();
if (color < dawColors.length) {
final ColorEx entry = dawColors[color].getColor();
switch(this.mode) {
case MODE_TRACK:
final ITrack cursorTrack = this.model.getCursorTrack();
if (cursorTrack.doesExist())
cursorTrack.setColor(entry);
else {
final IMasterTrack master = this.model.getMasterTrack();
if (master.isSelected())
master.setColor(entry);
}
break;
case MODE_LAYER:
final IBank<? extends ILayer> layerBank = this.getLayerBank();
final Optional<?> selectedItem = layerBank.getSelectedItem();
if (selectedItem.isPresent())
((ILayer) selectedItem.get()).setColor(entry);
break;
case MODE_CLIP:
final IClip clip = this.model.getCursorClip();
if (clip.doesExist())
clip.setColor(entry);
break;
}
}
this.surface.getViewManager().restore();
}
use of de.mossgrabers.framework.daw.data.IMasterTrack in project DrivenByMoss by git-moss.
the class MastertrackTouchCommand method execute.
/**
* {@inheritDoc}
*/
@Override
public void execute(final ButtonEvent event, final int velocity) {
final boolean isTouched = event != ButtonEvent.UP;
// Avoid accidentally leaving the browser
final ModeManager modeManager = this.surface.getModeManager();
if (modeManager.isActive(Modes.BROWSER))
return;
final IMasterTrack masterTrack = this.model.getMasterTrack();
masterTrack.touchVolume(isTouched);
if (this.surface.isDeletePressed()) {
this.surface.setTriggerConsumed(ButtonID.DELETE);
masterTrack.resetVolume();
return;
}
final boolean isMasterMode = modeManager.isActive(Modes.MASTER);
if (isTouched && isMasterMode)
return;
if (isTouched)
modeManager.setTemporary(Modes.MASTER_TEMP);
else if (!isMasterMode)
modeManager.restore();
}
Aggregations