Search in sources :

Example 41 with ModeManager

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

the class SelectSessionViewCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final ButtonEvent event) {
    if (event == ButtonEvent.DOWN) {
        this.isTemporary = false;
        final ViewManager viewManager = this.surface.getViewManager();
        if (Views.isSessionView(viewManager.getActiveViewId())) {
            final ModeManager modeManager = this.surface.getModeManager();
            if (modeManager.isActiveMode(Modes.MODE_SESSION_VIEW_SELECT))
                modeManager.restoreMode();
            else
                modeManager.setActiveMode(Modes.MODE_SESSION_VIEW_SELECT);
        } else
            viewManager.setActiveView(Views.VIEW_SESSION);
        return;
    }
    if (event == ButtonEvent.UP && this.isTemporary)
        this.surface.getViewManager().restoreView();
}
Also used : ViewManager(de.mossgrabers.framework.view.ViewManager) ModeManager(de.mossgrabers.framework.mode.ModeManager)

Example 42 with ModeManager

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

the class ModeSwitcher method scrollUp.

/**
 * Scroll upwards through the modes.
 */
public void scrollUp() {
    final ModeManager modeManager = this.surface.getModeManager();
    final Integer activeModeId = modeManager.getActiveModeId();
    if (Modes.MODE_PAN.equals(activeModeId)) {
        modeManager.setActiveMode(Modes.MODE_VOLUME);
        this.surface.getDisplay().notify("Volume");
    } else if (Modes.MODE_VOLUME.equals(activeModeId)) {
        modeManager.setActiveMode(Modes.MODE_TRACK);
        this.surface.getDisplay().notify("Track");
    } else if (Modes.MODE_TRACK.equals(activeModeId)) {
        modeManager.setActiveMode(Modes.MODE_DEVICE_PARAMS);
        this.surface.getDisplay().notify("Parameters");
    } else {
        modeManager.setActiveMode(Modes.MODE_PAN);
        this.surface.getDisplay().notify("Panorama");
    }
}
Also used : ModeManager(de.mossgrabers.framework.mode.ModeManager)

Example 43 with ModeManager

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

the class ModeSwitcher method scrollDown.

/**
 * Scroll downwards through the modes.
 */
public void scrollDown() {
    final ModeManager modeManager = this.surface.getModeManager();
    final Integer activeModeId = modeManager.getActiveModeId();
    if (Modes.MODE_PAN.equals(activeModeId)) {
        modeManager.setActiveMode(Modes.MODE_DEVICE_PARAMS);
        this.surface.getDisplay().notify("Parameters");
    } else if (Modes.MODE_VOLUME.equals(activeModeId)) {
        modeManager.setActiveMode(Modes.MODE_PAN);
        this.surface.getDisplay().notify("Panorama");
    } else if (Modes.MODE_TRACK.equals(activeModeId)) {
        modeManager.setActiveMode(Modes.MODE_VOLUME);
        this.surface.getDisplay().notify("Volume");
    } else {
        modeManager.setActiveMode(Modes.MODE_TRACK);
        this.surface.getDisplay().notify("Track");
    }
}
Also used : ModeManager(de.mossgrabers.framework.mode.ModeManager)

Example 44 with ModeManager

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

the class APCControllerSetup method updateButtons.

