use of com.bitwig.extension.controller.api.HardwareButton in project DrivenByMoss by git-moss.
the class HwSurfaceFactoryImpl method createButton.
/**
* {@inheritDoc}
*/
@Override
public IHwButton createButton(final int surfaceID, final ButtonID buttonID, final String label) {
final String id = createID(surfaceID, buttonID.name());
final HardwareButton hwButton = this.hardwareSurface.createHardwareButton(id);
return new HwButtonImpl(this.host, hwButton, label);
}
use of com.bitwig.extension.controller.api.HardwareButton in project DrivenByMoss by git-moss.
the class MidiInputImpl method bind.
/**
* {@inheritDoc}
*/
@Override
public void bind(final IHwButton button, final BindType type, final int channel, final int control) {
final HardwareButton hardwareButton = ((HwButtonImpl) button).getHardwareButton();
final AbsoluteHardwareValueMatcher pressedMatcher;
final HardwareActionMatcher releasedMatcher;
switch(type) {
case CC:
pressedMatcher = this.port.createAbsoluteCCValueMatcher(channel, control);
releasedMatcher = this.port.createCCActionMatcher(channel, control, 0);
break;
case NOTE:
pressedMatcher = this.port.createNoteOnVelocityValueMatcher(channel, control);
releasedMatcher = this.port.createNoteOffActionMatcher(channel, control);
break;
default:
throw new BindException(type);
}
final HardwareAction pressedAction = hardwareButton.pressedAction();
pressedAction.setPressureActionMatcher(pressedMatcher);
pressedAction.setShouldFireEvenWhenUsedAsNoteInput(true);
setAction(hardwareButton.releasedAction(), releasedMatcher);
}
use of com.bitwig.extension.controller.api.HardwareButton in project DrivenByMoss by git-moss.
the class MidiInputImpl method unbind.
/**
* {@inheritDoc}
*/
@Override
public void unbind(final IHwButton button) {
final HardwareButton hardwareButton = ((HwButtonImpl) button).getHardwareButton();
hardwareButton.pressedAction().setPressureActionMatcher(null);
hardwareButton.releasedAction().setActionMatcher(null);
}
Aggregations