Search in sources :

Example 31 with ITextDisplay

use of de.mossgrabers.framework.controller.display.ITextDisplay in project DrivenByMoss by git-moss.

the class DeviceParamsMode method updateDisplay.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay() {
    this.drawDisplay2();
    final ITextDisplay d = this.surface.getTextDisplay().clear();
    final ICursorDevice cd = this.model.getCursorDevice();
    if (!cd.doesExist()) {
        d.notify("Please select a device...");
        return;
    }
    // Row 1 & 2
    final int extenderOffset = this.surface.getExtenderOffset();
    final IParameterBank parameterBank = cd.getParameterBank();
    for (int i = 0; i < 8; i++) {
        final IParameter param = parameterBank.getItem(extenderOffset + i);
        d.setCell(0, i, param.doesExist() ? StringUtils.shortenAndFixASCII(param.getName(6), 6) : "").setCell(1, i, StringUtils.shortenAndFixASCII(param.getDisplayedValue(6), 6));
    }
    d.allDone();
}
Also used : IParameter(de.mossgrabers.framework.daw.data.IParameter) ITextDisplay(de.mossgrabers.framework.controller.display.ITextDisplay) IParameterBank(de.mossgrabers.framework.daw.data.bank.IParameterBank) ICursorDevice(de.mossgrabers.framework.daw.data.ICursorDevice)

Example 32 with ITextDisplay

use of de.mossgrabers.framework.controller.display.ITextDisplay in project DrivenByMoss by git-moss.

the class TrackMode method updateDisplay.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay() {
    if (!this.surface.getConfiguration().hasDisplay1())
        return;
    this.drawDisplay2();
    if (!this.drawTrackHeader())
        return;
    final ITextDisplay d = this.surface.getTextDisplay().clear();
    final Optional<ITrack> selectedTrack = this.getSelectedTrack();
    if (selectedTrack.isEmpty()) {
        d.notify("Please select a track...");
        return;
    }
    final boolean displayTrackNames = this.surface.getConfiguration().isDisplayTrackNames();
    if (!displayTrackNames) {
        d.setCell(0, 0, "Volume");
        d.setCell(0, 1, "Pan");
    }
    final ITrack t = selectedTrack.get();
    d.setCell(1, 0, t.getVolumeStr(6));
    d.setCell(1, 1, t.getPanStr(6));
    final int sendStart = 2;
    final int sendCount = 6;
    final boolean isEffectTrackBankActive = this.model.isEffectTrackBankActive();
    final ISendBank sendBank = t.getSendBank();
    for (int i = 0; i < sendCount; i++) {
        final int pos = sendStart + i;
        if (!isEffectTrackBankActive && i < sendBank.getItemCount()) {
            final ISend send = sendBank.getItem(i);
            if (send.doesExist()) {
                if (!displayTrackNames)
                    d.setCell(0, pos, StringUtils.fixASCII(send.getName()));
                d.setCell(1, pos, send.getDisplayedValue(6));
            }
        }
    }
    if (!displayTrackNames)
        d.done(0);
    d.done(1);
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITextDisplay(de.mossgrabers.framework.controller.display.ITextDisplay) ISend(de.mossgrabers.framework.daw.data.ISend) ISendBank(de.mossgrabers.framework.daw.data.bank.ISendBank)

Example 33 with ITextDisplay

use of de.mossgrabers.framework.controller.display.ITextDisplay in project DrivenByMoss by git-moss.

the class SelectCommand method handleButtonCombinations.

private boolean handleButtonCombinations(final ButtonEvent event) {
    // Select Send channels if Send button is pressed
    if (this.surface.isPressed(ButtonID.SENDS)) {
        if (event != ButtonEvent.DOWN)
            return true;
        final ITextDisplay display = this.surface.getTextDisplay();
        final ITrackBank effectTrackBank = this.model.getEffectTrackBank();
        if (effectTrackBank != null && effectTrackBank.getItem(this.channel).doesExist()) {
            this.surface.getModeManager().setActive(Modes.get(Modes.SEND1, this.index));
            display.notify("Send channel " + (this.channel + 1) + " selected.");
        } else
            display.notify("Send channel " + (this.channel + 1) + " does not exist.");
        this.surface.setTriggerConsumed(ButtonID.SENDS);
        return true;
    }
    // Execute stop if Select is pressed
    if (this.surface.isSelectPressed()) {
        if (event == ButtonEvent.DOWN)
            this.getTrackBank().getItem(this.channel).stop();
        return true;
    }
    if (this.surface.getConfiguration().hasOnly1Fader()) {
        if (event != ButtonEvent.DOWN)
            return true;
        final ModeManager modeManager = this.surface.getModeManager();
        // Select marker if marker mode is active
        if (modeManager.isActive(Modes.MARKERS)) {
            this.model.getMarkerBank().getItem(this.channel).select();
            return true;
        }
        // Select parameter if device mode is active
        if (modeManager.isActive(Modes.DEVICE_PARAMS)) {
            final ICursorDevice cursorDevice = this.model.getCursorDevice();
            if (cursorDevice.doesExist())
                cursorDevice.getParameterBank().getItem(this.channel).select();
            return true;
        }
    }
    return false;
}
Also used : ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank) ITextDisplay(de.mossgrabers.framework.controller.display.ITextDisplay) ICursorDevice(de.mossgrabers.framework.daw.data.ICursorDevice) ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Example 34 with ITextDisplay

