Search in sources :

Example 1 with ViewManager

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

the class SelectSessionViewCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final ButtonEvent event, final int velocity) {
    if (event == ButtonEvent.DOWN) {
        this.isTemporary = false;
        final ViewManager viewManager = this.surface.getViewManager();
        final ModeManager modeManager = this.surface.getModeManager();
        if (Views.isSessionView(viewManager.getActiveID())) {
            if (modeManager.isActive(Modes.SESSION_VIEW_SELECT))
                modeManager.restore();
            else
                modeManager.setTemporary(Modes.SESSION_VIEW_SELECT);
            return;
        }
        // Switch to the preferred session view and display scene/clip mode if enabled
        final PushConfiguration configuration = this.surface.getConfiguration();
        viewManager.setActive(configuration.isScenesClipViewSelected() ? Views.SCENE_PLAY : Views.SESSION);
        if (configuration.shouldDisplayScenesOrClips())
            modeManager.setActive(Modes.SESSION);
        return;
    }
    if (event == ButtonEvent.UP && this.isTemporary)
        this.surface.getViewManager().restore();
}
Also used : PushConfiguration(de.mossgrabers.controller.ableton.push.PushConfiguration) ViewManager(de.mossgrabers.framework.featuregroup.ViewManager) ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Example 2 with ViewManager

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

the class BeatstepControllerSetup method registerTriggerCommands.

/**
 * {@inheritDoc}
 */
@Override
protected void registerTriggerCommands() {
    final BeatstepControlSurface surface = this.getSurface();
    final ViewManager viewManager = surface.getViewManager();
    this.addButton(ButtonID.SHIFT, "Shift", (event, value) -> {
        if (event == ButtonEvent.DOWN) {
            viewManager.setActive(Views.SHIFT);
            return;
        }
        if (event == ButtonEvent.UP) {
            if (viewManager.isActive(Views.SHIFT))
                viewManager.restore();
            // Red LED is turned off on button release, restore the correct color
            final BeatstepPadGrid beatstepPadGrid = (BeatstepPadGrid) surface.getPadGrid();
            for (int note = 36; note < 52; note++) {
                final LightInfo lightInfo = beatstepPadGrid.getLightInfo(note);
                beatstepPadGrid.lightPad(note, lightInfo.getColor());
            }
        }
    }, BeatstepControlSurface.BEATSTEP_SHIFT);
}
Also used : ViewManager(de.mossgrabers.framework.featuregroup.ViewManager) BeatstepControlSurface(de.mossgrabers.controller.arturia.beatstep.controller.BeatstepControlSurface) BeatstepPadGrid(de.mossgrabers.controller.arturia.beatstep.controller.BeatstepPadGrid) LightInfo(de.mossgrabers.framework.controller.grid.LightInfo)

Example 3 with ViewManager

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

the class BeatstepControllerSetup method handleTrackChange.

/**
 * Handle a track selection change.
 *
 * @param isSelected Has the track been selected?
 */
private void handleTrackChange(final boolean isSelected) {
    if (!isSelected)
        return;
    final ViewManager viewManager = this.getSurface().getViewManager();
    if (viewManager.isActive(Views.PLAY))
        viewManager.getActive().updateNoteMapping();
    // Reset drum octave because the drum pad bank is also reset
    this.scales.resetDrumOctave();
    if (viewManager.isActive(Views.DRUM))
        viewManager.get(Views.DRUM).updateNoteMapping();
}
Also used : ViewManager(de.mossgrabers.framework.featuregroup.ViewManager)

Example 4 with ViewManager

use of de.mossgrabers.framework.featuregroup.ViewManager 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 5 with ViewManager

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

the class LaunchpadToggleShiftViewCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final ButtonEvent event, final int velocity) {
    final ViewManager viewManager = this.surface.getViewManager();
    if (event == ButtonEvent.DOWN && (viewManager.isActive(Views.TEMPO) || viewManager.isActive(Views.SHUFFLE))) {
        viewManager.restore();
        this.surface.setTriggerConsumed(ButtonID.SHIFT);
        return;
    }
    super.execute(event, velocity);
}
Also used : ViewManager(de.mossgrabers.framework.featuregroup.ViewManager)

Aggregations

ViewManager (de.mossgrabers.framework.featuregroup.ViewManager)58 ITrack (de.mossgrabers.framework.daw.data.ITrack)12 ModeManager (de.mossgrabers.framework.featuregroup.ModeManager)11 Views (de.mossgrabers.framework.view.Views)11 INoteMode (de.mossgrabers.framework.mode.INoteMode)5 BeatstepControlSurface (de.mossgrabers.controller.arturia.beatstep.controller.BeatstepControlSurface)4 MaschineControlSurface (de.mossgrabers.controller.ni.maschine.mk3.controller.MaschineControlSurface)4 IView (de.mossgrabers.framework.featuregroup.IView)4 DrumView (de.mossgrabers.controller.ni.maschine.mk3.view.DrumView)3 ConfiguredRecordCommand (de.mossgrabers.framework.command.trigger.transport.ConfiguredRecordCommand)3 FeatureGroupButtonColorSupplier (de.mossgrabers.framework.command.trigger.view.FeatureGroupButtonColorSupplier)3 IHost (de.mossgrabers.framework.daw.IHost)3 ITransport (de.mossgrabers.framework.daw.ITransport)3 ITrackBank (de.mossgrabers.framework.daw.data.bank.ITrackBank)3 PlayView (de.mossgrabers.controller.arturia.beatstep.view.PlayView)2 LaunchkeyMk3ControlSurface (de.mossgrabers.controller.novation.launchkey.maxi.controller.LaunchkeyMk3ControlSurface)2 LaunchkeyMiniMk3ControlSurface (de.mossgrabers.controller.novation.launchkey.mini.controller.LaunchkeyMiniMk3ControlSurface)2 SLMkIIIControlSurface (de.mossgrabers.controller.novation.slmkiii.controller.SLMkIIIControlSurface)2 DrumView (de.mossgrabers.controller.novation.slmkiii.view.DrumView)2 Configuration (de.mossgrabers.framework.configuration.Configuration)2