Search in sources :

Example 51 with ICursorDevice

use of de.mossgrabers.framework.daw.ICursorDevice in project DrivenByMoss by git-moss.

the class LaunchpadControllerSetup method updateIndication.

private void updateIndication() {
    final ViewManager viewManager = this.getSurface().getViewManager();
    final boolean isVolume = viewManager.isActiveView(Views.VIEW_VOLUME);
    final boolean isPan = viewManager.isActiveView(Views.VIEW_PAN);
    final boolean isSends = viewManager.isActiveView(Views.VIEW_SENDS);
    final boolean isDevice = viewManager.isActiveView(Views.VIEW_DEVICE);
    final ITrackBank tb = this.model.getTrackBank();
    final IChannelBank tbe = this.model.getEffectTrackBank();
    final ICursorDevice cursorDevice = this.model.getCursorDevice();
    final View view = viewManager.getActiveView();
    final int selSend = view instanceof SendsView ? ((SendsView) view).getSelectedSend() : -1;
    final boolean isSession = view instanceof SessionView && !isVolume && !isPan && !isSends;
    final boolean isEffect = this.model.isEffectTrackBankActive();
    tb.setIndication(!isEffect && isSession);
    tbe.setIndication(isEffect && isSession);
    for (int i = 0; i < 8; i++) {
        final ITrack track = tb.getTrack(i);
        track.setVolumeIndication(!isEffect && isVolume);
        track.setPanIndication(!isEffect && isPan);
        for (int j = 0; j < 8; j++) track.getSend(j).setIndication(!isEffect && isSends && selSend == j);
        final ITrack fxTrack = tbe.getTrack(i);
        fxTrack.setVolumeIndication(isEffect && isVolume);
        fxTrack.setPanIndication(isEffect && isPan);
        cursorDevice.indicateParameter(i, isDevice);
    }
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.ITrackBank) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) SendsView(de.mossgrabers.launchpad.view.SendsView) ViewManager(de.mossgrabers.framework.view.ViewManager) SessionView(de.mossgrabers.launchpad.view.SessionView) VolumeView(de.mossgrabers.launchpad.view.VolumeView) SessionView(de.mossgrabers.launchpad.view.SessionView) SequencerView(de.mossgrabers.launchpad.view.SequencerView) SceneView(de.mossgrabers.framework.view.SceneView) DeviceView(de.mossgrabers.launchpad.view.DeviceView) View(de.mossgrabers.framework.view.View) PanView(de.mossgrabers.launchpad.view.PanView) RaindropsView(de.mossgrabers.launchpad.view.RaindropsView) BrowserView(de.mossgrabers.launchpad.view.BrowserView) DrumView(de.mossgrabers.launchpad.view.DrumView) SendsView(de.mossgrabers.launchpad.view.SendsView) ShiftView(de.mossgrabers.launchpad.view.ShiftView) PlayView(de.mossgrabers.launchpad.view.PlayView) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice)

Example 52 with ICursorDevice

use of de.mossgrabers.framework.daw.ICursorDevice in project DrivenByMoss by git-moss.

the class DeviceLayerMode method onSecondRow.

/**
 * {@inheritDoc}
 */
@Override
public void onSecondRow(final int index, final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    final PushConfiguration config = this.surface.getConfiguration();
    if (!this.isPush2 || config.isMuteLongPressed() || config.isSoloLongPressed() || config.isMuteSoloLocked()) {
        final ICursorDevice cd = this.model.getCursorDevice();
        final int offset = getDrumPadIndex(cd);
        if (config.isMuteState())
            cd.toggleLayerOrDrumPadMute(offset + index);
        else
            cd.toggleLayerOrDrumPadSolo(offset + index);
        return;
    }
    final ModeManager modeManager = this.surface.getModeManager();
    IChannelBank fxTrackBank;
    switch(index) {
        case 0:
            if (modeManager.isActiveMode(Modes.MODE_DEVICE_LAYER_VOLUME))
                modeManager.setActiveMode(Modes.MODE_DEVICE_LAYER);
            else
                modeManager.setActiveMode(Modes.MODE_DEVICE_LAYER_VOLUME);
            break;
        case 1:
            if (modeManager.isActiveMode(Modes.MODE_DEVICE_LAYER_PAN))
                modeManager.setActiveMode(Modes.MODE_DEVICE_LAYER);
            else
                modeManager.setActiveMode(Modes.MODE_DEVICE_LAYER_PAN);
            break;
        case 2:
            // Not used
            break;
        case 3:
            if (!this.model.isEffectTrackBankActive()) {
                // Check if there are more than 4 FX channels
                if (!config.isSendsAreToggled()) {
                    fxTrackBank = this.model.getEffectTrackBank();
                    if (!fxTrackBank.getTrack(4).doesExist())
                        return;
                }
                config.setSendsAreToggled(!config.isSendsAreToggled());
                if (!modeManager.isActiveMode(Modes.MODE_DEVICE_LAYER))
                    modeManager.setActiveMode(Integer.valueOf(Modes.MODE_DEVICE_LAYER_SEND1.intValue() + (config.isSendsAreToggled() ? 4 : 0)));
            }
            break;
        case 7:
            this.moveUp();
            break;
        default:
            if (!this.model.isEffectTrackBankActive()) {
                final int sendOffset = config.isSendsAreToggled() ? 0 : 4;
                final int sendIndex = index - sendOffset;
                fxTrackBank = this.model.getEffectTrackBank();
                if (fxTrackBank.getTrack(sendIndex).doesExist()) {
                    final Integer si = Integer.valueOf(Modes.MODE_DEVICE_LAYER_SEND1.intValue() + sendIndex);
                    if (modeManager.isActiveMode(si))
                        modeManager.setActiveMode(Modes.MODE_DEVICE_LAYER);
                    else
                        modeManager.setActiveMode(si);
                }
            }
            break;
    }
}
Also used : PushConfiguration(de.mossgrabers.push.PushConfiguration) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice) ModeManager(de.mossgrabers.framework.mode.ModeManager)

