Search in sources :

Example 26 with ISendBank

use of de.mossgrabers.framework.daw.data.bank.ISendBank 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 27 with ISendBank

use of de.mossgrabers.framework.daw.data.bank.ISendBank 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)

Example 28 with ISendBank

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

the class SendMode method onKnobTouch.

/**
 * {@inheritDoc}
 */
@Override
public void onKnobTouch(final int index, final boolean isTouched) {
    this.isKnobTouched[index] = isTouched;
    final int channel = this.getExtenderOffset() + index;
    final ITrack t = this.getTrackBank().getItem(channel);
    if (!t.doesExist())
        return;
    final ISendBank sendBank = t.getSendBank();
    if (this.sendIndex < sendBank.getPageSize())
        sendBank.getItem(this.sendIndex).touchValue(isTouched);
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ISendBank(de.mossgrabers.framework.daw.data.bank.ISendBank)

Example 29 with ISendBank

use of de.mossgrabers.framework.daw.data.bank.ISendBank 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 ITextDisplay d = this.surface.getTextDisplay().clear();
    final Optional<ITrack> selectedTrack = this.getSelectedTrack();
    if (selectedTrack.isEmpty()) {
        d.notify("Please select a track...");
        return;
    }
    final boolean displayTrackNames = this.surface.getConfiguration().isDisplayTrackNames();
    if (!displayTrackNames) {
        d.setCell(0, 0, "Volume");
        d.setCell(0, 1, "Pan");
    }
    final ITrack t = selectedTrack.get();
    d.setCell(1, 0, t.getVolumeStr(6));
    d.setCell(1, 1, t.getPanStr(6));
    final int sendStart = 2;
    final int sendCount = 6;
    final boolean isEffectTrackBankActive = this.model.isEffectTrackBankActive();
    final ISendBank sendBank = t.getSendBank();
    for (int i = 0; i < sendCount; i++) {
        final int pos = sendStart + i;
        if (!isEffectTrackBankActive && i < sendBank.getItemCount()) {
            final ISend send = sendBank.getItem(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) ITextDisplay(de.mossgrabers.framework.controller.display.ITextDisplay) ISend(de.mossgrabers.framework.daw.data.ISend) ISendBank(de.mossgrabers.framework.daw.data.bank.ISendBank)

Example 30 with ISendBank

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

the class TrackMode method updateKnobLEDs.

/**
 * {@inheritDoc}
 */
@Override
public void updateKnobLEDs() {
    final int upperBound = this.model.getValueChanger().getUpperBound();
    final Optional<ITrack> t = this.getSelectedTrack();
    if (t.isEmpty()) {
        for (int i = 0; i < 8; i++) this.surface.setKnobLED(i, MCUControlSurface.KNOB_LED_MODE_WRAP, 0, upperBound);
        return;
    }
    final ITrack track = t.get();
    this.surface.setKnobLED(0, MCUControlSurface.KNOB_LED_MODE_WRAP, track.getVolume(), upperBound);
    this.surface.setKnobLED(1, MCUControlSurface.KNOB_LED_MODE_BOOST_CUT, track.getPan(), upperBound);
    final int start = 2;
    final int end = 6;
    final boolean isEffectTrackBankActive = this.model.isEffectTrackBankActive();
    final ISendBank sendBank = track.getSendBank();
    for (int i = 0; i < end; i++) {
        final int value;
        if (!isEffectTrackBankActive && i < sendBank.getItemCount())
            value = sendBank.getItem(i).getValue();
        else
            value = 0;
        this.surface.setKnobLED(start + i, MCUControlSurface.KNOB_LED_MODE_WRAP, value, upperBound);
    }
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) 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