use of de.mossgrabers.framework.controller.ContinuousID in project DrivenByMoss by git-moss.
the class KontrolProtocolControllerSetup method createModes.
/**
* {@inheritDoc}
*/
@Override
protected void createModes() {
final KontrolProtocolControlSurface surface = this.getSurface();
final ModeManager modeManager = surface.getModeManager();
final List<ContinuousID> controls = ContinuousID.createSequentialList(ContinuousID.KNOB1, 8);
controls.addAll(ContinuousID.createSequentialList(ContinuousID.FADER1, 8));
modeManager.register(Modes.VOLUME, new MixerMode(surface, this.model, controls));
modeManager.register(Modes.SEND, new SendMode(surface, this.model, controls));
modeManager.register(Modes.DEVICE_PARAMS, new ParamsMode(surface, this.model, controls));
}
use of de.mossgrabers.framework.controller.ContinuousID in project DrivenByMoss by git-moss.
the class UserView method bindCurrentPage.
/**
* Update the binding to the current page.
*/
private void bindCurrentPage() {
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(this.userParameterBank.getItem(i));
}
}
use of de.mossgrabers.framework.controller.ContinuousID 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.controller.ContinuousID in project DrivenByMoss by git-moss.
the class Kontrol1ControlSurface method buttonChange.
/**
* {@inheritDoc}
*/
@Override
public void buttonChange(final int usbControlNumber, final boolean isPressed) {
final ButtonID buttonID = BUTTON_MAP.get(Integer.valueOf(usbControlNumber));
if (buttonID == null) {
// Simulate knob touch via CC
final ContinuousID continuousID = CONTINUOUS_MAP.get(Integer.valueOf(usbControlNumber));
if (continuousID == null)
return;
final IHwContinuousControl continuous = this.getContinuous(continuousID);
if (isPressed) {
if (!continuous.isTouched())
continuous.triggerTouch(true);
} else if (continuous.isTouched())
continuous.triggerTouch(false);
return;
}
// Simulate button press via CC
if (isPressed) {
if (!this.isPressed(buttonID))
this.getButton(buttonID).trigger(ButtonEvent.DOWN);
} else if (this.isPressed(buttonID))
this.getButton(buttonID).trigger(ButtonEvent.UP);
}
Aggregations