use of de.mossgrabers.framework.daw.data.IParameter 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.IParameter in project DrivenByMoss by git-moss.
the class DeviceParamsMode method onKnobTouch.
/**
* {@inheritDoc}
*/
@Override
public void onKnobTouch(final int index, final boolean isTouched) {
this.isKnobTouched[index] = isTouched;
final ICursorDevice cd = this.model.getCursorDevice();
final IParameter param = cd.getParameterBank().getItem(index);
if (isTouched && this.surface.isDeletePressed()) {
this.surface.setTriggerConsumed(ButtonID.DELETE);
param.resetValue();
}
param.touchValue(isTouched);
this.checkStopAutomationOnKnobRelease(isTouched);
}
use of de.mossgrabers.framework.daw.data.IParameter in project DrivenByMoss by git-moss.
the class AbstractTrackMode method onKnobTouch.
/**
* {@inheritDoc}
*/
@Override
public void onKnobTouch(final int index, final boolean isTouched) {
this.isKnobTouched[index] = isTouched;
final IParameter parameter = this.getParameterProvider().get(index);
if (isTouched && this.surface.isDeletePressed()) {
this.surface.setTriggerConsumed(ButtonID.DELETE);
parameter.resetValue();
}
parameter.touchValue(isTouched);
this.checkStopAutomationOnKnobRelease(isTouched);
}
use of de.mossgrabers.framework.daw.data.IParameter in project DrivenByMoss by git-moss.
the class GrooveMode method displayParameter.
private void displayParameter(final ITextDisplay display, final GrooveParameterID paramID, final int index) {
IParameter p = this.model.getGroove().getParameter(paramID);
if (p == null)
p = EmptyParameter.INSTANCE;
if (!p.doesExist())
return;
display.setCell(0, index, p.getName(8));
display.setCell(1, index, p.getDisplayedValue(8));
display.setCell(2, index, p.getValue(), Format.FORMAT_VALUE);
}
use of de.mossgrabers.framework.daw.data.IParameter in project DrivenByMoss by git-moss.
the class UserMode method onKnobTouch.
/**
* {@inheritDoc}
*/
@Override
public void onKnobTouch(final int index, final boolean isTouched) {
this.isKnobTouched[index] = isTouched;
final IParameter param = this.bank.getItem(index);
if (isTouched && this.surface.isDeletePressed()) {
this.surface.setTriggerConsumed(ButtonID.DELETE);
param.resetValue();
}
param.touchValue(isTouched);
this.checkStopAutomationOnKnobRelease(isTouched);
}
Aggregations