use of de.mossgrabers.framework.daw.data.bank.IDeviceBank in project DrivenByMoss by git-moss.
the class DeviceParamsMode method updateDisplay1.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay1(final ITextDisplay display) {
final ICursorDevice cd = this.model.getCursorDevice();
if (!this.checkExists1(display, cd))
return;
// Row 1 & 2
final IParameterBank parameterBank = cd.getParameterBank();
for (int i = 0; i < 8; i++) {
final IParameter param = parameterBank.getItem(i);
display.setCell(0, i, param.doesExist() ? StringUtils.fixASCII(param.getName()) : "").setCell(1, i, StringUtils.fixASCII(param.getDisplayedValue(8)));
}
// Row 3
display.setBlock(2, 0, "Selected Device:").setBlock(2, 1, cd.getName());
// Row 4
if (this.showDevices) {
final IDeviceBank deviceBank = cd.getDeviceBank();
for (int i = 0; i < 8; i++) {
final IDevice device = deviceBank.getItem(i);
final StringBuilder sb = new StringBuilder();
if (device.doesExist()) {
if (i == cd.getIndex())
sb.append(Push1Display.SELECT_ARROW);
sb.append(device.getName());
}
display.setCell(3, i, sb.toString());
}
return;
}
final IParameterPageBank bank = cd.getParameterPageBank();
final int selectedItemIndex = bank.getSelectedItemIndex();
for (int i = 0; i < bank.getPageSize(); i++) {
final String item = bank.getItem(i);
final String selectedStr = i == selectedItemIndex ? Push1Display.SELECT_ARROW : "";
display.setCell(3, i, item.isEmpty() ? "" : selectedStr + item);
}
}
use of de.mossgrabers.framework.daw.data.bank.IDeviceBank in project DrivenByMoss by git-moss.
the class AbstractConfiguration method registerDeactivatedItemsHandler.
/**
* Register a handler for the 'exclude deactivated items' setting.
*
* @param model The model for getting the banks to configure
*/
public void registerDeactivatedItemsHandler(final IModel model) {
this.addSettingObserver(AbstractConfiguration.EXCLUDE_DEACTIVATED_ITEMS, () -> {
final boolean exclude = this.areDeactivatedItemsExcluded();
final ITrackBank trackBank = model.getTrackBank();
trackBank.setSkipDisabledItems(exclude);
for (int i = 0; i < trackBank.getPageSize(); i++) trackBank.getItem(i).getSendBank().setSkipDisabledItems(exclude);
final ITrackBank effectTrackBank = model.getEffectTrackBank();
if (effectTrackBank != null)
effectTrackBank.setSkipDisabledItems(exclude);
final ICursorDevice cursorDevice = model.getCursorDevice();
final IDeviceBank deviceBank = cursorDevice.getDeviceBank();
deviceBank.setSkipDisabledItems(exclude);
cursorDevice.getLayerBank().setSkipDisabledItems(exclude);
final IDrumPadBank drumPadBank = cursorDevice.getDrumPadBank();
if (drumPadBank != null)
drumPadBank.setSkipDisabledItems(exclude);
});
}
Aggregations