Search in sources :

Example 6 with IGraphicDisplay

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

the class FireLayerMode method updateDisplay.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay() {
    this.updateMode();
    final IGraphicDisplay display = this.surface.getGraphicsDisplay();
    String desc = "Select";
    String label = "a drum pad";
    int value = -1;
    int vuLeft = -1;
    int vuRight = -1;
    boolean isPan = false;
    final ISpecificDevice cd = this.model.getDrumDevice();
    final Optional<ILayer> channelOptional = cd.getLayerBank().getSelectedItem();
    if (channelOptional.isPresent()) {
        final IChannel channel = channelOptional.get();
        vuLeft = channel.getVuLeft();
        vuRight = channel.getVuRight();
        desc = channel.getPosition() + 1 + ": " + channel.getName(9);
        final ISendBank sendBank = channel.getSendBank();
        switch(this.selectedParameter) {
            case VOLUME:
                label = "Vol: " + channel.getVolumeStr();
                value = channel.getVolume();
                break;
            case PAN:
                label = "Pan: " + channel.getPanStr();
                value = channel.getPan();
                isPan = true;
                break;
            case SEND1:
            case SEND2:
            case SEND3:
            case SEND4:
            case SEND5:
            case SEND6:
                final int sendIndex = this.selectedParameter.ordinal() - Modes.SEND1.ordinal();
                label = getSendLabel(sendBank, sendIndex);
                value = getSendValue(sendBank, sendIndex);
                break;
            default:
                label = "Select a track";
                break;
        }
    }
    display.addElement(new TitleValueComponent(desc, label, value, vuLeft, vuRight, isPan));
    display.send();
}
Also used : IChannel(de.mossgrabers.framework.daw.data.IChannel) ILayer(de.mossgrabers.framework.daw.data.ILayer) IGraphicDisplay(de.mossgrabers.framework.controller.display.IGraphicDisplay) ISpecificDevice(de.mossgrabers.framework.daw.data.ISpecificDevice) ISendBank(de.mossgrabers.framework.daw.data.bank.ISendBank) TitleValueComponent(de.mossgrabers.controller.akai.fire.graphics.canvas.component.TitleValueComponent)

Example 7 with IGraphicDisplay

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

the class FireTrackMode method updateDisplay.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay() {
    this.updateMode();
    final IGraphicDisplay display = this.surface.getGraphicsDisplay();
    String desc = "Select";
    String label = "a track";
    int value = -1;
    int vuLeft = -1;
    int vuRight = -1;
    boolean isPan = false;
    final Optional<ITrack> trackOptional = this.model.getCurrentTrackBank().getSelectedItem();
    if (trackOptional.isPresent()) {
        final ITrack track = trackOptional.get();
        vuLeft = track.getVuLeft();
        vuRight = track.getVuRight();
        desc = track.getPosition() + 1 + ": " + track.getName(9);
        final ISendBank sendBank = track.getSendBank();
        switch(this.selectedParameter) {
            case VOLUME:
                label = "Vol: " + track.getVolumeStr();
                value = track.getVolume();
                break;
            case PAN:
                label = "Pan: " + track.getPanStr();
                value = track.getPan();
                isPan = true;
                break;
            case SEND1:
            case SEND2:
            case SEND3:
            case SEND4:
            case SEND5:
            case SEND6:
                final int sendIndex = this.selectedParameter.ordinal() - Modes.SEND1.ordinal();
                label = getSendLabel(sendBank, sendIndex);
                value = getSendValue(sendBank, sendIndex);
                break;
            default:
                // Not used
                break;
        }
    }
    display.addElement(new TitleValueComponent(desc, label, value, vuLeft, vuRight, isPan));
    display.send();
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) IGraphicDisplay(de.mossgrabers.framework.controller.display.IGraphicDisplay) ISendBank(de.mossgrabers.framework.daw.data.bank.ISendBank) TitleValueComponent(de.mossgrabers.controller.akai.fire.graphics.canvas.component.TitleValueComponent)

Example 8 with IGraphicDisplay

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

the class BrowserMode method updateDisplay.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay() {
    final IBrowser browser = this.model.getBrowser();
    if (!browser.isActive())
        return;
    final String[] rows = new String[3];
    final boolean[] sels = new boolean[] { false, false, false };
    final IGraphicDisplay display = this.surface.getGraphicsDisplay();
    final int idx = this.getTouchedKnob();
    if (idx < 0) {
        final String selectedResult = browser.getSelectedResult();
        rows[0] = browser.getSelectedContentType().toUpperCase(Locale.US);
        rows[1] = "Selection: ";
        rows[2] = selectedResult == null || selectedResult.isBlank() ? "None" : selectedResult;
    } else if (idx == 8) {
        final IBrowserColumnItem[] results = browser.getResultColumnItems();
        if (results[0].doesExist()) {
            for (int item = 0; item < 3; item++) {
                rows[item] = item < results.length ? results[item].getName() : "";
                sels[item] = item < results.length && results[item].isSelected();
            }
        } else {
            rows[0] = "No";
            rows[1] = "results ";
            rows[2] = "available...";
        }
    } else {
        final IBrowserColumn filterColumn = browser.getFilterColumn(idx);
        if (filterColumn.doesExist() && filterColumn.doesCursorExist()) {
            final IBrowserColumnItem[] item = filterColumn.getItems();
            for (int itemIndex = 0; itemIndex < 3; itemIndex++) {
                final int pos = itemIndex;
                String text = StringUtils.optimizeName(item[pos].getName(), 10);
                if (!text.isEmpty())
                    text = text + " (" + item[pos].getHitCount() + ")";
                rows[itemIndex] = text;
                sels[itemIndex] = item[pos].isSelected();
            }
        } else {
            rows[0] = "";
            rows[1] = "";
            rows[2] = "";
        }
    }
    display.addListElement(rows, sels);
    display.send();
}
Also used : IBrowser(de.mossgrabers.framework.daw.IBrowser) IGraphicDisplay(de.mossgrabers.framework.controller.display.IGraphicDisplay) IBrowserColumn(de.mossgrabers.framework.daw.data.IBrowserColumn)

Aggregations

IGraphicDisplay (de.mossgrabers.framework.controller.display.IGraphicDisplay)8 TitleValueComponent (de.mossgrabers.controller.akai.fire.graphics.canvas.component.TitleValueComponent)4 ISendBank (de.mossgrabers.framework.daw.data.bank.ISendBank)4 IChannel (de.mossgrabers.framework.daw.data.IChannel)3 TitleChannelsComponent (de.mossgrabers.controller.akai.fire.graphics.canvas.component.TitleChannelsComponent)2 ILayer (de.mossgrabers.framework.daw.data.ILayer)2 IParameter (de.mossgrabers.framework.daw.data.IParameter)2 ISend (de.mossgrabers.framework.daw.data.ISend)2 ISpecificDevice (de.mossgrabers.framework.daw.data.ISpecificDevice)2 ITrack (de.mossgrabers.framework.daw.data.ITrack)2 ITextDisplay (de.mossgrabers.framework.controller.display.ITextDisplay)1 IBrowser (de.mossgrabers.framework.daw.IBrowser)1 IBrowserColumn (de.mossgrabers.framework.daw.data.IBrowserColumn)1 ICursorDevice (de.mossgrabers.framework.daw.data.ICursorDevice)1 ILayerBank (de.mossgrabers.framework.daw.data.bank.ILayerBank)1 IParameterBank (de.mossgrabers.framework.daw.data.bank.IParameterBank)1 ITrackBank (de.mossgrabers.framework.daw.data.bank.ITrackBank)1