Search in sources :

Example 1 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() {
    final ITransport t = this.model.getTransport();
    final PadGrid padGrid = this.surface.getPadGrid();
    padGrid.light(36, t.isPlaying() ? BeatstepColors.BEATSTEP_BUTTON_STATE_PINK : BeatstepColors.BEATSTEP_BUTTON_STATE_BLUE);
    padGrid.light(37, t.isRecording() ? BeatstepColors.BEATSTEP_BUTTON_STATE_PINK : BeatstepColors.BEATSTEP_BUTTON_STATE_RED);
    padGrid.light(38, t.isLoop() ? BeatstepColors.BEATSTEP_BUTTON_STATE_PINK : BeatstepColors.BEATSTEP_BUTTON_STATE_OFF);
    padGrid.light(39, t.isMetronomeOn() ? BeatstepColors.BEATSTEP_BUTTON_STATE_PINK : BeatstepColors.BEATSTEP_BUTTON_STATE_OFF);
    padGrid.light(40, BeatstepColors.BEATSTEP_BUTTON_STATE_OFF);
    padGrid.light(41, BeatstepColors.BEATSTEP_BUTTON_STATE_RED);
    padGrid.light(42, BeatstepColors.BEATSTEP_BUTTON_STATE_RED);
    padGrid.light(43, BeatstepColors.BEATSTEP_BUTTON_STATE_RED);
    padGrid.light(44, BeatstepColors.BEATSTEP_BUTTON_STATE_RED);
    padGrid.light(45, BeatstepColors.BEATSTEP_BUTTON_STATE_RED);
    padGrid.light(46, BeatstepColors.BEATSTEP_BUTTON_STATE_PINK);
    padGrid.light(47, BeatstepColors.BEATSTEP_BUTTON_STATE_PINK);
    padGrid.light(48, BeatstepColors.BEATSTEP_BUTTON_STATE_PINK);
    padGrid.light(49, BeatstepColors.BEATSTEP_BUTTON_STATE_BLUE);
    padGrid.light(50, BeatstepColors.BEATSTEP_BUTTON_STATE_OFF);
    padGrid.light(51, BeatstepColors.BEATSTEP_BUTTON_STATE_PINK);
}
Also used : PadGrid(de.mossgrabers.framework.controller.grid.PadGrid) ITransport(de.mossgrabers.framework.daw.ITransport)

Example 2 with ITransport

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

the class PlayCommand method handleStopOptions.

/**
 * Handle the different options when the playback is stopped.
 */
protected void handleStopOptions() {
    final ITransport transport = this.model.getTransport();
    switch(this.surface.getConfiguration().getBehaviourOnStop()) {
        case RETURN_TO_ZERO:
            if (transport.isPlaying())
                transport.stopAndRewind();
            else
                transport.play();
            break;
        case MOVE_PLAY_CURSOR:
            transport.play();
            this.doubleClickTest();
            break;
        case PAUSE:
            if (transport.isPlaying())
                transport.stop();
            else
                transport.play();
            this.doubleClickTest();
            break;
    }
}
Also used : ITransport(de.mossgrabers.framework.daw.ITransport)

Example 3 with ITransport

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

the class MCUControllerSetup method updateSegmentDisplay.

private void updateSegmentDisplay() {
    if (!this.configuration.hasSegmentDisplay())
        return;
    final ITransport t = this.model.getTransport();
    String positionText = t.getPositionText();
    if (this.configuration.isDisplayTicks())
        positionText += " ";
    else {
        String tempoStr = t.formatTempoNoFraction(t.getTempo());
        final int pos = positionText.lastIndexOf(':');
        if (tempoStr.length() < 3)
            tempoStr = "0" + tempoStr;
        positionText = positionText.substring(0, pos + 1) + tempoStr;
    }
    this.getSurface().getSegmentDisplay().setTransportPositionDisplay(positionText);
}
Also used : ITransport(de.mossgrabers.framework.daw.ITransport)

Example 4 with ITransport

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

the class MCUControllerSetup method updateButtons.

