Search in sources :

Example 1 with ControllerHost

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);
}
Also used : ControllerHost(com.bitwig.extension.controller.api.ControllerHost)

Example 2 with ControllerHost

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.");
}
Also used : ControllerHost(com.bitwig.extension.controller.api.ControllerHost) SettingsUI(de.mossgrabers.framework.bitwig.configuration.SettingsUI) OscAddressSpace(com.bitwig.extension.api.opensoundcontrol.OscAddressSpace) OscModule(com.bitwig.extension.api.opensoundcontrol.OscModule) Scales(de.mossgrabers.framework.scale.Scales) OSCWriter(de.mossgrabers.osc.protocol.OSCWriter) OSCModel(de.mossgrabers.osc.protocol.OSCModel) ColorManager(de.mossgrabers.framework.controller.color.ColorManager) OSCParser(de.mossgrabers.osc.protocol.OSCParser)

Example 3 with ControllerHost

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, () -> ""));
}
Also used : ControllerHost(com.bitwig.extension.controller.api.ControllerHost) HostImpl(de.mossgrabers.bitwig.framework.daw.HostImpl)

Aggregations

ControllerHost (com.bitwig.extension.controller.api.ControllerHost)3 OscAddressSpace (com.bitwig.extension.api.opensoundcontrol.OscAddressSpace)1 OscModule (com.bitwig.extension.api.opensoundcontrol.OscModule)1 HostImpl (de.mossgrabers.bitwig.framework.daw.HostImpl)1 SettingsUI (de.mossgrabers.framework.bitwig.configuration.SettingsUI)1 ColorManager (de.mossgrabers.framework.controller.color.ColorManager)1 Scales (de.mossgrabers.framework.scale.Scales)1 OSCModel (de.mossgrabers.osc.protocol.OSCModel)1 OSCParser (de.mossgrabers.osc.protocol.OSCParser)1 OSCWriter (de.mossgrabers.osc.protocol.OSCWriter)1