Search in sources :

Example 6 with PushDisplay

use of de.mossgrabers.push.controller.PushDisplay in project DrivenByMoss by git-moss.

the class ScalesMode method updateDisplay2.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay2() {
    final Scale scale = this.scales.getScale();
    final int offset = this.scales.getScaleOffset();
    final Scale[] scaleValues = Scale.values();
    final String rangeText = this.scales.getRangeText();
    final PushDisplay display = (PushDisplay) this.surface.getDisplay();
    final DisplayMessage message = display.createMessage();
    final String[] items = new String[6];
    final boolean[] selected = new boolean[6];
    for (int i = 0; i < 6; i++) {
        final int pos = scale.ordinal() + i;
        items[i] = pos < scaleValues.length ? scaleValues[pos].getName() : "";
        selected[i] = i == 0;
    }
    message.addListElement(items, selected);
    for (int i = 0; i < 6; i++) message.addOptionElement(i == 3 ? "Note range: " + rangeText : "", Scales.BASES[6 + i], offset == 6 + i, "", Scales.BASES[i], offset == i, false);
    message.addOptionElement("", this.scales.isChromatic() ? "Chromatc" : "In Key", this.scales.isChromatic(), "", "", false, false);
    display.send(message);
}
Also used : PushDisplay(de.mossgrabers.push.controller.PushDisplay) Scale(de.mossgrabers.framework.scale.Scale) DisplayMessage(de.mossgrabers.push.controller.DisplayMessage)

Example 7 with PushDisplay

use of de.mossgrabers.push.controller.PushDisplay in project DrivenByMoss by git-moss.

the class SessionViewSelectMode method updateDisplay2.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay2() {
    final ViewManager viewManager = this.surface.getViewManager();
    final PushDisplay display = (PushDisplay) this.surface.getDisplay();
    final DisplayMessage message = display.createMessage();
    for (int i = 0; i < VIEWS.length; i++) {
        final boolean isMenuBottomSelected = VIEWS[i] != null && this.isSelected(viewManager, i);
        message.addOptionElement("", "", false, i == 0 ? "Session view" : "", VIEW_NAMES[i], isMenuBottomSelected, false);
    }
    display.send(message);
}
Also used : PushDisplay(de.mossgrabers.push.controller.PushDisplay) ViewManager(de.mossgrabers.framework.view.ViewManager) DisplayMessage(de.mossgrabers.push.controller.DisplayMessage)

Example 8 with PushDisplay

use of de.mossgrabers.push.controller.PushDisplay in project DrivenByMoss by git-moss.

the class SetupMode method updateDisplay2.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay2() {
    final PushConfiguration config = this.surface.getConfiguration();
    final PushDisplay display = (PushDisplay) this.surface.getDisplay();
    final DisplayMessage message = display.createMessage();
    message.addOptionElement("", "Setup", true, "", "", false, true);
    message.addOptionElement("Brightness", "Info", false, "", "", false, true);
    message.addParameterElement("Display", config.getDisplayBrightness() * 1023 / 100, config.getDisplayBrightness() + "%", this.isKnobTouched[2], -1);
    message.addParameterElement("LEDs", config.getLedBrightness() * 1023 / 100, config.getLedBrightness() + "%", this.isKnobTouched[3], -1);
    message.addOptionElement("        Pads", "", false, "", "", false, false);
    message.addParameterElement("Sensitivity", config.getPadSensitivity() * 1023 / 10, Integer.toString(config.getPadSensitivity()), this.isKnobTouched[5], -1);
    message.addParameterElement("Gain", config.getPadGain() * 1023 / 10, Integer.toString(config.getPadGain()), this.isKnobTouched[6], -1);
    message.addParameterElement("Dynamics", config.getPadDynamics() * 1023 / 10, Integer.toString(config.getPadDynamics()), this.isKnobTouched[7], -1);
    display.send(message);
}
Also used : PushConfiguration(de.mossgrabers.push.PushConfiguration) PushDisplay(de.mossgrabers.push.controller.PushDisplay) DisplayMessage(de.mossgrabers.push.controller.DisplayMessage)

Example 9 with PushDisplay

use of de.mossgrabers.push.controller.PushDisplay in project DrivenByMoss by git-moss.

