Search in sources :

Example 26 with ITransport

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

the class TransportMode method updateFirstRow.

/**
 * {@inheritDoc}
 */
@Override
public void updateFirstRow() {
    final ITransport transport = this.model.getTransport();
    final String preroll = transport.getPreroll();
    this.surface.updateButton(20, ITransport.PREROLL_NONE.equals(preroll) ? AbstractMode.BUTTON_COLOR_HI : AbstractMode.BUTTON_COLOR_ON);
    this.surface.updateButton(21, ITransport.PREROLL_1_BAR.equals(preroll) ? AbstractMode.BUTTON_COLOR_HI : AbstractMode.BUTTON_COLOR_ON);
    this.surface.updateButton(22, ITransport.PREROLL_2_BARS.equals(preroll) ? AbstractMode.BUTTON_COLOR_HI : AbstractMode.BUTTON_COLOR_ON);
    this.surface.updateButton(23, ITransport.PREROLL_4_BARS.equals(preroll) ? AbstractMode.BUTTON_COLOR_HI : AbstractMode.BUTTON_COLOR_ON);
    this.surface.updateButton(24, AbstractMode.BUTTON_COLOR_OFF);
    this.surface.updateButton(25, AbstractMode.BUTTON_COLOR_OFF);
    this.surface.updateButton(26, AbstractMode.BUTTON_COLOR_OFF);
    this.surface.updateButton(27, AbstractMode.BUTTON_COLOR_OFF);
}
Also used : ITransport(de.mossgrabers.framework.daw.ITransport)

Example 27 with ITransport

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

the class TransportMode method updateDisplay1.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay1() {
    final Display d = this.surface.getDisplay();
    final ITransport transport = this.model.getTransport();
    final String preroll = transport.getPreroll();
    final double tempo = transport.getTempo();
    d.clear();
    d.setBlock(2, 0, "Pre-roll");
    d.setCell(3, 0, (preroll == ITransport.PREROLL_NONE ? PushDisplay.RIGHT_ARROW : " ") + "None");
    d.setCell(3, 1, (preroll == ITransport.PREROLL_1_BAR ? PushDisplay.RIGHT_ARROW : " ") + "1 Bar");
    d.setCell(3, 2, (preroll == ITransport.PREROLL_2_BARS ? PushDisplay.RIGHT_ARROW : " ") + "2 Bars");
    d.setCell(3, 3, (preroll == ITransport.PREROLL_4_BARS ? PushDisplay.RIGHT_ARROW : " ") + "4 Bars");
    d.setBlock(0, 0, "Play Metro during").setBlock(0, 1, "Pre-roll?");
    d.setCell(1, 0, transport.isPrerollMetronomeEnabled() ? " Yes" : " No");
    d.setCell(0, 4, "Tempo").setCell(1, 4, transport.formatTempo(tempo)).setCell(2, 4, formatTempoBars(tempo));
    d.setCell(0, 5, "Time Sig.").setCell(1, 5, transport.getNumerator() + " / " + transport.getDenominator());
    d.setBlock(0, 3, "Play Position").setBlock(1, 3, transport.getPositionText()).allDone();
}
Also used : ITransport(de.mossgrabers.framework.daw.ITransport) Display(de.mossgrabers.framework.controller.display.Display) PushDisplay(de.mossgrabers.push.controller.PushDisplay)

Example 28 with ITransport

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

the class TransportMode method updateDisplay2.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay2() {
    final ITransport transport = this.model.getTransport();
    final String preroll = transport.getPreroll();
    final double tempo = transport.getTempo();
    final PushDisplay display = (PushDisplay) this.surface.getDisplay();
    final DisplayMessage message = display.createMessage();
    message.addOptionElement("Play Metronome during Pre-Roll?", transport.isPrerollMetronomeEnabled() ? "Yes" : "No", transport.isPrerollMetronomeEnabled(), "Pre-roll", "None", preroll == ITransport.PREROLL_NONE, false);
    message.addOptionElement("", "", false, "", "1 Bar", preroll == ITransport.PREROLL_1_BAR, false);
    message.addOptionElement("", "", false, "", "2 Bars", preroll == ITransport.PREROLL_2_BARS, false);
    message.addOptionElement("", "", false, "", "4 Bars", preroll == ITransport.PREROLL_4_BARS, false);
    message.addParameterElement("Tempo", (int) this.convertTempo(tempo), transport.formatTempo(tempo), this.isKnobTouched[0], -1);
    message.addOptionElement("  Time Sig.", "", false, "       " + transport.getNumerator() + " / " + transport.getDenominator(), "", false, false);
    message.addOptionElement("        Play Position", "", false, "        " + transport.getPositionText(), "", false, false);
    message.addOptionElement("", "", false, "", "", false, false);
    display.send(message);
}
Also used : ITransport(de.mossgrabers.framework.daw.ITransport) PushDisplay(de.mossgrabers.push.controller.PushDisplay) DisplayMessage(de.mossgrabers.push.controller.DisplayMessage)

