use of de.mossgrabers.framework.daw.IBrowser in project DrivenByMoss by git-moss.
the class BrowserView method onDeactivate.
/**
* {@inheritDoc}
*/
@Override
public void onDeactivate() {
// Close the browser if still open
final IBrowser browser = this.model.getBrowser();
if (browser.isActive())
browser.stopBrowsing(false);
final ViewManager viewManager = this.surface.getViewManager();
final Views activeID = viewManager.getActiveID();
if (activeID == Views.BROWSER) {
// Browse (...) button does not send an 'up' event
this.surface.getButton(ButtonID.BROWSE).clearState();
final Views previousID = viewManager.getPreviousID();
final Integer id = VIEW_COMMANDS.get(previousID);
final int viewCommand = id == null || previousID == Views.BROWSER ? LaunchkeyMk3ControlSurface.PAD_MODE_SESSION : id.intValue();
this.surface.getMidiOutput().sendCCEx(15, LaunchkeyMk3ControlSurface.LAUNCHKEY_VIEW_SELECT, viewCommand);
}
}
use of de.mossgrabers.framework.daw.IBrowser in project DrivenByMoss by git-moss.
the class BrowserView method onActivate.
/**
* {@inheritDoc}
*/
@Override
public void onActivate() {
final IBrowser browser = this.model.getBrowser();
if (browser.isActive()) {
// Browser is already opened, normally this means the user opened it in Bitwig.
// Set the Navigation mode on the Launchkey
this.surface.getMidiOutput().sendCCEx(15, LaunchkeyMk3ControlSurface.LAUNCHKEY_VIEW_SELECT, LaunchkeyMk3ControlSurface.PAD_MODE_NAVIGATION);
} else {
final ICursorDevice cursorDevice = this.model.getCursorDevice();
if (this.surface.isShiftPressed() || !cursorDevice.doesExist())
browser.insertAfterCursorDevice();
else
browser.replace(cursorDevice);
}
super.onActivate();
}
use of de.mossgrabers.framework.daw.IBrowser 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();
}
}
}
use of de.mossgrabers.framework.daw.IBrowser in project DrivenByMoss by git-moss.
the class BrowserMode method onKnobTouch.
/**
* {@inheritDoc}
*/
@Override
public void onKnobTouch(final int index, final boolean isTouched) {
if (isTouched && this.surface.isDeletePressed()) {
this.surface.setTriggerConsumed(ButtonID.DELETE);
final IBrowser browser = this.model.getBrowser();
if (browser != null)
browser.resetFilterColumn(index);
}
}
Aggregations