private void updateButtons() {
    final APCControlSurface surface = this.getSurface();
    final ViewManager viewManager = surface.getViewManager();
    final View activeView = viewManager.getActiveView();
    if (activeView != null) {
        ((APCCursorCommand) activeView.getTriggerCommand(Commands.COMMAND_ARROW_DOWN)).updateArrows();
        ((SceneView) activeView).updateSceneButtons();
    }
    final boolean isShift = surface.isShiftPressed();
    final boolean isSendA = surface.isPressed(APCControlSurface.APC_BUTTON_SEND_A);
    final ITransport t = this.model.getTransport();
    surface.updateButton(APCControlSurface.APC_BUTTON_PLAY, t.isPlaying() ? ColorManager.BUTTON_STATE_ON : ColorManager.BUTTON_STATE_OFF);
    surface.updateButton(APCControlSurface.APC_BUTTON_RECORD, t.isRecording() ? ColorManager.BUTTON_STATE_ON : ColorManager.BUTTON_STATE_OFF);
    // Activator, Solo, Record Arm
    final IChannelBank tb = this.model.getCurrentTrackBank();
    final ITrack selTrack = tb.getSelectedTrack();
    final int selIndex = selTrack == null ? -1 : selTrack.getIndex();
    final int clipLength = surface.getConfiguration().getNewClipLength();
    final ModeManager modeManager = surface.getModeManager();
    for (int i = 0; i < 8; i++) {
        final ITrack track = tb.getTrack(i);
        boolean isOn;
        if (isShift)
            isOn = i == clipLength;
        else
            isOn = isSendA ? modeManager.isActiveMode(Integer.valueOf(Modes.MODE_SEND1.intValue() + i)) : i == selIndex;
        surface.updateButtonEx(APCControlSurface.APC_BUTTON_TRACK_SELECTION, i, isOn ? ColorManager.BUTTON_STATE_ON : ColorManager.BUTTON_STATE_OFF);
        surface.updateButtonEx(APCControlSurface.APC_BUTTON_SOLO, i, track.doesExist() && (isShift ? track.isAutoMonitor() : track.isSolo()) ? ColorManager.BUTTON_STATE_ON : ColorManager.BUTTON_STATE_OFF);
        surface.updateButtonEx(APCControlSurface.APC_BUTTON_ACTIVATOR, i, track.doesExist() && (isShift ? track.isMonitor() : !track.isMute()) ? ColorManager.BUTTON_STATE_ON : ColorManager.BUTTON_STATE_OFF);
        if (this.isMkII) {
            surface.updateButtonEx(APCControlSurface.APC_BUTTON_A_B, i, track.doesExist() && !"AB".equals(track.getCrossfadeMode()) ? "A".equals(track.getCrossfadeMode()) ? ColorManager.BUTTON_STATE_ON : APCColors.BUTTON_STATE_BLINK : ColorManager.BUTTON_STATE_OFF);
            surface.updateButtonEx(APCControlSurface.APC_BUTTON_RECORD_ARM, i, track.doesExist() && track.isRecArm() ? ColorManager.BUTTON_STATE_ON : ColorManager.BUTTON_STATE_OFF);
        } else {
            if (isShift)
                surface.updateButtonEx(APCControlSurface.APC_BUTTON_RECORD_ARM, i, track.doesExist() && !"AB".equals(track.getCrossfadeMode()) ? "A".equals(track.getCrossfadeMode()) ? ColorManager.BUTTON_STATE_ON : APCColors.BUTTON_STATE_BLINK : ColorManager.BUTTON_STATE_OFF);
            else
                surface.updateButtonEx(APCControlSurface.APC_BUTTON_RECORD_ARM, i, track.doesExist() && track.isRecArm() ? ColorManager.BUTTON_STATE_ON : ColorManager.BUTTON_STATE_OFF);
        }
    }
    surface.updateButton(APCControlSurface.APC_BUTTON_MASTER, this.model.getMasterTrack().isSelected() ? ColorManager.BUTTON_STATE_ON : ColorManager.BUTTON_STATE_OFF);
    final ICursorDevice device = this.model.getCursorDevice();
    if (this.isMkII) {
        surface.updateButton(APCControlSurface.APC_BUTTON_SESSION, t.isLauncherOverdub() ? ColorManager.BUTTON_STATE_ON : ColorManager.BUTTON_STATE_OFF);
        surface.updateButton(APCControlSurface.APC_BUTTON_SEND_C, t.isMetronomeOn() ? ColorManager.BUTTON_STATE_ON : ColorManager.BUTTON_STATE_OFF);
        surface.updateButton(APCControlSurface.APC_BUTTON_DETAIL_VIEW, device.isEnabled() ? ColorManager.BUTTON_STATE_ON : ColorManager.BUTTON_STATE_OFF);
        surface.updateButton(APCControlSurface.APC_BUTTON_REC_QUANT, ColorManager.BUTTON_STATE_OFF);
        surface.updateButton(APCControlSurface.APC_BUTTON_MIDI_OVERDUB, ColorManager.BUTTON_STATE_OFF);
        surface.updateButton(APCControlSurface.APC_BUTTON_METRONOME, ColorManager.BUTTON_STATE_OFF);
        surface.updateButton(APCControlSurface.APC_BUTTON_CLIP_TRACK, ColorManager.BUTTON_STATE_OFF);
        surface.updateButton(APCControlSurface.APC_BUTTON_DEVICE_ON_OFF, ColorManager.BUTTON_STATE_OFF);
        surface.updateButton(APCControlSurface.APC_BUTTON_DEVICE_LEFT, ColorManager.BUTTON_STATE_OFF);
        surface.updateButton(APCControlSurface.APC_BUTTON_DEVICE_RIGHT, ColorManager.BUTTON_STATE_OFF);
        surface.updateButton(APCControlSurface.APC_BUTTON_BANK, this.model.getBrowser().isActive() ? ColorManager.BUTTON_STATE_ON : ColorManager.BUTTON_STATE_OFF);
    } else {
        surface.updateButton(APCControlSurface.APC_BUTTON_DETAIL_VIEW, ColorManager.BUTTON_STATE_OFF);
        surface.updateButton(APCControlSurface.APC_BUTTON_REC_QUANT, ColorManager.BUTTON_STATE_OFF);
        surface.updateButton(APCControlSurface.APC_BUTTON_MIDI_OVERDUB, t.isLauncherOverdub() ? ColorManager.BUTTON_STATE_ON : ColorManager.BUTTON_STATE_OFF);
        surface.updateButton(APCControlSurface.APC_BUTTON_METRONOME, t.isMetronomeOn() ? ColorManager.BUTTON_STATE_ON : ColorManager.BUTTON_STATE_OFF);
        surface.updateButton(APCControlSurface.APC_BUTTON_CLIP_TRACK, ColorManager.BUTTON_STATE_OFF);
        surface.updateButton(APCControlSurface.APC_BUTTON_DEVICE_ON_OFF, device.isEnabled() ? ColorManager.BUTTON_STATE_ON : ColorManager.BUTTON_STATE_OFF);
        surface.updateButton(APCControlSurface.APC_BUTTON_DEVICE_LEFT, ColorManager.BUTTON_STATE_OFF);
        surface.updateButton(APCControlSurface.APC_BUTTON_DEVICE_RIGHT, ColorManager.BUTTON_STATE_OFF);
    }
    this.updateDeviceKnobs();
}
Also used : APCControlSurface(de.mossgrabers.apc.controller.APCControlSurface) ITrack(de.mossgrabers.framework.daw.data.ITrack) APCCursorCommand(de.mossgrabers.apc.command.trigger.APCCursorCommand) ITransport(de.mossgrabers.framework.daw.ITransport) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) SceneView(de.mossgrabers.framework.view.SceneView) ViewManager(de.mossgrabers.framework.view.ViewManager) 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) ModeManager(de.mossgrabers.framework.mode.ModeManager)

