use of com.bitwig.extension.controller.api.ControllerHost in project DrivenByMoss by git-moss.
the class GenericControllerExtension method init.
/**
* {@inheritDoc}
*/
@Override
public void init() {
this.setup.init();
final ControllerHost host = this.getHost();
host.scheduleTask(() -> {
this.setup.startup();
host.println("Running.");
}, 1000);
}
use of com.bitwig.extension.controller.api.ControllerHost in project DrivenByMoss by git-moss.
the class OSCExtension method init.
/**
* {@inheritDoc}
*/
@Override
public void init() {
this.configuration.init(new SettingsUI(this.getHost().getPreferences()));
final Scales scales = new Scales(this.valueChanger, 0, 128, 128, 1);
scales.setChromatic(true);
final ControllerHost host = this.getHost();
final OSCModel model = new OSCModel(host, new ColorManager(), this.valueChanger, scales);
final OscModule oscModule = host.getOscModule();
// Send OSC messages
this.writer = new OSCWriter(model, this.configuration, oscModule);
// Receive OSC messages
final OscAddressSpace addressSpace = oscModule.createAddressSpace();
this.configuration.addSettingObserver(OSCConfiguration.DEBUG_COMMANDS, () -> addressSpace.setShouldLogMessages(this.configuration.getDebugCommands()));
addressSpace.registerDefaultMethod(new OSCParser(host, this.writer, this.configuration, model));
oscModule.createUdpServer(this.configuration.getReceivePort(), addressSpace);
// Initial flush of the whole DAW state
host.scheduleTask(() -> this.writer.flush(true), 1000);
host.println("Initialized.");
}
use of com.bitwig.extension.controller.api.ControllerHost in project DrivenByMoss by git-moss.
the class HwButtonImpl method bind.
/**
* {@inheritDoc}
*/
@Override
public void bind(final TriggerCommand command) {
this.command = command;
final ControllerHost controllerHost = ((HostImpl) this.host).getControllerHost();
this.hardwareButton.pressedAction().addBinding(controllerHost.createAction(this::handleButtonPressed, () -> ""));
this.hardwareButton.releasedAction().addBinding(controllerHost.createAction(this::handleButtonRelease, () -> ""));
}
Aggregations