Search in sources :

Example 21 with ITransport

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

the class LoopLengthMode method updateDisplay.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay() {
    final ITextDisplay d = this.surface.getTextDisplay().clear();
    final ITransport transport = this.model.getTransport();
    d.setBlock(0, 0, "Arranger Loop");
    d.setBlock(0, 2, "Start:").setBlock(0, 3, "  " + transport.getLoopStartBeatText());
    d.setBlock(1, 2, "Length:").setBlock(1, 3, "> " + transport.getLoopLengthBeatText());
    d.allDone();
}
Also used : ITransport(de.mossgrabers.framework.daw.ITransport) ITextDisplay(de.mossgrabers.framework.controller.display.ITextDisplay)

Example 22 with ITransport

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

the class PushControllerSetup method updateButtons.

private void updateButtons() {
    final ITransport t = this.model.getTransport();
    final PushControlSurface surface = this.getSurface();
    surface.updateButton(PushControlSurface.PUSH_BUTTON_METRONOME, t.isMetronomeOn() ? ColorManager.BUTTON_STATE_HI : ColorManager.BUTTON_STATE_ON);
    surface.updateButton(PushControlSurface.PUSH_BUTTON_PLAY, t.isPlaying() ? PushColors.PUSH_BUTTON_STATE_PLAY_HI : PushColors.PUSH_BUTTON_STATE_PLAY_ON);
    final boolean isShift = surface.isShiftPressed();
    final boolean isFlipRecord = this.configuration.isFlipRecord();
    final boolean isRecordShifted = isShift && !isFlipRecord || !isShift && isFlipRecord;
    if (isRecordShifted)
        surface.updateButton(PushControlSurface.PUSH_BUTTON_AUTOMATION, t.isWritingClipLauncherAutomation() ? PushColors.PUSH_BUTTON_STATE_REC_HI : PushColors.PUSH_BUTTON_STATE_REC_ON);
    else
        surface.updateButton(PushControlSurface.PUSH_BUTTON_AUTOMATION, t.isWritingArrangerAutomation() ? PushColors.PUSH_BUTTON_STATE_REC_HI : PushColors.PUSH_BUTTON_STATE_REC_ON);
    surface.updateButton(PushControlSurface.PUSH_BUTTON_RECORD, isRecordShifted ? t.isLauncherOverdub() ? PushColors.PUSH_BUTTON_STATE_OVR_HI : PushColors.PUSH_BUTTON_STATE_OVR_ON : t.isRecording() ? PushColors.PUSH_BUTTON_STATE_REC_HI : PushColors.PUSH_BUTTON_STATE_REC_ON);
    surface.updateButton(PushControlSurface.PUSH_BUTTON_ACCENT, this.configuration.isAccentActive() ? ColorManager.BUTTON_STATE_HI : ColorManager.BUTTON_STATE_ON);
    final PushConfiguration config = surface.getConfiguration();
    if (this.isPush2) {
        final ModeManager modeManager = surface.getModeManager();
        if (modeManager.isActiveMode(Modes.MODE_DEVICE_LAYER)) {
            final ICursorDevice cd = this.model.getCursorDevice();
            final IChannel layer = cd.getSelectedLayerOrDrumPad();
            surface.updateButton(PushControlSurface.PUSH_BUTTON_MUTE, layer != null && layer.isMute() ? PushColors.PUSH_BUTTON_STATE_MUTE_HI : PushColors.PUSH_BUTTON_STATE_MUTE_ON);
            surface.updateButton(PushControlSurface.PUSH_BUTTON_SOLO, layer != null && layer.isSolo() ? PushColors.PUSH_BUTTON_STATE_SOLO_HI : PushColors.PUSH_BUTTON_STATE_SOLO_ON);
        } else {
            final IChannelBank tb = this.model.getCurrentTrackBank();
            final ITrack selTrack = modeManager.isActiveMode(Modes.MODE_MASTER) ? this.model.getMasterTrack() : tb.getSelectedTrack();
            surface.updateButton(PushControlSurface.PUSH_BUTTON_MUTE, selTrack != null && selTrack.isMute() ? PushColors.PUSH_BUTTON_STATE_MUTE_HI : PushColors.PUSH_BUTTON_STATE_MUTE_ON);
            surface.updateButton(PushControlSurface.PUSH_BUTTON_SOLO, selTrack != null && selTrack.isSolo() ? PushColors.PUSH_BUTTON_STATE_SOLO_HI : PushColors.PUSH_BUTTON_STATE_SOLO_ON);
        }
        surface.updateButton(PushControlSurface.PUSH_BUTTON_CONVERT, this.model.canConvertClip() ? ColorManager.BUTTON_STATE_ON : ColorManager.BUTTON_STATE_OFF);
    } else {
        final boolean isMuteState = config.isMuteState();
        surface.updateButton(PushControlSurface.PUSH_BUTTON_MUTE, isMuteState ? PushColors.PUSH_BUTTON_STATE_MUTE_HI : PushColors.PUSH_BUTTON_STATE_MUTE_ON);
        surface.updateButton(PushControlSurface.PUSH_BUTTON_SOLO, !isMuteState ? PushColors.PUSH_BUTTON_STATE_SOLO_HI : PushColors.PUSH_BUTTON_STATE_SOLO_ON);
    }
    final ViewManager viewManager = surface.getViewManager();
    final boolean isSessionView = Views.isSessionView(viewManager.getActiveViewId());
    surface.updateButton(PushControlSurface.PUSH_BUTTON_NOTE, isSessionView ? ColorManager.BUTTON_STATE_ON : ColorManager.BUTTON_STATE_HI);
    if (this.host.hasClips()) {
        surface.updateButton(PushControlSurface.PUSH_BUTTON_CLIP_STOP, surface.isPressed(PushControlSurface.PUSH_BUTTON_CLIP_STOP) ? PushColors.PUSH_BUTTON_STATE_STOP_HI : PushColors.PUSH_BUTTON_STATE_STOP_ON);
        surface.updateButton(PushControlSurface.PUSH_BUTTON_SESSION, isSessionView ? ColorManager.BUTTON_STATE_HI : ColorManager.BUTTON_STATE_ON);
    } else {
        surface.updateButton(PushControlSurface.PUSH_BUTTON_CLIP_STOP, ColorManager.BUTTON_STATE_OFF);
        surface.updateButton(PushControlSurface.PUSH_BUTTON_SESSION, ColorManager.BUTTON_STATE_OFF);
    }
    surface.updateButton(PushControlSurface.PUSH_BUTTON_ACCENT, config.isAccentActive() ? ColorManager.BUTTON_STATE_HI : ColorManager.BUTTON_STATE_ON);
    final View activeView = viewManager.getActiveView();
    if (activeView != null) {
        ((PushCursorCommand) activeView.getTriggerCommand(Commands.COMMAND_ARROW_DOWN)).updateArrows();
        ((SceneView) activeView).updateSceneButtons();
    }
    final ICursorClip clip = activeView instanceof AbstractSequencerView && !(activeView instanceof ClipView) ? ((AbstractSequencerView<?, ?>) activeView).getClip() : null;
    surface.updateButton(PushControlSurface.PUSH_BUTTON_DEVICE_LEFT, clip != null && clip.canScrollStepsBackwards() ? ColorManager.BUTTON_STATE_ON : ColorManager.BUTTON_STATE_OFF);
    surface.updateButton(PushControlSurface.PUSH_BUTTON_DEVICE_RIGHT, clip != null && clip.canScrollStepsForwards() ? ColorManager.BUTTON_STATE_ON : ColorManager.BUTTON_STATE_OFF);
}
Also used : IChannel(de.mossgrabers.framework.daw.data.IChannel) ITrack(de.mossgrabers.framework.daw.data.ITrack) ITransport(de.mossgrabers.framework.daw.ITransport) ViewManager(de.mossgrabers.framework.view.ViewManager) ColorView(de.mossgrabers.push.view.ColorView) PlayView(de.mossgrabers.push.view.PlayView) SequencerView(de.mossgrabers.push.view.SequencerView) ScenePlayView(de.mossgrabers.push.view.ScenePlayView) DrumView(de.mossgrabers.push.view.DrumView) SceneView(de.mossgrabers.framework.view.SceneView) View(de.mossgrabers.framework.view.View) ClipView(de.mossgrabers.push.view.ClipView) AbstractSequencerView(de.mossgrabers.framework.view.AbstractSequencerView) PrgChangeView(de.mossgrabers.push.view.PrgChangeView) PianoView(de.mossgrabers.push.view.PianoView) SessionView(de.mossgrabers.push.view.SessionView) RaindropsView(de.mossgrabers.push.view.RaindropsView) AbstractSequencerView(de.mossgrabers.framework.view.AbstractSequencerView) PushCursorCommand(de.mossgrabers.push.command.trigger.PushCursorCommand) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) ICursorClip(de.mossgrabers.framework.daw.ICursorClip) SceneView(de.mossgrabers.framework.view.SceneView) ClipView(de.mossgrabers.push.view.ClipView) PushControlSurface(de.mossgrabers.push.controller.PushControlSurface) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice) ModeManager(de.mossgrabers.framework.mode.ModeManager)

