Search in sources :

Example 21 with ISend

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

the class TrackSendMode method onKnobValue.

/**
 * {@inheritDoc}
 */
@Override
public void onKnobValue(final int index, final int value) {
    final Optional<ITrack> track = this.getTrack(index);
    if (track.isEmpty())
        return;
    final ISend item = track.get().getSendBank().getItem(this.sendIndex);
    if (this.isAbsolute)
        item.setValue(value);
    else
        item.changeValue(value);
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ISend(de.mossgrabers.framework.daw.data.ISend)

Example 22 with ISend

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

the class FireLayerMixerMode method updateDisplay.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay() {
    this.updateMode();
    final IGraphicDisplay display = this.surface.getGraphicsDisplay();
    final ISpecificDevice cd = this.model.getDrumDevice();
    final ILayerBank layerBank = cd.getLayerBank();
    final Optional<ILayer> channelOptional = layerBank.getSelectedItem();
    String label = "None";
    if (channelOptional.isPresent()) {
        final IChannel channel = channelOptional.get();
        label = channel.getPosition() + 1 + ": " + channel.getName(9);
    }
    final int size = layerBank.getPageSize();
    final boolean[] selected = new boolean[size];
    final int[] values = new int[size];
    final boolean isMode = this.isAnyKnobTouched() || !this.model.getTransport().isPlaying();
    if (isMode) {
        switch(this.selectedParameter) {
            case VOLUME:
                for (int i = 0; i < size; i++) {
                    final IChannel channel = layerBank.getItem(i);
                    selected[i] = channel.isSelected();
                    values[i] = channel.getVolume();
                }
                break;
            case PAN:
                for (int i = 0; i < size; i++) {
                    final IChannel channel = layerBank.getItem(i);
                    selected[i] = channel.isSelected();
                    values[i] = channel.getPan();
                }
                break;
            case SEND1:
            case SEND2:
            case SEND3:
            case SEND4:
            case SEND5:
            case SEND6:
                final int sendIndex = this.selectedParameter.ordinal() - Modes.SEND1.ordinal();
                for (int i = 0; i < size; i++) {
                    final IChannel channel = layerBank.getItem(i);
                    selected[i] = channel.isSelected();
                    final ISendBank sendBank = channel.getSendBank();
                    if (sendBank != null) {
                        final ISend send = sendBank.getItem(sendIndex);
                        if (send.doesExist())
                            values[i] = send.getValue();
                    }
                }
                break;
            default:
                // Not used
                break;
        }
    } else {
        for (int i = 0; i < size; i++) {
            final IChannel channel = layerBank.getItem(i);
            selected[i] = channel.isSelected();
            values[i] = channel.getVu();
        }
    }
    display.addElement(new TitleChannelsComponent(label, selected, values, this.selectedParameter == Modes.PAN && isMode));
    display.send();
}
Also used : ILayerBank(de.mossgrabers.framework.daw.data.bank.ILayerBank) IChannel(de.mossgrabers.framework.daw.data.IChannel) ILayer(de.mossgrabers.framework.daw.data.ILayer) IGraphicDisplay(de.mossgrabers.framework.controller.display.IGraphicDisplay) TitleChannelsComponent(de.mossgrabers.controller.akai.fire.graphics.canvas.component.TitleChannelsComponent) ISpecificDevice(de.mossgrabers.framework.daw.data.ISpecificDevice) ISend(de.mossgrabers.framework.daw.data.ISend) ISendBank(de.mossgrabers.framework.daw.data.bank.ISendBank)

Example 23 with ISend

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

the class FireTrackMode method onKnobTouch.

/**
 * {@inheritDoc}
 */
@Override
public void onKnobTouch(final int index, final boolean isTouched) {
    this.selectedParameter = this.surface.isPressed(ButtonID.ALT) ? ALT_MODES[index] : MODES[index];
    this.isKnobTouched[index] = isTouched;
    final Optional<ITrack> trackOptional = this.model.getCurrentTrackBank().getSelectedItem();
    if (!trackOptional.isPresent())
        return;
    final ITrack track = trackOptional.get();
    switch(this.selectedParameter) {
        case VOLUME:
            if (isTouched && this.surface.isDeletePressed())
                track.resetVolume();
            track.touchVolume(isTouched);
            break;
        case PAN:
            if (isTouched && this.surface.isDeletePressed())
                track.resetPan();
            track.touchPan(isTouched);
            break;
        case SEND1:
        case SEND2:
        case SEND3:
        case SEND4:
        case SEND5:
        case SEND6:
            final int sendIndex = this.selectedParameter.ordinal() - Modes.SEND1.ordinal();
            final ISend item = track.getSendBank().getItem(sendIndex);
            if (isTouched && this.surface.isDeletePressed())
                item.resetValue();
            item.touchValue(isTouched);
            break;
        default:
            // Not used
            break;
    }
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ISend(de.mossgrabers.framework.daw.data.ISend)

Example 24 with ISend

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

the class FireTrackMode method getSendLabel.

private static String getSendLabel(final ISendBank sendBank, final int index) {
    final int pos = index + 1;
    if (sendBank == null)
        return "No FX " + pos;
    final ISend send = sendBank.getItem(index);
    if (!send.doesExist())
        return "No FX " + pos;
    return send.getName(4) + ": " + send.getDisplayedValue();
}
Also used : ISend(de.mossgrabers.framework.daw.data.ISend)

Example 25 with ISend

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

the class TrackMode method updateDisplay.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay() {
    final ITrackBank currentTrackBank = this.model.getCurrentTrackBank();
    final Optional<ITrack> t = currentTrackBank.getSelectedItem();
    final Kontrol1Display d = (Kontrol1Display) this.surface.getDisplay();
    d.clear();
    if (t.isEmpty()) {
        d.setCell(0, 3, "  PLEASE").setCell(0, 4, "SELECT A").setCell(0, 5, "TRACK").allDone();
        return;
    }
    final boolean isEffectTrackBankActive = this.model.isEffectTrackBankActive();
    final ITrack track = t.get();
    d.setCell(0, 0, (isEffectTrackBankActive ? "TR-FX " : "TRACK ") + (track.getPosition() + 1)).setCell(1, 0, StringUtils.shortenAndFixASCII(track.getName(), 8).toUpperCase(Locale.US));
    d.setCell(0, 1, "VOLUME").setCell(1, 1, getSecondLineText(track)).setCell(0, 2, "PAN").setCell(1, 2, track.getPanStr(8));
    d.setBar(1, this.surface.getContinuous(ContinuousID.KNOB1).isTouched(), track.getVolume());
    d.setPanBar(2, this.surface.getContinuous(ContinuousID.KNOB2).isTouched(), track.getPan());
    if (!isEffectTrackBankActive) {
        final ISendBank sendBank = track.getSendBank();
        for (int i = 0; i < 6; i++) {
            final int pos = 3 + i;
            final ISend sendData = sendBank.getItem(i);
            d.setCell(0, pos, StringUtils.shortenAndFixASCII(sendData.getName(8), 8).toUpperCase(Locale.US)).setCell(1, pos, sendData.getDisplayedValue(8));
            d.setBar(pos, this.surface.getContinuous(ContinuousID.get(ContinuousID.KNOB3, i)).isTouched() && sendData.doesExist(), sendData.getValue());
        }
    }
    d.allDone();
}
Also used : Kontrol1Display(de.mossgrabers.controller.ni.kontrol.mki.controller.Kontrol1Display) ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank) ISend(de.mossgrabers.framework.daw.data.ISend) ISendBank(de.mossgrabers.framework.daw.data.bank.ISendBank)

Aggregations

ISend (de.mossgrabers.framework.daw.data.ISend)52 ITrack (de.mossgrabers.framework.daw.data.ITrack)40 ISendBank (de.mossgrabers.framework.daw.data.bank.ISendBank)17 IChannelBank (de.mossgrabers.framework.daw.IChannelBank)11 ITrackBank (de.mossgrabers.framework.daw.data.bank.ITrackBank)10 IChannel (de.mossgrabers.framework.daw.data.IChannel)9 Display (de.mossgrabers.framework.controller.display.Display)6 IValueChanger (de.mossgrabers.framework.controller.valuechanger.IValueChanger)5 PushConfiguration (de.mossgrabers.push.PushConfiguration)5 PushDisplay (de.mossgrabers.push.controller.PushDisplay)5 PushConfiguration (de.mossgrabers.controller.ableton.push.PushConfiguration)4 ITextDisplay (de.mossgrabers.framework.controller.display.ITextDisplay)4 SendData (de.mossgrabers.framework.graphics.canvas.utils.SendData)4 IValueChanger (de.mossgrabers.framework.controller.IValueChanger)3 TitleChannelsComponent (de.mossgrabers.controller.akai.fire.graphics.canvas.component.TitleChannelsComponent)2 FaderConfig (de.mossgrabers.controller.ni.maschine.jam.controller.FaderConfig)2 SLMkIIIDisplay (de.mossgrabers.controller.novation.slmkiii.controller.SLMkIIIDisplay)2 ColorEx (de.mossgrabers.framework.controller.color.ColorEx)2 IGraphicDisplay (de.mossgrabers.framework.controller.display.IGraphicDisplay)2 ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)2