Search in sources :

Example 21 with ICursorDevice

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

the class PushControllerSetup method updateIndication.

private void updateIndication(final Integer mode) {
    final ITrackBank tb = this.model.getTrackBank();
    final IChannelBank tbe = this.model.getEffectTrackBank();
    final PushControlSurface surface = this.getSurface();
    final boolean isSession = surface.getViewManager().isActiveView(Views.VIEW_SESSION);
    final boolean isEffect = this.model.isEffectTrackBankActive();
    final boolean isPan = Modes.MODE_PAN.equals(mode);
    final boolean isVolume = Modes.MODE_VOLUME.equals(mode);
    tb.setIndication(!isEffect && isSession);
    if (tbe != null)
        tbe.setIndication(isEffect && isSession);
    final ICursorDevice cursorDevice = this.model.getCursorDevice();
    final ITrack selectedTrack = tb.getSelectedTrack();
    for (int i = 0; i < tb.getNumTracks(); i++) {
        final boolean hasTrackSel = selectedTrack != null && selectedTrack.getIndex() == i && Modes.MODE_TRACK.equals(mode);
        final ITrack track = tb.getTrack(i);
        track.setVolumeIndication(!isEffect && (isVolume || hasTrackSel));
        track.setPanIndication(!isEffect && (isPan || hasTrackSel));
        for (int j = 0; j < tb.getNumSends(); j++) track.getSend(j).setIndication(!isEffect && (mode.intValue() - Modes.MODE_SEND1.intValue() == j || hasTrackSel));
        if (tbe != null) {
            final ITrack fxTrack = tbe.getTrack(i);
            fxTrack.setVolumeIndication(isEffect);
            fxTrack.setPanIndication(isEffect && isPan);
        }
        cursorDevice.indicateParameter(i, true);
    }
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.ITrackBank) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) PushControlSurface(de.mossgrabers.push.controller.PushControlSurface) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice)

Example 22 with ICursorDevice

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

the class DeviceLayerMode method updateDisplay2.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay2() {
    final ICursorDevice cd = this.model.getCursorDevice();
    final PushDisplay display = (PushDisplay) this.surface.getDisplay();
    final DisplayMessage message = display.createMessage();
    if (!cd.hasSelectedDevice()) {
        for (int i = 0; i < 8; i++) message.addOptionElement(i == 2 ? "Please select a device or press 'Add Device'..." : "", i == 7 ? "Up" : "", true, "", "", false, true);
        display.send(message);
        return;
    }
    final boolean noLayers = cd.hasLayers() && cd.hasZeroLayers();
    if (noLayers) {
        for (int i = 0; i < 8; i++) message.addOptionElement(i == 3 ? "Please create a " + (cd.hasDrumPads() ? "Drum Pad..." : "Device Layer...") : "", i == 7 ? "Up" : "", true, "", "", false, true);
        display.send(message);
        return;
    }
    this.updateMenu();
    this.updateDisplayElements(message, cd, cd.getSelectedLayerOrDrumPad());
    display.send(message);
}
Also used : PushDisplay(de.mossgrabers.push.controller.PushDisplay) DisplayMessage(de.mossgrabers.push.controller.DisplayMessage) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice)

Example 23 with ICursorDevice

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

the class DeviceLayerMode method updateDisplay1.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay1() {
    final Display d = this.surface.getDisplay().clear();
    final ICursorDevice cd = this.model.getCursorDevice();
    if (!cd.hasSelectedDevice()) {
        d.setBlock(1, 0, "           Select").setBlock(1, 1, "a device or press").setBlock(1, 2, "'Add Effect'...  ").allDone();
        return;
    }
    final boolean noLayers = cd.hasLayers() && cd.hasZeroLayers();
    if (noLayers) {
        d.setBlock(1, 1, "    Please create").setBlock(1, 2, cd.hasDrumPads() ? "a Drum Pad..." : "a Device Layer...");
    } else {
        final IChannel l = cd.getSelectedLayerOrDrumPad();
        if (l != null) {
            d.setCell(0, 0, "Volume").setCell(1, 0, l.getVolumeStr(8)).setCell(2, 0, this.surface.getConfiguration().isEnableVUMeters() ? l.getVu() : l.getVolume(), Format.FORMAT_VALUE);
            d.setCell(0, 1, "Pan").setCell(1, 1, l.getPanStr(8)).setCell(2, 1, l.getPan(), Format.FORMAT_PAN);
            final IChannelBank fxTrackBank = this.model.getEffectTrackBank();
            if (fxTrackBank == null) {
                for (int i = 0; i < 6; i++) {
                    final int pos = 2 + i;
                    final ISend send = l.getSend(i);
                    d.setCell(0, pos, send.getName()).setCell(1, pos, send.getDisplayedValue(8)).setCell(2, pos, send.getValue(), Format.FORMAT_VALUE);
                }
            } else {
                final boolean isFX = this.model.isEffectTrackBankActive();
                for (int i = 0; i < 6; i++) {
                    final ITrack fxTrack = fxTrackBank.getTrack(i);
                    final boolean isEmpty = isFX || !fxTrack.doesExist();
                    final int pos = 2 + i;
                    if (isEmpty) {
                        d.clearCell(0, pos);
                        d.clearCell(2, pos);
                    } else {
                        final ISend send = l.getSend(i);
                        d.setCell(0, pos, fxTrack.getName()).setCell(1, pos, send.getDisplayedValue(8));
                        d.setCell(2, pos, send.getValue(), Format.FORMAT_VALUE);
                    }
                }
            }
        }
    }
    this.drawRow4(d, cd);
}
Also used : IChannel(de.mossgrabers.framework.daw.data.IChannel) ITrack(de.mossgrabers.framework.daw.data.ITrack) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) ISend(de.mossgrabers.framework.daw.data.ISend) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice) Display(de.mossgrabers.framework.controller.display.Display) PushDisplay(de.mossgrabers.push.controller.PushDisplay)

Example 24 with ICursorDevice

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

the class DeviceLayerModePan method onValueKnob.

/**
 * {@inheritDoc}
 */
@Override
public void onValueKnob(final int index, final int value) {
    final ICursorDevice cd = this.model.getCursorDevice();
    // Drum Pad Bank has size of 16, layers only 8
    final int offset = getDrumPadIndex(cd);
    final IChannel layer = cd.getLayerOrDrumPad(offset + index);
    if (layer.doesExist())
        cd.changeLayerOrDrumPadPan(offset + index, value);
}
Also used : IChannel(de.mossgrabers.framework.daw.data.IChannel) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice)

Example 25 with ICursorDevice

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

the class DeviceLayerModePan method updateDisplay1.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay1() {
    final Display d = this.surface.getDisplay();
    final ICursorDevice cd = this.model.getCursorDevice();
    // Drum Pad Bank has size of 16, layers only 8
    final int offset = getDrumPadIndex(cd);
    for (int i = 0; i < 8; i++) {
        final IChannel layer = cd.getLayerOrDrumPad(offset + i);
        d.setCell(0, i, layer.doesExist() ? "Pan" : "").setCell(1, i, layer.getPanStr(8));
        if (layer.doesExist())
            d.setCell(2, i, layer.getPan(), Format.FORMAT_VALUE);
        else
            d.clearCell(2, i);
    }
    d.done(0).done(1).done(2);
    this.drawRow4(d, cd);
}
Also used : IChannel(de.mossgrabers.framework.daw.data.IChannel) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice) Display(de.mossgrabers.framework.controller.display.Display)

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