use of de.mossgrabers.framework.daw.data.IParameter in project DrivenByMoss by git-moss.
the class MaschineUserMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
final ITextDisplay d = this.surface.getTextDisplay().clear();
// Row 1 & 2
for (int i = 0; i < 8; i++) {
final IParameter param = this.bank.getItem(i);
String name = param.doesExist() ? StringUtils.shortenAndFixASCII(param.getName(), 6) : "";
if (i == this.getSelectedParameter())
name = ">" + name;
d.setCell(0, i, name).setCell(1, i, param.getDisplayedValue(8));
}
d.allDone();
}
use of de.mossgrabers.framework.daw.data.IParameter in project DrivenByMoss by git-moss.
the class UserMode method onSecondRow.
/**
* {@inheritDoc}
*/
@Override
public void onSecondRow(final int index, final ButtonEvent event) {
if (event != ButtonEvent.UP)
return;
final IParameter param = this.bank.getItem(index);
if (!param.doesExist())
return;
// Toggle between the min and max value
final int max = this.model.getValueChanger().getUpperBound() - 1;
param.setValueImmediatly(param.getValue() < max / 2 ? max : 0);
}
use of de.mossgrabers.framework.daw.data.IParameter in project DrivenByMoss by git-moss.
the class UserMode method updateDisplay2.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay2(final IGraphicDisplay display) {
final IValueChanger valueChanger = this.model.getValueChanger();
final String[] userPageNames = this.surface.getConfiguration().getUserPageNames();
final int pageSize = this.bank.getPageSize();
final int selectedPage = this.bank.getScrollPosition() / pageSize;
for (int i = 0; i < pageSize; i++) {
final boolean isBottomMenuOn = i == selectedPage;
final IParameter param = this.bank.getItem(i);
final boolean exists = param.doesExist();
final String parameterName = exists ? param.getName(9) : "";
final int parameterValue = valueChanger.toDisplayValue(exists ? param.getValue() : 0);
final String parameterValueStr = exists ? param.getDisplayedValue(8) : "";
final boolean parameterIsActive = this.isKnobTouched[i];
final int parameterModulatedValue = valueChanger.toDisplayValue(exists ? param.getModulatedValue() : -1);
display.addParameterElement("", false, userPageNames[i], "USER", isBottomMenuOn ? ColorEx.WHITE : ColorEx.GRAY, isBottomMenuOn, parameterName, parameterValue, parameterValueStr, parameterIsActive, parameterModulatedValue);
}
}
use of de.mossgrabers.framework.daw.data.IParameter in project DrivenByMoss by git-moss.
the class NoteRepeatMode method updateDisplay2.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay2(final IGraphicDisplay display) {
if (this.noteRepeat == null)
return;
display.addOptionElement("Period", "", false, "", "", false, false);
final int selPeriodIndex = this.getSelectedPeriodIndex();
display.addListElement(6, Resolution.getNames(), selPeriodIndex);
if (this.host.supports(Capability.NOTE_REPEAT_LENGTH)) {
display.addOptionElement(" Length", "", false, "", "", false, false);
final int selLengthIndex = this.getSelectedNoteLengthIndex();
display.addListElement(6, Resolution.getNames(), selLengthIndex);
} else {
display.addEmptyElement();
display.addEmptyElement();
}
display.addEmptyElement();
final int upperBound = this.model.getValueChanger().getUpperBound();
if (this.host.supports(Capability.NOTE_REPEAT_MODE)) {
final String bottomMenu = this.host.supports(Capability.NOTE_REPEAT_USE_PRESSURE_TO_VELOCITY) ? "Use Pressure" : "";
final boolean isBottomMenuEnabled = this.noteRepeat.usePressure();
final ArpeggiatorMode mode = this.noteRepeat.getMode();
final Configuration configuration = this.surface.getConfiguration();
final List<ArpeggiatorMode> arpeggiatorModes = configuration.getArpeggiatorModes();
final int modeIndex = configuration.lookupArpeggiatorModeIndex(mode);
final int value = modeIndex * upperBound / (arpeggiatorModes.size() - 1);
display.addParameterElementWithPlainMenu("", false, bottomMenu, null, isBottomMenuEnabled, "Mode", value, StringUtils.optimizeName(mode.getName(), 8), this.isKnobTouched[5], -1);
} else
display.addEmptyElement();
if (this.host.supports(Capability.NOTE_REPEAT_OCTAVES)) {
final String bottomMenu = this.host.supports(Capability.NOTE_REPEAT_IS_FREE_RUNNING) ? "Sync" : "";
final boolean isBottomMenuEnabled = !this.noteRepeat.isFreeRunning();
final int octaves = this.noteRepeat.getOctaves();
final int value = octaves * upperBound / 8;
display.addParameterElementWithPlainMenu("", false, bottomMenu, null, isBottomMenuEnabled, "Octaves", value, Integer.toString(octaves), this.isKnobTouched[6], -1);
} else
display.addEmptyElement();
if (this.host.supports(Capability.NOTE_REPEAT_SWING)) {
final IGroove groove = this.model.getGroove();
final IParameter shuffleParam = groove.getParameter(GrooveParameterID.SHUFFLE_AMOUNT);
final IParameter enabledParam = groove.getParameter(GrooveParameterID.ENABLED);
final int value = enabledParam.getValue();
display.addParameterElementWithPlainMenu("Groove " + enabledParam.getDisplayedValue(8), value != 0, "Shuffle", null, this.noteRepeat.isShuffle(), shuffleParam.getName(10), shuffleParam.getValue(), shuffleParam.getDisplayedValue(8), this.isKnobTouched[7], -1);
} else
display.addEmptyElement();
}
use of de.mossgrabers.framework.daw.data.IParameter in project DrivenByMoss by git-moss.
the class NoteRepeatMode method onSecondRow.
/**
* {@inheritDoc}
*/
@Override
public void onSecondRow(final int index, final ButtonEvent event) {
if (event != ButtonEvent.UP || this.noteRepeat == null)
return;
if (index == 7 && this.host.supports(Capability.NOTE_REPEAT_SWING)) {
final IParameter grooveEnabled = this.model.getGroove().getParameter(GrooveParameterID.ENABLED);
grooveEnabled.setValue(grooveEnabled.getValue() == 0 ? this.model.getValueChanger().getUpperBound() : 0);
}
}
Aggregations