Example 29 with ITransport

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

the class ControlView method updateButtons.

/**
 * {@inheritDoc}
 */
@Override
public void updateButtons() {
    final IChannelBank tb = this.model.getCurrentTrackBank();
    final ICursorDevice cd = this.model.getCursorDevice();
    final ITransport transport = this.model.getTransport();
    final int clipLength = this.surface.getConfiguration().getNewClipLength();
    final Integer mode = this.surface.getModeManager().getActiveModeId();
    final boolean isTrack = mode == Modes.MODE_TRACK;
    final boolean isTrackToggles = mode == Modes.MODE_TRACK_TOGGLES;
    final boolean isVolume = mode == Modes.MODE_VOLUME;
    final boolean isMaster = mode == Modes.MODE_MASTER;
    final boolean isFixed = mode == Modes.MODE_FIXED;
    final boolean isFrame = mode == Modes.MODE_FRAME;
    final boolean isPreset = mode == Modes.MODE_BROWSER;
    final boolean isDevice = mode == Modes.MODE_PARAMS;
    final boolean isFunctions = mode == Modes.MODE_FUNCTIONS;
    if (mode == Modes.MODE_VIEW_SELECT) {
        for (int i = 0; i < 8; i++) this.surface.updateButton(SLControlSurface.MKII_BUTTON_ROW1_1 + i, SLControlSurface.MKII_BUTTON_STATE_OFF);
    } else {
        // Button row 1: Clip length or functions
        this.surface.updateButton(SLControlSurface.MKII_BUTTON_ROW1_1, !isFunctions && clipLength == 0 ? SLControlSurface.MKII_BUTTON_STATE_ON : SLControlSurface.MKII_BUTTON_STATE_OFF);
        this.surface.updateButton(SLControlSurface.MKII_BUTTON_ROW1_2, !isFunctions && clipLength == 1 ? SLControlSurface.MKII_BUTTON_STATE_ON : SLControlSurface.MKII_BUTTON_STATE_OFF);
        this.surface.updateButton(SLControlSurface.MKII_BUTTON_ROW1_3, !isFunctions && clipLength == 2 ? SLControlSurface.MKII_BUTTON_STATE_ON : SLControlSurface.MKII_BUTTON_STATE_OFF);
        this.surface.updateButton(SLControlSurface.MKII_BUTTON_ROW1_4, !isFunctions && clipLength == 3 ? SLControlSurface.MKII_BUTTON_STATE_ON : SLControlSurface.MKII_BUTTON_STATE_OFF);
        this.surface.updateButton(SLControlSurface.MKII_BUTTON_ROW1_5, !isFunctions && clipLength == 4 ? SLControlSurface.MKII_BUTTON_STATE_ON : SLControlSurface.MKII_BUTTON_STATE_OFF);
        this.surface.updateButton(SLControlSurface.MKII_BUTTON_ROW1_6, isFunctions && this.model.getCursorDevice().isWindowOpen() || !isFunctions && clipLength == 5 ? SLControlSurface.MKII_BUTTON_STATE_ON : SLControlSurface.MKII_BUTTON_STATE_OFF);
        this.surface.updateButton(SLControlSurface.MKII_BUTTON_ROW1_7, isFunctions && transport.isMetronomeOn() || !isFunctions && clipLength == 6 ? SLControlSurface.MKII_BUTTON_STATE_ON : SLControlSurface.MKII_BUTTON_STATE_OFF);
        this.surface.updateButton(SLControlSurface.MKII_BUTTON_ROW1_8, !isFunctions && clipLength == 7 ? SLControlSurface.MKII_BUTTON_STATE_ON : SLControlSurface.MKII_BUTTON_STATE_OFF);
    }
    // Button row 2: Track toggles / Browse
    if (mode == Modes.MODE_BROWSER) {
        final int selMode = ((DevicePresetsMode) this.surface.getModeManager().getMode(Modes.MODE_BROWSER)).getSelectionMode();
        this.surface.updateButton(SLControlSurface.MKII_BUTTON_ROW2_1, SLControlSurface.MKII_BUTTON_STATE_ON);
        this.surface.updateButton(SLControlSurface.MKII_BUTTON_ROW2_2, SLControlSurface.MKII_BUTTON_STATE_ON);
        this.surface.updateButton(SLControlSurface.MKII_BUTTON_ROW2_3, selMode == DevicePresetsMode.SELECTION_OFF ? SLControlSurface.MKII_BUTTON_STATE_ON : SLControlSurface.MKII_BUTTON_STATE_OFF);
        this.surface.updateButton(SLControlSurface.MKII_BUTTON_ROW2_4, selMode == DevicePresetsMode.SELECTION_OFF ? SLControlSurface.MKII_BUTTON_STATE_ON : SLControlSurface.MKII_BUTTON_STATE_OFF);
        this.surface.updateButton(SLControlSurface.MKII_BUTTON_ROW2_5, selMode == DevicePresetsMode.SELECTION_OFF ? SLControlSurface.MKII_BUTTON_STATE_ON : SLControlSurface.MKII_BUTTON_STATE_OFF);
        this.surface.updateButton(SLControlSurface.MKII_BUTTON_ROW2_6, selMode == DevicePresetsMode.SELECTION_OFF ? SLControlSurface.MKII_BUTTON_STATE_ON : SLControlSurface.MKII_BUTTON_STATE_OFF);
        this.surface.updateButton(SLControlSurface.MKII_BUTTON_ROW2_7, selMode == DevicePresetsMode.SELECTION_OFF ? SLControlSurface.MKII_BUTTON_STATE_ON : SLControlSurface.MKII_BUTTON_STATE_OFF);
        this.surface.updateButton(SLControlSurface.MKII_BUTTON_ROW2_8, SLControlSurface.MKII_BUTTON_STATE_ON);
    } else {
        final boolean isNoOverlayMode = mode != Modes.MODE_FRAME && mode != Modes.MODE_BROWSER;
        final ITrack track = tb.getSelectedTrack();
        this.surface.updateButton(SLControlSurface.MKII_BUTTON_ROW2_1, isNoOverlayMode && track != null && track.isMute() ? SLControlSurface.MKII_BUTTON_STATE_ON : SLControlSurface.MKII_BUTTON_STATE_OFF);
        this.surface.updateButton(SLControlSurface.MKII_BUTTON_ROW2_2, isNoOverlayMode && track != null && track.isSolo() ? SLControlSurface.MKII_BUTTON_STATE_ON : SLControlSurface.MKII_BUTTON_STATE_OFF);
        this.surface.updateButton(SLControlSurface.MKII_BUTTON_ROW2_3, isNoOverlayMode && track != null && track.isRecArm() ? SLControlSurface.MKII_BUTTON_STATE_ON : SLControlSurface.MKII_BUTTON_STATE_OFF);
        this.surface.updateButton(SLControlSurface.MKII_BUTTON_ROW2_4, transport.isWritingArrangerAutomation() ? SLControlSurface.MKII_BUTTON_STATE_ON : SLControlSurface.MKII_BUTTON_STATE_OFF);
        this.surface.updateButton(SLControlSurface.MKII_BUTTON_ROW2_5, SLControlSurface.MKII_BUTTON_STATE_OFF);
        this.surface.updateButton(SLControlSurface.MKII_BUTTON_ROW2_6, this.model.getCursorDevice().isEnabled() ? SLControlSurface.MKII_BUTTON_STATE_ON : SLControlSurface.MKII_BUTTON_STATE_OFF);
        this.surface.updateButton(SLControlSurface.MKII_BUTTON_ROW2_7, isNoOverlayMode && cd.canSelectPreviousFX() ? SLControlSurface.MKII_BUTTON_STATE_ON : SLControlSurface.MKII_BUTTON_STATE_OFF);
        this.surface.updateButton(SLControlSurface.MKII_BUTTON_ROW2_8, isNoOverlayMode && cd.canSelectNextFX() ? SLControlSurface.MKII_BUTTON_STATE_ON : SLControlSurface.MKII_BUTTON_STATE_OFF);
    }
    // Button row 3: Selected track indication
    for (int i = 0; i < 8; i++) this.surface.updateButton(SLControlSurface.MKII_BUTTON_ROW3_1 + i, tb.getTrack(i).isSelected() ? SLControlSurface.MKII_BUTTON_STATE_ON : SLControlSurface.MKII_BUTTON_STATE_OFF);
    // LED indications for device parameters
    ((DeviceParamsMode) this.surface.getModeManager().getMode(Modes.MODE_PARAMS)).setLEDs();
    // Transport buttons
    this.surface.updateButton(SLControlSurface.MKII_BUTTON_ROW4_3, !transport.isPlaying() ? SLControlSurface.MKII_BUTTON_STATE_ON : SLControlSurface.MKII_BUTTON_STATE_OFF);
    this.surface.updateButton(SLControlSurface.MKII_BUTTON_ROW4_4, transport.isPlaying() ? SLControlSurface.MKII_BUTTON_STATE_ON : SLControlSurface.MKII_BUTTON_STATE_OFF);
    this.surface.updateButton(SLControlSurface.MKII_BUTTON_ROW4_5, transport.isLoop() ? SLControlSurface.MKII_BUTTON_STATE_ON : SLControlSurface.MKII_BUTTON_STATE_OFF);
    this.surface.updateButton(SLControlSurface.MKII_BUTTON_ROW4_6, transport.isRecording() ? SLControlSurface.MKII_BUTTON_STATE_ON : SLControlSurface.MKII_BUTTON_STATE_OFF);
    this.surface.updateButton(SLControlSurface.MKII_BUTTON_ROWSEL1, isFunctions || isFixed ? SLControlSurface.MKII_BUTTON_STATE_ON : SLControlSurface.MKII_BUTTON_STATE_OFF);
    this.surface.updateButton(SLControlSurface.MKII_BUTTON_ROWSEL2, isDevice ? SLControlSurface.MKII_BUTTON_STATE_ON : SLControlSurface.MKII_BUTTON_STATE_OFF);
    this.surface.updateButton(SLControlSurface.MKII_BUTTON_ROWSEL3, isTrackToggles || isFrame || isPreset ? SLControlSurface.MKII_BUTTON_STATE_ON : SLControlSurface.MKII_BUTTON_STATE_OFF);
    this.surface.updateButton(SLControlSurface.MKII_BUTTON_ROWSEL4, isTrack || isMaster ? SLControlSurface.MKII_BUTTON_STATE_ON : SLControlSurface.MKII_BUTTON_STATE_OFF);
    this.surface.updateButton(SLControlSurface.MKII_BUTTON_ROWSEL6, isVolume ? SLControlSurface.MKII_BUTTON_STATE_ON : SLControlSurface.MKII_BUTTON_STATE_OFF);
    this.surface.updateButton(SLControlSurface.MKII_BUTTON_ROWSEL7, SLControlSurface.MKII_BUTTON_STATE_OFF);
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) ITransport(de.mossgrabers.framework.daw.ITransport) DevicePresetsMode(de.mossgrabers.sl.mode.device.DevicePresetsMode) DeviceParamsMode(de.mossgrabers.sl.mode.device.DeviceParamsMode) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice)

