Search in sources :

Example 6 with ViewManager

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

the class ShiftView method activateBrowserView.

private void activateBrowserView() {
    final ViewManager viewManager = this.surface.getViewManager();
    final Integer previousViewId = viewManager.getPreviousViewId();
    viewManager.setActiveView(Views.VIEW_BROWSER);
    viewManager.setPreviousView(previousViewId);
}
Also used : ViewManager(de.mossgrabers.framework.view.ViewManager)

Example 7 with ViewManager

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

the class BeatstepControllerSetup method updateIndication.

private void updateIndication() {
    final BeatstepControlSurface surface = this.getSurface();
    final ViewManager viewManager = surface.getViewManager();
    final boolean isTrack = viewManager.isActiveView(Views.VIEW_TRACK);
    final boolean isDevice = viewManager.isActiveView(Views.VIEW_DEVICE);
    final boolean isSession = viewManager.isActiveView(Views.VIEW_SESSION);
    final IMasterTrack mt = this.model.getMasterTrack();
    mt.setVolumeIndication(!isDevice);
    final ITrackBank tb = this.model.getTrackBank();
    final ITrack selectedTrack = tb.getSelectedTrack();
    final IChannelBank tbe = this.model.getEffectTrackBank();
    final ITrack selectedFXTrack = tbe.getSelectedTrack();
    final ICursorDevice cursorDevice = this.model.getCursorDevice();
    final boolean isEffect = this.model.isEffectTrackBankActive();
    tb.setIndication(!isEffect && isSession);
    tbe.setIndication(isEffect && isSession);
    for (int i = 0; i < 8; i++) {
        final boolean hasTrackSel = selectedTrack != null && selectedTrack.getIndex() == i;
        final ITrack track = tb.getTrack(i);
        track.setVolumeIndication(!isEffect && hasTrackSel && !isDevice);
        track.setPanIndication(!isEffect && hasTrackSel && !isDevice);
        for (int j = 0; j < 6; j++) track.getSend(j).setIndication(!isEffect && hasTrackSel && isTrack);
        final boolean hasFXTrackSel = selectedFXTrack != null && selectedFXTrack.getIndex() == i;
        final ITrack fxTrack = tbe.getTrack(i);
        fxTrack.setVolumeIndication(isEffect && hasFXTrackSel && isTrack);
        fxTrack.setPanIndication(isEffect && hasFXTrackSel && isTrack);
        cursorDevice.indicateParameter(i, isDevice);
    }
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.ITrackBank) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) ViewManager(de.mossgrabers.framework.view.ViewManager) BeatstepControlSurface(de.mossgrabers.beatstep.controller.BeatstepControlSurface) IMasterTrack(de.mossgrabers.framework.daw.data.IMasterTrack) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice)

Example 8 with ViewManager

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

the class BeatstepControllerSetup method handleTrackChange.

/**
 * Handle a track selection change.
 *
 * @param index The index of the track
 * @param isSelected Has the track been selected?
 */
private void handleTrackChange(final int index, final boolean isSelected) {
    if (!isSelected)
        return;
    final ViewManager viewManager = this.getSurface().getViewManager();
    if (viewManager.isActiveView(Views.VIEW_PLAY))
        viewManager.getActiveView().updateNoteMapping();
    // Reset drum octave because the drum pad bank is also reset
    this.scales.setDrumOctave(0);
    if (viewManager.isActiveView(Views.VIEW_DRUM))
        viewManager.getView(Views.VIEW_DRUM).updateNoteMapping();
}
Also used : ViewManager(de.mossgrabers.framework.view.ViewManager)

Example 9 with ViewManager

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

the class ViewMultiSelectCommand method executeNormal.

/**
 * {@inheritDoc}
 */
@Override
public void executeNormal(final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    final ViewManager viewManager = this.surface.getViewManager();
    final Integer activeViewId = viewManager.getActiveViewId();
    int index = this.viewIds.indexOf(activeViewId) + 1;
    if (index < 0 || index >= this.viewIds.size())
        index = 0;
    viewManager.setActiveView(this.viewIds.get(index));
}
Also used : ViewManager(de.mossgrabers.framework.view.ViewManager)

Example 10 with ViewManager

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

the class MCUControllerSetup method registerContinuousCommands.

/**
 * {@inheritDoc}
 */
@Override
protected void registerContinuousCommands() {
    MCUControlSurface surface = this.getSurface();
    ViewManager viewManager = surface.getViewManager();
    viewManager.registerContinuousCommand(Commands.CONT_COMMAND_PLAY_POSITION, new PlayPositionTempoCommand(this.model, surface));
    surface.assignContinuousCommand(MCUControlSurface.MCU_CC_JOG, 1, Commands.CONT_COMMAND_PLAY_POSITION);
    for (int index = 0; index < this.numMCUDevices; index++) {
        surface = this.getSurface(index);
        viewManager = surface.getViewManager();
        for (int i = 0; i < 8; i++) {
            final Integer commandID = Integer.valueOf(Commands.CONT_COMMAND_KNOB1.intValue() + i);
            viewManager.registerContinuousCommand(commandID, new KnobRowModeCommand<>(i, this.model, surface));
            surface.assignContinuousCommand(MCUControlSurface.MCU_CC_VPOT1 + i, 1, commandID);
        }
    }
}
Also used : ViewManager(de.mossgrabers.framework.view.ViewManager) MCUControlSurface(de.mossgrabers.mcu.controller.MCUControlSurface) PlayPositionTempoCommand(de.mossgrabers.mcu.command.continuous.PlayPositionTempoCommand)

Aggregations

ViewManager (de.mossgrabers.framework.view.ViewManager)64 ITrack (de.mossgrabers.framework.daw.data.ITrack)16 IChannelBank (de.mossgrabers.framework.daw.IChannelBank)10 View (de.mossgrabers.framework.view.View)9 ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)8 ModeManager (de.mossgrabers.framework.mode.ModeManager)7 DrumView (de.mossgrabers.launchpad.view.DrumView)7 PlayView (de.mossgrabers.launchpad.view.PlayView)7 RaindropsView (de.mossgrabers.launchpad.view.RaindropsView)7 SequencerView (de.mossgrabers.launchpad.view.SequencerView)7 AbstractSequencerView (de.mossgrabers.framework.view.AbstractSequencerView)6 ColorView (de.mossgrabers.push.view.ColorView)6 APCControlSurface (de.mossgrabers.apc.controller.APCControlSurface)5 PushControlSurface (de.mossgrabers.push.controller.PushControlSurface)5 IBrowser (de.mossgrabers.framework.daw.IBrowser)4 ITrackBank (de.mossgrabers.framework.daw.ITrackBank)4 MCUControlSurface (de.mossgrabers.mcu.controller.MCUControlSurface)4 ColorManager (de.mossgrabers.framework.controller.color.ColorManager)3 Scales (de.mossgrabers.framework.scale.Scales)3 SceneView (de.mossgrabers.framework.view.SceneView)3