use of de.mossgrabers.framework.daw.data.bank.IParameterBank in project DrivenByMoss by git-moss.
the class DeviceHandler method scrollParameterPage.
private void scrollParameterPage(final KnobMode knobMode, final MidiValue value) {
if (isAbsolute(knobMode) || !this.increaseKnobMovement())
return;
final ICursorDevice cursorDevice = this.model.getCursorDevice();
final IParameterBank parameterBank = cursorDevice.getParameterBank();
if (this.isIncrease(knobMode, value))
parameterBank.scrollForwards();
else
parameterBank.scrollBackwards();
this.mvHelper.notifySelectedParameterPage();
}
use of de.mossgrabers.framework.daw.data.bank.IParameterBank in project DrivenByMoss by git-moss.
the class DeviceHandler method scrollParameterBank.
private void scrollParameterBank(final KnobMode knobMode, final MidiValue value) {
if (isAbsolute(knobMode) || !this.increaseKnobMovement())
return;
final ICursorDevice cursorDevice = this.model.getCursorDevice();
final IParameterBank parameterBank = cursorDevice.getParameterBank();
if (this.isIncrease(knobMode, value))
parameterBank.selectNextPage();
else
parameterBank.selectPreviousPage();
this.mvHelper.notifySelectedParameterPage();
}
use of de.mossgrabers.framework.daw.data.bank.IParameterBank in project DrivenByMoss by git-moss.
the class UserModule method flush.
/**
* {@inheritDoc}
*/
@Override
public void flush(final boolean dump) {
final String userAddress = "/user/";
final IParameterBank parameterBank = this.model.getUserParameterBank();
for (int i = 0; i < parameterBank.getPageSize(); i++) {
final int oneplus = i + 1;
this.flushParameterData(this.writer, userAddress + oneplus + "/", parameterBank.getItem(i), dump);
}
final int numPages = parameterBank.getItemCount() / parameterBank.getPageSize();
final int selectedPage = parameterBank.getScrollPosition() / parameterBank.getPageSize();
for (int i = 0; i < numPages; i++) {
final int oneplus = i + 1;
this.writer.sendOSC(userAddress + "page/" + oneplus + "/", "Page " + (i + 1), dump);
this.writer.sendOSC(userAddress + "page/" + oneplus + "/selected", selectedPage == i, dump);
}
this.writer.sendOSC(userAddress + "page/selected/name", "Page " + (selectedPage + 1), dump);
}
use of de.mossgrabers.framework.daw.data.bank.IParameterBank 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.IParameterBank in project DrivenByMoss by git-moss.
the class DeviceParamsMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
this.drawDisplay2();
final ITextDisplay d = this.surface.getTextDisplay().clear();
final ICursorDevice cd = this.model.getCursorDevice();
if (!cd.doesExist()) {
d.notify("Please select a device...");
return;
}
// Row 1 & 2
final int extenderOffset = this.surface.getExtenderOffset();
final IParameterBank parameterBank = cd.getParameterBank();
for (int i = 0; i < 8; i++) {
final IParameter param = parameterBank.getItem(extenderOffset + i);
d.setCell(0, i, param.doesExist() ? StringUtils.shortenAndFixASCII(param.getName(6), 6) : "").setCell(1, i, StringUtils.shortenAndFixASCII(param.getDisplayedValue(6), 6));
}
d.allDone();
}
Aggregations