Search in sources :

Example 1 with APCControlSurface

use of de.mossgrabers.apc.controller.APCControlSurface in project DrivenByMoss by git-moss.

the class APCControllerSetup method updateDeviceKnobs.

private void updateDeviceKnobs() {
    final APCControlSurface surface = this.getSurface();
    final View view = surface.getViewManager().getActiveView();
    if (view == null)
        return;
    final ICursorDevice cd = this.model.getCursorDevice();
    for (int i = 0; i < 8; i++) {
        final Integer deviceKnobCommand = Integer.valueOf(Commands.CONT_COMMAND_DEVICE_KNOB1.intValue() + i);
        if (!((DeviceKnobRowCommand) view.getContinuousCommand(deviceKnobCommand)).isKnobMoving())
            surface.setLED(APCControlSurface.APC_KNOB_DEVICE_KNOB_1 + i, cd.getFXParam(i).getValue());
    }
}
Also used : APCControlSurface(de.mossgrabers.apc.controller.APCControlSurface) SessionView(de.mossgrabers.apc.view.SessionView) ShiftView(de.mossgrabers.apc.view.ShiftView) SceneView(de.mossgrabers.framework.view.SceneView) View(de.mossgrabers.framework.view.View) DrumView(de.mossgrabers.apc.view.DrumView) SequencerView(de.mossgrabers.apc.view.SequencerView) PlayView(de.mossgrabers.apc.view.PlayView) RaindropsView(de.mossgrabers.apc.view.RaindropsView) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice)

Example 2 with APCControlSurface

use of de.mossgrabers.apc.controller.APCControlSurface in project DrivenByMoss by git-moss.

the class APCControllerSetup method updateMode.

private void updateMode(final Integer mode) {
    final APCControlSurface surface = this.getSurface();
    final Integer m = mode == null ? surface.getModeManager().getActiveModeId() : mode;
    this.updateIndication(m);
    surface.updateButton(APCControlSurface.APC_BUTTON_PAN, m == Modes.MODE_PAN ? ColorManager.BUTTON_STATE_ON : ColorManager.BUTTON_STATE_OFF);
    if (surface.isMkII()) {
        surface.updateButton(APCControlSurface.APC_BUTTON_SEND_A, m == Modes.MODE_SEND1 || m == Modes.MODE_SEND3 || m == Modes.MODE_SEND5 || m == Modes.MODE_SEND7 ? ColorManager.BUTTON_STATE_ON : ColorManager.BUTTON_STATE_OFF);
        surface.updateButton(APCControlSurface.APC_BUTTON_SEND_B, m == Modes.MODE_SEND2 || m == Modes.MODE_SEND4 || m == Modes.MODE_SEND6 || m == Modes.MODE_SEND8 ? ColorManager.BUTTON_STATE_ON : ColorManager.BUTTON_STATE_OFF);
    } else {
        surface.updateButton(APCControlSurface.APC_BUTTON_SEND_A, m == Modes.MODE_SEND1 || m == Modes.MODE_SEND4 || m == Modes.MODE_SEND7 ? ColorManager.BUTTON_STATE_ON : ColorManager.BUTTON_STATE_OFF);
        surface.updateButton(APCControlSurface.APC_BUTTON_SEND_B, m == Modes.MODE_SEND2 || m == Modes.MODE_SEND5 || m == Modes.MODE_SEND8 ? ColorManager.BUTTON_STATE_ON : ColorManager.BUTTON_STATE_OFF);
        surface.updateButton(APCControlSurface.APC_BUTTON_SEND_C, m == Modes.MODE_SEND3 || m == Modes.MODE_SEND6 ? ColorManager.BUTTON_STATE_ON : ColorManager.BUTTON_STATE_OFF);
    }
}
Also used : APCControlSurface(de.mossgrabers.apc.controller.APCControlSurface)

Example 3 with APCControlSurface

use of de.mossgrabers.apc.controller.APCControlSurface in project DrivenByMoss by git-moss.

the class APCControllerSetup method registerContinuousCommands.

/**
 * {@inheritDoc}
 */
