Search in sources :

Example 1 with IGraphicDisplay

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

the class BaseMode method updateDisplay.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay() {
    if (this.surface.getConfiguration().isPush2()) {
        final IGraphicDisplay display = this.surface.getGraphicsDisplay();
        this.updateDisplay2(display);
        display.send();
        return;
    }
    final ITextDisplay display = this.surface.getTextDisplay().clear();
    this.updateDisplay1(display);
    display.allDone();
}
Also used : IGraphicDisplay(de.mossgrabers.framework.controller.display.IGraphicDisplay) ITextDisplay(de.mossgrabers.framework.controller.display.ITextDisplay)

Example 2 with IGraphicDisplay

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

the class FireTrackMixerMode method updateDisplay.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay() {
    this.updateMode();
    final IGraphicDisplay display = this.surface.getGraphicsDisplay();
    final ITrackBank trackBank = this.model.getCurrentTrackBank();
    final Optional<ITrack> trackOptional = trackBank.getSelectedItem();
    String label = "None";
    if (trackOptional.isPresent()) {
        final ITrack track = trackOptional.get();
        label = track.getPosition() + 1 + ": " + track.getName(9);
    }
    final int size = trackBank.getPageSize();
    final boolean[] selected = new boolean[size];
    final int[] values = new int[size];
    final boolean isMode = this.isAnyKnobTouched() || !this.model.getTransport().isPlaying();
    if (isMode) {
        switch(this.selectedParameter) {
            case VOLUME:
                for (int i = 0; i < size; i++) {
                    final IChannel channel = trackBank.getItem(i);
                    selected[i] = channel.isSelected();
                    values[i] = channel.getVolume();
                }
                break;
            case PAN:
                for (int i = 0; i < size; i++) {
                    final IChannel channel = trackBank.getItem(i);
                    selected[i] = channel.isSelected();
                    values[i] = channel.getPan();
                }
                break;
            case SEND1:
            case SEND2:
            case SEND3:
            case SEND4:
            case SEND5:
            case SEND6:
                final int sendIndex = this.selectedParameter.ordinal() - Modes.SEND1.ordinal();
                for (int i = 0; i < size; i++) {
                    final IChannel channel = trackBank.getItem(i);
                    selected[i] = channel.isSelected();
                    final ISendBank sendBank = channel.getSendBank();
                    if (sendBank != null) {
                        final ISend send = sendBank.getItem(sendIndex);
                        if (send.doesExist())
                            values[i] = send.getValue();
                    }
                }
                break;
            default:
                // Not used
                break;
        }
    } else {
        for (int i = 0; i < size; i++) {
            final IChannel channel = trackBank.getItem(i);
            selected[i] = channel.isSelected();
            values[i] = channel.getVu();
        }
    }
    display.addElement(new TitleChannelsComponent(label, selected, values, this.selectedParameter == Modes.PAN && isMode));
    display.send();
}
Also used : IChannel(de.mossgrabers.framework.daw.data.IChannel) ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank) IGraphicDisplay(de.mossgrabers.framework.controller.display.IGraphicDisplay) TitleChannelsComponent(de.mossgrabers.controller.akai.fire.graphics.canvas.component.TitleChannelsComponent) ISend(de.mossgrabers.framework.daw.data.ISend) ISendBank(de.mossgrabers.framework.daw.data.bank.ISendBank)

Example 3 with IGraphicDisplay

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

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

the class FireLayerMixerMode method updateDisplay.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay() {
    this.updateMode();
    final IGraphicDisplay display = this.surface.getGraphicsDisplay();
    final ISpecificDevice cd = this.model.getDrumDevice();
    final ILayerBank layerBank = cd.getLayerBank();
    final Optional<ILayer> channelOptional = layerBank.getSelectedItem();
    String label = "None";
    if (channelOptional.isPresent()) {
        final IChannel channel = channelOptional.get();
        label = channel.getPosition() + 1 + ": " + channel.getName(9);
    }
    final int size = layerBank.getPageSize();
    final boolean[] selected = new boolean[size];
    final int[] values = new int[size];
    final boolean isMode = this.isAnyKnobTouched() || !this.model.getTransport().isPlaying();
    if (isMode) {
        switch(this.selectedParameter) {
            case VOLUME:
                for (int i = 0; i < size; i++) {
                    final IChannel channel = layerBank.getItem(i);
                    selected[i] = channel.isSelected();
                    values[i] = channel.getVolume();
                }
                break;
            case PAN:
                for (int i = 0; i < size; i++) {
                    final IChannel channel = layerBank.getItem(i);
                    selected[i] = channel.isSelected();
                    values[i] = channel.getPan();
                }
                break;
            case SEND1:
            case SEND2:
            case SEND3:
            case SEND4:
            case SEND5:
            case SEND6:
                final int sendIndex = this.selectedParameter.ordinal() - Modes.SEND1.ordinal();
                for (int i = 0; i < size; i++) {
                    final IChannel channel = layerBank.getItem(i);
                    selected[i] = channel.isSelected();
                    final ISendBank sendBank = channel.getSendBank();
                    if (sendBank != null) {
                        final ISend send = sendBank.getItem(sendIndex);
                        if (send.doesExist())
                            values[i] = send.getValue();
                    }
                }
                break;
            default:
                // Not used
                break;
        }
    } else {
        for (int i = 0; i < size; i++) {
            final IChannel channel = layerBank.getItem(i);
            selected[i] = channel.isSelected();
            values[i] = channel.getVu();
        }
    }
    display.addElement(new TitleChannelsComponent(label, selected, values, this.selectedParameter == Modes.PAN && isMode));
    display.send();
}
Also used : ILayerBank(de.mossgrabers.framework.daw.data.bank.ILayerBank) IChannel(de.mossgrabers.framework.daw.data.IChannel) ILayer(de.mossgrabers.framework.daw.data.ILayer) IGraphicDisplay(de.mossgrabers.framework.controller.display.IGraphicDisplay) TitleChannelsComponent(de.mossgrabers.controller.akai.fire.graphics.canvas.component.TitleChannelsComponent) ISpecificDevice(de.mossgrabers.framework.daw.data.ISpecificDevice) ISend(de.mossgrabers.framework.daw.data.ISend) ISendBank(de.mossgrabers.framework.daw.data.bank.ISendBank)

Example 5 with IGraphicDisplay

use of de.mossgrabers.framework.controller.display.IGraphicDisplay 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)

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