Search in sources :

Example 1 with TitleValueComponent

use of de.mossgrabers.controller.akai.fire.graphics.canvas.component.TitleValueComponent in project DrivenByMoss by git-moss.

the class FireUserMode method updateDisplay.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay() {
    final IGraphicDisplay display = this.surface.getGraphicsDisplay();
    final IParameterBank userBank = this.model.getUserParameterBank();
    final int page = userBank.getScrollPosition() / userBank.getPageSize();
    final String desc = "User Page: " + (page + 1);
    String paramLine = "";
    int value = -1;
    final int touchedKnob = this.getTouchedKnob();
    if (touchedKnob > -1) {
        final IParameter p = userBank.getItem(touchedKnob);
        paramLine = p.getName(5);
        if (paramLine.isEmpty())
            paramLine = "Not mapped";
        else {
            value = p.getValue();
            paramLine += ": " + p.getDisplayedValue(6);
        }
    }
    display.addElement(new TitleValueComponent(desc, paramLine, value, false));
    display.send();
}
Also used : IParameter(de.mossgrabers.framework.daw.data.IParameter) IGraphicDisplay(de.mossgrabers.framework.controller.display.IGraphicDisplay) IParameterBank(de.mossgrabers.framework.daw.data.bank.IParameterBank) TitleValueComponent(de.mossgrabers.controller.akai.fire.graphics.canvas.component.TitleValueComponent)

Example 2 with TitleValueComponent

use of de.mossgrabers.controller.akai.fire.graphics.canvas.component.TitleValueComponent in project DrivenByMoss by git-moss.

the class FireParameterMode method updateDisplay.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay() {
    final IGraphicDisplay display = this.surface.getGraphicsDisplay();
    String desc = "Select";
    String paramLine = "a device";
    int value = -1;
    if (this.model.hasSelectedDevice()) {
        paramLine = "";
        final ICursorDevice cursorDevice = this.model.getCursorDevice();
        final Optional<String> pageName = cursorDevice.getParameterPageBank().getSelectedItem();
        desc = cursorDevice.getName(5) + ": " + (pageName.isPresent() ? StringUtils.optimizeName(pageName.get(), 5) : "None");
        int touchedKnob = this.getTouchedKnob();
        touchedKnob = this.surface.isPressed(ButtonID.ALT) ? 4 + touchedKnob : touchedKnob;
        if (touchedKnob > -1) {
            final IParameter p = this.bank.getItem(touchedKnob);
            paramLine = p.getName(5);
            if (!paramLine.isEmpty()) {
                value = p.getValue();
                paramLine += ": " + p.getDisplayedValue(6);
            }
        }
    }
    display.addElement(new TitleValueComponent(desc, paramLine, value, false));
    display.send();
}
Also used : IParameter(de.mossgrabers.framework.daw.data.IParameter) IGraphicDisplay(de.mossgrabers.framework.controller.display.IGraphicDisplay) ICursorDevice(de.mossgrabers.framework.daw.data.ICursorDevice) TitleValueComponent(de.mossgrabers.controller.akai.fire.graphics.canvas.component.TitleValueComponent)

Example 3 with TitleValueComponent

use of de.mossgrabers.controller.akai.fire.graphics.canvas.component.TitleValueComponent 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 4 with TitleValueComponent

use of de.mossgrabers.controller.akai.fire.graphics.canvas.component.TitleValueComponent 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)

Aggregations

TitleValueComponent (de.mossgrabers.controller.akai.fire.graphics.canvas.component.TitleValueComponent)4 IGraphicDisplay (de.mossgrabers.framework.controller.display.IGraphicDisplay)4 IParameter (de.mossgrabers.framework.daw.data.IParameter)2 ISendBank (de.mossgrabers.framework.daw.data.bank.ISendBank)2 IChannel (de.mossgrabers.framework.daw.data.IChannel)1 ICursorDevice (de.mossgrabers.framework.daw.data.ICursorDevice)1 ILayer (de.mossgrabers.framework.daw.data.ILayer)1 ISpecificDevice (de.mossgrabers.framework.daw.data.ISpecificDevice)1 ITrack (de.mossgrabers.framework.daw.data.ITrack)1 IParameterBank (de.mossgrabers.framework.daw.data.bank.IParameterBank)1