@SuppressWarnings("unchecked")
private void updateButtons() {
    final MCUControlSurface surface = this.getSurface();
    final Integer mode = surface.getModeManager().getActiveModeId();
    if (mode == null)
        return;
    this.updateVUandFaders();
    this.updateSegmentDisplay();
    // Set button states
    final ITransport t = this.model.getTransport();
    final boolean isShift = surface.isShiftPressed();
    final boolean isFlipRecord = this.configuration.isFlipRecord();
    final boolean isRecordShifted = isShift && !isFlipRecord || !isShift && isFlipRecord;
    final boolean isTrackOn = Modes.MODE_TRACK.equals(mode) || Modes.MODE_VOLUME.equals(mode);
    final boolean isPanOn = Modes.MODE_PAN.equals(mode);
    final boolean isSendOn = mode.intValue() >= Modes.MODE_SEND1.intValue() && mode.intValue() <= Modes.MODE_SEND8.intValue();
    final boolean isDeviceOn = Modes.MODE_DEVICE_PARAMS.equals(mode);
    final boolean isLEDOn = surface.isPressed(MCUControlSurface.MCU_OPTION) ? this.model.isCursorTrackPinned() : isTrackOn;
    surface.updateButton(MCUControlSurface.MCU_MODE_IO, isLEDOn ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF);
    surface.updateButton(MCUControlSurface.MCU_MODE_PAN, isPanOn ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF);
    surface.updateButton(MCUControlSurface.MCU_MODE_SENDS, isSendOn ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF);
    final ICursorDevice cursorDevice = this.model.getCursorDevice();
    final boolean isOn = surface.isPressed(MCUControlSurface.MCU_OPTION) ? cursorDevice.isPinned() : isDeviceOn;
    surface.updateButton(MCUControlSurface.MCU_MODE_PLUGIN, isOn ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF);
    surface.updateButton(MCUControlSurface.MCU_USER, Modes.MODE_BROWSER.equals(mode) ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF);
    final ITransport transport = this.model.getTransport();
    final String automationWriteMode = transport.getAutomationWriteMode();
    final boolean writingArrangerAutomation = transport.isWritingArrangerAutomation();
    surface.updateButton(MCUControlSurface.MCU_F6, transport.isPunchInEnabled() ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF);
    surface.updateButton(MCUControlSurface.MCU_F7, transport.isPunchOutEnabled() ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF);
    surface.updateButton(MCUControlSurface.MCU_READ, !writingArrangerAutomation ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF);
    final int writeState = writingArrangerAutomation && ITransport.AUTOMATION_MODES_VALUES[2].equals(automationWriteMode) ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF;
    surface.updateButton(MCUControlSurface.MCU_WRITE, writeState);
    surface.updateButton(MCUControlSurface.MCU_GROUP, writeState);
    surface.updateButton(MCUControlSurface.MCU_TRIM, transport.isWritingClipLauncherAutomation() ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF);
    surface.updateButton(MCUControlSurface.MCU_TOUCH, writingArrangerAutomation && ITransport.AUTOMATION_MODES_VALUES[1].equals(automationWriteMode) ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF);
    surface.updateButton(MCUControlSurface.MCU_LATCH, writingArrangerAutomation && ITransport.AUTOMATION_MODES_VALUES[0].equals(automationWriteMode) ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF);
    final View view = surface.getViewManager().getView(Views.VIEW_CONTROL);
    surface.updateButton(MCUControlSurface.MCU_REWIND, ((WindCommand<MCUControlSurface, MCUConfiguration>) view.getTriggerCommand(Commands.COMMAND_REWIND)).isRewinding() ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF);
    surface.updateButton(MCUControlSurface.MCU_FORWARD, ((WindCommand<MCUControlSurface, MCUConfiguration>) view.getTriggerCommand(Commands.COMMAND_FORWARD)).isForwarding() ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF);
    surface.updateButton(MCUControlSurface.MCU_REPEAT, t.isLoop() ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF);
    surface.updateButton(MCUControlSurface.MCU_STOP, !t.isPlaying() ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF);
    surface.updateButton(MCUControlSurface.MCU_PLAY, t.isPlaying() ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF);
    surface.updateButton(MCUControlSurface.MCU_RECORD, isRecordShifted ? t.isLauncherOverdub() ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF : t.isRecording() ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF);
    surface.updateButton(MCUControlSurface.MCU_NAME_VALUE, surface.getConfiguration().isDisplayTrackNames() ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF);
    surface.updateButton(MCUControlSurface.MCU_ZOOM, surface.getConfiguration().isZoomState() ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF);
    surface.updateButton(MCUControlSurface.MCU_SCRUB, surface.getModeManager().isActiveMode(Modes.MODE_DEVICE_PARAMS) ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF);
    surface.updateButton(MCUControlSurface.MCU_MIDI_TRACKS, MCU_BUTTON_STATE_OFF);
    surface.updateButton(MCUControlSurface.MCU_INPUTS, MCU_BUTTON_STATE_OFF);
    surface.updateButton(MCUControlSurface.MCU_AUDIO_TRACKS, surface.isShiftPressed() && cursorDevice.isWindowOpen() ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF);
    surface.updateButton(MCUControlSurface.MCU_AUDIO_INSTR, MCU_BUTTON_STATE_OFF);
    surface.updateButton(MCUControlSurface.MCU_CLICK, (isShift ? t.isMetronomeTicksOn() : t.isMetronomeOn()) ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF);
    surface.updateButton(MCUControlSurface.MCU_SOLO, this.model.getGroove().getParameters()[0].getValue() > 0 ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF);
    surface.updateButton(MCUControlSurface.MCU_REPLACE, (isShift ? t.isLauncherOverdub() : t.isArrangerOverdub()) ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF);
    surface.updateButton(MCUControlSurface.MCU_FLIP, this.model.isEffectTrackBankActive() ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF);
    final boolean displayTicks = this.configuration.isDisplayTicks();
    surface.updateButton(MCUControlSurface.MCU_SMPTE_BEATS, displayTicks ? MCU_BUTTON_STATE_OFF : MCU_BUTTON_STATE_ON);
    surface.updateButton(MCUControlSurface.MCU_SMPTE_LED, displayTicks ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF);
    surface.updateButton(MCUControlSurface.MCU_BEATS_LED, displayTicks ? MCU_BUTTON_STATE_OFF : MCU_BUTTON_STATE_ON);
    surface.updateButton(MCUControlSurface.MCU_MARKER, this.model.getArranger().areCueMarkersVisible() ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF);
}
Also used : WindCommand(de.mossgrabers.framework.command.trigger.transport.WindCommand) ITransport(de.mossgrabers.framework.daw.ITransport) MCUControlSurface(de.mossgrabers.mcu.controller.MCUControlSurface) View(de.mossgrabers.framework.view.View) ControlView(de.mossgrabers.mcu.view.ControlView) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice)

