Search in sources :

Example 36 with Display

use of de.mossgrabers.framework.controller.display.Display 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 37 with Display

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

the class DeviceBrowserMode method updateDisplay1.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay1() {
    final IBrowser browser = this.model.getBrowser();
    if (!browser.isActive()) {
        this.surface.getModeManager().restoreMode();
        return;
    }
    final Display d = this.surface.getDisplay().clear();
    switch(this.selectionMode) {
        case DeviceBrowserMode.SELECTION_OFF:
            final String selectedResult = browser.getSelectedResult();
            final String deviceName = this.model.getCursorDevice().getName();
            String selectedContentType = browser.getSelectedContentType();
            if (this.filterColumn == -1)
                selectedContentType = PushDisplay.RIGHT_ARROW + selectedContentType;
            d.setCell(0, 7, selectedContentType).setBlock(3, 0, " Selected Device:").setBlock(3, 1, deviceName.length() == 0 ? "None" : deviceName);
            final boolean isPresetSession = browser.isPresetContentType();
            d.setBlock(3, 2, isPresetSession ? " Selected Preset:" : "").setBlock(3, 3, isPresetSession ? selectedResult == null || selectedResult.length() == 0 ? "None" : selectedResult : "");
            for (int i = 0; i < 7; i++) {
                final IBrowserColumn column = this.getFilterColumn(i);
                String name = column == null ? "" : StringUtils.shortenAndFixASCII(column.getName(), 8);
                if (i == this.filterColumn)
                    name = PushDisplay.RIGHT_ARROW + name;
                d.setCell(0, i, name).setCell(1, i, getColumnName(column));
            }
            break;
        case DeviceBrowserMode.SELECTION_PRESET:
            final IBrowserColumnItem[] results = browser.getResultColumnItems();
            if (!results[0].doesExist()) {
                d.clear().setBlock(1, 1, "       No results").setBlock(1, 2, "available...").allDone();
                return;
            }
            for (int i = 0; i < 16; i++) {
                if (i < results.length)
                    d.setBlock(i % 4, i / 4, (results[i].isSelected() ? PushDisplay.RIGHT_ARROW : " ") + results[i].getName(16));
                else
                    d.setBlock(i % 4, i / 4, "");
            }
            break;
        case DeviceBrowserMode.SELECTION_FILTER:
            final IBrowserColumnItem[] items = browser.getFilterColumn(this.filterColumn).getItems();
            for (int i = 0; i < 16; i++) {
                String text = (items[i].isSelected() ? PushDisplay.RIGHT_ARROW : " ") + items[i].getName() + "                ";
                if (!items[i].getName().isEmpty()) {
                    final String hitStr = "(" + items[i].getHitCount() + ")";
                    text = text.substring(0, 17 - hitStr.length()) + hitStr;
                }
                d.setBlock(i % 4, i / 4, text);
            }
            break;
    }
    d.allDone();
}
Also used : IBrowser(de.mossgrabers.framework.daw.IBrowser) IBrowserColumnItem(de.mossgrabers.framework.daw.data.IBrowserColumnItem) IBrowserColumn(de.mossgrabers.framework.daw.data.IBrowserColumn) Display(de.mossgrabers.framework.controller.display.Display) PushDisplay(de.mossgrabers.push.controller.PushDisplay)

Example 38 with Display

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

the class DeviceLayerModeVolume method updateDisplay1.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay1() {
    final Display d = this.surface.getDisplay();
    final ICursorDevice cd = this.model.getCursorDevice();
    // Drum Pad Bank has size of 16, layers only 8
    final int offset = getDrumPadIndex(cd);
    final PushConfiguration config = this.surface.getConfiguration();
    for (int i = 0; i < 8; i++) {
        final IChannel layer = cd.getLayerOrDrumPad(offset + i);
        d.setCell(0, i, layer.doesExist() ? "Volume" : "").setCell(1, i, layer.getVolumeStr(8));
        if (layer.doesExist())
            d.setCell(2, i, config.isEnableVUMeters() ? layer.getVu() : layer.getVolume(), Format.FORMAT_VALUE);
        else
            d.clearCell(2, i);
    }
    d.done(0).done(1).done(2);
    this.drawRow4(d, cd);
}
Also used : PushConfiguration(de.mossgrabers.push.PushConfiguration) IChannel(de.mossgrabers.framework.daw.data.IChannel) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice) Display(de.mossgrabers.framework.controller.display.Display)

