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);
}
}
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();
}
}
}
Aggregations