Search in sources :

Example 1 with IChannelBank

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

the class ShiftView method updateSceneButtons.

/**
 * {@inheritDoc}
 */
@Override
public void updateSceneButtons() {
    // Draw the track states on the scene buttons
    final int trackState = this.surface.getTrackState();
    this.surface.updateButton(APCminiControlSurface.APC_BUTTON_SCENE_BUTTON1, trackState == APCminiControlSurface.TRACK_STATE_CLIP_STOP ? APCminiControlSurface.APC_BUTTON_STATE_ON : APCminiControlSurface.APC_BUTTON_STATE_OFF);
    this.surface.updateButton(APCminiControlSurface.APC_BUTTON_SCENE_BUTTON2, trackState == APCminiControlSurface.TRACK_STATE_SOLO ? APCminiControlSurface.APC_BUTTON_STATE_ON : APCminiControlSurface.APC_BUTTON_STATE_OFF);
    this.surface.updateButton(APCminiControlSurface.APC_BUTTON_SCENE_BUTTON3, trackState == APCminiControlSurface.TRACK_STATE_REC_ARM ? APCminiControlSurface.APC_BUTTON_STATE_ON : APCminiControlSurface.APC_BUTTON_STATE_OFF);
    this.surface.updateButton(APCminiControlSurface.APC_BUTTON_SCENE_BUTTON4, trackState == APCminiControlSurface.TRACK_STATE_MUTE ? APCminiControlSurface.APC_BUTTON_STATE_ON : APCminiControlSurface.APC_BUTTON_STATE_OFF);
    this.surface.updateButton(APCminiControlSurface.APC_BUTTON_SCENE_BUTTON5, trackState == APCminiControlSurface.TRACK_STATE_SELECT ? APCminiControlSurface.APC_BUTTON_STATE_ON : APCminiControlSurface.APC_BUTTON_STATE_OFF);
    this.surface.updateButton(APCminiControlSurface.APC_BUTTON_SCENE_BUTTON6, this.model.isEffectTrackBankActive() ? APCminiControlSurface.APC_BUTTON_STATE_ON : APCminiControlSurface.APC_BUTTON_STATE_OFF);
    this.surface.updateButton(APCminiControlSurface.APC_BUTTON_SCENE_BUTTON7, APCminiControlSurface.APC_BUTTON_STATE_OFF);
    this.surface.updateButton(APCminiControlSurface.APC_BUTTON_SCENE_BUTTON8, APCminiControlSurface.APC_BUTTON_STATE_OFF);
    final IChannelBank tb = this.model.getCurrentTrackBank();
    this.surface.updateButton(APCminiControlSurface.APC_BUTTON_TRACK_BUTTON1, tb.canScrollScenesUp() ? APCminiControlSurface.APC_BUTTON_STATE_ON : APCminiControlSurface.APC_BUTTON_STATE_OFF);
    this.surface.updateButton(APCminiControlSurface.APC_BUTTON_TRACK_BUTTON2, tb.canScrollScenesDown() ? APCminiControlSurface.APC_BUTTON_STATE_ON : APCminiControlSurface.APC_BUTTON_STATE_OFF);
    this.surface.updateButton(APCminiControlSurface.APC_BUTTON_TRACK_BUTTON3, tb.canScrollTracksUp() ? APCminiControlSurface.APC_BUTTON_STATE_ON : APCminiControlSurface.APC_BUTTON_STATE_OFF);
    this.surface.updateButton(APCminiControlSurface.APC_BUTTON_TRACK_BUTTON4, tb.canScrollTracksDown() ? APCminiControlSurface.APC_BUTTON_STATE_ON : APCminiControlSurface.APC_BUTTON_STATE_OFF);
    final Integer mode = this.surface.getModeManager().getActiveModeId();
    this.surface.updateButton(APCminiControlSurface.APC_BUTTON_TRACK_BUTTON5, Modes.MODE_VOLUME.equals(mode) ? APCminiControlSurface.APC_BUTTON_STATE_ON : APCminiControlSurface.APC_BUTTON_STATE_OFF);
    this.surface.updateButton(APCminiControlSurface.APC_BUTTON_TRACK_BUTTON6, Modes.MODE_PAN.equals(mode) ? APCminiControlSurface.APC_BUTTON_STATE_ON : APCminiControlSurface.APC_BUTTON_STATE_OFF);
    this.surface.updateButton(APCminiControlSurface.APC_BUTTON_TRACK_BUTTON7, Modes.isSendMode(mode) ? APCminiControlSurface.APC_BUTTON_STATE_ON : APCminiControlSurface.APC_BUTTON_STATE_OFF);
    this.surface.updateButton(APCminiControlSurface.APC_BUTTON_TRACK_BUTTON8, Modes.MODE_DEVICE.equals(mode) ? APCminiControlSurface.APC_BUTTON_STATE_ON : APCminiControlSurface.APC_BUTTON_STATE_OFF);
}
Also used : IChannelBank(de.mossgrabers.framework.daw.IChannelBank)

Example 2 with IChannelBank

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

the class TrackButtons method updateTrackButtons.

/**
 * Update track button LEDs.
 */
