Search in sources :

Example 1 with APCminiControlSurface

use of de.mossgrabers.apcmini.controller.APCminiControlSurface in project DrivenByMoss by git-moss.

the class APCminiControllerSetup method createModes.

/**
 * {@inheritDoc}
 */
@Override
protected void createModes() {
    final APCminiControlSurface surface = this.getSurface();
    final ModeManager modeManager = surface.getModeManager();
    modeManager.registerMode(Modes.MODE_VOLUME, new VolumeMode(surface, this.model));
    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(i, surface, this.model));
    modeManager.registerMode(Modes.MODE_DEVICE, new DeviceMode(surface, this.model));
    modeManager.setDefaultMode(Modes.MODE_VOLUME);
}
Also used : APCminiControlSurface(de.mossgrabers.apcmini.controller.APCminiControlSurface) DeviceMode(de.mossgrabers.apcmini.mode.DeviceMode) VolumeMode(de.mossgrabers.apcmini.mode.VolumeMode) SendMode(de.mossgrabers.apcmini.mode.SendMode) PanMode(de.mossgrabers.apcmini.mode.PanMode) ModeManager(de.mossgrabers.framework.mode.ModeManager)

Example 2 with APCminiControlSurface

use of de.mossgrabers.apcmini.controller.APCminiControlSurface in project DrivenByMoss by git-moss.

the class APCminiControllerSetup method createSurface.

/**
 * {@inheritDoc}
 */
@Override
protected void createSurface() {
    final IMidiAccess midiAccess = this.factory.createMidiAccess();
    final IMidiOutput output = midiAccess.createOutput();
    final IMidiInput input = midiAccess.createInput("Akai APCmini");
    final APCminiControlSurface surface = new APCminiControlSurface(this.model.getHost(), this.colorManager, this.configuration, output, input);
    this.surfaces.add(surface);
    surface.setDisplay(new DummyDisplay(this.host));
}
Also used : IMidiAccess(de.mossgrabers.framework.daw.midi.IMidiAccess) IMidiOutput(de.mossgrabers.framework.daw.midi.IMidiOutput) APCminiControlSurface(de.mossgrabers.apcmini.controller.APCminiControlSurface) DummyDisplay(de.mossgrabers.framework.controller.display.DummyDisplay) IMidiInput(de.mossgrabers.framework.daw.midi.IMidiInput)

Example 3 with APCminiControlSurface

use of de.mossgrabers.apcmini.controller.APCminiControlSurface in project DrivenByMoss by git-moss.

the class APCminiControllerSetup method updateIndication.

private void updateIndication(final Integer mode) {
    final ITrackBank tb = this.model.getTrackBank();
    final IChannelBank tbe = this.model.getEffectTrackBank();
    final APCminiControlSurface surface = this.getSurface();
    final ViewManager viewManager = surface.getViewManager();
    final boolean isShiftView = viewManager.isActiveView(Views.VIEW_SHIFT);
    final boolean isSession = viewManager.isActiveView(Views.VIEW_SESSION) || isShiftView;
    final boolean isEffect = this.model.isEffectTrackBankActive();
    final boolean isPan = Modes.MODE_PAN.equals(mode);
    final boolean isDevice = Modes.MODE_DEVICE.equals(mode);
    tb.setIndication(!isEffect && isSession);
    tbe.setIndication(isEffect && isSession);
    final ICursorDevice cursorDevice = this.model.getCursorDevice();
    for (int i = 0; i < 8; i++) {
        final ITrack track = tb.getTrack(i);
        track.setVolumeIndication(!isEffect);
        track.setPanIndication(!isEffect && isPan);
        for (int j = 0; j < 8; j++) track.getSend(j).setIndication(!isEffect && (Modes.MODE_SEND1.equals(mode) && j == 0 || Modes.MODE_SEND2.equals(mode) && j == 1 || Modes.MODE_SEND3.equals(mode) && j == 2 || Modes.MODE_SEND4.equals(mode) && j == 3 || Modes.MODE_SEND5.equals(mode) && j == 4 || Modes.MODE_SEND6.equals(mode) && j == 5 || Modes.MODE_SEND7.equals(mode) && j == 6 || Modes.MODE_SEND8.equals(mode) && j == 7));
        final ITrack fxTrack = tbe.getTrack(i);
        fxTrack.setVolumeIndication(isEffect);
        fxTrack.setPanIndication(isEffect && isPan);
        cursorDevice.indicateParameter(i, isDevice || isShiftView);
    }
}
Also used : APCminiControlSurface(de.mossgrabers.apcmini.controller.APCminiControlSurface) ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.ITrackBank) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) ViewManager(de.mossgrabers.framework.view.ViewManager) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice)

