Search in sources :

Example 6 with ICursorDevice

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

the class APCQuantizeCommand method executeShifted.

/**
 * {@inheritDoc}
 */
@Override
public void executeShifted(final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    final ICursorDevice cursorDevice = this.model.getCursorDevice();
    if (cursorDevice.hasSelectedDevice()) {
        final boolean pinned = cursorDevice.isPinned();
        cursorDevice.togglePinned();
        final boolean cursorTrackPinned = this.model.isCursorTrackPinned();
        if (pinned == cursorTrackPinned)
            this.model.toggleCursorTrackPinned();
    }
}
Also used : ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice)

Example 7 with ICursorDevice

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

the class DeviceLeftCommand method executeShifted.

/**
 * {@inheritDoc}
 */
@Override
public void executeShifted(final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    // Exit layer
    final ICursorDevice cd = this.model.getCursorDevice();
    final IChannel layer = cd.getSelectedLayerOrDrumPad();
    if (!cd.hasLayers() || layer == null) {
        if (cd.isNested()) {
            cd.selectParent();
            cd.selectChannel();
        }
    } else
        layer.setSelected(false);
}
Also used : IChannel(de.mossgrabers.framework.daw.data.IChannel) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice)

Example 8 with ICursorDevice

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

the class BeatstepControllerSetup method updateIndication.

private void updateIndication() {
    final BeatstepControlSurface surface = this.getSurface();
    final ViewManager viewManager = surface.getViewManager();
    final boolean isTrack = viewManager.isActiveView(Views.VIEW_TRACK);
    final boolean isDevice = viewManager.isActiveView(Views.VIEW_DEVICE);
    final boolean isSession = viewManager.isActiveView(Views.VIEW_SESSION);
    final IMasterTrack mt = this.model.getMasterTrack();
    mt.setVolumeIndication(!isDevice);
    final ITrackBank tb = this.model.getTrackBank();
    final ITrack selectedTrack = tb.getSelectedTrack();
    final IChannelBank tbe = this.model.getEffectTrackBank();
    final ITrack selectedFXTrack = tbe.getSelectedTrack();
    final ICursorDevice cursorDevice = this.model.getCursorDevice();
    final boolean isEffect = this.model.isEffectTrackBankActive();
    tb.setIndication(!isEffect && isSession);
    tbe.setIndication(isEffect && isSession);
    for (int i = 0; i < 8; i++) {
        final boolean hasTrackSel = selectedTrack != null && selectedTrack.getIndex() == i;
        final ITrack track = tb.getTrack(i);
        track.setVolumeIndication(!isEffect && hasTrackSel && !isDevice);
        track.setPanIndication(!isEffect && hasTrackSel && !isDevice);
        for (int j = 0; j < 6; j++) track.getSend(j).setIndication(!isEffect && hasTrackSel && isTrack);
        final boolean hasFXTrackSel = selectedFXTrack != null && selectedFXTrack.getIndex() == i;
        final ITrack fxTrack = tbe.getTrack(i);
        fxTrack.setVolumeIndication(isEffect && hasFXTrackSel && isTrack);
        fxTrack.setPanIndication(isEffect && hasFXTrackSel && isTrack);
        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) ViewManager(de.mossgrabers.framework.view.ViewManager) BeatstepControlSurface(de.mossgrabers.beatstep.controller.BeatstepControlSurface) IMasterTrack(de.mossgrabers.framework.daw.data.IMasterTrack) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice)

Example 9 with ICursorDevice

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

the class AbstractDrumView method onDeactivate.

/**
 * {@inheritDoc}
 */
@Override
public void onDeactivate() {
    super.onDeactivate();
    final ICursorDevice primary = this.model.getPrimaryDevice();
    primary.enableObservers(false);
    primary.setDrumPadIndication(false);
}
Also used : ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice)

Example 10 with ICursorDevice

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

the class AbstractDrumView64 method drawGrid.

/**
 * {@inheritDoc}
 */
@Override
public void drawGrid() {
    if (!this.model.canSelectedTrackHoldNotes()) {
        this.surface.getPadGrid().turnOff();
        return;
    }
    // halfColumns x playLines Drum Pad Grid
    final ICursorDevice drumDevice64 = this.model.getDrumDevice64();
    final boolean hasDrumPads = drumDevice64.hasDrumPads();
    boolean isSoloed = false;
    final int numPads = this.rows * this.columns;
    if (hasDrumPads) {
        for (int i = 0; i < numPads; i++) {
            if (drumDevice64.getDrumPad(i).isSolo()) {
                isSoloed = true;
                break;
            }
        }
    }
    final boolean isRecording = this.model.hasRecordingState();
    for (int index = 0; index < numPads; index++) {
        final int x = index / 32 * 4 + index % 4;
        final int y = index / 4 % 8;
        this.surface.getPadGrid().lightEx(x, 7 - y, this.getPadColor(index, drumDevice64, isSoloed, isRecording));
    }
}
Also used : 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