use of de.mossgrabers.framework.daw.data.IParameter in project DrivenByMoss by git-moss.
the class TrackCrossfadeBMode method executeMethod.
/**
* {@inheritDoc}
*/
@Override
protected void executeMethod(final ITrack track) {
final IParameter crossfadeParameter = track.getCrossfadeParameter();
final double v = this.model.getValueChanger().toNormalizedValue(crossfadeParameter.getValue());
crossfadeParameter.setNormalizedValue(v > 0.9 ? 0.5 : 1);
}
use of de.mossgrabers.framework.daw.data.IParameter in project DrivenByMoss by git-moss.
the class FireParameterMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
final IGraphicDisplay display = this.surface.getGraphicsDisplay();
String desc = "Select";
String paramLine = "a device";
int value = -1;
if (this.model.hasSelectedDevice()) {
paramLine = "";
final ICursorDevice cursorDevice = this.model.getCursorDevice();
final Optional<String> pageName = cursorDevice.getParameterPageBank().getSelectedItem();
desc = cursorDevice.getName(5) + ": " + (pageName.isPresent() ? StringUtils.optimizeName(pageName.get(), 5) : "None");
int touchedKnob = this.getTouchedKnob();
touchedKnob = this.surface.isPressed(ButtonID.ALT) ? 4 + touchedKnob : touchedKnob;
if (touchedKnob > -1) {
final IParameter p = this.bank.getItem(touchedKnob);
paramLine = p.getName(5);
if (!paramLine.isEmpty()) {
value = p.getValue();
paramLine += ": " + p.getDisplayedValue(6);
}
}
}
display.addElement(new TitleValueComponent(desc, paramLine, value, false));
display.send();
}
use of de.mossgrabers.framework.daw.data.IParameter in project DrivenByMoss by git-moss.
the class UserMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
this.drawDisplay2();
final ITextDisplay d = this.surface.getTextDisplay().clear();
// Row 1 & 2
final int extenderOffset = this.surface.getExtenderOffset();
final IParameterBank parameterBank = this.model.getUserParameterBank();
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();
}
use of de.mossgrabers.framework.daw.data.IParameter in project DrivenByMoss by git-moss.
the class UserMode method updateKnobLEDs.
/**
* {@inheritDoc}
*/
@Override
public void updateKnobLEDs() {
final int upperBound = this.model.getValueChanger().getUpperBound();
final int extenderOffset = this.surface.getExtenderOffset();
final IParameterBank parameterBank = this.model.getUserParameterBank();
for (int i = 0; i < 8; i++) {
final IParameter param = parameterBank.getItem(extenderOffset + i);
this.surface.setKnobLED(i, MCUControlSurface.KNOB_LED_MODE_SINGLE_DOT, param.doesExist() ? Math.max(1, param.getValue()) : 0, upperBound);
}
}
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.model.getUserParameterBank().getItem(index);
if (param.doesExist())
param.touchValue(isTouched);
}
Aggregations