Search in sources :

Example 1 with ITrackBank

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

the class APCControllerSetup method createModel.

/**
 * {@inheritDoc}
 */
@Override
protected void createModel() {
    this.model = this.factory.createModel(this.colorManager, this.valueChanger, this.scales, 8, 5, 8, 16, 16, true, -1, -1, -1, -1);
    final ITrackBank trackBank = this.model.getTrackBank();
    trackBank.setIndication(true);
    trackBank.addTrackSelectionObserver(this::handleTrackChange);
}
Also used : ITrackBank(de.mossgrabers.framework.daw.ITrackBank)

Example 2 with ITrackBank

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

the class APCminiControllerSetup method updateIndication.

private void updateIndication(final Integer mode) {
    final ITrackBank tb = this.model.getTrackBank();
    final IChannelBank tbe = this.model.getEffectTrackBank();
    final APCminiControlSurface surface = this.getSurface();
    final ViewManager viewManager = surface.getViewManager();
    final boolean isShiftView = viewManager.isActiveView(Views.VIEW_SHIFT);
    final boolean isSession = viewManager.isActiveView(Views.VIEW_SESSION) || isShiftView;
    final boolean isEffect = this.model.isEffectTrackBankActive();
    final boolean isPan = Modes.MODE_PAN.equals(mode);
    final boolean isDevice = Modes.MODE_DEVICE.equals(mode);
    tb.setIndication(!isEffect && isSession);
    tbe.setIndication(isEffect && isSession);
    final ICursorDevice cursorDevice = this.model.getCursorDevice();
    for (int i = 0; i < 8; i++) {
        final ITrack track = tb.getTrack(i);
        track.setVolumeIndication(!isEffect);
        track.setPanIndication(!isEffect && isPan);
        for (int j = 0; j < 8; j++) track.getSend(j).setIndication(!isEffect && (Modes.MODE_SEND1.equals(mode) && j == 0 || Modes.MODE_SEND2.equals(mode) && j == 1 || Modes.MODE_SEND3.equals(mode) && j == 2 || Modes.MODE_SEND4.equals(mode) && j == 3 || Modes.MODE_SEND5.equals(mode) && j == 4 || Modes.MODE_SEND6.equals(mode) && j == 5 || Modes.MODE_SEND7.equals(mode) && j == 6 || Modes.MODE_SEND8.equals(mode) && j == 7));
        final ITrack fxTrack = tbe.getTrack(i);
        fxTrack.setVolumeIndication(isEffect);
        fxTrack.setPanIndication(isEffect && isPan);
        cursorDevice.indicateParameter(i, isDevice || isShiftView);
    }
}
Also used : APCminiControlSurface(de.mossgrabers.apcmini.controller.APCminiControlSurface) ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.ITrackBank) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) ViewManager(de.mossgrabers.framework.view.ViewManager) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice)

Example 3 with ITrackBank

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

the class TrackEditing method onTrackKnob.

/**
 * A knob is moved for changing a track parameter.
 *
 * @param index The index of the knob
 * @param value The knobs value
 */
public void onTrackKnob(final int index, final int value) {
    if (value == 64)
        return;
    final IChannelBank tb = this.model.getCurrentTrackBank();
    final ITrack selectedTrack = tb.getSelectedTrack();
    if (selectedTrack == null)
        return;
    switch(index) {
        case 0:
            selectedTrack.changeVolume(value);
            break;
        case 1:
            selectedTrack.changePan(value);
            break;
        case 2:
            selectedTrack.setMute(value > 64);
            break;
        case 3:
            selectedTrack.setSolo(value > 64);
            break;
        case 4:
            selectedTrack.changeCrossfadeModeAsNumber(value);
            break;
        case 5:
            this.model.getTransport().changeTempo(value >= 65);
            break;
        case 6:
            this.model.getTransport().changePosition(value >= 65, this.surface.isShiftPressed());
            break;
        case 7:
            this.model.getMasterTrack().changeVolume(value);
            break;
        // Send 1 - 4
        case 8:
        case 9:
        case 10:
        case 11:
            if (tb instanceof ITrackBank)
                selectedTrack.getSend(index - 8).changeValue(value);
            break;
    }
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.ITrackBank) IChannelBank(de.mossgrabers.framework.daw.IChannelBank)

Example 4 with ITrackBank

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

the class TrackView method onKnob.

/**
 * {@inheritDoc}
 */
