use of de.mossgrabers.framework.daw.data.IParameter in project DrivenByMoss by git-moss.
the class FireUserMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
final IGraphicDisplay display = this.surface.getGraphicsDisplay();
final IParameterBank userBank = this.model.getUserParameterBank();
final int page = userBank.getScrollPosition() / userBank.getPageSize();
final String desc = "User Page: " + (page + 1);
String paramLine = "";
int value = -1;
final int touchedKnob = this.getTouchedKnob();
if (touchedKnob > -1) {
final IParameter p = userBank.getItem(touchedKnob);
paramLine = p.getName(5);
if (paramLine.isEmpty())
paramLine = "Not mapped";
else {
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 TransportHandler method handleMetronomeVolume.
private void handleMetronomeVolume(final KnobMode knobMode, final MidiValue value) {
final ITransport transport = this.model.getTransport();
final IParameter metronomeVolumeParameter = transport.getMetronomeVolumeParameter();
final int val = value.getValue();
if (isAbsolute(knobMode))
metronomeVolumeParameter.setValue(this.getAbsoluteValueChanger(value), val);
else
metronomeVolumeParameter.changeValue(this.getRelativeValueChanger(knobMode), val);
}
use of de.mossgrabers.framework.daw.data.IParameter in project DrivenByMoss by git-moss.
the class UserView method onDeactivate.
/**
* {@inheritDoc}
*/
@Override
public void onDeactivate() {
for (int i = 0; i < 8; i++) {
final ContinuousID faderID = ContinuousID.get(ContinuousID.FADER1, i);
final IHwContinuousControl continuous = this.surface.getContinuous(faderID);
if (continuous != null)
continuous.bind((IParameter) null);
}
this.surface.rebindGrid();
super.onDeactivate();
}
use of de.mossgrabers.framework.daw.data.IParameter in project DrivenByMoss by git-moss.
the class LaunchpadShuffleView method onGridNote.
/**
* {@inheritDoc}}
*/
@Override
public void onGridNote(final int note, final int velocity) {
if (velocity != 0)
return;
// Toggle shuffle on/off
if (note == 36) {
final IGroove groove = this.model.getGroove();
final IParameter enabledParameter = groove.getParameter(GrooveParameterID.ENABLED);
if (enabledParameter != null) {
enabledParameter.setNormalizedValue(enabledParameter.getValue() == 0 ? 1 : 0);
return;
}
}
// Shuffle rate
if (note == 38 || note == 39) {
final IGroove groove = this.model.getGroove();
final IParameter rateParameter = groove.getParameter(GrooveParameterID.SHUFFLE_RATE);
if (rateParameter != null) {
rateParameter.setNormalizedValue(rateParameter.getValue() == 0 ? 1 : 0);
return;
}
}
this.surface.getViewManager().restore();
}
use of de.mossgrabers.framework.daw.data.IParameter in project DrivenByMoss by git-moss.
the class LaunchpadShuffleView method fillBottom.
/**
* {@index}
*/
@Override
protected void fillBottom() {
super.fillBottom();
final IGroove groove = this.model.getGroove();
final IParameter enabledParameter = groove.getParameter(GrooveParameterID.ENABLED);
if (enabledParameter == null || !enabledParameter.doesExist())
return;
this.padGrid.lightEx(0, 7, enabledParameter.getValue() == 0 ? LaunchpadColorManager.LAUNCHPAD_COLOR_GREY_HI : LaunchpadColorManager.LAUNCHPAD_COLOR_GREEN_HI);
final IParameter rateParameter = groove.getParameter(GrooveParameterID.SHUFFLE_RATE);
if (rateParameter == null || !rateParameter.doesExist())
return;
final boolean isEight = rateParameter.getValue() == 0;
this.padGrid.lightEx(2, 7, isEight ? LaunchpadColorManager.LAUNCHPAD_COLOR_BLUE_HI : LaunchpadColorManager.LAUNCHPAD_COLOR_GREY_HI);
this.padGrid.lightEx(3, 7, !isEight ? LaunchpadColorManager.LAUNCHPAD_COLOR_BLUE_HI : LaunchpadColorManager.LAUNCHPAD_COLOR_GREY_HI);
}
Aggregations