Search in sources :

Example 1 with ISend

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

the class ChannelImpl method enableObservers.

/**
 * {@inheritDoc}
 */
@Override
public void enableObservers(final boolean enable) {
    this.channel.exists().setIsSubscribed(enable);
    this.channel.name().setIsSubscribed(enable);
    this.channel.isActivated().setIsSubscribed(enable);
    this.channel.mute().setIsSubscribed(enable);
    this.channel.solo().setIsSubscribed(enable);
    this.channel.color().setIsSubscribed(enable);
    this.volumeParameter.enableObservers(enable);
    this.panParameter.enableObservers(enable);
    for (final ISend send : this.sends) send.enableObservers(enable);
}
Also used : ISend(de.mossgrabers.framework.daw.data.ISend)

Example 2 with ISend

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

the class SendsView method drawGrid.

/**
 * {@inheritDoc}
 */
@Override
public void drawGrid() {
    final ColorManager cm = this.model.getColorManager();
    final IChannelBank tb = this.model.getCurrentTrackBank();
    final IMidiOutput output = this.surface.getOutput();
    for (int i = 0; i < 8; i++) {
        final ITrack track = tb.getTrack(i);
        final ISend send = track.getSend(this.selectedSend);
        final int color = cm.getColor(BitwigColors.getColorIndex(track.getColor()));
        if (this.trackColors[i] != color || !track.doesExist() || send.getName().isEmpty())
            this.setupFader(i);
        this.trackColors[i] = color;
        output.sendCC(LaunchpadControlSurface.LAUNCHPAD_FADER_1 + i, send.getValue());
    }
}
Also used : IMidiOutput(de.mossgrabers.framework.daw.midi.IMidiOutput) ITrack(de.mossgrabers.framework.daw.data.ITrack) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) ISend(de.mossgrabers.framework.daw.data.ISend) ColorManager(de.mossgrabers.framework.controller.color.ColorManager)

Example 3 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() {
    if (!this.surface.getConfiguration().hasDisplay1())
        return;
    this.drawDisplay2();
    if (!this.drawTrackHeader())
        return;
    final Display d = this.surface.getDisplay().clear();
    final IChannelBank currentTrackBank = this.model.getCurrentTrackBank();
    final ITrack selectedTrack = currentTrackBank.getSelectedTrack();
    if (selectedTrack == null) {
        d.notify("Please select a track...", true, false);
        return;
    }
    final MCUConfiguration config = this.surface.getConfiguration();
    final boolean displayTrackNames = this.surface.getConfiguration().isDisplayTrackNames();
    if (!displayTrackNames) {
        d.setCell(0, 0, "Volume");
        d.setCell(0, 1, "Pan");
    }
    d.setCell(1, 0, selectedTrack.getVolumeStr(6));
    d.setCell(1, 1, selectedTrack.getPanStr(6));
    int sendStart = 2;
    int sendCount = 6;
    if (config.isDisplayCrossfader()) {
        sendStart = 3;
        sendCount = 5;
        final String crossfadeMode = selectedTrack.getCrossfadeMode();
        if (!displayTrackNames)
            d.setCell(0, 2, "Crossfade");
        d.setCell(1, 2, "A".equals(crossfadeMode) ? "A" : "B".equals(crossfadeMode) ? "     B" : "  <>  ");
    }
    final boolean isEffectTrackBankActive = this.model.isEffectTrackBankActive();
    for (int i = 0; i < sendCount; i++) {
        final int pos = sendStart + i;
        if (!isEffectTrackBankActive) {
            final ISend send = selectedTrack.getSend(i);
            if (send.doesExist()) {
                if (!displayTrackNames)
                    d.setCell(0, pos, StringUtils.fixASCII(send.getName()));
                d.setCell(1, pos, send.getDisplayedValue(6));
            }
        }
    }
    if (!displayTrackNames)
        d.done(0);
    d.done(1);
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) MCUConfiguration(de.mossgrabers.mcu.MCUConfiguration) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) ISend(de.mossgrabers.framework.daw.data.ISend) Display(de.mossgrabers.framework.controller.display.Display)

Example 4 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 DisplayMessage message, final ICursorDevice cd, final IChannel l) {
    final int sendIndex = this.getCurrentSendIndex();
    final IChannelBank fxTrackBank = this.model.getEffectTrackBank();
    this.updateMenu();
    final PushConfiguration config = this.surface.getConfiguration();
    // Drum Pad Bank has size of 16, layers only 8
    final int offset = getDrumPadIndex(cd);
    final int sendOffset = config.isSendsAreToggled() ? 4 : 0;
    for (int i = 0; i < 8; i++) {
        final IChannel layer = cd.getLayerOrDrumPad(offset + i);
        // The menu item
        String topMenu;
        boolean topMenuSelected;
        if (config.isMuteLongPressed() || config.isMuteSoloLocked() && config.isMuteState()) {
            topMenu = layer.doesExist() ? "Mute" : "";
            topMenuSelected = layer.isMute();
        } else if (config.isSoloLongPressed() || config.isMuteSoloLocked() && config.isSoloState()) {
            topMenu = layer.doesExist() ? "Solo" : "";
            topMenuSelected = layer.isSolo();
        } else {
            topMenu = this.menu[i];
            topMenuSelected = i > 3 && i - 4 + sendOffset == sendIndex;
        }
        // Channel info
        final String[] sendName = new String[4];
        final String[] valueStr = new String[4];
        final int[] value = new int[4];
        final int[] modulatedValue = new int[4];
        final boolean[] selected = new boolean[4];
        for (int j = 0; j < 4; j++) {
            final int sendPos = sendOffset + j;
            final ISend send = layer.getSend(sendPos);
            sendName[j] = fxTrackBank == null ? send.getName() : fxTrackBank.getTrack(sendPos).getName();
            valueStr[j] = send.doesExist() && sendIndex == sendPos && this.isKnobTouched[i] ? send.getDisplayedValue() : "";
            value[j] = send.doesExist() ? send.getValue() : 0;
            modulatedValue[j] = send.doesExist() ? send.getModulatedValue() : 0;
            selected[j] = sendIndex == sendPos;
        }
        message.addSendsElement(topMenu, topMenuSelected, layer.doesExist() ? layer.getName() : "", ChannelType.LAYER, cd.getLayerOrDrumPad(offset + i).getColor(), layer.isSelected(), sendName, valueStr, value, modulatedValue, selected, false);
    }
}
Also used : PushConfiguration(de.mossgrabers.push.PushConfiguration) IChannel(de.mossgrabers.framework.daw.data.IChannel) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) ISend(de.mossgrabers.framework.daw.data.ISend)

Example 5 with ISend

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

the class SendMode method updateDisplay1.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay1() {
    final Display d = this.surface.getDisplay();
    final int sendIndex = this.getCurrentSendIndex();
    final IChannelBank tb = this.model.getCurrentTrackBank();
    for (int i = 0; i < 8; i++) {
        final ITrack t = tb.getTrack(i);
        if (t.doesExist()) {
            final ISend send = t.getSend(sendIndex);
            d.setCell(0, i, send.getName());
            d.setCell(1, i, send.getDisplayedValue(8));
            d.setCell(2, i, send.getValue(), Format.FORMAT_VALUE);
        } else
            d.clearColumn(i);
    }
    d.done(0).done(1).done(2);
    this.drawRow4();
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) ISend(de.mossgrabers.framework.daw.data.ISend) Display(de.mossgrabers.framework.controller.display.Display) PushDisplay(de.mossgrabers.push.controller.PushDisplay)

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