Example 4 with APCminiControlSurface

use of de.mossgrabers.apcmini.controller.APCminiControlSurface in project DrivenByMoss by git-moss.

the class APCminiControllerSetup method createObservers.

/**
 * {@inheritDoc}
 */
@Override
protected void createObservers() {
    final APCminiControlSurface surface = this.getSurface();
    surface.getViewManager().addViewChangeListener((previousViewId, activeViewId) -> this.updateMode(null));
    surface.getModeManager().addModeListener((previousModeId, activeModeId) -> this.updateMode(activeModeId));
    this.createScaleObservers(this.configuration);
    this.configuration.addSettingObserver(APCminiConfiguration.FADER_CTRL, () -> {
        final ModeManager modeManager = surface.getModeManager();
        switch(this.configuration.getFaderCtrl()) {
            case "Volume":
                modeManager.setActiveMode(Modes.MODE_VOLUME);
                break;
            case "Pan":
                modeManager.setActiveMode(Modes.MODE_PAN);
                break;
            case "Send 1":
                modeManager.setActiveMode(Modes.MODE_SEND1);
                break;
            case "Send 2":
                modeManager.setActiveMode(Modes.MODE_SEND2);
                break;
            case "Send 3":
                modeManager.setActiveMode(Modes.MODE_SEND3);
                break;
            case "Send 4":
                modeManager.setActiveMode(Modes.MODE_SEND4);
                break;
            case "Send 5":
                modeManager.setActiveMode(Modes.MODE_SEND5);
                break;
            case "Send 6":
                modeManager.setActiveMode(Modes.MODE_SEND6);
                break;
            case "Send 7":
                modeManager.setActiveMode(Modes.MODE_SEND7);
                break;
            case "Send 8":
                modeManager.setActiveMode(Modes.MODE_SEND8);
                break;
            case "Device":
                modeManager.setActiveMode(Modes.MODE_DEVICE);
                break;
        }
    });
    this.configuration.addSettingObserver(APCminiConfiguration.SOFT_KEYS, () -> {
        for (int i = 0; i < APCminiConfiguration.SOFT_KEYS_OPTIONS.length; i++) {
            final String opt = APCminiConfiguration.SOFT_KEYS_OPTIONS[i];
            if (opt.equals(this.configuration.getSoftKeys()))
                surface.setTrackState(i);
        }
    });
}
Also used : APCminiControlSurface(de.mossgrabers.apcmini.controller.APCminiControlSurface) ModeManager(de.mossgrabers.framework.mode.ModeManager)

Example 5 with APCminiControlSurface

use of de.mossgrabers.apcmini.controller.APCminiControlSurface in project DrivenByMoss by git-moss.

the class APCminiControllerSetup method startup.

/**
 * {@inheritDoc}
 */
@Override
public void startup() {
    final APCminiControlSurface surface = this.getSurface();
    surface.getModeManager().setActiveMode(Modes.MODE_VOLUME);
    surface.getViewManager().setActiveView(Views.VIEW_PLAY);
}
Also used : APCminiControlSurface(de.mossgrabers.apcmini.controller.APCminiControlSurface)

Aggregations

APCminiControlSurface (de.mossgrabers.apcmini.controller.APCminiControlSurface)9 ViewManager (de.mossgrabers.framework.view.ViewManager)3 ModeManager (de.mossgrabers.framework.mode.ModeManager)2 ShiftCommand (de.mossgrabers.apcmini.command.trigger.ShiftCommand)1 TrackSelectCommand (de.mossgrabers.apcmini.command.trigger.TrackSelectCommand)1 DeviceMode (de.mossgrabers.apcmini.mode.DeviceMode)1 PanMode (de.mossgrabers.apcmini.mode.PanMode)1 SendMode (de.mossgrabers.apcmini.mode.SendMode)1 VolumeMode (de.mossgrabers.apcmini.mode.VolumeMode)1 BrowserView (de.mossgrabers.apcmini.view.BrowserView)1 DrumView (de.mossgrabers.apcmini.view.DrumView)1 PlayView (de.mossgrabers.apcmini.view.PlayView)1 RaindropsView (de.mossgrabers.apcmini.view.RaindropsView)1 SequencerView (de.mossgrabers.apcmini.view.SequencerView)1 SessionView (de.mossgrabers.apcmini.view.SessionView)1 ShiftView (de.mossgrabers.apcmini.view.ShiftView)1 DummyDisplay (de.mossgrabers.framework.controller.display.DummyDisplay)1 IChannelBank (de.mossgrabers.framework.daw.IChannelBank)1 ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)1 ITrackBank (de.mossgrabers.framework.daw.ITrackBank)1