@Override
public void onKnob(final int index, final int value) {
    if (index < 12) {
        this.extensions.onTrackKnob(index, value);
        return;
    }
    final IChannelBank tb = this.model.getCurrentTrackBank();
    final ITrack selectedTrack = tb.getSelectedTrack();
    if (selectedTrack == null)
        return;
    switch(index) {
        // Send 5 - 6
        case 12:
        case 13:
            if (tb instanceof ITrackBank)
                selectedTrack.getSend(index - 8).changeValue(value);
            break;
        case 14:
            // Not used
            break;
        // Crossfader
        case 15:
            this.model.getTransport().changeCrossfade(value);
            break;
    }
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.ITrackBank) IChannelBank(de.mossgrabers.framework.daw.IChannelBank)

Example 5 with ITrackBank

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

the class BeatstepControllerSetup method updateIndication.

private void updateIndication() {
    final BeatstepControlSurface surface = this.getSurface();
    final ViewManager viewManager = surface.getViewManager();
    final boolean isTrack = viewManager.isActiveView(Views.VIEW_TRACK);
    final boolean isDevice = viewManager.isActiveView(Views.VIEW_DEVICE);
    final boolean isSession = viewManager.isActiveView(Views.VIEW_SESSION);
    final IMasterTrack mt = this.model.getMasterTrack();
    mt.setVolumeIndication(!isDevice);
    final ITrackBank tb = this.model.getTrackBank();
    final ITrack selectedTrack = tb.getSelectedTrack();
    final IChannelBank tbe = this.model.getEffectTrackBank();
    final ITrack selectedFXTrack = tbe.getSelectedTrack();
    final ICursorDevice cursorDevice = this.model.getCursorDevice();
    final boolean isEffect = this.model.isEffectTrackBankActive();
    tb.setIndication(!isEffect && isSession);
    tbe.setIndication(isEffect && isSession);
    for (int i = 0; i < 8; i++) {
        final boolean hasTrackSel = selectedTrack != null && selectedTrack.getIndex() == i;
        final ITrack track = tb.getTrack(i);
        track.setVolumeIndication(!isEffect && hasTrackSel && !isDevice);
        track.setPanIndication(!isEffect && hasTrackSel && !isDevice);
        for (int j = 0; j < 6; j++) track.getSend(j).setIndication(!isEffect && hasTrackSel && isTrack);
        final boolean hasFXTrackSel = selectedFXTrack != null && selectedFXTrack.getIndex() == i;
        final ITrack fxTrack = tbe.getTrack(i);
        fxTrack.setVolumeIndication(isEffect && hasFXTrackSel && isTrack);
        fxTrack.setPanIndication(isEffect && hasFXTrackSel && isTrack);
        cursorDevice.indicateParameter(i, isDevice);
    }
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.ITrackBank) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) ViewManager(de.mossgrabers.framework.view.ViewManager) BeatstepControlSurface(de.mossgrabers.beatstep.controller.BeatstepControlSurface) IMasterTrack(de.mossgrabers.framework.daw.data.IMasterTrack) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice)

Aggregations

ITrackBank (de.mossgrabers.framework.daw.ITrackBank)25 IChannelBank (de.mossgrabers.framework.daw.IChannelBank)20 ITrack (de.mossgrabers.framework.daw.data.ITrack)18 ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)7 PushConfiguration (de.mossgrabers.push.PushConfiguration)5 ModeManager (de.mossgrabers.framework.mode.ModeManager)4 ViewManager (de.mossgrabers.framework.view.ViewManager)4 IValueChanger (de.mossgrabers.framework.controller.IValueChanger)3 DisplayMessage (de.mossgrabers.push.controller.DisplayMessage)3 PushDisplay (de.mossgrabers.push.controller.PushDisplay)3 IMasterTrack (de.mossgrabers.framework.daw.data.IMasterTrack)2 ISend (de.mossgrabers.framework.daw.data.ISend)2 PushControlSurface (de.mossgrabers.push.controller.PushControlSurface)2 APCControlSurface (de.mossgrabers.apc.controller.APCControlSurface)1 APCminiControlSurface (de.mossgrabers.apcmini.controller.APCminiControlSurface)1 BeatstepControlSurface (de.mossgrabers.beatstep.controller.BeatstepControlSurface)1 IApplication (de.mossgrabers.framework.daw.IApplication)1 ISlot (de.mossgrabers.framework.daw.data.ISlot)1 SceneView (de.mossgrabers.framework.view.SceneView)1 View (de.mossgrabers.framework.view.View)1