Search in sources :

Example 1 with AbstractSequencerView

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

the class PushControllerSetup method updateButtons.

private void updateButtons() {
    final ITransport t = this.model.getTransport();
    final PushControlSurface surface = this.getSurface();
    surface.updateButton(PushControlSurface.PUSH_BUTTON_METRONOME, t.isMetronomeOn() ? ColorManager.BUTTON_STATE_HI : ColorManager.BUTTON_STATE_ON);
    surface.updateButton(PushControlSurface.PUSH_BUTTON_PLAY, t.isPlaying() ? PushColors.PUSH_BUTTON_STATE_PLAY_HI : PushColors.PUSH_BUTTON_STATE_PLAY_ON);
    final boolean isShift = surface.isShiftPressed();
    final boolean isFlipRecord = this.configuration.isFlipRecord();
    final boolean isRecordShifted = isShift && !isFlipRecord || !isShift && isFlipRecord;
    if (isRecordShifted)
        surface.updateButton(PushControlSurface.PUSH_BUTTON_AUTOMATION, t.isWritingClipLauncherAutomation() ? PushColors.PUSH_BUTTON_STATE_REC_HI : PushColors.PUSH_BUTTON_STATE_REC_ON);
    else
        surface.updateButton(PushControlSurface.PUSH_BUTTON_AUTOMATION, t.isWritingArrangerAutomation() ? PushColors.PUSH_BUTTON_STATE_REC_HI : PushColors.PUSH_BUTTON_STATE_REC_ON);
    surface.updateButton(PushControlSurface.PUSH_BUTTON_RECORD, isRecordShifted ? t.isLauncherOverdub() ? PushColors.PUSH_BUTTON_STATE_OVR_HI : PushColors.PUSH_BUTTON_STATE_OVR_ON : t.isRecording() ? PushColors.PUSH_BUTTON_STATE_REC_HI : PushColors.PUSH_BUTTON_STATE_REC_ON);
    surface.updateButton(PushControlSurface.PUSH_BUTTON_ACCENT, this.configuration.isAccentActive() ? ColorManager.BUTTON_STATE_HI : ColorManager.BUTTON_STATE_ON);
    final PushConfiguration config = surface.getConfiguration();
    if (this.isPush2) {
        final ModeManager modeManager = surface.getModeManager();
        if (modeManager.isActiveMode(Modes.MODE_DEVICE_LAYER)) {
            final ICursorDevice cd = this.model.getCursorDevice();
            final IChannel layer = cd.getSelectedLayerOrDrumPad();
            surface.updateButton(PushControlSurface.PUSH_BUTTON_MUTE, layer != null && layer.isMute() ? PushColors.PUSH_BUTTON_STATE_MUTE_HI : PushColors.PUSH_BUTTON_STATE_MUTE_ON);
            surface.updateButton(PushControlSurface.PUSH_BUTTON_SOLO, layer != null && layer.isSolo() ? PushColors.PUSH_BUTTON_STATE_SOLO_HI : PushColors.PUSH_BUTTON_STATE_SOLO_ON);
        } else {
            final IChannelBank tb = this.model.getCurrentTrackBank();
            final ITrack selTrack = modeManager.isActiveMode(Modes.MODE_MASTER) ? this.model.getMasterTrack() : tb.getSelectedTrack();
            surface.updateButton(PushControlSurface.PUSH_BUTTON_MUTE, selTrack != null && selTrack.isMute() ? PushColors.PUSH_BUTTON_STATE_MUTE_HI : PushColors.PUSH_BUTTON_STATE_MUTE_ON);
            surface.updateButton(PushControlSurface.PUSH_BUTTON_SOLO, selTrack != null && selTrack.isSolo() ? PushColors.PUSH_BUTTON_STATE_SOLO_HI : PushColors.PUSH_BUTTON_STATE_SOLO_ON);
        }
        surface.updateButton(PushControlSurface.PUSH_BUTTON_CONVERT, this.model.canConvertClip() ? ColorManager.BUTTON_STATE_ON : ColorManager.BUTTON_STATE_OFF);
    } else {
        final boolean isMuteState = config.isMuteState();
        surface.updateButton(PushControlSurface.PUSH_BUTTON_MUTE, isMuteState ? PushColors.PUSH_BUTTON_STATE_MUTE_HI : PushColors.PUSH_BUTTON_STATE_MUTE_ON);
        surface.updateButton(PushControlSurface.PUSH_BUTTON_SOLO, !isMuteState ? PushColors.PUSH_BUTTON_STATE_SOLO_HI : PushColors.PUSH_BUTTON_STATE_SOLO_ON);
    }
    final ViewManager viewManager = surface.getViewManager();
    final boolean isSessionView = Views.isSessionView(viewManager.getActiveViewId());
    surface.updateButton(PushControlSurface.PUSH_BUTTON_NOTE, isSessionView ? ColorManager.BUTTON_STATE_ON : ColorManager.BUTTON_STATE_HI);
    if (this.host.hasClips()) {
        surface.updateButton(PushControlSurface.PUSH_BUTTON_CLIP_STOP, surface.isPressed(PushControlSurface.PUSH_BUTTON_CLIP_STOP) ? PushColors.PUSH_BUTTON_STATE_STOP_HI : PushColors.PUSH_BUTTON_STATE_STOP_ON);
        surface.updateButton(PushControlSurface.PUSH_BUTTON_SESSION, isSessionView ? ColorManager.BUTTON_STATE_HI : ColorManager.BUTTON_STATE_ON);
    } else {
        surface.updateButton(PushControlSurface.PUSH_BUTTON_CLIP_STOP, ColorManager.BUTTON_STATE_OFF);
        surface.updateButton(PushControlSurface.PUSH_BUTTON_SESSION, ColorManager.BUTTON_STATE_OFF);
    }
    surface.updateButton(PushControlSurface.PUSH_BUTTON_ACCENT, config.isAccentActive() ? ColorManager.BUTTON_STATE_HI : ColorManager.BUTTON_STATE_ON);
    final View activeView = viewManager.getActiveView();
    if (activeView != null) {
        ((PushCursorCommand) activeView.getTriggerCommand(Commands.COMMAND_ARROW_DOWN)).updateArrows();
        ((SceneView) activeView).updateSceneButtons();
    }
    final ICursorClip clip = activeView instanceof AbstractSequencerView && !(activeView instanceof ClipView) ? ((AbstractSequencerView<?, ?>) activeView).getClip() : null;
    surface.updateButton(PushControlSurface.PUSH_BUTTON_DEVICE_LEFT, clip != null && clip.canScrollStepsBackwards() ? ColorManager.BUTTON_STATE_ON : ColorManager.BUTTON_STATE_OFF);
    surface.updateButton(PushControlSurface.PUSH_BUTTON_DEVICE_RIGHT, clip != null && clip.canScrollStepsForwards() ? ColorManager.BUTTON_STATE_ON : ColorManager.BUTTON_STATE_OFF);
}
Also used : IChannel(de.mossgrabers.framework.daw.data.IChannel) ITrack(de.mossgrabers.framework.daw.data.ITrack) ITransport(de.mossgrabers.framework.daw.ITransport) ViewManager(de.mossgrabers.framework.view.ViewManager) ColorView(de.mossgrabers.push.view.ColorView) PlayView(de.mossgrabers.push.view.PlayView) SequencerView(de.mossgrabers.push.view.SequencerView) ScenePlayView(de.mossgrabers.push.view.ScenePlayView) DrumView(de.mossgrabers.push.view.DrumView) SceneView(de.mossgrabers.framework.view.SceneView) View(de.mossgrabers.framework.view.View) ClipView(de.mossgrabers.push.view.ClipView) AbstractSequencerView(de.mossgrabers.framework.view.AbstractSequencerView) PrgChangeView(de.mossgrabers.push.view.PrgChangeView) PianoView(de.mossgrabers.push.view.PianoView) SessionView(de.mossgrabers.push.view.SessionView) RaindropsView(de.mossgrabers.push.view.RaindropsView) AbstractSequencerView(de.mossgrabers.framework.view.AbstractSequencerView) PushCursorCommand(de.mossgrabers.push.command.trigger.PushCursorCommand) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) ICursorClip(de.mossgrabers.framework.daw.ICursorClip) SceneView(de.mossgrabers.framework.view.SceneView) ClipView(de.mossgrabers.push.view.ClipView) PushControlSurface(de.mossgrabers.push.controller.PushControlSurface) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice) ModeManager(de.mossgrabers.framework.mode.ModeManager)

