Search in sources :

Example 16 with View

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

the class APCControlSurface method handleMidi.

/**
 * {@inheritDoc}
 */
@Override
protected void handleMidi(final int status, final int data1, final int data2) {
    final int code = status & 0xF0;
    final int channel = status & 0xF;
    switch(code) {
        // Note on/off
        case 0x80:
        case 0x90:
            int note = data1;
            if (!this.isMkII && data1 >= 53 && data1 <= 57)
                note = (4 - (data1 - APC_BUTTON_CLIP_LAUNCH_1)) * 8 + channel;
            if (this.isGridNote(note))
                this.handleGridNote(note, code == 0x80 ? 0 : data2);
            else
                this.handleCC(channel, note, code == 0x80 ? 0 : data2);
            break;
        // CC
        case 0xB0:
            final View view = this.viewManager.getActiveView();
            if (view == null)
                return;
            final Integer commandID = this.getContinuousCommand(data1, channel);
            if (commandID != null)
                view.executeContinuousCommand(commandID, data2);
            if (data1 == APCControlSurface.APC_FOOTSWITCH_2)
                view.executeTriggerCommand(this.getTriggerCommand(APCControlSurface.APC_FOOTSWITCH_2), data2 > 0 ? ButtonEvent.DOWN : ButtonEvent.UP);
            break;
        default:
            this.host.println("Unhandled midi status: " + status);
            break;
    }
}
Also used : View(de.mossgrabers.framework.view.View)

Example 17 with View

use of de.mossgrabers.framework.view.View 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 18 with View

use of de.mossgrabers.framework.view.View 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)

Example 19 with View

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

the class RightCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final ButtonEvent event) {
    final IChannelBank tb = this.model.getCurrentTrackBank();
    final ITrack sel = tb.getSelectedTrack();
    final int index = sel == null ? 0 : sel.getIndex() + 1;
    final View view = this.surface.getViewManager().getActiveView();
    if (index == 8 || this.surface.isShiftPressed()) {
        if (!tb.canScrollTracksDown())
            return;
        tb.scrollTracksPageDown();
        final int newSel = index == 8 || sel == null ? 0 : sel.getIndex();
        this.surface.scheduleTask(() -> view.selectTrack(newSel), 75);
        return;
    }
    view.selectTrack(index);
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) View(de.mossgrabers.framework.view.View)

Example 20 with View

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

the class LaunchpadControllerSetup method updateIndication.

private void updateIndication() {
    final ViewManager viewManager = this.getSurface().getViewManager();
    final boolean isVolume = viewManager.isActiveView(Views.VIEW_VOLUME);
    final boolean isPan = viewManager.isActiveView(Views.VIEW_PAN);
    final boolean isSends = viewManager.isActiveView(Views.VIEW_SENDS);
    final boolean isDevice = viewManager.isActiveView(Views.VIEW_DEVICE);
    final ITrackBank tb = this.model.getTrackBank();
    final IChannelBank tbe = this.model.getEffectTrackBank();
    final ICursorDevice cursorDevice = this.model.getCursorDevice();
    final View view = viewManager.getActiveView();
    final int selSend = view instanceof SendsView ? ((SendsView) view).getSelectedSend() : -1;
    final boolean isSession = view instanceof SessionView && !isVolume && !isPan && !isSends;
    final boolean isEffect = this.model.isEffectTrackBankActive();
    tb.setIndication(!isEffect && isSession);
    tbe.setIndication(isEffect && isSession);
    for (int i = 0; i < 8; i++) {
        final ITrack track = tb.getTrack(i);
        track.setVolumeIndication(!isEffect && isVolume);
        track.setPanIndication(!isEffect && isPan);
        for (int j = 0; j < 8; j++) track.getSend(j).setIndication(!isEffect && isSends && selSend == j);
        final ITrack fxTrack = tbe.getTrack(i);
        fxTrack.setVolumeIndication(isEffect && isVolume);
        fxTrack.setPanIndication(isEffect && isPan);
        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) SendsView(de.mossgrabers.launchpad.view.SendsView) ViewManager(de.mossgrabers.framework.view.ViewManager) SessionView(de.mossgrabers.launchpad.view.SessionView) VolumeView(de.mossgrabers.launchpad.view.VolumeView) SessionView(de.mossgrabers.launchpad.view.SessionView) SequencerView(de.mossgrabers.launchpad.view.SequencerView) SceneView(de.mossgrabers.framework.view.SceneView) DeviceView(de.mossgrabers.launchpad.view.DeviceView) View(de.mossgrabers.framework.view.View) PanView(de.mossgrabers.launchpad.view.PanView) RaindropsView(de.mossgrabers.launchpad.view.RaindropsView) BrowserView(de.mossgrabers.launchpad.view.BrowserView) DrumView(de.mossgrabers.launchpad.view.DrumView) SendsView(de.mossgrabers.launchpad.view.SendsView) ShiftView(de.mossgrabers.launchpad.view.ShiftView) PlayView(de.mossgrabers.launchpad.view.PlayView) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice)

Aggregations

View (de.mossgrabers.framework.view.View)24 ViewManager (de.mossgrabers.framework.view.ViewManager)9 ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)8 SceneView (de.mossgrabers.framework.view.SceneView)8 ITrack (de.mossgrabers.framework.daw.data.ITrack)6 ModeManager (de.mossgrabers.framework.mode.ModeManager)6 IChannelBank (de.mossgrabers.framework.daw.IChannelBank)5 AbstractSequencerView (de.mossgrabers.framework.view.AbstractSequencerView)5 ITransport (de.mossgrabers.framework.daw.ITransport)4 DrumView (de.mossgrabers.launchpad.view.DrumView)4 PlayView (de.mossgrabers.launchpad.view.PlayView)4 RaindropsView (de.mossgrabers.launchpad.view.RaindropsView)4 SequencerView (de.mossgrabers.launchpad.view.SequencerView)4 PushControlSurface (de.mossgrabers.push.controller.PushControlSurface)3 ClipView (de.mossgrabers.push.view.ClipView)3 ColorView (de.mossgrabers.push.view.ColorView)3 DrumView (de.mossgrabers.push.view.DrumView)3 PianoView (de.mossgrabers.push.view.PianoView)3 APCControlSurface (de.mossgrabers.apc.controller.APCControlSurface)2 DrumView (de.mossgrabers.apc.view.DrumView)2