Search in sources :

Example 1 with ModeManager

use of de.mossgrabers.framework.mode.ModeManager 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 2 with ModeManager

use of de.mossgrabers.framework.mode.ModeManager in project DrivenByMoss by git-moss.

the class ShiftView method onScene.

/**
 * {@inheritDoc}
 */
@Override
public void onScene(final int index, final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    switch(index) {
        case 5:
            this.model.toggleCurrentTrackBank();
            final boolean isEffectTrackBank = this.model.isEffectTrackBankActive();
            if (isEffectTrackBank) {
                // No Sends on effect tracks
                final ModeManager modeManager = this.surface.getModeManager();
                if (Modes.isSendMode(modeManager.getActiveModeId()))
                    modeManager.setActiveMode(Modes.MODE_VOLUME);
            }
            this.surface.getDisplay().notify(isEffectTrackBank ? "Effect Tracks" : "Instrument/Audio Tracks");
            break;
        case 6:
            this.model.getCursorDevice().toggleWindowOpen();
            break;
        case 7:
            this.model.getCurrentTrackBank().stop();
            break;
        default:
            this.surface.setTrackState(index);
            this.surface.getConfiguration().setSoftKeys(APCminiConfiguration.SOFT_KEYS_OPTIONS[index]);
            this.surface.getDisplay().notify(APCminiConfiguration.SOFT_KEYS_OPTIONS[index]);
            break;
    }
}
Also used : ModeManager(de.mossgrabers.framework.mode.ModeManager)

Example 3 with ModeManager

use of de.mossgrabers.framework.mode.ModeManager 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 4 with ModeManager

use of de.mossgrabers.framework.mode.ModeManager 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 ModeManager

use of de.mossgrabers.framework.mode.ModeManager in project DrivenByMoss by git-moss.

the class ModeMultiSelectCommand method executeNormal.

/**
 * {@inheritDoc}
 */
@Override
public void executeNormal(final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    final ModeManager modeManager = this.surface.getModeManager();
    final Integer activeModeId = modeManager.getActiveModeId();
    int index = this.modeIds.indexOf(activeModeId) + 1;
    if (index < 0 || index >= this.modeIds.size())
        index = 0;
    modeManager.setActiveMode(this.modeIds.get(index));
}
Also used : ModeManager(de.mossgrabers.framework.mode.ModeManager)

Aggregations

ModeManager (de.mossgrabers.framework.mode.ModeManager)67 IChannelBank (de.mossgrabers.framework.daw.IChannelBank)20 ITrack (de.mossgrabers.framework.daw.data.ITrack)18 ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)9 ViewManager (de.mossgrabers.framework.view.ViewManager)7 PushConfiguration (de.mossgrabers.push.PushConfiguration)7 View (de.mossgrabers.framework.view.View)6 SceneView (de.mossgrabers.framework.view.SceneView)5 PushControlSurface (de.mossgrabers.push.controller.PushControlSurface)5 ITrackBank (de.mossgrabers.framework.daw.ITrackBank)4 IChannel (de.mossgrabers.framework.daw.data.IChannel)4 ITransport (de.mossgrabers.framework.daw.ITransport)3 DeviceBrowserMode (de.mossgrabers.push.mode.device.DeviceBrowserMode)3 DeviceParamsMode (de.mossgrabers.push.mode.device.DeviceParamsMode)3 APCControlSurface (de.mossgrabers.apc.controller.APCControlSurface)2 APCminiControlSurface (de.mossgrabers.apcmini.controller.APCminiControlSurface)2 ICursorClip (de.mossgrabers.framework.daw.ICursorClip)2 IMasterTrack (de.mossgrabers.framework.daw.data.IMasterTrack)2 AbstractSequencerView (de.mossgrabers.framework.view.AbstractSequencerView)2 LaunchpadControlSurface (de.mossgrabers.launchpad.controller.LaunchpadControlSurface)2