Example 23 with ITransport

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

the class OSCWriter method flush.

/**
 * Flush out all values.
 *
 * @param dump Forces a flush if true otherwise only changed values are flushed
 */
public void flush(final boolean dump) {
    if (this.udpServer == null)
        return;
    // 
    // Transport
    // 
    final ITransport trans = this.model.getTransport();
    this.sendOSC("/play", trans.isPlaying(), dump);
    this.sendOSC("/record", trans.isRecording(), dump);
    this.sendOSC("/overdub", trans.isArrangerOverdub(), dump);
    this.sendOSC("/overdub/launcher", trans.isLauncherOverdub(), dump);
    this.sendOSC("/repeat", trans.isLoop(), dump);
    this.sendOSC("/punchIn", trans.isPunchInEnabled(), dump);
    this.sendOSC("/punchOut", trans.isPunchOutEnabled(), dump);
    this.sendOSC("/click", trans.isMetronomeOn(), dump);
    this.sendOSC("/click/ticks", trans.isMetronomeTicksOn(), dump);
    this.sendOSC("/click/volume", trans.getMetronomeVolume(), dump);
    this.sendOSC("/click/volumeStr", trans.getMetronomeVolumeStr(), dump);
    this.sendOSC("/click/preroll", trans.isPrerollMetronomeEnabled(), dump);
    this.sendOSC("/preroll", trans.getPrerollAsBars(), dump);
    this.sendOSC("/tempo/raw", trans.getTempo(), dump);
    this.sendOSC("/crossfade", trans.getCrossfade(), dump);
    this.sendOSC("/autowrite", trans.isWritingArrangerAutomation(), dump);
    this.sendOSC("/autowrite/launcher", trans.isWritingClipLauncherAutomation(), dump);
    this.sendOSC("/automationWriteMode", trans.getAutomationWriteMode(), dump);
    this.sendOSC("/time/str", trans.getPositionText(), dump);
    this.sendOSC("/time/signature", trans.getNumerator() + " / " + trans.getDenominator(), dump);
    this.sendOSC("/beat/str", trans.getBeatText(), dump);
    // 
    // Frames
    // 
    final IApplication app = this.model.getApplication();
    this.sendOSC("/layout", app.getPanelLayout().toLowerCase(), dump);
    final IArranger arrange = this.model.getArranger();
    this.sendOSC("/arranger/cueMarkerVisibility", arrange.areCueMarkersVisible(), dump);
    this.sendOSC("/arranger/playbackFollow", arrange.isPlaybackFollowEnabled(), dump);
    this.sendOSC("/arranger/trackRowHeight", arrange.hasDoubleRowTrackHeight(), dump);
    this.sendOSC("/arranger/clipLauncherSectionVisibility", arrange.isClipLauncherVisible(), dump);
    this.sendOSC("/arranger/timeLineVisibility", arrange.isTimelineVisible(), dump);
    this.sendOSC("/arranger/ioSectionVisibility", arrange.isIoSectionVisible(), dump);
    this.sendOSC("/arranger/effectTracksVisibility", arrange.areEffectTracksVisible(), dump);
    final IMixer mix = this.model.getMixer();
    this.sendOSC("/mixer/clipLauncherSectionVisibility", mix.isClipLauncherSectionVisible(), dump);
    this.sendOSC("/mixer/crossFadeSectionVisibility", mix.isCrossFadeSectionVisible(), dump);
    this.sendOSC("/mixer/deviceSectionVisibility", mix.isDeviceSectionVisible(), dump);
    this.sendOSC("/mixer/sendsSectionVisibility", mix.isSendSectionVisible(), dump);
    this.sendOSC("/mixer/ioSectionVisibility", mix.isIoSectionVisible(), dump);
    this.sendOSC("/mixer/meterSectionVisibility", mix.isMeterSectionVisible(), dump);
    // 
    // Project
    // 
    this.sendOSC("/project/name", this.model.getProject().getName(), dump);
    this.sendOSC("/project/engine", app.isEngineActive(), dump);
    // 
    // Master-/Track(-commands)
    // 
    final IChannelBank trackBank = this.model.getCurrentTrackBank();
    for (int i = 0; i < trackBank.getNumTracks(); i++) this.flushTrack("/track/" + (i + 1) + "/", trackBank.getTrack(i), dump);
    this.flushTrack("/master/", this.model.getMasterTrack(), dump);
    final ITrack selectedTrack = trackBank.getSelectedTrack();
    this.flushTrack("/track/selected/", selectedTrack == null ? EMPTY_TRACK : selectedTrack, dump);
    this.sendOSC("/track/toggleBank", this.model.isEffectTrackBankActive() ? 1 : 0, dump);
    // 
    // Scenes
    // 
    final ISceneBank sceneBank = this.model.getSceneBank();
    for (int i = 0; i < sceneBank.getNumScenes(); i++) this.flushScene("/scene/" + (i + 1) + "/", sceneBank.getScene(i), dump);
    // 
    // Device / Primary Device
    // 
    final ICursorDevice cd = this.model.getCursorDevice();
    this.flushDevice("/device/", cd, dump);
    if (cd.hasDrumPads()) {
        for (int i = 0; i < cd.getNumDrumPads(); i++) this.flushDeviceLayers("/device/drumpad/" + (i + 1) + "/", cd.getLayerOrDrumPad(i), dump);
    }
    for (int i = 0; i < cd.getNumLayers(); i++) this.flushDeviceLayers("/device/layer/" + (i + 1) + "/", cd.getLayerOrDrumPad(i), dump);
    this.flushDevice("/primary/", this.model.getPrimaryDevice(), dump);
    // 
    // Browser
    // 
    this.flushBrowser("/browser/", this.model.getBrowser(), dump);
    // 
    // Notes
    // 
    this.flushNotes("/vkb_midi/note/", dump);
    try {
        int pos = 0;
        this.udpServer.startBundle();
        for (final OscMessageData message : this.messages) {
            final String address = message.getAddress();
            final Object[] values = message.getValues();
            this.udpServer.sendMessage(address, values);
            pos++;
            if (pos > 1000) {
                pos = 0;
                this.udpServer.endBundle();
                this.udpServer.startBundle();
            }
        }
        this.udpServer.endBundle();
    } catch (final IOException ex) {
        this.model.getHost().error("Could not send UDP message.", ex);
    }
    this.messages.clear();
}
Also used : IMixer(de.mossgrabers.framework.daw.IMixer) ITrack(de.mossgrabers.framework.daw.data.ITrack) ITransport(de.mossgrabers.framework.daw.ITransport) IArranger(de.mossgrabers.framework.daw.IArranger) IOException(java.io.IOException) ISceneBank(de.mossgrabers.framework.daw.ISceneBank) IApplication(de.mossgrabers.framework.daw.IApplication) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice)