Example 5 with ITransport

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

the class LaunchpadControllerSetup method updateButtons.

private void updateButtons() {
    final LaunchpadControlSurface surface = this.getSurface();
    final ViewManager viewManager = surface.getViewManager();
    final View activeView = viewManager.getActiveView();
    if (activeView != null) {
        ((LaunchpadCursorCommand) activeView.getTriggerCommand(Commands.COMMAND_ARROW_DOWN)).updateArrows();
        ((SceneView) activeView).updateSceneButtons();
    }
    if (!this.isPro) {
        surface.setButton(LaunchpadControlSurface.LAUNCHPAD_MKII_BUTTON_USER, surface.isUserPressed() ? LaunchpadColors.LAUNCHPAD_COLOR_WHITE : LaunchpadColors.LAUNCHPAD_COLOR_GREY_LO);
        return;
    }
    surface.setButton(LaunchpadControlSurface.LAUNCHPAD_PRO_BUTTON_USER, LaunchpadColors.LAUNCHPAD_COLOR_BLACK);
    final boolean isShift = surface.isShiftPressed();
    final ITrack selTrack = this.model.getCurrentTrackBank().getSelectedTrack();
    final int index = selTrack == null ? -1 : selTrack.getIndex();
    final ModeManager modeManager = surface.getModeManager();
    final ITransport transport = this.model.getTransport();
    surface.setButton(LaunchpadControlSurface.LAUNCHPAD_BUTTON_SHIFT, isShift ? LaunchpadColors.LAUNCHPAD_COLOR_WHITE : LaunchpadColors.LAUNCHPAD_COLOR_GREY_LO);
    surface.setButton(LaunchpadControlSurface.LAUNCHPAD_BUTTON_CLICK, isShift ? LaunchpadColors.LAUNCHPAD_COLOR_GREEN_SPRING : transport.isMetronomeOn() ? LaunchpadColors.LAUNCHPAD_COLOR_GREEN_HI : LaunchpadColors.LAUNCHPAD_COLOR_GREEN_LO);
    surface.setButton(LaunchpadControlSurface.LAUNCHPAD_BUTTON_UNDO, isShift ? LaunchpadColors.LAUNCHPAD_COLOR_GREEN_SPRING : LaunchpadColors.LAUNCHPAD_COLOR_GREEN_LO);
    surface.setButton(LaunchpadControlSurface.LAUNCHPAD_BUTTON_DELETE, isShift ? LaunchpadColors.LAUNCHPAD_COLOR_BLACK : LaunchpadColors.LAUNCHPAD_COLOR_GREEN_LO);
    surface.setButton(LaunchpadControlSurface.LAUNCHPAD_BUTTON_QUANTIZE, isShift ? LaunchpadColors.LAUNCHPAD_COLOR_BLACK : LaunchpadColors.LAUNCHPAD_COLOR_GREEN_LO);
    surface.setButton(LaunchpadControlSurface.LAUNCHPAD_BUTTON_DUPLICATE, isShift ? LaunchpadColors.LAUNCHPAD_COLOR_GREEN_SPRING : LaunchpadColors.LAUNCHPAD_COLOR_GREEN_LO);
    surface.setButton(LaunchpadControlSurface.LAUNCHPAD_BUTTON_DOUBLE, isShift ? LaunchpadColors.LAUNCHPAD_COLOR_GREEN_SPRING : LaunchpadColors.LAUNCHPAD_COLOR_GREEN_LO);
    final boolean flipRecord = surface.getConfiguration().isFlipRecord();
    surface.setButton(LaunchpadControlSurface.LAUNCHPAD_BUTTON_RECORD, isShift && !flipRecord || !isShift && flipRecord ? transport.isLauncherOverdub() ? LaunchpadColors.LAUNCHPAD_COLOR_ROSE : LaunchpadColors.LAUNCHPAD_COLOR_RED_AMBER : transport.isRecording() ? LaunchpadColors.LAUNCHPAD_COLOR_RED_HI : LaunchpadColors.LAUNCHPAD_COLOR_RED_LO);
    surface.setButton(LaunchpadControlSurface.LAUNCHPAD_BUTTON_REC_ARM, modeManager.isActiveMode(Modes.MODE_REC_ARM) ? LaunchpadColors.LAUNCHPAD_COLOR_RED : index == 0 ? LaunchpadColors.LAUNCHPAD_COLOR_WHITE : LaunchpadColors.LAUNCHPAD_COLOR_GREY_LO);
    surface.setButton(LaunchpadControlSurface.LAUNCHPAD_BUTTON_TRACK, modeManager.isActiveMode(Modes.MODE_TRACK_SELECT) ? LaunchpadColors.LAUNCHPAD_COLOR_GREEN : index == 1 ? LaunchpadColors.LAUNCHPAD_COLOR_WHITE : LaunchpadColors.LAUNCHPAD_COLOR_GREY_LO);
    surface.setButton(LaunchpadControlSurface.LAUNCHPAD_BUTTON_MUTE, modeManager.isActiveMode(Modes.MODE_MUTE) ? LaunchpadColors.LAUNCHPAD_COLOR_YELLOW : index == 2 ? LaunchpadColors.LAUNCHPAD_COLOR_WHITE : LaunchpadColors.LAUNCHPAD_COLOR_GREY_LO);
    surface.setButton(LaunchpadControlSurface.LAUNCHPAD_BUTTON_SOLO, modeManager.isActiveMode(Modes.MODE_SOLO) ? LaunchpadColors.LAUNCHPAD_COLOR_BLUE : index == 3 ? LaunchpadColors.LAUNCHPAD_COLOR_WHITE : LaunchpadColors.LAUNCHPAD_COLOR_GREY_LO);
    surface.setButton(LaunchpadControlSurface.LAUNCHPAD_BUTTON_VOLUME, viewManager.isActiveView(Views.VIEW_VOLUME) ? LaunchpadColors.LAUNCHPAD_COLOR_CYAN : index == 4 ? LaunchpadColors.LAUNCHPAD_COLOR_WHITE : LaunchpadColors.LAUNCHPAD_COLOR_GREY_LO);
    surface.setButton(LaunchpadControlSurface.LAUNCHPAD_BUTTON_PAN, viewManager.isActiveView(Views.VIEW_PAN) ? LaunchpadColors.LAUNCHPAD_COLOR_SKY : index == 5 ? LaunchpadColors.LAUNCHPAD_COLOR_WHITE : LaunchpadColors.LAUNCHPAD_COLOR_GREY_LO);
    surface.setButton(LaunchpadControlSurface.LAUNCHPAD_BUTTON_SENDS, viewManager.isActiveView(Views.VIEW_SENDS) ? LaunchpadColors.LAUNCHPAD_COLOR_ORCHID : index == 6 ? LaunchpadColors.LAUNCHPAD_COLOR_WHITE : LaunchpadColors.LAUNCHPAD_COLOR_GREY_LO);
    surface.setButton(LaunchpadControlSurface.LAUNCHPAD_BUTTON_STOP_CLIP, modeManager.isActiveMode(Modes.MODE_STOP_CLIP) ? LaunchpadColors.LAUNCHPAD_COLOR_ROSE : index == 7 ? LaunchpadColors.LAUNCHPAD_COLOR_WHITE : LaunchpadColors.LAUNCHPAD_COLOR_GREY_LO);
    // Update the front LED with the color of the current track
    final ITrack track = index == -1 ? null : this.model.getCurrentTrackBank().getTrack(index);
    final int color = track != null && track.doesExist() ? this.colorManager.getColor(BitwigColors.getColorIndex(track.getColor())) : 0;
    surface.sendLaunchpadSysEx("0A 63 " + StringUtils.toHexStr(color));
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITransport(de.mossgrabers.framework.daw.ITransport) SceneView(de.mossgrabers.framework.view.SceneView) ViewManager(de.mossgrabers.framework.view.ViewManager) VolumeView(de.mossgrabers.launchpad.view.VolumeView) SessionView(de.mossgrabers.launchpad.view.SessionView) SequencerView(de.mossgrabers.launchpad.view.SequencerView) SceneView(de.mossgrabers.framework.view.SceneView) DeviceView(de.mossgrabers.launchpad.view.DeviceView) View(de.mossgrabers.framework.view.View) PanView(de.mossgrabers.launchpad.view.PanView) RaindropsView(de.mossgrabers.launchpad.view.RaindropsView) BrowserView(de.mossgrabers.launchpad.view.BrowserView) DrumView(de.mossgrabers.launchpad.view.DrumView) SendsView(de.mossgrabers.launchpad.view.SendsView) ShiftView(de.mossgrabers.launchpad.view.ShiftView) PlayView(de.mossgrabers.launchpad.view.PlayView) LaunchpadControlSurface(de.mossgrabers.launchpad.controller.LaunchpadControlSurface) LaunchpadCursorCommand(de.mossgrabers.launchpad.command.trigger.LaunchpadCursorCommand) ModeManager(de.mossgrabers.framework.mode.ModeManager)

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