public void updateTrackButtons() {
    final IChannelBank tb = this.model.getCurrentTrackBank();
    final int trackState = this.surface.getTrackState();
    for (int i = 0; i < 8; i++) {
        switch(trackState) {
            case APCminiControlSurface.TRACK_STATE_CLIP_STOP:
                this.surface.updateButton(APCminiControlSurface.APC_BUTTON_TRACK_BUTTON1 + i, this.surface.isPressed(APCminiControlSurface.APC_BUTTON_TRACK_BUTTON1 + i) ? APCminiControlSurface.APC_BUTTON_STATE_ON : APCminiControlSurface.APC_BUTTON_STATE_OFF);
                break;
            case APCminiControlSurface.TRACK_STATE_SOLO:
                this.surface.updateButton(APCminiControlSurface.APC_BUTTON_TRACK_BUTTON1 + i, tb.getTrack(i).isSolo() ? APCminiControlSurface.APC_BUTTON_STATE_ON : APCminiControlSurface.APC_BUTTON_STATE_OFF);
                break;
            case APCminiControlSurface.TRACK_STATE_REC_ARM:
                this.surface.updateButton(APCminiControlSurface.APC_BUTTON_TRACK_BUTTON1 + i, tb.getTrack(i).isRecArm() ? APCminiControlSurface.APC_BUTTON_STATE_ON : APCminiControlSurface.APC_BUTTON_STATE_OFF);
                break;
            case APCminiControlSurface.TRACK_STATE_MUTE:
                this.surface.updateButton(APCminiControlSurface.APC_BUTTON_TRACK_BUTTON1 + i, !tb.getTrack(i).isMute() ? APCminiControlSurface.APC_BUTTON_STATE_ON : APCminiControlSurface.APC_BUTTON_STATE_OFF);
                break;
            case APCminiControlSurface.TRACK_STATE_SELECT:
                this.surface.updateButton(APCminiControlSurface.APC_BUTTON_TRACK_BUTTON1 + i, tb.getTrack(i).isSelected() ? APCminiControlSurface.APC_BUTTON_STATE_ON : APCminiControlSurface.APC_BUTTON_STATE_OFF);
                break;
        }
    }
}
Also used : IChannelBank(de.mossgrabers.framework.daw.IChannelBank)

Example 3 with IChannelBank

use of de.mossgrabers.framework.daw.IChannelBank 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 4 with IChannelBank

use of de.mossgrabers.framework.daw.IChannelBank 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 5 with IChannelBank

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

the class TrackView method drawGrid.

/**
 * {@inheritDoc}
 */
@Override
public void drawGrid() {
    final IChannelBank tb = this.model.getCurrentTrackBank();
    final PadGrid padGrid = this.surface.getPadGrid();
    for (int i = 0; i < 8; i++) padGrid.light(44 + i, tb.getTrack(i).isSelected() ? BeatstepColors.BEATSTEP_BUTTON_STATE_BLUE : BeatstepColors.BEATSTEP_BUTTON_STATE_OFF);
    final ITrack sel = tb.getSelectedTrack();
    padGrid.light(36, sel != null && sel.isActivated() ? BeatstepColors.BEATSTEP_BUTTON_STATE_RED : BeatstepColors.BEATSTEP_BUTTON_STATE_OFF);
    padGrid.light(37, BeatstepColors.BEATSTEP_BUTTON_STATE_BLUE);
    padGrid.light(38, BeatstepColors.BEATSTEP_BUTTON_STATE_BLUE);
    padGrid.light(39, BeatstepColors.BEATSTEP_BUTTON_STATE_RED);
    padGrid.light(40, BeatstepColors.BEATSTEP_BUTTON_STATE_RED);
    padGrid.light(41, BeatstepColors.BEATSTEP_BUTTON_STATE_OFF);
    padGrid.light(42, BeatstepColors.BEATSTEP_BUTTON_STATE_BLUE);
    padGrid.light(43, BeatstepColors.BEATSTEP_BUTTON_STATE_BLUE);
}
Also used : PadGrid(de.mossgrabers.framework.controller.grid.PadGrid) ITrack(de.mossgrabers.framework.daw.data.ITrack) IChannelBank(de.mossgrabers.framework.daw.IChannelBank)

Aggregations

IChannelBank (de.mossgrabers.framework.daw.IChannelBank)114 ITrack (de.mossgrabers.framework.daw.data.ITrack)92 ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)22 ITrackBank (de.mossgrabers.framework.daw.ITrackBank)20 ModeManager (de.mossgrabers.framework.mode.ModeManager)20 PushConfiguration (de.mossgrabers.push.PushConfiguration)19 Display (de.mossgrabers.framework.controller.display.Display)18 ISend (de.mossgrabers.framework.daw.data.ISend)11 ViewManager (de.mossgrabers.framework.view.ViewManager)10 PushDisplay (de.mossgrabers.push.controller.PushDisplay)10 IChannel (de.mossgrabers.framework.daw.data.IChannel)9 IMasterTrack (de.mossgrabers.framework.daw.data.IMasterTrack)7 ISlot (de.mossgrabers.framework.daw.data.ISlot)7 IValueChanger (de.mossgrabers.framework.controller.IValueChanger)5 View (de.mossgrabers.framework.view.View)5 DisplayMessage (de.mossgrabers.push.controller.DisplayMessage)5 ITransport (de.mossgrabers.framework.daw.ITransport)4 IMidiOutput (de.mossgrabers.framework.daw.midi.IMidiOutput)4 ColorManager (de.mossgrabers.framework.controller.color.ColorManager)3 PadGrid (de.mossgrabers.framework.controller.grid.PadGrid)3