Search in sources :

Example 46 with IBrowser

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);
    }
}
Also used : IBrowser(de.mossgrabers.framework.daw.IBrowser) Views(de.mossgrabers.framework.view.Views) ViewManager(de.mossgrabers.framework.featuregroup.ViewManager)

Example 47 with IBrowser

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();
}
Also used : IBrowser(de.mossgrabers.framework.daw.IBrowser) ICursorDevice(de.mossgrabers.framework.daw.data.ICursorDevice)

Example 48 with IBrowser

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();
        }
    }
}
Also used : IBrowser(de.mossgrabers.framework.daw.IBrowser) IBrowserColumn(de.mossgrabers.framework.daw.data.IBrowserColumn)

Example 49 with IBrowser

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);
    }
}
Also used : IBrowser(de.mossgrabers.framework.daw.IBrowser)

Aggregations

IBrowser (de.mossgrabers.framework.daw.IBrowser)49 IBrowserColumn (de.mossgrabers.framework.daw.data.IBrowserColumn)21 IBrowserColumnItem (de.mossgrabers.framework.daw.data.IBrowserColumnItem)11 ICursorDevice (de.mossgrabers.framework.daw.data.ICursorDevice)5 ITextDisplay (de.mossgrabers.framework.controller.display.ITextDisplay)4 ViewManager (de.mossgrabers.framework.view.ViewManager)4 Display (de.mossgrabers.framework.controller.display.Display)3 ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)3 ITrack (de.mossgrabers.framework.daw.data.ITrack)3 IChannelBank (de.mossgrabers.framework.daw.IChannelBank)2 ViewManager (de.mossgrabers.framework.featuregroup.ViewManager)2 PushDisplay (de.mossgrabers.push.controller.PushDisplay)2 SLMkIIIDisplay (de.mossgrabers.controller.novation.slmkiii.controller.SLMkIIIDisplay)1 ParametersMode (de.mossgrabers.controller.novation.slmkiii.mode.device.ParametersMode)1 UnknownCommandException (de.mossgrabers.controller.osc.exception.UnknownCommandException)1 ColorEx (de.mossgrabers.framework.controller.color.ColorEx)1 IGraphicDisplay (de.mossgrabers.framework.controller.display.IGraphicDisplay)1 ILayer (de.mossgrabers.framework.daw.data.ILayer)1 IMasterTrack (de.mossgrabers.framework.daw.data.IMasterTrack)1 ModeManager (de.mossgrabers.framework.featuregroup.ModeManager)1