Search in sources :

Example 16 with ISendBank

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

the class TrackMode method onKnobTouch.

/**
 * {@inheritDoc}
 */
@Override
public void onKnobTouch(final int index, final boolean isTouched) {
    final Optional<ITrack> track = this.model.getCurrentTrackBank().getSelectedItem();
    if (track.isEmpty())
        return;
    final ITrack t = track.get();
    switch(index) {
        case 0:
            if (isTouched && this.surface.isDeletePressed())
                t.resetVolume();
            t.touchVolume(isTouched);
            break;
        case 1:
            if (isTouched && this.surface.isDeletePressed())
                t.resetPan();
            t.touchPan(isTouched);
            break;
        default:
            final ISendBank sendBank = t.getSendBank();
            if (!sendBank.hasExistingItems())
                return;
            final ISend item = sendBank.getItem(index - 2);
            if (isTouched && this.surface.isDeletePressed())
                item.resetValue();
            item.touchValue(isTouched);
            break;
    }
}
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 17 with ISendBank

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

the class TrackMode method onKnobValue.

/**
 * {@inheritDoc}
 */
@Override
public void onKnobValue(final int index, final int value) {
    final Optional<ITrack> track = this.model.getCurrentTrackBank().getSelectedItem();
    if (track.isEmpty())
        return;
    final ITrack t = track.get();
    switch(index) {
        case 0:
            if (this.isAbsolute)
                t.setVolume(value);
            else
                t.changeVolume(value);
            break;
        case 1:
            if (this.isAbsolute)
                t.setPan(value);
            else
                t.changePan(value);
            break;
        default:
            final ISendBank sendBank = t.getSendBank();
            if (!sendBank.hasExistingItems())
                return;
            final ISend send = sendBank.getItem(index - 2);
            if (this.isAbsolute)
                send.setValue(value);
            else
                send.changeValue(value);
            break;
    }
}
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 18 with ISendBank

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

the class TrackMode method getKnobValue.

/**
 * {@inheritDoc}
 */
@Override
public int getKnobValue(final int index) {
    final Optional<ITrack> track = this.model.getCurrentTrackBank().getSelectedItem();
    if (track.isEmpty())
        return -1;
    final ITrack t = track.get();
    switch(index) {
        case 0:
            return t.getVolume();
        case 1:
            return t.getPan();
        default:
            final ISendBank sendBank = t.getSendBank();
            if (!sendBank.hasExistingItems())
                return 0;
            return sendBank.getItem(index - 2).getValue();
    }
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ISendBank(de.mossgrabers.framework.daw.data.bank.ISendBank)

Example 19 with ISendBank

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

the class SendLayerOrDrumPadParameterProvider method get.

/**
 * {@inheritDoc}
 */
@Override
public IParameter get(final int index) {
    if (this.sendIndex == -1) {
        final Optional<? extends IChannel> channel = this.bank.getSelectedItem();
        if (channel.isEmpty())
            return EmptyParameter.INSTANCE;
        final ISendBank sendBank = channel.get().getSendBank();
        return sendBank.getItemCount() > 0 ? sendBank.getItem(index) : EmptyParameter.INSTANCE;
    }
    final ISendBank sendBank = this.bank.getItem(index).getSendBank();
    return sendBank.getItemCount() == 0 ? EmptyParameter.INSTANCE : sendBank.getItem(this.sendIndex);
}
Also used : ISendBank(de.mossgrabers.framework.daw.data.bank.ISendBank)

Example 20 with ISendBank

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

the class MaschineSendSelectCommand method executeNormal.

/**
 * {@inheritDoc}
 */
@Override
public void executeNormal(final ButtonEvent event) {
    final ModeManager modeManager = this.surface.getModeManager();
    final Modes activeMode = modeManager.getActiveID();
    super.executeNormal(event);
    final Modes newMode = modeManager.getActiveID();
    if (activeMode == newMode)
        return;
    final int sendIndex = newMode.ordinal() - Modes.SEND1.ordinal();
    final Optional<ITrack> t = this.model.getCurrentTrackBank().getSelectedItem();
    if (t.isEmpty())
        return;
    final ISendBank sendBank = t.get().getSendBank();
    final ISend send = sendBank.getItem(sendIndex);
    if (send.doesExist())
        this.surface.getDisplay().notify("Send " + (sendIndex + 1) + ": " + send.getName());
}
Also used : Modes(de.mossgrabers.framework.mode.Modes) ITrack(de.mossgrabers.framework.daw.data.ITrack) ISend(de.mossgrabers.framework.daw.data.ISend) ISendBank(de.mossgrabers.framework.daw.data.bank.ISendBank) ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

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