Example 2 with AbstractSequencerView

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

the class LaunchpadCursorCommand method scrollRight.

/**
 * {@inheritDoc}
 */
@SuppressWarnings("rawtypes")
@Override
protected void scrollRight() {
    final ViewManager viewManager = this.surface.getViewManager();
    if (viewManager.isActiveView(Views.VIEW_PLAY)) {
        final Scales scales = this.model.getScales();
        scales.nextScale();
        final String name = scales.getScale().getName();
        this.surface.getConfiguration().setScale(name);
        this.surface.getDisplay().notify(name);
        return;
    }
    if (viewManager.isActiveView(Views.VIEW_DEVICE)) {
        final ICursorDevice cursorDevice = this.model.getCursorDevice();
        cursorDevice.nextParameterPage();
        this.surface.getDisplay().notify(cursorDevice.getSelectedParameterPageName());
        return;
    }
    if (viewManager.isActiveView(Views.VIEW_BROWSER)) {
        this.model.getBrowser().nextContentType();
        return;
    }
    if (viewManager.isActiveView(Views.VIEW_SHIFT) || viewManager.isActiveView(Views.VIEW_DRUM64))
        return;
    // VIEW_SEQUENCER, VIEW_RAINDROPS, VIEW_DRUM, VIEW_DRUM4, VIEW_DRUM8
    final View activeView = viewManager.getActiveView();
    if (activeView instanceof AbstractSequencerView) {
        ((AbstractSequencerView) activeView).onRight(ButtonEvent.DOWN);
        return;
    }
    // VIEW_SESSION, VIEW_VOLUME, VIEW_PAN, VIEW_SENDS
    this.scrollTracksRight();
}
Also used : ViewManager(de.mossgrabers.framework.view.ViewManager) Scales(de.mossgrabers.framework.scale.Scales) View(de.mossgrabers.framework.view.View) AbstractSequencerView(de.mossgrabers.framework.view.AbstractSequencerView) RaindropsView(de.mossgrabers.launchpad.view.RaindropsView) PlayView(de.mossgrabers.launchpad.view.PlayView) SequencerView(de.mossgrabers.launchpad.view.SequencerView) DrumView(de.mossgrabers.launchpad.view.DrumView) AbstractSequencerView(de.mossgrabers.framework.view.AbstractSequencerView) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice)

