Search in sources :

Example 16 with ISend

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

the class FireTrackMixerMode method updateDisplay.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay() {
    this.updateMode();
    final IGraphicDisplay display = this.surface.getGraphicsDisplay();
    final ITrackBank trackBank = this.model.getCurrentTrackBank();
    final Optional<ITrack> trackOptional = trackBank.getSelectedItem();
    String label = "None";
    if (trackOptional.isPresent()) {
        final ITrack track = trackOptional.get();
        label = track.getPosition() + 1 + ": " + track.getName(9);
    }
    final int size = trackBank.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 = trackBank.getItem(i);
                    selected[i] = channel.isSelected();
                    values[i] = channel.getVolume();
                }
                break;
            case PAN:
                for (int i = 0; i < size; i++) {
                    final IChannel channel = trackBank.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 = trackBank.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 = trackBank.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 : IChannel(de.mossgrabers.framework.daw.data.IChannel) ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank) IGraphicDisplay(de.mossgrabers.framework.controller.display.IGraphicDisplay) TitleChannelsComponent(de.mossgrabers.controller.akai.fire.graphics.canvas.component.TitleChannelsComponent) ISend(de.mossgrabers.framework.daw.data.ISend) ISendBank(de.mossgrabers.framework.daw.data.bank.ISendBank)

Example 17 with ISend

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

the class SendsView method setupFader.

/**
 * {@inheritDoc}
 */
@Override
public void setupFader(final int index) {
    final ITrack track = this.model.getCurrentTrackBank().getItem(index);
    final int color = this.colorManager.getColorIndex(DAWColor.getColorIndex(track.getColor()));
    this.surface.setupFader(index, color, false);
    final ISend send = track.getSendBank().getItem(this.selectedSend);
    this.surface.setFaderValue(index, send.getValue());
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ISend(de.mossgrabers.framework.daw.data.ISend)

Example 18 with ISend

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

the class MixView method getButtonColor.

/**
 * {@inheritDoc}
 */
@Override
public int getButtonColor(final ButtonID buttonID) {
    final int index = 7 - (buttonID.ordinal() - ButtonID.SCENE1.ordinal());
    int color = 0;
    int value = 0;
    final Optional<ITrack> track = this.model.getCurrentTrackBank().getSelectedItem();
    if (track.isPresent()) {
        switch(this.faderMode) {
            default:
            case VOLUME:
                value = track.get().getVolume();
                color = LaunchpadColorManager.LAUNCHPAD_COLOR_CYAN;
                break;
            case PAN:
                value = track.get().getPan();
                color = LaunchpadColorManager.LAUNCHPAD_COLOR_SKY_HI;
                break;
            case SEND1:
                final ISend send1 = track.get().getSendBank().getItem(0);
                value = send1.doesExist() ? send1.getValue() : 0;
                color = LaunchpadColorManager.LAUNCHPAD_COLOR_ORCHID_HI;
                break;
            case SEND2:
                final ISend send2 = track.get().getSendBank().getItem(1);
                value = send2.doesExist() ? send2.getValue() : 0;
                color = LaunchpadColorManager.LAUNCHPAD_COLOR_LIME_HI;
                break;
        }
    }
    this.fader.setup(color, this.faderMode == FaderMode.PAN);
    this.fader.setValue(value);
    return this.fader.getColorState(index);
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ISend(de.mossgrabers.framework.daw.data.ISend)

Example 19 with ISend

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

the class ModeMultiSelectCommand method getSendModeNotification.

/**
 * Build the information text for a send channel.
 *
 * @param modeID The ID of the send mode
 * @param modeName The name of the mode
 * @param trackBank The track bank from which to get more effect info
 * @return The text
 */
public static String getSendModeNotification(final Modes modeID, final String modeName, final ITrackBank trackBank) {
    final int sendIndex = modeID.ordinal() - Modes.SEND1.ordinal();
    String sendModeName = modeName + " " + (sendIndex + 1);
    Optional<ITrack> selectedTrack = trackBank.getSelectedItem();
    if (selectedTrack.isEmpty()) {
        final ITrack item = trackBank.getItem(0);
        selectedTrack = item.doesExist() ? Optional.of(item) : Optional.empty();
    }
    if (selectedTrack.isPresent()) {
        sendModeName += ": ";
        final ISend send = selectedTrack.get().getSendBank().getItem(sendIndex);
        sendModeName += send.doesExist() ? send.getName() : "-";
    }
    return sendModeName;
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ISend(de.mossgrabers.framework.daw.data.ISend)

Example 20 with ISend

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

the class TrackSendMode method onKnobTouch.

/**
 * {@inheritDoc}
 */
@Override
public void onKnobTouch(final int index, final boolean isTouched) {
    final Optional<ITrack> track = this.getTrack(index);
    if (track.isEmpty())
        return;
    final ISend item = track.get().getSendBank().getItem(this.sendIndex);
    if (!item.doesExist())
        return;
    if (isTouched && this.surface.isDeletePressed()) {
        this.surface.setTriggerConsumed(ButtonID.DELETE);
        item.resetValue();
    }
    item.touchValue(isTouched);
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ISend(de.mossgrabers.framework.daw.data.ISend)

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