Example 24 with ITransport

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

the class APCControllerSetup method updateButtons.

private void updateButtons() {
    final APCControlSurface surface = this.getSurface();
    final ViewManager viewManager = surface.getViewManager();
    final View activeView = viewManager.getActiveView();
    if (activeView != null) {
        ((APCCursorCommand) activeView.getTriggerCommand(Commands.COMMAND_ARROW_DOWN)).updateArrows();
        ((SceneView) activeView).updateSceneButtons();
    }
    final boolean isShift = surface.isShiftPressed();
    final boolean isSendA = surface.isPressed(APCControlSurface.APC_BUTTON_SEND_A);
    final ITransport t = this.model.getTransport();
    surface.updateButton(APCControlSurface.APC_BUTTON_PLAY, t.isPlaying() ? ColorManager.BUTTON_STATE_ON : ColorManager.BUTTON_STATE_OFF);
    surface.updateButton(APCControlSurface.APC_BUTTON_RECORD, t.isRecording() ? ColorManager.BUTTON_STATE_ON : ColorManager.BUTTON_STATE_OFF);
    // Activator, Solo, Record Arm
    final IChannelBank tb = this.model.getCurrentTrackBank();
    final ITrack selTrack = tb.getSelectedTrack();
    final int selIndex = selTrack == null ? -1 : selTrack.getIndex();
    final int clipLength = surface.getConfiguration().getNewClipLength();
    final ModeManager modeManager = surface.getModeManager();
    for (int i = 0; i < 8; i++) {
        final ITrack track = tb.getTrack(i);
        boolean isOn;
        if (isShift)
            isOn = i == clipLength;
        else
            isOn = isSendA ? modeManager.isActiveMode(Integer.valueOf(Modes.MODE_SEND1.intValue() + i)) : i == selIndex;
        surface.updateButtonEx(APCControlSurface.APC_BUTTON_TRACK_SELECTION, i, isOn ? ColorManager.BUTTON_STATE_ON : ColorManager.BUTTON_STATE_OFF);
        surface.updateButtonEx(APCControlSurface.APC_BUTTON_SOLO, i, track.doesExist() && (isShift ? track.isAutoMonitor() : track.isSolo()) ? ColorManager.BUTTON_STATE_ON : ColorManager.BUTTON_STATE_OFF);
        surface.updateButtonEx(APCControlSurface.APC_BUTTON_ACTIVATOR, i, track.doesExist() && (isShift ? track.isMonitor() : !track.isMute()) ? ColorManager.BUTTON_STATE_ON : ColorManager.BUTTON_STATE_OFF);
        if (this.isMkII) {
            surface.updateButtonEx(APCControlSurface.APC_BUTTON_A_B, i, track.doesExist() && !"AB".equals(track.getCrossfadeMode()) ? "A".equals(track.getCrossfadeMode()) ? ColorManager.BUTTON_STATE_ON : APCColors.BUTTON_STATE_BLINK : ColorManager.BUTTON_STATE_OFF);
            surface.updateButtonEx(APCControlSurface.APC_BUTTON_RECORD_ARM, i, track.doesExist() && track.isRecArm() ? ColorManager.BUTTON_STATE_ON : ColorManager.BUTTON_STATE_OFF);
        } else {
            if (isShift)
                surface.updateButtonEx(APCControlSurface.APC_BUTTON_RECORD_ARM, i, track.doesExist() && !"AB".equals(track.getCrossfadeMode()) ? "A".equals(track.getCrossfadeMode()) ? ColorManager.BUTTON_STATE_ON : APCColors.BUTTON_STATE_BLINK : ColorManager.BUTTON_STATE_OFF);
            else
                surface.updateButtonEx(APCControlSurface.APC_BUTTON_RECORD_ARM, i, track.doesExist() && track.isRecArm() ? ColorManager.BUTTON_STATE_ON : ColorManager.BUTTON_STATE_OFF);
        }
    }
    surface.updateButton(APCControlSurface.APC_BUTTON_MASTER, this.model.getMasterTrack().isSelected() ? ColorManager.BUTTON_STATE_ON : ColorManager.BUTTON_STATE_OFF);
    final ICursorDevice device = this.model.getCursorDevice();
    if (this.isMkII) {
        surface.updateButton(APCControlSurface.APC_BUTTON_SESSION, t.isLauncherOverdub() ? ColorManager.BUTTON_STATE_ON : ColorManager.BUTTON_STATE_OFF);
        surface.updateButton(APCControlSurface.APC_BUTTON_SEND_C, t.isMetronomeOn() ? ColorManager.BUTTON_STATE_ON : ColorManager.BUTTON_STATE_OFF);
        surface.updateButton(APCControlSurface.APC_BUTTON_DETAIL_VIEW, device.isEnabled() ? ColorManager.BUTTON_STATE_ON : ColorManager.BUTTON_STATE_OFF);
        surface.updateButton(APCControlSurface.APC_BUTTON_REC_QUANT, ColorManager.BUTTON_STATE_OFF);
        surface.updateButton(APCControlSurface.APC_BUTTON_MIDI_OVERDUB, ColorManager.BUTTON_STATE_OFF);
        surface.updateButton(APCControlSurface.APC_BUTTON_METRONOME, ColorManager.BUTTON_STATE_OFF);
        surface.updateButton(APCControlSurface.APC_BUTTON_CLIP_TRACK, ColorManager.BUTTON_STATE_OFF);
        surface.updateButton(APCControlSurface.APC_BUTTON_DEVICE_ON_OFF, ColorManager.BUTTON_STATE_OFF);
        surface.updateButton(APCControlSurface.APC_BUTTON_DEVICE_LEFT, ColorManager.BUTTON_STATE_OFF);
        surface.updateButton(APCControlSurface.APC_BUTTON_DEVICE_RIGHT, ColorManager.BUTTON_STATE_OFF);
        surface.updateButton(APCControlSurface.APC_BUTTON_BANK, this.model.getBrowser().isActive() ? ColorManager.BUTTON_STATE_ON : ColorManager.BUTTON_STATE_OFF);
    } else {
        surface.updateButton(APCControlSurface.APC_BUTTON_DETAIL_VIEW, ColorManager.BUTTON_STATE_OFF);
        surface.updateButton(APCControlSurface.APC_BUTTON_REC_QUANT, ColorManager.BUTTON_STATE_OFF);
        surface.updateButton(APCControlSurface.APC_BUTTON_MIDI_OVERDUB, t.isLauncherOverdub() ? ColorManager.BUTTON_STATE_ON : ColorManager.BUTTON_STATE_OFF);
        surface.updateButton(APCControlSurface.APC_BUTTON_METRONOME, t.isMetronomeOn() ? ColorManager.BUTTON_STATE_ON : ColorManager.BUTTON_STATE_OFF);
        surface.updateButton(APCControlSurface.APC_BUTTON_CLIP_TRACK, ColorManager.BUTTON_STATE_OFF);
        surface.updateButton(APCControlSurface.APC_BUTTON_DEVICE_ON_OFF, device.isEnabled() ? ColorManager.BUTTON_STATE_ON : ColorManager.BUTTON_STATE_OFF);
        surface.updateButton(APCControlSurface.APC_BUTTON_DEVICE_LEFT, ColorManager.BUTTON_STATE_OFF);
        surface.updateButton(APCControlSurface.APC_BUTTON_DEVICE_RIGHT, ColorManager.BUTTON_STATE_OFF);
    }
    this.updateDeviceKnobs();
}
Also used : APCControlSurface(de.mossgrabers.apc.controller.APCControlSurface) ITrack(de.mossgrabers.framework.daw.data.ITrack) APCCursorCommand(de.mossgrabers.apc.command.trigger.APCCursorCommand) ITransport(de.mossgrabers.framework.daw.ITransport) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) SceneView(de.mossgrabers.framework.view.SceneView) ViewManager(de.mossgrabers.framework.view.ViewManager) SessionView(de.mossgrabers.apc.view.SessionView) ShiftView(de.mossgrabers.apc.view.ShiftView) SceneView(de.mossgrabers.framework.view.SceneView) View(de.mossgrabers.framework.view.View) DrumView(de.mossgrabers.apc.view.DrumView) SequencerView(de.mossgrabers.apc.view.SequencerView) PlayView(de.mossgrabers.apc.view.PlayView) RaindropsView(de.mossgrabers.apc.view.RaindropsView) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice) ModeManager(de.mossgrabers.framework.mode.ModeManager)