Example 30 with ITransport

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

the class ControlMode method updateDisplay.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay() {
    final ACVSDisplay d = (ACVSDisplay) this.surface.getDisplay();
    final ACVSConfiguration configuration = this.surface.getConfiguration();
    final boolean isForce = configuration.isActiveACVSDevice(ACVSDevice.FORCE);
    final boolean isMPC = !isForce;
    final boolean isMPC_X = configuration.isActiveACVSDevice(ACVSDevice.MPC_X);
    final ITrackBank tb = this.model.getCurrentTrackBank();
    final ICursorDevice device = this.model.getCursorDevice();
    final int maxScene = calcMaxScene(this.model.getSceneBank());
    d.setScreenItem(ScreenItem.TRACK_NUMBER_OF_SCENES, maxScene);
    // Maximum number of sends
    d.setScreenItem(ScreenItem.TRACK_SENDS_NO, calcNumberOfSends(tb));
    for (int i = 0; i < 8; i++) {
        // Send track data
        final ITrack track = tb.getItem(i);
        sendTrackData(d, i, track);
        this.sendClipData(d, isMPC, i, track.getSlotBank());
    }
    this.sendSceneData(d, isMPC);
    // Set device data
    final boolean exists = device.doesExist();
    final Optional<String> selectedPage = device.getParameterPageBank().getSelectedItem();
    d.setRow(ACVSDisplay.ITEM_ID_DEVICE_BANK_NAME, exists ? selectedPage.orElse("") : "");
    d.setRow(ACVSDisplay.ITEM_ID_DEVICE_NAME, exists ? device.getName() : "");
    d.setScreenItem(ScreenItem.DEVICE_COUNT, device.doesExist() ? device.getDeviceBank().getItemCount() : 0);
    final int devicePosition = device.getPosition();
    d.setScreenItem(ScreenItem.CURRENT_DEVICE_INDEX, devicePosition >= 0 ? devicePosition : 0);
    d.setScreenItem(ScreenItem.CURRENT_DEVICE_ACTIVE, device.isEnabled() ? 127 : 0);
    final IParameterBank parameterBank = device.getParameterBank();
    for (int i = 0; i < 8; i++) {
        final IParameter param = parameterBank.getItem(i);
        d.setRow(ACVSDisplay.ITEM_ID_DEVICE_PARAMETER_NAME_FIRST + i, param.getName());
        d.setRow(ACVSDisplay.ITEM_ID_DEVICE_PARAMETER_VALUE_FIRST + i, param.getDisplayedValue());
        d.setScreenItem(ScreenItem.get(ScreenItem.DEVICE_PARAM1_ENABLED, i), param.doesExist() ? 127 : 0);
        d.setScreenItem(ScreenItem.get(ScreenItem.DEVICE_PARAM1_VALUE, i), param.getValue());
        if (isForce || isMPC_X) {
            d.setScreenItem(ScreenItem.get(ScreenItem.KNOBSTYLE1_COLOR, 8 + i), param.doesExist() ? 1 : 0);
            d.setScreenItem(ScreenItem.get(ScreenItem.KNOB_VALUE1, 8 + i), param.getValue());
            d.setRow(ACVSDisplay.ITEM_ID_DEVICE_PARAM_NAME1 + 8 + i, param.getName());
            d.setRow(ACVSDisplay.ITEM_ID_DEVICE_PARAM_VALUE1 + 8 + i, param.getDisplayedValue());
            final ITrack track = tb.getItem(i);
            d.setScreenItem(ScreenItem.get(ScreenItem.KNOBSTYLE1_COLOR, i), track.doesExist() ? 1 : 0);
            d.setScreenItem(ScreenItem.get(ScreenItem.KNOB_VALUE1, i), track.getVolume());
            d.setRow(ACVSDisplay.ITEM_ID_DEVICE_PARAM_NAME1 + i, track.getName());
            d.setRow(ACVSDisplay.ITEM_ID_DEVICE_PARAM_VALUE1 + i, track.getVolumeStr());
        }
    }
    // Set transport data
    final ITransport transport = this.model.getTransport();
    d.setRow(ACVSDisplay.ITEM_ID_TEMPO, transport.getTempoParameter().getDisplayedValue());
    d.setRow(ACVSDisplay.ITEM_ID_ARRANGEMENT_POSITION, transport.getBeatText().split(":")[0].replace('.', ':'));
    d.setRow(ACVSDisplay.ITEM_ID_LOOP_START, transport.getLoopStartBeatText().split(":")[0].replace('.', ':'));
    d.setRow(ACVSDisplay.ITEM_ID_LOOP_LENGTH, transport.getLoopLengthBeatText().split(":")[0].replace('.', ':'));
    this.sendAdditionalMPCParameters(d);
    if (!isMPC)
        this.sendAdditionalForceParameters(d);
    d.allDone();
    if (this.currentMaxScene != maxScene) {
        this.currentMaxScene = maxScene;
        this.surface.forceFlush();
    }
}
Also used : IParameter(de.mossgrabers.framework.daw.data.IParameter) ITrack(de.mossgrabers.framework.daw.data.ITrack) ACVSDisplay(de.mossgrabers.controller.akai.acvs.controller.ACVSDisplay) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank) ITransport(de.mossgrabers.framework.daw.ITransport) ACVSConfiguration(de.mossgrabers.controller.akai.acvs.ACVSConfiguration) IParameterBank(de.mossgrabers.framework.daw.data.bank.IParameterBank) ICursorDevice(de.mossgrabers.framework.daw.data.ICursorDevice)

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