use of de.mossgrabers.framework.daw.data.IParameter in project DrivenByMoss by git-moss.
the class GrooveMode method updateDisplay1.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay1(final ITextDisplay display) {
display.setCell(0, 0, "Quantize");
display.setCell(0, 1, Push1Display.SELECT_ARROW + TAG_GROOVE);
final IGroove groove = this.model.getGroove();
final IParameter enabledParameter = groove.getParameter(GrooveParameterID.ENABLED);
if (enabledParameter != null)
display.setCell(3, 0, enabledParameter.getValue() == 0 ? " Off" : "Enabled");
display.setCell(2, 1, "Shuffle:");
this.displayParameter(display, GrooveParameterID.SHUFFLE_AMOUNT, 2);
this.displayParameter(display, GrooveParameterID.SHUFFLE_RATE, 3);
final boolean hasAccent = groove.getParameter(GrooveParameterID.ACCENT_AMOUNT) != EmptyParameter.INSTANCE;
display.setCell(2, 4, hasAccent ? " Accent:" : "");
this.displayParameter(display, GrooveParameterID.ACCENT_AMOUNT, 5);
this.displayParameter(display, GrooveParameterID.ACCENT_PHASE, 6);
this.displayParameter(display, GrooveParameterID.ACCENT_RATE, 7);
}
use of de.mossgrabers.framework.daw.data.IParameter in project DrivenByMoss by git-moss.
the class GrooveMode method displayParameter.
private void displayParameter(final IGraphicDisplay display, final GrooveParameterID paramID, final int index) {
IParameter p = this.model.getGroove().getParameter(paramID);
if (p == null)
p = EmptyParameter.INSTANCE;
display.addParameterElement(" ", false, "", (ChannelType) null, null, false, p.getName(10), p.getValue(), p.getDisplayedValue(8), this.isKnobTouched[index], -1);
}
use of de.mossgrabers.framework.daw.data.IParameter in project DrivenByMoss by git-moss.
the class GrooveMode method onFirstRow.
/**
* {@inheritDoc}
*/
@Override
public void onFirstRow(final int index, final ButtonEvent event) {
if (event != ButtonEvent.UP)
return;
if (index == 0) {
final IParameter parameter = this.model.getGroove().getParameter(GrooveParameterID.ENABLED);
parameter.setNormalizedValue(parameter.getValue() > 0 ? 0 : 1);
}
}
use of de.mossgrabers.framework.daw.data.IParameter in project DrivenByMoss by git-moss.
the class GrooveMode method updateDisplay2.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay2(final IGraphicDisplay display) {
final IGroove groove = this.model.getGroove();
final IParameter enabledParameter = groove.getParameter(GrooveParameterID.ENABLED);
String paramText;
if (enabledParameter == null)
paramText = "";
else
paramText = enabledParameter.getValue() == 0 ? "Off" : "Enabled";
display.addOptionElement("", "Quantize", false, null, "", paramText, enabledParameter != null && enabledParameter.getValue() > 0, null, true);
display.addOptionElement("", TAG_GROOVE, true, null, " Shuffle", "", false, null, true);
this.displayParameter(display, GrooveParameterID.SHUFFLE_AMOUNT, 2);
this.displayParameter(display, GrooveParameterID.SHUFFLE_RATE, 3);
final boolean hasAccent = groove.getParameter(GrooveParameterID.ACCENT_AMOUNT) != EmptyParameter.INSTANCE;
display.addOptionElement("", hasAccent ? "" : " ", false, null, hasAccent ? " Accent" : "", "", false, null, true);
this.displayParameter(display, GrooveParameterID.ACCENT_AMOUNT, 5);
this.displayParameter(display, GrooveParameterID.ACCENT_PHASE, 6);
this.displayParameter(display, GrooveParameterID.ACCENT_RATE, 7);
}
use of de.mossgrabers.framework.daw.data.IParameter in project DrivenByMoss by git-moss.
the class FxTrackHandler method changeTrackVolume.
private void changeTrackVolume(final KnobMode knobMode, final int trackIndex, final MidiValue value) {
final Optional<ITrack> track = this.getTrack(trackIndex);
if (track.isEmpty())
return;
final int val = value.getValue();
final IParameter volumeParameter = track.get().getVolumeParameter();
if (isAbsolute(knobMode))
volumeParameter.setValue(this.getAbsoluteValueChanger(value), val);
else
volumeParameter.changeValue(this.getRelativeValueChanger(knobMode), val);
}
Aggregations