Example 25 with ITransport

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

the class ShiftView method drawGrid.

/**
 * {@inheritDoc}
 */
@Override
public void drawGrid() {
    // Draw the keyboard
    final int scaleOffset = this.scales.getScaleOffset();
    // 0'C', 1'G', 2'D', 3'A', 4'E', 5'B', 6'F', 7'Bb', 8'Eb', 9'Ab', 10'Db', 11'Gb'
    final PadGrid padGrid = this.surface.getPadGrid();
    for (int i = 7; i < 64; i++) padGrid.light(36 + i, APCminiColors.APC_COLOR_BLACK);
    padGrid.light(36 + 0, scaleOffset == 0 ? APCminiColors.APC_COLOR_GREEN : APCminiColors.APC_COLOR_YELLOW);
    padGrid.light(36 + 1, scaleOffset == 2 ? APCminiColors.APC_COLOR_GREEN : APCminiColors.APC_COLOR_YELLOW);
    padGrid.light(36 + 2, scaleOffset == 4 ? APCminiColors.APC_COLOR_GREEN : APCminiColors.APC_COLOR_YELLOW);
    padGrid.light(36 + 3, scaleOffset == 6 ? APCminiColors.APC_COLOR_GREEN : APCminiColors.APC_COLOR_YELLOW);
    padGrid.light(36 + 4, scaleOffset == 1 ? APCminiColors.APC_COLOR_GREEN : APCminiColors.APC_COLOR_YELLOW);
    padGrid.light(36 + 5, scaleOffset == 3 ? APCminiColors.APC_COLOR_GREEN : APCminiColors.APC_COLOR_YELLOW);
    padGrid.light(36 + 6, scaleOffset == 5 ? APCminiColors.APC_COLOR_GREEN : APCminiColors.APC_COLOR_YELLOW);
    padGrid.light(36 + 9, scaleOffset == 10 ? APCminiColors.APC_COLOR_GREEN : APCminiColors.APC_COLOR_RED);
    padGrid.light(36 + 10, scaleOffset == 8 ? APCminiColors.APC_COLOR_GREEN : APCminiColors.APC_COLOR_RED);
    padGrid.light(36 + 12, scaleOffset == 11 ? APCminiColors.APC_COLOR_GREEN : APCminiColors.APC_COLOR_RED);
    padGrid.light(36 + 13, scaleOffset == 9 ? APCminiColors.APC_COLOR_GREEN : APCminiColors.APC_COLOR_RED);
    padGrid.light(36 + 14, scaleOffset == 7 ? APCminiColors.APC_COLOR_GREEN : APCminiColors.APC_COLOR_RED);
    // Device Parameters up/down
    padGrid.light(36 + 24, APCminiColors.APC_COLOR_YELLOW);
    padGrid.light(36 + 25, APCminiColors.APC_COLOR_YELLOW);
    // Device up/down
    padGrid.light(36 + 32, APCminiColors.APC_COLOR_GREEN);
    padGrid.light(36 + 33, APCminiColors.APC_COLOR_GREEN);
    // Change the scale
    padGrid.light(36 + 35, APCminiColors.APC_COLOR_RED);
    padGrid.light(36 + 36, APCminiColors.APC_COLOR_RED);
    padGrid.light(36 + 27, APCminiColors.APC_COLOR_GREEN);
    // Draw the view selection: Session, Note, Drum, Sequencer
    final Integer previousViewId = this.surface.getViewManager().getPreviousViewId();
    padGrid.light(36 + 56, previousViewId == Views.VIEW_SESSION ? APCminiColors.APC_COLOR_GREEN : APCminiColors.APC_COLOR_YELLOW);
    padGrid.light(36 + 57, previousViewId == Views.VIEW_PLAY ? APCminiColors.APC_COLOR_GREEN : APCminiColors.APC_COLOR_YELLOW);
    padGrid.light(36 + 58, previousViewId == Views.VIEW_DRUM ? APCminiColors.APC_COLOR_GREEN : APCminiColors.APC_COLOR_YELLOW);
    padGrid.light(36 + 59, previousViewId == Views.VIEW_SEQUENCER ? APCminiColors.APC_COLOR_GREEN : APCminiColors.APC_COLOR_YELLOW);
    padGrid.light(36 + 60, previousViewId == Views.VIEW_RAINDROPS ? APCminiColors.APC_COLOR_GREEN : APCminiColors.APC_COLOR_YELLOW);
    // Draw transport
    final ITransport transport = this.model.getTransport();
    padGrid.light(36 + 63, transport.isPlaying() ? APCminiColors.APC_COLOR_GREEN_BLINK : APCminiColors.APC_COLOR_GREEN);
    padGrid.light(36 + 55, transport.isRecording() ? APCminiColors.APC_COLOR_RED_BLINK : APCminiColors.APC_COLOR_RED);
    padGrid.light(36 + 47, APCminiColors.APC_COLOR_YELLOW);
    padGrid.light(36 + 39, APCminiColors.APC_COLOR_YELLOW);
    padGrid.light(36 + 62, APCminiColors.APC_COLOR_YELLOW);
    padGrid.light(36 + 54, transport.isLauncherOverdub() ? APCminiColors.APC_COLOR_RED_BLINK : APCminiColors.APC_COLOR_RED);
    padGrid.light(36 + 46, APCminiColors.APC_COLOR_YELLOW);
    padGrid.light(36 + 38, APCminiColors.APC_COLOR_YELLOW);
}
Also used : PadGrid(de.mossgrabers.framework.controller.grid.PadGrid) ITransport(de.mossgrabers.framework.daw.ITransport)