use of de.mossgrabers.framework.controller.display.ITextDisplay in project DrivenByMoss by git-moss.

the class VolumeMode method drawTrackHeader.

/**
 * {@inheritDoc}
 */
@Override
protected boolean drawTrackHeader() {
    if (!super.drawTrackHeader())
        return false;
    if (this.surface.getConfiguration().isDisplayTrackNames())
        return true;
    final ITrackBank tb = this.getTrackBank();
    final ITextDisplay d = this.surface.getTextDisplay();
    final int extenderOffset = this.getExtenderOffset();
    for (int i = 0; i < 8; i++) {
        if (tb.getItem(extenderOffset + i).doesExist())
            d.setCell(0, i, "Volume");
        else
            d.clearCell(0, i);
    }
    d.done(0);
    return true;
}
Also used : ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank) ITextDisplay(de.mossgrabers.framework.controller.display.ITextDisplay)

Example 35 with ITextDisplay

use of de.mossgrabers.framework.controller.display.ITextDisplay in project DrivenByMoss by git-moss.

the class FunctionMode method updateDisplay.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay() {
    final ITextDisplay d = this.surface.getTextDisplay().clearRow(0).clearRow(1);
    d.setBlock(0, 0, "Functions:");
    d.setCell(1, 0, "  Undo").setCell(1, 1, "  Redo").setCell(1, 2, " Delete").setCell(1, 3, " Double");
    d.setCell(1, 4, "  New").setCell(1, 5, " Window ").setCell(1, 6, "Metronom").setCell(1, 7, "TapTempo");
    d.done(0).done(1);
}
Also used : ITextDisplay(de.mossgrabers.framework.controller.display.ITextDisplay)

Aggregations

ITextDisplay (de.mossgrabers.framework.controller.display.ITextDisplay)49 ITrack (de.mossgrabers.framework.daw.data.ITrack)16 ITrackBank (de.mossgrabers.framework.daw.data.bank.ITrackBank)16 ICursorDevice (de.mossgrabers.framework.daw.data.ICursorDevice)8 IParameter (de.mossgrabers.framework.daw.data.IParameter)6 IMasterTrack (de.mossgrabers.framework.daw.data.IMasterTrack)5 IParameterBank (de.mossgrabers.framework.daw.data.bank.IParameterBank)5 IBrowser (de.mossgrabers.framework.daw.IBrowser)4 ITransport (de.mossgrabers.framework.daw.ITransport)4 IBrowserColumn (de.mossgrabers.framework.daw.data.IBrowserColumn)4 ICursorTrack (de.mossgrabers.framework.daw.data.ICursorTrack)4 ISend (de.mossgrabers.framework.daw.data.ISend)4 ISendBank (de.mossgrabers.framework.daw.data.bank.ISendBank)4 IBrowserColumnItem (de.mossgrabers.framework.daw.data.IBrowserColumnItem)3 Scales (de.mossgrabers.framework.scale.Scales)2 IGraphicDisplay (de.mossgrabers.framework.controller.display.IGraphicDisplay)1 IApplication (de.mossgrabers.framework.daw.IApplication)1 IStepInfo (de.mossgrabers.framework.daw.IStepInfo)1 GridStep (de.mossgrabers.framework.daw.data.GridStep)1 IMarker (de.mossgrabers.framework.daw.data.IMarker)1