Search in sources :

Example 6 with ISendBank

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

the class SendMode method resetParameter.

/**
 * {@inheritDoc}
 */
@Override
protected void resetParameter(final int index) {
    final int extenderOffset = this.getExtenderOffset();
    final ISendBank sendBank = this.getTrackBank().getItem(extenderOffset + index).getSendBank();
    if (this.sendIndex < sendBank.getPageSize())
        sendBank.getItem(this.sendIndex).resetValue();
}
Also used : ISendBank(de.mossgrabers.framework.daw.data.bank.ISendBank)

Example 7 with ISendBank

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

the class SendMode method updateDisplay.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay() {
    if (!this.surface.getConfiguration().hasDisplay1())
        return;
    if (this.model.isEffectTrackBankActive()) {
        this.surface.getModeManager().setActive(Modes.TRACK);
        return;
    }
    this.drawDisplay2();
    if (!this.drawTrackHeader())
        return;
    final ITextDisplay d = this.surface.getTextDisplay();
    final ITrackBank tb = this.getTrackBank();
    if (!tb.canEditSend(this.sendIndex)) {
        d.notify("Send channel " + (this.sendIndex + 1) + " does not exist.");
        return;
    }
    final int extenderOffset = this.getExtenderOffset();
    for (int i = 0; i < 8; i++) {
        final ITrack t = tb.getItem(extenderOffset + i);
        final ISendBank sendBank = t.getSendBank();
        d.setCell(1, i, this.sendIndex < sendBank.getPageSize() ? sendBank.getItem(this.sendIndex).getDisplayedValue(6) : "");
    }
    d.done(1);
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank) ITextDisplay(de.mossgrabers.framework.controller.display.ITextDisplay) ISendBank(de.mossgrabers.framework.daw.data.bank.ISendBank)

Example 8 with ISendBank

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

the class SendMode method updateKnobLEDs.

/**
 * {@inheritDoc}
 */
@Override
public void updateKnobLEDs() {
    final ITrackBank tb = this.getTrackBank();
    if (this.model.isEffectTrackBankActive()) {
        this.surface.getModeManager().setActive(Modes.TRACK);
        return;
    }
    final int upperBound = this.model.getValueChanger().getUpperBound();
    final int extenderOffset = this.getExtenderOffset();
    for (int i = 0; i < 8; i++) {
        final ITrack t = tb.getItem(extenderOffset + i);
        final ISendBank sendBank = t.getSendBank();
        this.surface.setKnobLED(i, MCUControlSurface.KNOB_LED_MODE_WRAP, this.sendIndex < sendBank.getPageSize() ? sendBank.getItem(this.sendIndex).getValue() : 0, upperBound);
    }
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank) ISendBank(de.mossgrabers.framework.daw.data.bank.ISendBank)

Example 9 with ISendBank

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

the class SendMode method drawTrackHeader.

/**
 * {@inheritDoc}
 */
@Override
protected boolean drawTrackHeader() {
    if (this.model.isEffectTrackBankActive()) {
        this.surface.getModeManager().setActive(Modes.TRACK);
        return true;
    }
    if (!super.drawTrackHeader())
        return false;
    if (this.surface.getConfiguration().isDisplayTrackNames())
        return true;
    final ITextDisplay d = this.surface.getTextDisplay();
    final ITrackBank tb = this.getTrackBank();
    final int extenderOffset = this.getExtenderOffset();
    for (int i = 0; i < 8; i++) {
        final ITrack t = tb.getItem(extenderOffset + i);
        if (t.doesExist()) {
            final ISendBank sendBank = t.getSendBank();
            d.setCell(0, i, StringUtils.shortenAndFixASCII(this.sendIndex < sendBank.getPageSize() ? sendBank.getItem(this.sendIndex).getName(6) : "", 6));
        } else
            d.clearCell(0, i);
    }
    d.done(0);
    return true;
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank) ITextDisplay(de.mossgrabers.framework.controller.display.ITextDisplay) ISendBank(de.mossgrabers.framework.daw.data.bank.ISendBank)

Example 10 with ISendBank

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