Example 39 with Display

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

the class DeviceParamsMode method updateDisplay1.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay1() {
    final Display d = this.surface.getDisplay().clear();
    final ICursorDevice cd = this.model.getCursorDevice();
    if (!cd.hasSelectedDevice()) {
        d.clear().setBlock(1, 0, "           Select").setBlock(1, 1, "a device or press").setBlock(1, 2, "'Add Effect'...  ").allDone();
        return;
    }
    // Row 1 & 2
    for (int i = 0; i < 8; i++) {
        final IParameter param = cd.getFXParam(i);
        d.setCell(0, i, param.doesExist() ? StringUtils.fixASCII(param.getName()) : "").setCell(1, i, param.getDisplayedValue(8));
    }
    // Row 3
    d.setBlock(2, 0, "Selected Device:").setBlock(2, 1, cd.getName());
    // Row 4
    if (this.showDevices) {
        for (int i = 0; i < 8; i++) d.setCell(3, i, cd.doesSiblingExist(i) ? (i == cd.getPositionInBank() ? PushDisplay.RIGHT_ARROW : "") + cd.getSiblingDeviceName(i) : "");
    } else {
        final String[] pages = cd.getParameterPageNames();
        final int page = Math.min(Math.max(0, cd.getSelectedParameterPage()), pages.length - 1);
        final int start = page / 8 * 8;
        for (int i = 0; i < 8; i++) {
            final int index = start + i;
            d.setCell(3, i, index < pages.length ? (index == page ? PushDisplay.RIGHT_ARROW : "") + pages[index] : "");
        }
    }
    d.allDone();
}
Also used : IParameter(de.mossgrabers.framework.daw.data.IParameter) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice) Display(de.mossgrabers.framework.controller.display.Display) PushDisplay(de.mossgrabers.push.controller.PushDisplay)

Example 40 with Display

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

the class CrossfaderMode method updateDisplay1.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay1() {
    final Display d = this.surface.getDisplay();
    final IChannelBank tb = this.model.getCurrentTrackBank();
    final int upperBound = this.model.getValueChanger().getUpperBound();
    for (int i = 0; i < 8; i++) {
        final ITrack t = tb.getTrack(i);
        d.setCell(0, i, t.doesExist() ? "Crossfdr" : "");
        if (t.doesExist()) {
            final boolean isA = "A".equals(t.getCrossfadeMode());
            d.setCell(1, i, isA ? "A" : "B".equals(t.getCrossfadeMode()) ? "       B" : "   <> ");
            d.setCell(2, i, isA ? 0 : "B".equals(t.getCrossfadeMode()) ? upperBound : upperBound / 2, Format.FORMAT_PAN);
        } else {
            d.clearCell(1, i);
            d.clearCell(2, i);
        }
    }
    d.done(0).done(1).done(2);
    this.drawRow4();
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) Display(de.mossgrabers.framework.controller.display.Display)

Aggregations

Display (de.mossgrabers.framework.controller.display.Display)53 PushDisplay (de.mossgrabers.push.controller.PushDisplay)22 IChannelBank (de.mossgrabers.framework.daw.IChannelBank)18 ITrack (de.mossgrabers.framework.daw.data.ITrack)18 ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)10 ISend (de.mossgrabers.framework.daw.data.ISend)6 IChannel (de.mossgrabers.framework.daw.data.IChannel)5 IMasterTrack (de.mossgrabers.framework.daw.data.IMasterTrack)4 IParameter (de.mossgrabers.framework.daw.data.IParameter)4 PushConfiguration (de.mossgrabers.push.PushConfiguration)4 SLDisplay (de.mossgrabers.sl.controller.SLDisplay)4 IBrowser (de.mossgrabers.framework.daw.IBrowser)3 IBrowserColumn (de.mossgrabers.framework.daw.data.IBrowserColumn)3 IBrowserColumnItem (de.mossgrabers.framework.daw.data.IBrowserColumnItem)3 ViewManager (de.mossgrabers.framework.view.ViewManager)3 IApplication (de.mossgrabers.framework.daw.IApplication)2 MCUConfiguration (de.mossgrabers.mcu.MCUConfiguration)2 IValueChanger (de.mossgrabers.framework.controller.IValueChanger)1 ICursorClip (de.mossgrabers.framework.daw.ICursorClip)1 ISceneBank (de.mossgrabers.framework.daw.ISceneBank)1