use of de.mossgrabers.framework.daw.data.IMasterTrack in project DrivenByMoss by git-moss.
the class GenericFlexiControllerSetup method updateIndication.
protected void updateIndication() {
final Set<FlexiCommand> commands = this.configuration.getMappedCommands();
final FlexiCommand[] allCommands = FlexiCommand.values();
final ITrackBank trackBank = this.model.getTrackBank();
final Optional<ITrack> selectedTrack = trackBank.getSelectedItem();
for (int i = 0; i < trackBank.getPageSize(); i++) {
final boolean hasTrackSel = selectedTrack.isPresent() && selectedTrack.get().getIndex() == i;
final ITrack track = trackBank.getItem(i);
track.setVolumeIndication(this.testVolumeIndication(commands, allCommands, i, hasTrackSel));
track.setPanIndication(this.testPanIndication(commands, allCommands, i, hasTrackSel));
final ISendBank sendBank = track.getSendBank();
final int sendPageSize = sendBank.getPageSize();
for (int j = 0; j < sendPageSize; j++) sendBank.getItem(j).setIndication(this.testSendIndication(commands, allCommands, i, hasTrackSel, sendPageSize, j));
}
final IMasterTrack masterTrack = this.model.getMasterTrack();
masterTrack.setVolumeIndication(commands.contains(FlexiCommand.MASTER_SET_VOLUME));
masterTrack.setPanIndication(commands.contains(FlexiCommand.MASTER_SET_PANORAMA));
final IParameterBank parameterBank = this.model.getCursorDevice().getParameterBank();
for (int i = 0; i < parameterBank.getPageSize(); i++) parameterBank.getItem(i).setIndication(this.testParameterIndication(commands, allCommands, i));
}
use of de.mossgrabers.framework.daw.data.IMasterTrack in project DrivenByMoss by git-moss.
the class VolumeView method getButtonColor.
/**
* {@inheritDoc}
*/
@Override
public int getButtonColor(final ButtonID buttonID) {
final IMasterTrack track = this.model.getMasterTrack();
final int color = track.doesExist() ? this.colorManager.getColorIndex(DAWColor.getColorIndex(track.getColor())) : 0;
this.masterFader.setup(color, false);
this.masterFader.setValue(track.getVolume());
final int index = 7 - (buttonID.ordinal() - ButtonID.SCENE1.ordinal());
return this.masterFader.getColorState(index);
}
use of de.mossgrabers.framework.daw.data.IMasterTrack in project DrivenByMoss by git-moss.
the class BrowserCommand method activateBrowser.
/**
* Activate the browser depending on the parameters and the currently active mode.
*
* @param insertDevice Insert a device if true otherwise select preset
* @param beforeCurrent Insert the device before the current device if any
* @return True if activated
*/
private boolean activateBrowser(final boolean insertDevice, final boolean beforeCurrent) {
final ICursorDevice cursorDevice = this.model.getCursorDevice();
final boolean hasCursorDevice = cursorDevice.doesExist();
final IBrowser browser = this.model.getBrowser();
if (hasCursorDevice) {
// Replace the cursor device
if (!insertDevice) {
browser.replace(cursorDevice);
return true;
}
if (Modes.isLayerMode(this.surface.getModeManager().getActiveID())) {
final Optional<ILayer> layer = cursorDevice.getLayerBank().getSelectedItem();
if (layer.isEmpty())
return false;
browser.addDevice(layer.get());
return true;
}
if (beforeCurrent)
browser.insertBeforeCursorDevice();
else
browser.insertAfterCursorDevice();
return true;
}
// No cursor device, add to the selected channel, if any
final Optional<ITrack> channel = this.model.getCurrentTrackBank().getSelectedItem();
if (channel.isPresent()) {
browser.addDevice(channel.get());
return true;
}
final IMasterTrack master = this.model.getMasterTrack();
if (!master.isSelected())
return false;
browser.addDevice(master);
return true;
}
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 MasterMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
if (!this.surface.getConfiguration().hasDisplay1())
return;
this.drawDisplay2();
final ITextDisplay d = this.surface.getTextDisplay().clear();
final String projectName = StringUtils.fixASCII(this.model.getProject().getName());
final IMasterTrack master = this.model.getMasterTrack();
final IApplication application = this.model.getApplication();
d.setCell(0, 0, "Volume").setCell(0, 1, "Pan").setBlock(0, 1, "Audio Engine:").setCell(0, 4, application.isEngineActive() ? " On" : " Off");
d.setCell(0, 5, "Prjct:").setBlock(0, 3, projectName);
d.setCell(1, 0, master.getVolumeStr(6)).setCell(1, 1, master.getPanStr(6)).setBlock(1, 1, application.isEngineActive() ? " Turn off" : " Turn on");
d.setCell(1, 6, " <<").setCell(1, 7, " >>").allDone();
}
Aggregations