@Override
protected void registerContinuousCommands() {
    final APCControlSurface surface = this.getSurface();
    final ViewManager viewManager = surface.getViewManager();
    this.addContinuousCommand(Commands.CONT_COMMAND_MASTER_KNOB, APCControlSurface.APC_KNOB_MASTER_LEVEL, new MasterFaderAbsoluteCommand<>(this.model, surface));
    this.addContinuousCommand(Commands.CONT_COMMAND_PLAY_POSITION, APCControlSurface.APC_KNOB_CUE_LEVEL, new PlayPositionCommand<>(this.model, surface));
    this.addContinuousCommand(Commands.CONT_COMMAND_CROSSFADER, APCControlSurface.APC_KNOB_CROSSFADER, new CrossfaderCommand<>(this.model, surface));
    for (int i = 0; i < 8; i++) {
        final Integer faderCommand = Integer.valueOf(Commands.CONT_COMMAND_FADER1.intValue() + i);
        viewManager.registerContinuousCommand(faderCommand, new FaderAbsoluteCommand<>(i, this.model, surface));
        surface.assignContinuousCommand(APCControlSurface.APC_KNOB_TRACK_LEVEL, i, faderCommand);
        final Integer knobCommand = Integer.valueOf(Commands.CONT_COMMAND_KNOB1.intValue() + i);
        viewManager.registerContinuousCommand(knobCommand, new KnobRowModeCommand<>(i, this.model, surface));
        surface.assignContinuousCommand(APCControlSurface.APC_KNOB_TRACK_KNOB_1 + i, knobCommand);
        final Integer deviceKnobCommand = Integer.valueOf(Commands.CONT_COMMAND_DEVICE_KNOB1.intValue() + i);
        viewManager.registerContinuousCommand(deviceKnobCommand, new DeviceKnobRowCommand(i, this.model, surface));
        surface.assignContinuousCommand(APCControlSurface.APC_KNOB_DEVICE_KNOB_1 + i, deviceKnobCommand);
    }
    if (this.isMkII)
        this.addContinuousCommand(Commands.CONT_COMMAND_TEMPO, APCControlSurface.APC_KNOB_TEMPO, new TempoCommand<>(this.model, surface));
}
Also used : APCControlSurface(de.mossgrabers.apc.controller.APCControlSurface) ViewManager(de.mossgrabers.framework.view.ViewManager) TempoCommand(de.mossgrabers.framework.command.continuous.TempoCommand) TapTempoCommand(de.mossgrabers.framework.command.trigger.transport.TapTempoCommand) DeviceKnobRowCommand(de.mossgrabers.apc.command.continuous.DeviceKnobRowCommand)

Example 4 with APCControlSurface

use of de.mossgrabers.apc.controller.APCControlSurface in project DrivenByMoss by git-moss.

the class APCControllerSetup method createModes.

/**
 * {@inheritDoc}
 */
@Override
protected void createModes() {
    final APCControlSurface surface = this.getSurface();
    final ModeManager modeManager = surface.getModeManager();
    modeManager.registerMode(Modes.MODE_PAN, new PanMode(surface, this.model));
    for (int i = 0; i < 8; i++) modeManager.registerMode(Integer.valueOf(Modes.MODE_SEND1.intValue() + i), new SendMode(surface, this.model, i));
    modeManager.registerMode(Modes.MODE_BROWSER, new BrowserMode(surface, this.model));
}
Also used : APCControlSurface(de.mossgrabers.apc.controller.APCControlSurface) BrowserMode(de.mossgrabers.apc.mode.BrowserMode) SendMode(de.mossgrabers.apc.mode.SendMode) PanMode(de.mossgrabers.apc.mode.PanMode) ModeManager(de.mossgrabers.framework.mode.ModeManager)

Example 5 with APCControlSurface

use of de.mossgrabers.apc.controller.APCControlSurface in project DrivenByMoss by git-moss.

the class APCControllerSetup method createSurface.

/**
 * {@inheritDoc}
 */
@Override
protected void createSurface() {
    final IMidiAccess midiAccess = this.factory.createMidiAccess();
    final IMidiOutput output = midiAccess.createOutput();
    final IMidiInput input = midiAccess.createInput(this.isMkII ? "Akai APC40 mkII" : "Akai APC40", "B040??");
    final APCControlSurface surface = new APCControlSurface(this.model.getHost(), this.colorManager, this.configuration, output, input, this.isMkII);
    this.surfaces.add(surface);
    surface.setDisplay(new DummyDisplay(this.host));
    for (int i = 0; i < 8; i++) surface.setLED(APCControlSurface.APC_KNOB_DEVICE_KNOB_LED_1 + i, 1);
}
Also used : IMidiAccess(de.mossgrabers.framework.daw.midi.IMidiAccess) IMidiOutput(de.mossgrabers.framework.daw.midi.IMidiOutput) APCControlSurface(de.mossgrabers.apc.controller.APCControlSurface) DummyDisplay(de.mossgrabers.framework.controller.display.DummyDisplay) IMidiInput(de.mossgrabers.framework.daw.midi.IMidiInput)

Aggregations

APCControlSurface (de.mossgrabers.apc.controller.APCControlSurface)12 ViewManager (de.mossgrabers.framework.view.ViewManager)5 DrumView (de.mossgrabers.apc.view.DrumView)3 PlayView (de.mossgrabers.apc.view.PlayView)3 RaindropsView (de.mossgrabers.apc.view.RaindropsView)3 SequencerView (de.mossgrabers.apc.view.SequencerView)3 SessionView (de.mossgrabers.apc.view.SessionView)3 ShiftView (de.mossgrabers.apc.view.ShiftView)3 ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)3 ITrack (de.mossgrabers.framework.daw.data.ITrack)3 APCCursorCommand (de.mossgrabers.apc.command.trigger.APCCursorCommand)2 IChannelBank (de.mossgrabers.framework.daw.IChannelBank)2 ModeManager (de.mossgrabers.framework.mode.ModeManager)2 SceneView (de.mossgrabers.framework.view.SceneView)2 View (de.mossgrabers.framework.view.View)2 DeviceKnobRowCommand (de.mossgrabers.apc.command.continuous.DeviceKnobRowCommand)1 APCBrowserCommand (de.mossgrabers.apc.command.trigger.APCBrowserCommand)1 APCQuantizeCommand (de.mossgrabers.apc.command.trigger.APCQuantizeCommand)1 APCRecordCommand (de.mossgrabers.apc.command.trigger.APCRecordCommand)1 BankLeftCommand (de.mossgrabers.apc.command.trigger.BankLeftCommand)1