use of de.mossgrabers.framework.daw.data.IBrowserColumn in project DrivenByMoss by git-moss.
the class DeviceBrowserMode method selectNext.
private void selectNext(final int index, final int count) {
final IBrowser browser = this.model.getBrowser();
if (index < 7) {
final Optional<IBrowserColumn> fc = this.getFilterColumn(index);
if (fc.isPresent() && fc.get().doesExist()) {
final int fi = fc.get().getIndex();
if (fi < 0)
return;
this.filterColumn = fi;
for (int i = 0; i < count; i++) browser.selectNextFilterItem(this.filterColumn);
}
} else {
for (int i = 0; i < count; i++) browser.selectNextResult();
}
}
use of de.mossgrabers.framework.daw.data.IBrowserColumn in project DrivenByMoss by git-moss.
the class AddDeviceCommand method execute.
/**
* {@inheritDoc}
*/
@Override
public void execute(final ButtonEvent event, final int velocity) {
if (event != ButtonEvent.UP)
return;
final IBrowser browser = this.model.getBrowser();
if (browser.isActive()) {
final IBrowserColumn collectionsColumn = browser.getFilterColumn(0);
final IBrowserColumnItem first = collectionsColumn.getItems()[0];
if (first.getName().equals(collectionsColumn.getWildcard()) && first.isSelected())
collectionsColumn.selectNextItem();
else
collectionsColumn.resetFilter();
} else
super.executeNormal(event);
}
use of de.mossgrabers.framework.daw.data.IBrowserColumn in project DrivenByMoss by git-moss.
the class BrowserMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
final IBrowser browser = this.model.getBrowser();
if (!browser.isActive())
return;
final SLMkIIIDisplay d = this.surface.getDisplay();
d.clear();
d.setCell(0, 0, StringUtils.fixASCII(browser.getSelectedContentType()));
d.setPropertyColor(0, 0, SLMkIIIColorManager.SLMKIII_GREEN);
d.setCell(3, 0, "<< Tab");
d.setPropertyColor(0, 2, SLMkIIIColorManager.SLMKIII_GREEN);
d.setPropertyValue(0, 1, 0);
d.setPropertyColor(1, 0, SLMkIIIColorManager.SLMKIII_GREEN);
d.setCell(3, 1, "Tab >>");
d.setPropertyColor(1, 2, SLMkIIIColorManager.SLMKIII_GREEN);
d.setPropertyValue(1, 1, 0);
final IBrowserColumn selectedFilterColumn = browser.getSelectedFilterColumn();
d.setCell(0, 2, selectedFilterColumn.doesExist() ? StringUtils.fixASCII(selectedFilterColumn.getName()) : "-");
d.setPropertyColor(2, 0, SLMkIIIColorManager.SLMKIII_DARK_GREEN_HALF);
d.setCell(3, 2, "<< Filter");
d.setPropertyColor(2, 2, SLMkIIIColorManager.SLMKIII_DARK_GREEN_HALF);
d.setPropertyValue(2, 1, 0);
d.setPropertyColor(3, 0, SLMkIIIColorManager.SLMKIII_DARK_GREEN_HALF);
d.setCell(3, 3, "Filter >>");
d.setPropertyColor(3, 2, SLMkIIIColorManager.SLMKIII_DARK_GREEN_HALF);
d.setPropertyValue(3, 1, 0);
d.setCell(0, 4, selectedFilterColumn.doesExist() ? StringUtils.fixASCII(selectedFilterColumn.getCursorName()) : "-");
d.setPropertyColor(4, 0, SLMkIIIColorManager.SLMKIII_GREEN_LIGHT);
d.setCell(3, 4, "<< F-Sel");
d.setPropertyColor(4, 2, SLMkIIIColorManager.SLMKIII_GREEN_LIGHT);
d.setPropertyValue(4, 1, 0);
d.setPropertyColor(5, 0, SLMkIIIColorManager.SLMKIII_GREEN_LIGHT);
d.setCell(3, 5, "F-Sel >>");
d.setPropertyColor(5, 2, SLMkIIIColorManager.SLMKIII_GREEN_LIGHT);
d.setPropertyValue(5, 1, 0);
final String resultName = StringUtils.pad(StringUtils.fixASCII(browser.getSelectedResult()), 18, ' ');
final String name1 = resultName.substring(0, 9);
final String name2 = resultName.substring(9, 18);
d.setCell(0, 6, name1);
d.setPropertyColor(6, 0, SLMkIIIColorManager.SLMKIII_GREEN_GRASS);
d.setCell(3, 6, "<< Result");
d.setPropertyColor(6, 2, SLMkIIIColorManager.SLMKIII_GREEN_GRASS);
d.setPropertyValue(6, 1, 0);
d.setCell(0, 7, name2);
d.setPropertyColor(7, 0, SLMkIIIColorManager.SLMKIII_GREEN_GRASS);
d.setCell(3, 7, "Result >>");
d.setPropertyColor(7, 2, SLMkIIIColorManager.SLMKIII_GREEN_GRASS);
d.setPropertyValue(7, 1, 0);
d.setCell(0, 8, "Browser");
this.setButtonInfo(d);
d.allDone();
}
use of de.mossgrabers.framework.daw.data.IBrowserColumn in project DrivenByMoss by git-moss.
the class DevicePresetsMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
final ITextDisplay d = this.surface.getTextDisplay().clear();
if (!this.model.hasSelectedDevice()) {
d.setRow(0, " Please select a device... ");
d.done(0).done(1);
return;
}
final IBrowser browser = this.model.getBrowser();
if (!browser.isActive()) {
d.setRow(0, " No active Browsing Session. ");
d.setRow(1, " Press Browse again... ");
d.done(0).done(1);
return;
}
String selectedResult;
switch(this.selectionMode) {
case DevicePresetsMode.SELECTION_OFF:
selectedResult = browser.getSelectedResult();
d.setBlock(0, 0, "Preset:").setBlock(1, 0, selectedResult == null ? "None" : selectedResult);
for (int i = 0; i < 6; i++) {
final IBrowserColumn column = browser.getFilterColumn(i);
final String columnName = column.doesExist() ? StringUtils.shortenAndFixASCII(column.getName() + ":", 8) : "";
d.setCell(0, 2 + i, columnName).setCell(1, 2 + i, column.doesCursorExist() ? column.getCursorName() : "");
}
break;
case DevicePresetsMode.SELECTION_PRESET:
final IBrowserColumnItem[] results = browser.getResultColumnItems();
for (int i = 0; i < 16; i++) d.setCell(i % 2, i / 2, (results[i].isSelected() ? SLDisplay.RIGHT_ARROW : " ") + results[i].getName());
break;
case DevicePresetsMode.SELECTION_FILTER:
final IBrowserColumnItem[] items = browser.getFilterColumn(this.filterColumn).getItems();
for (int i = 0; i < 16; i++) {
final String name = StringUtils.fixASCII(items[i].getName());
String text = (items[i].isSelected() ? SLDisplay.RIGHT_ARROW : " ") + name + " ";
if (!name.isEmpty()) {
final String hitStr = "(" + items[i].getHitCount() + ")";
text = text.substring(0, 17 - hitStr.length()) + hitStr;
}
d.setCell(i % 2, i / 2, text);
}
break;
default:
// Not used
break;
}
d.done(0).done(1);
}
use of de.mossgrabers.framework.daw.data.IBrowserColumn in project DrivenByMoss by git-moss.
the class BrowserMode method selectPrevious.
private void selectPrevious(final int index, final int count) {
final IBrowser browser = this.model.getBrowser();
final int filterColumnCount = Math.min(browser.getFilterColumnCount(), 7);
if (index < filterColumnCount) {
final IBrowserColumn fc = browser.getFilterColumn(index);
if (fc != null && fc.doesExist()) {
final int fi = fc.getIndex();
if (fi < 0)
return;
for (int j = 0; j < count; j++) browser.selectPreviousFilterItem(fi);
}
} else {
for (int j = 0; j < count; j++) browser.selectPreviousResult();
}
}
Aggregations