Search in sources :

Example 1 with IView

use of de.mossgrabers.framework.featuregroup.IView in project DrivenByMoss by git-moss.

the class ShiftView method onGridNote.

/**
 * {@inheritDoc}
 */
@Override
public void onGridNote(final int note, final int velocity) {
    if (velocity == 0)
        return;
    int viewIndex;
    IView view;
    final ICursorDevice cursorDevice = this.model.getCursorDevice();
    switch(note - 36) {
        // Play
        case 0:
            this.playCommand.executeNormal(ButtonEvent.UP);
            break;
        // Record
        case 1:
            this.model.getTransport().startRecording();
            break;
        // Repeat
        case 2:
            this.model.getTransport().toggleLoop();
            break;
        // Click
        case 3:
            this.model.getTransport().toggleMetronome();
            break;
        // Tap Tempo
        case 4:
            this.model.getTransport().tapTempo();
            break;
        // Insert device before current
        case 5:
            this.model.getBrowser().insertBeforeCursorDevice();
            break;
        // Insert device after current
        case 6:
            this.model.getBrowser().insertAfterCursorDevice();
            break;
        // Open the browser
        case 7:
            this.model.getBrowser().replace(cursorDevice);
            break;
        // Toggle window of VSTs
        case 15:
            cursorDevice.toggleWindowOpen();
            break;
        default:
            viewIndex = note - 44;
            if (viewIndex < 0 || viewIndex >= 6)
                return;
            final ViewManager viewManager = this.surface.getViewManager();
            final Views viewId = VIEWS[viewIndex];
            viewManager.setPreviousID(viewId);
            view = viewManager.get(viewId);
            this.surface.getDisplay().notify(view.getName());
            break;
    }
}
Also used : IView(de.mossgrabers.framework.featuregroup.IView) Views(de.mossgrabers.framework.view.Views) ViewManager(de.mossgrabers.framework.featuregroup.ViewManager) ICursorDevice(de.mossgrabers.framework.daw.data.ICursorDevice)

Example 2 with IView

use of de.mossgrabers.framework.featuregroup.IView in project DrivenByMoss by git-moss.

the class ButtonRowSelectCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final ButtonEvent event, final int velocity) {
    if (event != ButtonEvent.DOWN)
        return;
    final IView view = this.surface.getViewManager().getActive();
    if (view == null)
        return;
    final ModeManager modeManager = this.surface.getModeManager();
    switch(this.row) {
        case 0:
            ((SLView) view).onButtonRow1Select();
            break;
        case 1:
            modeManager.setActive(Modes.DEVICE_PARAMS);
            this.model.getHost().showNotification("Device Parameters");
            break;
        case 2:
            ((SLView) view).onButtonRow2Select();
            break;
        case 3:
            modeManager.setActive(Modes.TRACK);
            this.model.getHost().showNotification("Track");
            break;
        case 4:
            break;
        case 5:
        case 6:
        case 7:
            modeManager.setActive(Modes.VOLUME);
            this.model.getHost().showNotification("Volume");
            break;
        default:
            // Intentionally empty
            break;
    }
}
Also used : IView(de.mossgrabers.framework.featuregroup.IView) SLView(de.mossgrabers.controller.novation.sl.view.SLView) ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Example 3 with IView

use of de.mossgrabers.framework.featuregroup.IView in project DrivenByMoss by git-moss.

the class Kontrol1ControllerSetup method handleTrackChange.

/**
 * Handle a track selection change.
 *
 * @param isSelected Has the track been selected?
 */
private void handleTrackChange(final boolean isSelected) {
    if (!isSelected)
        return;
    this.host.scheduleTask(() -> {
        final Kontrol1ControlSurface surface = this.getSurface();
        final IView activeView = surface.getViewManager().getActive();
        if (activeView != null) {
            activeView.updateNoteMapping();
            activeView.drawGrid();
        }
        if (this.model.canSelectedTrackHoldNotes()) {
            final IDrumDevice primary = this.model.getDrumDevice();
            if (primary.hasDrumPads())
                primary.getDrumPadBank().scrollTo(0);
        }
    }, 100);
}
Also used : IView(de.mossgrabers.framework.featuregroup.IView) Kontrol1ControlSurface(de.mossgrabers.controller.ni.kontrol.mki.controller.Kontrol1ControlSurface) IDrumDevice(de.mossgrabers.framework.daw.data.IDrumDevice)

Example 4 with IView

