Search in sources :

Example 51 with ISend

use of de.mossgrabers.framework.daw.data.ISend 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 52 with ISend

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

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