Search in sources :

Example 36 with ISend

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

the class FireLayerMode 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 37 with ISend

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

the class DeviceLayerModeSend method updateDisplayElements.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplayElements(final IGraphicDisplay display, final Optional<ILayer> l) {
    this.updateMenuItems(5 + this.sendIndex % 4);
    final PushConfiguration config = this.surface.getConfiguration();
    // Drum Pad Bank has size of 16, layers only 8
    final int offset = this.getDrumPadIndex();
    final int sendOffset = config.isSendsAreToggled() ? 4 : 0;
    for (int i = 0; i < 8; i++) {
        final IChannel layer = this.bank.getItem(offset + i);
        final Pair<String, Boolean> pair = this.menu.get(i);
        final String topMenu = pair.getKey();
        final boolean isTopMenuOn = pair.getValue().booleanValue();
        // Channel info
        final SendData[] sendData = new SendData[4];
        for (int j = 0; j < 4; j++) {
            final int sendPos = sendOffset + j;
            final ISend send = layer.getSendBank().getItem(sendPos);
            final boolean exists = send.doesExist();
            sendData[j] = new SendData(send.getName(), exists && this.sendIndex == sendPos && this.isKnobTouched[i] ? send.getDisplayedValue() : "", exists ? send.getValue() : 0, exists ? send.getModulatedValue() : 0, this.sendIndex == sendPos);
        }
        display.addSendsElement(topMenu, isTopMenuOn, layer.doesExist() ? layer.getName() : "", ChannelType.LAYER, this.bank.getItem(offset + i).getColor(), layer.isSelected(), sendData, false, layer.isActivated(), layer.isActivated());
    }
}
Also used : PushConfiguration(de.mossgrabers.controller.ableton.push.PushConfiguration) IChannel(de.mossgrabers.framework.daw.data.IChannel) ISend(de.mossgrabers.framework.daw.data.ISend) SendData(de.mossgrabers.framework.graphics.canvas.utils.SendData)

Example 38 with ISend

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

the class DeviceLayerMode method updateDisplayElements.

/**
 * Update all 8 elements.
 *
 * @param display The display
 * @param l The channel data
 */
protected void updateDisplayElements(final IGraphicDisplay display, final Optional<ILayer> l) {
    // Drum Pad Bank has size of 16, layers only 8
    final int offset = this.getDrumPadIndex();
    // Get the index at which to draw the Sends element
    int sendsIndex = l.isEmpty() ? -1 : l.get().getIndex() - offset + 1;
    if (sendsIndex == 8)
        sendsIndex = 6;
    this.updateMenuItems(-1);
    final PushConfiguration config = this.surface.getConfiguration();
    for (int i = 0; i < 8; i++) {
        final IChannel layer = this.bank.getItem(offset + i);
        final Pair<String, Boolean> pair = this.menu.get(i);
        final String topMenu = pair.getKey();
        final boolean isTopMenuOn = pair.getValue().booleanValue();
        // Channel info
        final String bottomMenu = layer.doesExist() ? layer.getName(12) : "";
        final ColorEx bottomMenuColor = layer.getColor();
        final boolean isBottomMenuOn = layer.isSelected();
        if (layer.isSelected()) {
            final IValueChanger valueChanger = this.model.getValueChanger();
            final boolean enableVUMeters = config.isEnableVUMeters();
            final int vuR = valueChanger.toDisplayValue(enableVUMeters ? layer.getVuRight() : 0);
            final int vuL = valueChanger.toDisplayValue(enableVUMeters ? layer.getVuLeft() : 0);
            display.addChannelElement(topMenu, isTopMenuOn, bottomMenu, ChannelType.LAYER, bottomMenuColor, isBottomMenuOn, valueChanger.toDisplayValue(layer.getVolume()), valueChanger.toDisplayValue(layer.getModulatedVolume()), this.isKnobTouched[0] ? layer.getVolumeStr(8) : "", valueChanger.toDisplayValue(layer.getPan()), valueChanger.toDisplayValue(layer.getModulatedPan()), this.isKnobTouched[1] ? layer.getPanStr(8) : "", vuL, vuR, layer.isMute(), layer.isSolo(), false, layer.isActivated(), 0, false);
        } else if (sendsIndex == i && l.isPresent()) {
            final ITrackBank fxTrackBank = this.model.getEffectTrackBank();
            final SendData[] sendData = new SendData[4];
            for (int j = 0; j < 4; j++) {
                final int sendOffset = config.isSendsAreToggled() ? 4 : 0;
                final int sendPos = sendOffset + j;
                final ISend send = l.get().getSendBank().getItem(sendPos);
                final boolean doesExist = send.doesExist();
                sendData[j] = new SendData(fxTrackBank == null ? send.getName() : fxTrackBank.getItem(sendPos).getName(), doesExist && this.isKnobTouched[4 + j] ? send.getDisplayedValue() : "", doesExist ? send.getValue() : 0, doesExist ? send.getModulatedValue() : 0, true);
            }
            display.addSendsElement(topMenu, isTopMenuOn, layer.doesExist() ? layer.getName() : "", ChannelType.LAYER, this.bank.getItem(offset + i).getColor(), layer.isSelected(), sendData, true, l.get().isActivated(), layer.isActivated());
        } else
            display.addChannelSelectorElement(topMenu, isTopMenuOn, bottomMenu, ChannelType.LAYER, bottomMenuColor, isBottomMenuOn, layer.isActivated());
    }
}
Also used : PushConfiguration(de.mossgrabers.controller.ableton.push.PushConfiguration) IChannel(de.mossgrabers.framework.daw.data.IChannel) IValueChanger(de.mossgrabers.framework.controller.valuechanger.IValueChanger) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank) ColorEx(de.mossgrabers.framework.controller.color.ColorEx) ISend(de.mossgrabers.framework.daw.data.ISend) SendData(de.mossgrabers.framework.graphics.canvas.utils.SendData)

Example 39 with ISend

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

the class TrackHandler method getSendValue.

private int getSendValue(final int trackIndex, final int sendIndex) {
    final Optional<ITrack> track = this.getTrack(trackIndex);
    if (track.isEmpty())
        return 0;
    final ISendBank sendBank = track.get().getSendBank();
    if (sendIndex >= sendBank.getPageSize())
        return 0;
    final ISend send = sendBank.getItem(sendIndex);
    if (send == null)
        return 0;
    return send.getValue();
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ISend(de.mossgrabers.framework.daw.data.ISend) ISendBank(de.mossgrabers.framework.daw.data.bank.ISendBank)

Example 40 with ISend

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

the class TrackHandler method changeSendVolume.

private void changeSendVolume(final int trackIndex, final int sendIndex, final KnobMode knobMode, final MidiValue value) {
    final Optional<ITrack> track = this.getTrack(trackIndex);
    if (track.isEmpty())
        return;
    final ISendBank sendBank = track.get().getSendBank();
    if (sendIndex >= sendBank.getPageSize())
        return;
    final ISend send = sendBank.getItem(sendIndex);
    if (send == null)
        return;
    final int val = value.getValue();
    if (isAbsolute(knobMode))
        send.setValue(this.getAbsoluteValueChanger(value), val);
    else
        send.changeValue(this.getRelativeValueChanger(knobMode), val);
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) 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