the class SendMode method updateDisplay.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay() {
    final IValueChanger valueChanger = this.model.getValueChanger();
    final Optional<ITrack> selectedTrack = this.bank.getSelectedItem();
    final ISendBank sendBank = selectedTrack.isEmpty() ? null : selectedTrack.get().getSendBank();
    final int[] vuData = new int[16];
    for (int i = 0; i < 8; i++) {
        final ISend send = sendBank == null ? EmptySend.INSTANCE : sendBank.getItem(i);
        this.surface.sendKontrolTrackSysEx(KontrolProtocolControlSurface.KONTROL_TRACK_AVAILABLE, send.doesExist() ? TrackType.RETURN_BUS : TrackType.EMPTY, i);
        this.surface.sendKontrolTrackSysEx(KontrolProtocolControlSurface.KONTROL_TRACK_SELECTED, send.isSelected() ? 1 : 0, i);
        this.surface.sendKontrolTrackSysEx(KontrolProtocolControlSurface.KONTROL_TRACK_RECARM, 0, i);
        this.surface.sendKontrolTrackSysEx(KontrolProtocolControlSurface.KONTROL_TRACK_VOLUME_TEXT, 0, i, send.getDisplayedValue(8));
        this.surface.sendKontrolTrackSysEx(KontrolProtocolControlSurface.KONTROL_TRACK_PAN_TEXT, 0, i, send.getDisplayedValue(8));
        final String n = selectedTrack.isPresent() ? getName(selectedTrack.get(), send) : "";
        this.surface.sendKontrolTrackSysEx(KontrolProtocolControlSurface.KONTROL_TRACK_NAME, 0, i, n);
        final int j = 2 * i;
        vuData[j] = valueChanger.toMidiValue(send.getModulatedValue());
        vuData[j + 1] = valueChanger.toMidiValue(send.getModulatedValue());
    }
    this.surface.sendKontrolTrackSysEx(KontrolProtocolControlSurface.KONTROL_TRACK_VU, 2, 0, vuData);
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) IValueChanger(de.mossgrabers.framework.controller.valuechanger.IValueChanger) ISend(de.mossgrabers.framework.daw.data.ISend) ISendBank(de.mossgrabers.framework.daw.data.bank.ISendBank)

Aggregations

ISendBank (de.mossgrabers.framework.daw.data.bank.ISendBank)31 ITrack (de.mossgrabers.framework.daw.data.ITrack)25 ISend (de.mossgrabers.framework.daw.data.ISend)17 ITrackBank (de.mossgrabers.framework.daw.data.bank.ITrackBank)8 IGraphicDisplay (de.mossgrabers.framework.controller.display.IGraphicDisplay)4 ITextDisplay (de.mossgrabers.framework.controller.display.ITextDisplay)4 IChannel (de.mossgrabers.framework.daw.data.IChannel)3 ILayer (de.mossgrabers.framework.daw.data.ILayer)3 TitleChannelsComponent (de.mossgrabers.controller.akai.fire.graphics.canvas.component.TitleChannelsComponent)2 TitleValueComponent (de.mossgrabers.controller.akai.fire.graphics.canvas.component.TitleValueComponent)2 IValueChanger (de.mossgrabers.framework.controller.valuechanger.IValueChanger)2 IMasterTrack (de.mossgrabers.framework.daw.data.IMasterTrack)2 ISpecificDevice (de.mossgrabers.framework.daw.data.ISpecificDevice)2 IParameterBank (de.mossgrabers.framework.daw.data.bank.IParameterBank)2 ModeManager (de.mossgrabers.framework.featuregroup.ModeManager)2 Modes (de.mossgrabers.framework.mode.Modes)2 PushConfiguration (de.mossgrabers.controller.ableton.push.PushConfiguration)1 BeatstepControlSurface (de.mossgrabers.controller.arturia.beatstep.controller.BeatstepControlSurface)1 FlexiCommand (de.mossgrabers.controller.generic.controller.FlexiCommand)1 Kontrol1Display (de.mossgrabers.controller.ni.kontrol.mki.controller.Kontrol1Display)1