use of de.mossgrabers.framework.featuregroup.IView in project DrivenByMoss by git-moss.

the class NoteViewSelectMode method updateDisplay1.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay1(final ITextDisplay display) {
    final ViewManager viewManager = this.surface.getViewManager();
    display.setBlock(1, 0, "Sequence:");
    display.setBlock(2, 0, "Play:");
    display.setBlock(2, 3, "Tools:");
    for (int i = 0; i < VIEWS.length; i++) {
        if (VIEWS[i] != null) {
            final IView view = viewManager.get(VIEWS[i]);
            String value = "";
            if (view != null)
                value = (viewManager.isActive(VIEWS[i]) ? Push1Display.SELECT_ARROW : "") + StringUtils.optimizeName(view.getName(), 8);
            display.setCell(3, i, value);
        }
        if (VIEWS_TOP[i] != null) {
            final IView view = viewManager.get(VIEWS_TOP[i]);
            String value = "";
            if (view != null)
                value = (viewManager.isActive(VIEWS_TOP[i]) ? Push1Display.SELECT_ARROW : "") + StringUtils.optimizeName(view.getName(), 8);
            display.setCell(0, i, value);
        }
    }
}
Also used : IView(de.mossgrabers.framework.featuregroup.IView) ViewManager(de.mossgrabers.framework.featuregroup.ViewManager)

Example 5 with IView

use of de.mossgrabers.framework.featuregroup.IView in project DrivenByMoss by git-moss.

the class NoteViewSelectMode method updateDisplay2.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay2(final IGraphicDisplay display) {
    final ViewManager viewManager = this.surface.getViewManager();
    for (int i = 0; i < VIEWS.length; i++) {
        String menuBottomName = "";
        if (VIEWS[i] != null) {
            final IView view = viewManager.get(VIEWS[i]);
            if (view != null)
                menuBottomName = view.getName();
        }
        final String menuTopName = VIEWS_TOP[i] == null ? "" : viewManager.get(VIEWS_TOP[i]).getName();
        final boolean isMenuBottomSelected = VIEWS[i] != null && viewManager.isActive(VIEWS[i]);
        final boolean isMenuTopSelected = VIEWS_TOP[i] != null && viewManager.isActive(VIEWS_TOP[i]);
        String titleBottom = "";
        String titleTop = "";
        if (i == 0) {
            titleTop = "Sequence";
            titleBottom = "Play";
        } else if (i == 6)
            titleBottom = "Tools";
        display.addOptionElement(titleTop, menuTopName, isMenuTopSelected, titleBottom, menuBottomName, isMenuBottomSelected, false);
    }
}
Also used : IView(de.mossgrabers.framework.featuregroup.IView) ViewManager(de.mossgrabers.framework.featuregroup.ViewManager)

Aggregations

IView (de.mossgrabers.framework.featuregroup.IView)6 ViewManager (de.mossgrabers.framework.featuregroup.ViewManager)4 ModeManager (de.mossgrabers.framework.featuregroup.ModeManager)2 Views (de.mossgrabers.framework.view.Views)2 Kontrol1ControlSurface (de.mossgrabers.controller.ni.kontrol.mki.controller.Kontrol1ControlSurface)1 MaschineMonitorEncoderCommand (de.mossgrabers.controller.ni.maschine.core.command.trigger.MaschineMonitorEncoderCommand)1 MainKnobRowModeCommand (de.mossgrabers.controller.ni.maschine.mk3.command.continuous.MainKnobRowModeCommand)1 TouchstripCommand (de.mossgrabers.controller.ni.maschine.mk3.command.continuous.TouchstripCommand)1 MaschineControlSurface (de.mossgrabers.controller.ni.maschine.mk3.controller.MaschineControlSurface)1 StudioEncoderModeManager (de.mossgrabers.controller.ni.maschine.mk3.controller.StudioEncoderModeManager)1 SLView (de.mossgrabers.controller.novation.sl.view.SLView)1 IHwAbsoluteKnob (de.mossgrabers.framework.controller.hardware.IHwAbsoluteKnob)1 IHwRelativeKnob (de.mossgrabers.framework.controller.hardware.IHwRelativeKnob)1 ICursorDevice (de.mossgrabers.framework.daw.data.ICursorDevice)1 IDrumDevice (de.mossgrabers.framework.daw.data.IDrumDevice)1 IMode (de.mossgrabers.framework.featuregroup.IMode)1