Aggregations

ITransport (de.mossgrabers.framework.daw.ITransport)47 ITrack (de.mossgrabers.framework.daw.data.ITrack)9 ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)5 IHost (de.mossgrabers.framework.daw.IHost)5 IMidiInput (de.mossgrabers.framework.daw.midi.IMidiInput)5 ConfiguredRecordCommand (de.mossgrabers.framework.command.trigger.transport.ConfiguredRecordCommand)4 ITextDisplay (de.mossgrabers.framework.controller.display.ITextDisplay)4 IChannelBank (de.mossgrabers.framework.daw.IChannelBank)4 ITrackBank (de.mossgrabers.framework.daw.data.bank.ITrackBank)4 IMidiOutput (de.mossgrabers.framework.daw.midi.IMidiOutput)4 ViewManager (de.mossgrabers.framework.featuregroup.ViewManager)4 View (de.mossgrabers.framework.view.View)4 FeatureGroupButtonColorSupplier (de.mossgrabers.framework.command.trigger.view.FeatureGroupButtonColorSupplier)3 ICursorDevice (de.mossgrabers.framework.daw.data.ICursorDevice)3 ModeManager (de.mossgrabers.framework.mode.ModeManager)3 ButtonEvent (de.mossgrabers.framework.utils.ButtonEvent)3 SceneView (de.mossgrabers.framework.view.SceneView)3 ViewManager (de.mossgrabers.framework.view.ViewManager)3 SLMkIIIDisplay (de.mossgrabers.controller.novation.slmkiii.controller.SLMkIIIDisplay)2 ButtonID (de.mossgrabers.framework.controller.ButtonID)2