Search in sources :

Example 26 with IBrowserColumn

use of de.mossgrabers.framework.daw.data.IBrowserColumn in project DrivenByMoss by git-moss.

the class BrowserModule method flush.

/**
 * {@inheritDoc}
 */
@Override
public void flush(final boolean dump) {
    final String browserAddress = "/browser/";
    final IBrowser browser = this.model.getBrowser();
    final boolean isActive = browser.isActive();
    this.writer.sendOSC(browserAddress + "isActive", isActive, dump);
    if (!isActive)
        return;
    this.writer.sendOSC(browserAddress + "tab", browser.getSelectedContentType(), dump);
    IBrowserColumn column;
    // Filter Columns
    for (int i = 0; i < browser.getFilterColumnCount(); i++) {
        final String filterAddress = browserAddress + "filter/" + (i + 1) + "/";
        column = browser.getFilterColumn(i);
        this.writer.sendOSC(filterAddress + TAG_EXISTS, column.doesExist(), dump);
        this.writer.sendOSC(filterAddress + TAG_NAME, column.getName(), dump);
        this.writer.sendOSC(filterAddress + "wildcard", column.getWildcard(), dump);
        final IBrowserColumnItem[] items = column.getItems();
        for (int j = 0; j < items.length; j++) {
            final String browserItemAddress = filterAddress + "item/" + (j + 1) + "/";
            this.writer.sendOSC(browserItemAddress + TAG_EXISTS, items[j].doesExist(), dump);
            this.writer.sendOSC(browserItemAddress + TAG_NAME, items[j].getName(), dump);
            this.writer.sendOSC(browserItemAddress + "hits", items[j].getHitCount(), dump);
            this.writer.sendOSC(browserItemAddress + "isSelected", items[j].isSelected(), dump);
        }
    }
    // Presets
    final String presetAddress = browserAddress + "result/";
    final IBrowserColumnItem[] items = browser.getResultColumnItems();
    for (int i = 0; i < items.length; i++) {
        final String browserPresetAddress = presetAddress + (i + 1) + "/";
        this.writer.sendOSC(browserPresetAddress + TAG_EXISTS, items[i].doesExist(), dump);
        this.writer.sendOSC(browserPresetAddress + TAG_NAME, items[i].getName(), dump);
        this.writer.sendOSC(browserPresetAddress + "hits", items[i].getHitCount(), dump);
        this.writer.sendOSC(browserPresetAddress + "isSelected", items[i].isSelected(), dump);
    }
}
Also used : IBrowser(de.mossgrabers.framework.daw.IBrowser) IBrowserColumnItem(de.mossgrabers.framework.daw.data.IBrowserColumnItem) IBrowserColumn(de.mossgrabers.framework.daw.data.IBrowserColumn)

Example 27 with IBrowserColumn

use of de.mossgrabers.framework.daw.data.IBrowserColumn in project DrivenByMoss by git-moss.

the class BrowseMode method selectPrevious.

/**
 * Select the previous filter or preset.
 *
 * @param count The number of items to decrease
 */
public void selectPrevious(final int count) {
    final int index = this.selectedColumn == -1 ? 7 : this.selectedColumn;
    final IBrowser browser = this.model.getBrowser();
    for (int i = 0; i < count; i++) {
        if (index < 7) {
            final IBrowserColumn fc = browser.getFilterColumn(index);
            if (fc != null && fc.doesExist()) {
                this.filterColumn = fc.getIndex();
                for (int j = 0; j < count; j++) browser.selectPreviousFilterItem(this.filterColumn);
                if (browser.getSelectedFilterItemIndex(this.filterColumn) == -1)
                    browser.previousFilterItemPage(this.filterColumn);
            }
        } else {
            for (int j = 0; j < count; j++) browser.selectPreviousResult();
        }
    }
}
Also used : IBrowser(de.mossgrabers.framework.daw.IBrowser) IBrowserColumn(de.mossgrabers.framework.daw.data.IBrowserColumn)

Aggregations

IBrowserColumn (de.mossgrabers.framework.daw.data.IBrowserColumn)27 IBrowser (de.mossgrabers.framework.daw.IBrowser)21 IBrowserColumnItem (de.mossgrabers.framework.daw.data.IBrowserColumnItem)13 ITextDisplay (de.mossgrabers.framework.controller.display.ITextDisplay)4 Display (de.mossgrabers.framework.controller.display.Display)3 ICursorDevice (de.mossgrabers.framework.daw.data.ICursorDevice)2 PushDisplay (de.mossgrabers.push.controller.PushDisplay)2 SLMkIIIDisplay (de.mossgrabers.controller.novation.slmkiii.controller.SLMkIIIDisplay)1 ColorEx (de.mossgrabers.framework.controller.color.ColorEx)1 IGraphicDisplay (de.mossgrabers.framework.controller.display.IGraphicDisplay)1 ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)1 DisplayMessage (de.mossgrabers.push.controller.DisplayMessage)1 SLDisplay (de.mossgrabers.sl.controller.SLDisplay)1