Search in sources :

Example 11 with IChannel

use of de.mossgrabers.framework.daw.data.IChannel 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 12 with IChannel

use of de.mossgrabers.framework.daw.data.IChannel 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)

Example 13 with IChannel

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

the class DeviceLayerModeSend 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);
    final int sendIndex = this.getCurrentSendIndex();
    for (int i = 0; i < 8; i++) {
        final IChannel layer = cd.getLayerOrDrumPad(offset + i);
        final boolean exists = layer.doesExist();
        final ISend send = layer.getSend(sendIndex);
        d.setCell(0, i, exists ? send.getName() : "").setCell(1, i, send.getDisplayedValue(8));
        if (exists)
            d.setCell(2, i, send.getValue(), 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) ISend(de.mossgrabers.framework.daw.data.ISend) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice) Display(de.mossgrabers.framework.controller.display.Display)

Example 14 with IChannel

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

the class OSCParser method parseLayerOrDrumpad.

private void parseLayerOrDrumpad(final ICursorDevice cursorDevice, final LinkedList<String> parts, final Object value) {
    if (parts.isEmpty()) {
        this.host.println("Missing Layer/Drumpad command.");
        return;
    }
    final String command = parts.removeFirst();
    try {
        final int layerNo;
        if ("selected".equals(command)) {
            final IChannel selectedLayerOrDrumPad = cursorDevice.getSelectedLayerOrDrumPad();
            layerNo = selectedLayerOrDrumPad == null ? -1 : selectedLayerOrDrumPad.getIndex();
        } else {
            layerNo = Integer.parseInt(command) - 1;
        }
        this.parseDeviceLayerValue(cursorDevice, layerNo, parts, value);
    } catch (final NumberFormatException ex) {
        switch(command) {
            case "parent":
                if (cursorDevice.doesExist()) {
                    cursorDevice.selectParent();
                    cursorDevice.selectChannel();
                }
                break;
            case "+":
                cursorDevice.nextLayerOrDrumPad();
                break;
            case "-":
                cursorDevice.previousLayerOrDrumPad();
                break;
            case "page":
                if (parts.isEmpty()) {
                    this.host.println("Missing Layer/Drumpad Page subcommand: " + command);
                    return;
                }
                if ("+".equals(parts.get(0)))
                    cursorDevice.nextLayerOrDrumPadBank();
                else
                    cursorDevice.previousLayerOrDrumPadBank();
                break;
            default:
                this.host.println("Unknown Layour/Drum command: " + command);
                break;
        }
    }
}
Also used : IChannel(de.mossgrabers.framework.daw.data.IChannel)

Example 15 with IChannel

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

the class ColorView method onGridNote.

/**
 * {@inheritDoc}
 */
@Override
public void onGridNote(final int note, final int velocity) {
    if (velocity == 0)
        return;
    final int color = note - 36;
    if (color < BitwigColors.BITWIG_COLORS.length) {
        final double[] entry = BitwigColors.getColorEntry(BitwigColors.BITWIG_COLORS[color]);
        switch(this.mode) {
            case MODE_TRACK:
                final IChannelBank tb = this.model.getCurrentTrackBank();
                final ITrack t = tb.getSelectedTrack();
                if (t == null) {
                    final IMasterTrack master = this.model.getMasterTrack();
                    if (master.isSelected())
                        master.setColor(entry[0], entry[1], entry[2]);
                } else
                    t.setColor(entry[0], entry[1], entry[2]);
                break;
            case MODE_LAYER:
                final ICursorDevice cd = this.model.getCursorDevice();
                final IChannel deviceChain = cd.getSelectedLayerOrDrumPad();
                cd.setLayerOrDrumPadColor(deviceChain.getIndex(), entry[0], entry[1], entry[2]);
                break;
            case MODE_CLIP:
                final ICursorClip clip = this.model.getCursorClip();
                if (clip != null)
                    clip.setColor(entry[0], entry[1], entry[2]);
                break;
        }
    }
    this.surface.getViewManager().restoreView();
}
Also used : IChannel(de.mossgrabers.framework.daw.data.IChannel) ITrack(de.mossgrabers.framework.daw.data.ITrack) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) ICursorClip(de.mossgrabers.framework.daw.ICursorClip) IMasterTrack(de.mossgrabers.framework.daw.data.IMasterTrack) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice)

Aggregations

IChannel (de.mossgrabers.framework.daw.data.IChannel)57 ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)25 IChannelBank (de.mossgrabers.framework.daw.IChannelBank)9 ISend (de.mossgrabers.framework.daw.data.ISend)9 PushConfiguration (de.mossgrabers.push.PushConfiguration)7 ITrack (de.mossgrabers.framework.daw.data.ITrack)6 Display (de.mossgrabers.framework.controller.display.Display)5 IDrumPadBank (de.mossgrabers.framework.daw.data.bank.IDrumPadBank)5 ModeManager (de.mossgrabers.framework.mode.ModeManager)4 IGraphicDisplay (de.mossgrabers.framework.controller.display.IGraphicDisplay)3 ILayer (de.mossgrabers.framework.daw.data.ILayer)3 ISpecificDevice (de.mossgrabers.framework.daw.data.ISpecificDevice)3 ISendBank (de.mossgrabers.framework.daw.data.bank.ISendBank)3 PushDisplay (de.mossgrabers.push.controller.PushDisplay)3 PushConfiguration (de.mossgrabers.controller.ableton.push.PushConfiguration)2 TitleChannelsComponent (de.mossgrabers.controller.akai.fire.graphics.canvas.component.TitleChannelsComponent)2 IValueChanger (de.mossgrabers.framework.controller.IValueChanger)2 IValueChanger (de.mossgrabers.framework.controller.valuechanger.IValueChanger)2 ICursorClip (de.mossgrabers.framework.daw.ICursorClip)2 ITrackBank (de.mossgrabers.framework.daw.data.bank.ITrackBank)2