Example 53 with ICursorDevice

use of de.mossgrabers.framework.daw.ICursorDevice in project DrivenByMoss by git-moss.

the class DeviceLayerMode method onFirstRow.

/**
 * {@inheritDoc}
 */
@Override
public void onFirstRow(final int index, final ButtonEvent event) {
    if (event == ButtonEvent.DOWN)
        return;
    if (event == ButtonEvent.UP) {
        final ICursorDevice cd = this.model.getCursorDevice();
        if (!cd.hasSelectedDevice())
            return;
        final int offset = getDrumPadIndex(cd);
        final IChannel layer = cd.getLayerOrDrumPad(offset + index);
        if (!layer.doesExist())
            return;
        final int layerIndex = layer.getIndex();
        if (!layer.isSelected()) {
            cd.selectLayerOrDrumPad(layerIndex);
            return;
        }
        cd.enterLayerOrDrumPad(layer.getIndex());
        cd.selectFirstDeviceInLayerOrDrumPad(layer.getIndex());
        final ModeManager modeManager = this.surface.getModeManager();
        modeManager.setActiveMode(Modes.MODE_DEVICE_PARAMS);
        ((DeviceParamsMode) modeManager.getMode(Modes.MODE_DEVICE_PARAMS)).setShowDevices(true);
        return;
    }
    // LONG press
    this.surface.setButtonConsumed(PushControlSurface.PUSH_BUTTON_ROW1_1 + index);
    this.moveUp();
}
Also used : IChannel(de.mossgrabers.framework.daw.data.IChannel) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice) ModeManager(de.mossgrabers.framework.mode.ModeManager)

Example 54 with ICursorDevice

use of de.mossgrabers.framework.daw.ICursorDevice in project DrivenByMoss by git-moss.

the class DeviceLayerMode method moveUp.

/**
 * Move up the hierarchy.
 */
protected void moveUp() {
    // There is no device on the track move upwards to the track view
    final ICursorDevice cd = this.model.getCursorDevice();
    if (!cd.hasSelectedDevice()) {
        this.surface.getViewManager().getActiveView().executeTriggerCommand(Commands.COMMAND_TRACK, ButtonEvent.DOWN);
        return;
    }
    final ModeManager modeManager = this.surface.getModeManager();
    modeManager.setActiveMode(Modes.MODE_DEVICE_PARAMS);
    cd.selectChannel();
    ((DeviceParamsMode) modeManager.getMode(Modes.MODE_DEVICE_PARAMS)).setShowDevices(true);
}
Also used : ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice) ModeManager(de.mossgrabers.framework.mode.ModeManager)

Example 55 with ICursorDevice

use of de.mossgrabers.framework.daw.ICursorDevice in project DrivenByMoss by git-moss.

the class DeviceLayerMode method onValueKnob.

/**
 * {@inheritDoc}
 */
@Override
public void onValueKnob(final int index, final int value) {
    final ICursorDevice cd = this.model.getCursorDevice();
    final IChannel selectedDeviceLayer = cd.getSelectedLayerOrDrumPad();
    if (selectedDeviceLayer == null)
        return;
    switch(index) {
        case 0:
            cd.changeLayerOrDrumPadVolume(selectedDeviceLayer.getIndex(), value);
            break;
        case 1:
            cd.changeLayerOrDrumPadPan(selectedDeviceLayer.getIndex(), value);
            break;
        default:
            if (this.isPush2 && index < 4)
                break;
            final int sendIndex = index - (this.isPush2 ? this.surface.getConfiguration().isSendsAreToggled() ? 0 : 4 : 2);
            cd.changeLayerOrDrumPadSend(selectedDeviceLayer.getIndex(), sendIndex, value);
            break;
    }
}
Also used : IChannel(de.mossgrabers.framework.daw.data.IChannel) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice)

Aggregations

ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)72 IChannel (de.mossgrabers.framework.daw.data.IChannel)25 IChannelBank (de.mossgrabers.framework.daw.IChannelBank)22 ITrack (de.mossgrabers.framework.daw.data.ITrack)19 Display (de.mossgrabers.framework.controller.display.Display)10 ModeManager (de.mossgrabers.framework.mode.ModeManager)9 View (de.mossgrabers.framework.view.View)8 ViewManager (de.mossgrabers.framework.view.ViewManager)8 ITrackBank (de.mossgrabers.framework.daw.ITrackBank)7 IParameter (de.mossgrabers.framework.daw.data.IParameter)6 ITransport (de.mossgrabers.framework.daw.ITransport)5 PushConfiguration (de.mossgrabers.push.PushConfiguration)5 ICursorClip (de.mossgrabers.framework.daw.ICursorClip)4 IMasterTrack (de.mossgrabers.framework.daw.data.IMasterTrack)4 SceneView (de.mossgrabers.framework.view.SceneView)4 APCControlSurface (de.mossgrabers.apc.controller.APCControlSurface)3 IBrowser (de.mossgrabers.framework.daw.IBrowser)3 Scales (de.mossgrabers.framework.scale.Scales)3 AbstractSequencerView (de.mossgrabers.framework.view.AbstractSequencerView)3 DrumView (de.mossgrabers.launchpad.view.DrumView)3