Example 3 with AbstractSequencerView

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

the class LaunchpadCursorCommand method scrollLeft.

/**
 * {@inheritDoc}
 */
@SuppressWarnings("rawtypes")
@Override
protected void scrollLeft() {
    final ViewManager viewManager = this.surface.getViewManager();
    if (viewManager.isActiveView(Views.VIEW_PLAY)) {
        final Scales scales = this.model.getScales();
        scales.prevScale();
        final String name = scales.getScale().getName();
        this.surface.getConfiguration().setScale(name);
        this.surface.getDisplay().notify(name);
        return;
    }
    if (viewManager.isActiveView(Views.VIEW_DEVICE)) {
        final ICursorDevice cursorDevice = this.model.getCursorDevice();
        cursorDevice.previousParameterPage();
        this.surface.getDisplay().notify(cursorDevice.getSelectedParameterPageName());
        return;
    }
    if (viewManager.isActiveView(Views.VIEW_BROWSER)) {
        this.model.getBrowser().previousContentType();
        return;
    }
    if (viewManager.isActiveView(Views.VIEW_SHIFT) || viewManager.isActiveView(Views.VIEW_DRUM64))
        return;
    // VIEW_SEQUENCER, VIEW_RAINDROPS, VIEW_DRUM, VIEW_DRUM4, VIEW_DRUM8
    final View activeView = viewManager.getActiveView();
    if (activeView instanceof AbstractSequencerView) {
        ((AbstractSequencerView) activeView).onLeft(ButtonEvent.DOWN);
        return;
    }
    // VIEW_SESSION, VIEW_VOLUME, VIEW_PAN, VIEW_SENDS
    this.scrollTracksLeft();
}
Also used : ViewManager(de.mossgrabers.framework.view.ViewManager) Scales(de.mossgrabers.framework.scale.Scales) View(de.mossgrabers.framework.view.View) AbstractSequencerView(de.mossgrabers.framework.view.AbstractSequencerView) RaindropsView(de.mossgrabers.launchpad.view.RaindropsView) PlayView(de.mossgrabers.launchpad.view.PlayView) SequencerView(de.mossgrabers.launchpad.view.SequencerView) DrumView(de.mossgrabers.launchpad.view.DrumView) AbstractSequencerView(de.mossgrabers.framework.view.AbstractSequencerView) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice)

Aggregations

ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)3 AbstractSequencerView (de.mossgrabers.framework.view.AbstractSequencerView)3 View (de.mossgrabers.framework.view.View)3 ViewManager (de.mossgrabers.framework.view.ViewManager)3 Scales (de.mossgrabers.framework.scale.Scales)2 DrumView (de.mossgrabers.launchpad.view.DrumView)2 PlayView (de.mossgrabers.launchpad.view.PlayView)2 RaindropsView (de.mossgrabers.launchpad.view.RaindropsView)2 SequencerView (de.mossgrabers.launchpad.view.SequencerView)2 IChannelBank (de.mossgrabers.framework.daw.IChannelBank)1 ICursorClip (de.mossgrabers.framework.daw.ICursorClip)1 ITransport (de.mossgrabers.framework.daw.ITransport)1 IChannel (de.mossgrabers.framework.daw.data.IChannel)1 ITrack (de.mossgrabers.framework.daw.data.ITrack)1 ModeManager (de.mossgrabers.framework.mode.ModeManager)1 SceneView (de.mossgrabers.framework.view.SceneView)1 PushCursorCommand (de.mossgrabers.push.command.trigger.PushCursorCommand)1 PushControlSurface (de.mossgrabers.push.controller.PushControlSurface)1 ClipView (de.mossgrabers.push.view.ClipView)1 ColorView (de.mossgrabers.push.view.ColorView)1