Example 45 with ModeManager

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

the class ShiftView method onSelectTrack.

/**
 * {@inheritDoc}
 */
@Override
public void onSelectTrack(final int index, final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    switch(index) {
        case 0:
            this.model.getCurrentTrackBank().scrollScenesPageUp();
            break;
        case 1:
            this.model.getCurrentTrackBank().scrollScenesPageDown();
            break;
        case 2:
            this.model.getCurrentTrackBank().scrollTracksPageUp();
            break;
        case 3:
            this.model.getCurrentTrackBank().scrollTracksPageDown();
            break;
        case 4:
            this.surface.getModeManager().setActiveMode(Modes.MODE_VOLUME);
            this.surface.getConfiguration().setFaderCtrl("Volume");
            this.surface.getDisplay().notify("Volume");
            break;
        case 5:
            this.surface.getModeManager().setActiveMode(Modes.MODE_PAN);
            this.surface.getConfiguration().setFaderCtrl("Pan");
            this.surface.getDisplay().notify("Pan");
            break;
        case 6:
            if (this.model.isEffectTrackBankActive())
                return;
            final ModeManager modeManager = this.surface.getModeManager();
            Integer mode = Integer.valueOf(modeManager.getActiveModeId().intValue() + 1);
            // Wrap
            if (!Modes.isSendMode(mode))
                mode = Modes.MODE_SEND1;
            // Check if Send channel exists
            final IChannelBank fxTrackBank = this.model.getEffectTrackBank();
            if (Modes.isSendMode(mode) && fxTrackBank != null && !fxTrackBank.getTrack(mode.intValue() - Modes.MODE_SEND1.intValue()).doesExist())
                mode = Modes.MODE_SEND1;
            modeManager.setActiveMode(mode);
            final String name = "Send " + (mode.intValue() - Modes.MODE_SEND1.intValue() + 1);
            this.surface.getConfiguration().setFaderCtrl(name);
            this.surface.getDisplay().notify(name);
            break;
        case 7:
            if (this.surface.getModeManager().isActiveMode(Modes.MODE_DEVICE)) {
                this.model.getBrowser().browseForPresets();
                final ViewManager viewManager = this.surface.getViewManager();
                final Integer previousViewId = viewManager.getPreviousViewId();
                viewManager.setActiveView(Views.VIEW_BROWSER);
                viewManager.setPreviousView(previousViewId);
            } else {
                this.surface.getModeManager().setActiveMode(Modes.MODE_DEVICE);
                this.surface.getConfiguration().setFaderCtrl("Device");
                this.surface.getDisplay().notify("Device");
            }
            break;
    }
}
Also used : IChannelBank(de.mossgrabers.framework.daw.IChannelBank) ViewManager(de.mossgrabers.framework.view.ViewManager) 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