the class DeviceBrowserMode method updateDisplay2.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay2() {
    final IBrowser browser = this.model.getBrowser();
    if (!browser.isActive()) {
        this.surface.getModeManager().restoreMode();
        return;
    }
    final PushDisplay display = (PushDisplay) this.surface.getDisplay();
    final DisplayMessage message = display.createMessage();
    switch(this.selectionMode) {
        case DeviceBrowserMode.SELECTION_OFF:
            String selectedResult = browser.getSelectedResult();
            if (selectedResult == null || selectedResult.length() == 0)
                selectedResult = "None";
            final boolean isPresetSession = browser.isPresetContentType();
            final String deviceName = this.model.getCursorDevice().getName();
            for (int i = 0; i < 7; i++) {
                final IBrowserColumn column = this.getFilterColumn(i);
                final String headerTopName = i == 0 ? "Device: " + (deviceName.isEmpty() ? "None" : deviceName) : "";
                final String headerBottomName = i == 0 && isPresetSession ? "Preset: " + selectedResult : "";
                final String menuBottomName = getColumnName(column);
                message.addOptionElement(headerTopName, column == null ? "" : column.getName(), i == this.filterColumn, headerBottomName, menuBottomName, !menuBottomName.equals(" "), false);
            }
            message.addOptionElement("", browser.getSelectedContentType(), this.filterColumn == -1, "", "", false, false);
            break;
        case DeviceBrowserMode.SELECTION_PRESET:
            final IBrowserColumnItem[] results = browser.getResultColumnItems();
            if (!results[0].doesExist()) {
                for (int i = 0; i < 8; i++) message.addOptionElement(i == 3 ? "No results available..." : "", "", false, "", "", false, false);
                display.send(message);
                return;
            }
            for (int i = 0; i < 8; i++) {
                final String[] items = new String[6];
                final boolean[] selected = new boolean[6];
                for (int item = 0; item < 6; item++) {
                    final int pos = i * 6 + item;
                    items[item] = pos < results.length ? results[pos].getName(16) : "";
                    selected[item] = pos < results.length ? results[pos].isSelected() : false;
                }
                message.addListElement(items, selected);
            }
            break;
        case DeviceBrowserMode.SELECTION_FILTER:
            final IBrowserColumnItem[] item = browser.getFilterColumn(this.filterColumn).getItems();
            for (int i = 0; i < 8; i++) {
                final String[] items = new String[6];
                final boolean[] selected = new boolean[6];
                for (int itemIndex = 0; itemIndex < 6; itemIndex++) {
                    final int pos = i * 6 + itemIndex;
                    String text = StringUtils.optimizeName(item[pos].getName(), 10);
                    if (!text.isEmpty())
                        text = text + " (" + item[pos].getHitCount() + ")";
                    items[itemIndex] = text;
                    selected[itemIndex] = item[pos].isSelected();
                }
                message.addListElement(items, selected);
            }
            break;
    }
    display.send(message);
}
Also used : IBrowser(de.mossgrabers.framework.daw.IBrowser) IBrowserColumnItem(de.mossgrabers.framework.daw.data.IBrowserColumnItem) PushDisplay(de.mossgrabers.push.controller.PushDisplay) IBrowserColumn(de.mossgrabers.framework.daw.data.IBrowserColumn) DisplayMessage(de.mossgrabers.push.controller.DisplayMessage)

Example 10 with PushDisplay

use of de.mossgrabers.push.controller.PushDisplay in project DrivenByMoss by git-moss.

the class DeviceLayerMode method updateDisplay2.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay2() {
    final ICursorDevice cd = this.model.getCursorDevice();
    final PushDisplay display = (PushDisplay) this.surface.getDisplay();
    final DisplayMessage message = display.createMessage();
    if (!cd.hasSelectedDevice()) {
        for (int i = 0; i < 8; i++) message.addOptionElement(i == 2 ? "Please select a device or press 'Add Device'..." : "", i == 7 ? "Up" : "", true, "", "", false, true);
        display.send(message);
        return;
    }
    final boolean noLayers = cd.hasLayers() && cd.hasZeroLayers();
    if (noLayers) {
        for (int i = 0; i < 8; i++) message.addOptionElement(i == 3 ? "Please create a " + (cd.hasDrumPads() ? "Drum Pad..." : "Device Layer...") : "", i == 7 ? "Up" : "", true, "", "", false, true);
        display.send(message);
        return;
    }
    this.updateMenu();
    this.updateDisplayElements(message, cd, cd.getSelectedLayerOrDrumPad());
    display.send(message);
}
Also used : PushDisplay(de.mossgrabers.push.controller.PushDisplay) DisplayMessage(de.mossgrabers.push.controller.DisplayMessage) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice)

Aggregations

PushDisplay (de.mossgrabers.push.controller.PushDisplay)26 DisplayMessage (de.mossgrabers.push.controller.DisplayMessage)24 IValueChanger (de.mossgrabers.framework.controller.IValueChanger)6 IChannelBank (de.mossgrabers.framework.daw.IChannelBank)6 ITrack (de.mossgrabers.framework.daw.data.ITrack)6 PushConfiguration (de.mossgrabers.push.PushConfiguration)6 ITrackBank (de.mossgrabers.framework.daw.ITrackBank)3 ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)2 IParameter (de.mossgrabers.framework.daw.data.IParameter)2 ISend (de.mossgrabers.framework.daw.data.ISend)2 ViewManager (de.mossgrabers.framework.view.ViewManager)2 IApplication (de.mossgrabers.framework.daw.IApplication)1 IBrowser (de.mossgrabers.framework.daw.IBrowser)1 ICursorClip (de.mossgrabers.framework.daw.ICursorClip)1 ITransport (de.mossgrabers.framework.daw.ITransport)1 IBrowserColumn (de.mossgrabers.framework.daw.data.IBrowserColumn)1 IBrowserColumnItem (de.mossgrabers.framework.daw.data.IBrowserColumnItem)1 IChannel (de.mossgrabers.framework.daw.data.IChannel)1 IMasterTrack (de.mossgrabers.framework.daw.data.IMasterTrack)1 Scale (de.mossgrabers.framework.scale.Scale)1