Search in sources :

Example 11 with PushControlSurface

use of de.mossgrabers.push.controller.PushControlSurface in project DrivenByMoss by git-moss.

the class PushControllerSetup method flush.

/**
 * {@inheritDoc}
 */
@Override
public void flush() {
    this.flushSurfaces();
    this.updateButtons();
    final PushControlSurface surface = this.getSurface();
    this.updateMode(surface.getModeManager().getActiveModeId());
    final View activeView = surface.getViewManager().getActiveView();
    if (activeView == null)
        return;
    final de.mossgrabers.framework.command.core.PitchbendCommand pitchbendCommand = activeView.getPitchbendCommand();
    if (pitchbendCommand != null)
        pitchbendCommand.updateValue();
}
Also used : MasterMode(de.mossgrabers.push.mode.track.MasterMode) NoteMode(de.mossgrabers.push.mode.NoteMode) PanMode(de.mossgrabers.push.mode.track.PanMode) TransportMode(de.mossgrabers.push.mode.TransportMode) TrackMode(de.mossgrabers.push.mode.track.TrackMode) CrossfaderMode(de.mossgrabers.push.mode.track.CrossfaderMode) RibbonMode(de.mossgrabers.push.mode.RibbonMode) FixedMode(de.mossgrabers.push.mode.FixedMode) ConfigurationMode(de.mossgrabers.push.mode.ConfigurationMode) ScalesMode(de.mossgrabers.push.mode.ScalesMode) SetupMode(de.mossgrabers.push.mode.SetupMode) LayerDetailsMode(de.mossgrabers.push.mode.track.LayerDetailsMode) DeviceParamsMode(de.mossgrabers.push.mode.device.DeviceParamsMode) FrameMode(de.mossgrabers.push.mode.FrameMode) NoteViewSelectMode(de.mossgrabers.push.mode.NoteViewSelectMode) SendMode(de.mossgrabers.push.mode.track.SendMode) ScaleLayoutMode(de.mossgrabers.push.mode.ScaleLayoutMode) SessionViewSelectMode(de.mossgrabers.push.mode.SessionViewSelectMode) InfoMode(de.mossgrabers.push.mode.InfoMode) GrooveMode(de.mossgrabers.push.mode.GrooveMode) VolumeMode(de.mossgrabers.push.mode.track.VolumeMode) TrackDetailsMode(de.mossgrabers.push.mode.track.TrackDetailsMode) DeviceBrowserMode(de.mossgrabers.push.mode.device.DeviceBrowserMode) ClipMode(de.mossgrabers.push.mode.track.ClipMode) AutomationMode(de.mossgrabers.push.mode.AutomationMode) AccentMode(de.mossgrabers.push.mode.AccentMode) DeviceLayerMode(de.mossgrabers.push.mode.device.DeviceLayerMode) PushControlSurface(de.mossgrabers.push.controller.PushControlSurface) 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)

Example 12 with PushControlSurface

use of de.mossgrabers.push.controller.PushControlSurface in project DrivenByMoss by git-moss.

the class PushControllerSetup method createModes.

/**
 * {@inheritDoc}
 */
@Override
protected void createModes() {
    final PushControlSurface surface = this.getSurface();
    final ModeManager modeManager = surface.getModeManager();
    modeManager.registerMode(Modes.MODE_VOLUME, new VolumeMode(surface, this.model));
    modeManager.registerMode(Modes.MODE_PAN, new PanMode(surface, this.model));
    modeManager.registerMode(Modes.MODE_CROSSFADER, new CrossfaderMode(surface, this.model));
    final SendMode modeSend = new SendMode(surface, this.model);
    modeManager.registerMode(Modes.MODE_SEND1, modeSend);
    modeManager.registerMode(Modes.MODE_SEND2, modeSend);
    modeManager.registerMode(Modes.MODE_SEND3, modeSend);
    modeManager.registerMode(Modes.MODE_SEND4, modeSend);
    modeManager.registerMode(Modes.MODE_SEND5, modeSend);
    modeManager.registerMode(Modes.MODE_SEND6, modeSend);
    modeManager.registerMode(Modes.MODE_MASTER, new MasterMode(surface, this.model, false));
    modeManager.registerMode(Modes.MODE_MASTER_TEMP, new MasterMode(surface, this.model, true));
    modeManager.registerMode(Modes.MODE_TRACK, new TrackMode(surface, this.model));
    modeManager.registerMode(Modes.MODE_TRACK_DETAILS, new TrackDetailsMode(surface, this.model));
    modeManager.registerMode(Modes.MODE_DEVICE_LAYER_DETAILS, new LayerDetailsMode(surface, this.model));
    modeManager.registerMode(Modes.MODE_CLIP, new ClipMode(surface, this.model));
    modeManager.registerMode(Modes.MODE_NOTE, new NoteMode(surface, this.model));
    modeManager.registerMode(Modes.MODE_FRAME, new FrameMode(surface, this.model));
    modeManager.registerMode(Modes.MODE_SCALES, new ScalesMode(surface, this.model));
    modeManager.registerMode(Modes.MODE_SCALE_LAYOUT, new ScaleLayoutMode(surface, this.model));
    modeManager.registerMode(Modes.MODE_ACCENT, new AccentMode(surface, this.model));
    modeManager.registerMode(Modes.MODE_FIXED, new FixedMode(surface, this.model));
    modeManager.registerMode(Modes.MODE_RIBBON, new RibbonMode(surface, this.model));
    modeManager.registerMode(Modes.MODE_GROOVE, new GrooveMode(surface, this.model));
    modeManager.registerMode(Modes.MODE_VIEW_SELECT, new NoteViewSelectMode(surface, this.model));
    modeManager.registerMode(Modes.MODE_AUTOMATION, new AutomationMode(surface, this.model));
    modeManager.registerMode(Modes.MODE_TRANSPORT, new TransportMode(surface, this.model));
    modeManager.registerMode(Modes.MODE_DEVICE_PARAMS, new DeviceParamsMode(surface, this.model));
    modeManager.registerMode(Modes.MODE_DEVICE_LAYER, new DeviceLayerMode(surface, this.model));
    modeManager.registerMode(Modes.MODE_BROWSER, new DeviceBrowserMode(surface, this.model));
    modeManager.registerMode(Modes.MODE_DEVICE_LAYER_VOLUME, new DeviceLayerModeVolume(surface, this.model));
    modeManager.registerMode(Modes.MODE_DEVICE_LAYER_PAN, new DeviceLayerModePan(surface, this.model));
    final DeviceLayerModeSend modeLayerSend = new DeviceLayerModeSend(surface, this.model);
    modeManager.registerMode(Modes.MODE_DEVICE_LAYER_SEND1, modeLayerSend);
    modeManager.registerMode(Modes.MODE_DEVICE_LAYER_SEND2, modeLayerSend);
    modeManager.registerMode(Modes.MODE_DEVICE_LAYER_SEND3, modeLayerSend);
    modeManager.registerMode(Modes.MODE_DEVICE_LAYER_SEND4, modeLayerSend);
    modeManager.registerMode(Modes.MODE_DEVICE_LAYER_SEND5, modeLayerSend);
    modeManager.registerMode(Modes.MODE_DEVICE_LAYER_SEND6, modeLayerSend);
    if (this.isPush2) {
        modeManager.registerMode(Modes.MODE_SEND7, modeSend);
        modeManager.registerMode(Modes.MODE_SEND8, modeSend);
        modeManager.registerMode(Modes.MODE_DEVICE_LAYER_SEND7, modeLayerSend);
        modeManager.registerMode(Modes.MODE_DEVICE_LAYER_SEND8, modeLayerSend);
        modeManager.registerMode(Modes.MODE_SETUP, new SetupMode(surface, this.model));
        modeManager.registerMode(Modes.MODE_INFO, new InfoMode(surface, this.model));
    } else
        modeManager.registerMode(Modes.MODE_CONFIGURATION, new ConfigurationMode(surface, this.model));
    if (this.host.hasClips()) {
        modeManager.registerMode(Modes.MODE_SESSION_VIEW_SELECT, new SessionViewSelectMode(surface, this.model));
    }
}
Also used : NoteMode(de.mossgrabers.push.mode.NoteMode) ScalesMode(de.mossgrabers.push.mode.ScalesMode) GrooveMode(de.mossgrabers.push.mode.GrooveMode) TrackMode(de.mossgrabers.push.mode.track.TrackMode) DeviceLayerModeVolume(de.mossgrabers.push.mode.device.DeviceLayerModeVolume) MasterMode(de.mossgrabers.push.mode.track.MasterMode) LayerDetailsMode(de.mossgrabers.push.mode.track.LayerDetailsMode) DeviceParamsMode(de.mossgrabers.push.mode.device.DeviceParamsMode) DeviceLayerModePan(de.mossgrabers.push.mode.device.DeviceLayerModePan) DeviceLayerMode(de.mossgrabers.push.mode.device.DeviceLayerMode) ScaleLayoutMode(de.mossgrabers.push.mode.ScaleLayoutMode) DeviceLayerModeSend(de.mossgrabers.push.mode.device.DeviceLayerModeSend) ConfigurationMode(de.mossgrabers.push.mode.ConfigurationMode) SendMode(de.mossgrabers.push.mode.track.SendMode) AutomationMode(de.mossgrabers.push.mode.AutomationMode) TrackDetailsMode(de.mossgrabers.push.mode.track.TrackDetailsMode) ModeManager(de.mossgrabers.framework.mode.ModeManager) InfoMode(de.mossgrabers.push.mode.InfoMode) PanMode(de.mossgrabers.push.mode.track.PanMode) FixedMode(de.mossgrabers.push.mode.FixedMode) SessionViewSelectMode(de.mossgrabers.push.mode.SessionViewSelectMode) DeviceBrowserMode(de.mossgrabers.push.mode.device.DeviceBrowserMode) AccentMode(de.mossgrabers.push.mode.AccentMode) SetupMode(de.mossgrabers.push.mode.SetupMode) RibbonMode(de.mossgrabers.push.mode.RibbonMode) NoteViewSelectMode(de.mossgrabers.push.mode.NoteViewSelectMode) CrossfaderMode(de.mossgrabers.push.mode.track.CrossfaderMode) ClipMode(de.mossgrabers.push.mode.track.ClipMode) VolumeMode(de.mossgrabers.push.mode.track.VolumeMode) TransportMode(de.mossgrabers.push.mode.TransportMode) PushControlSurface(de.mossgrabers.push.controller.PushControlSurface) FrameMode(de.mossgrabers.push.mode.FrameMode)

Example 13 with PushControlSurface

use of de.mossgrabers.push.controller.PushControlSurface in project DrivenByMoss by git-moss.

the class PushControllerSetup method updateMode.

private void updateMode(final Integer mode) {
    if (mode == null)
        return;
    this.updateIndication(mode);
    final boolean isMasterOn = Modes.MODE_MASTER.equals(mode) || Modes.MODE_MASTER_TEMP.equals(mode) || Modes.MODE_FRAME.equals(mode);
    final boolean isVolumeOn = Modes.MODE_VOLUME.equals(mode) || Modes.MODE_CROSSFADER.equals(mode);
    final boolean isPanOn = mode.intValue() >= Modes.MODE_PAN.intValue() && mode.intValue() <= Modes.MODE_SEND8.intValue();
    final boolean isDeviceOn = Modes.isDeviceMode(mode);
    boolean isMixOn = Modes.MODE_TRACK.equals(mode);
    if (this.isPush2)
        isMixOn = isMixOn || isVolumeOn || isPanOn;
    final PushControlSurface surface = this.getSurface();
    surface.updateButton(PushControlSurface.PUSH_BUTTON_MASTER, isMasterOn ? ColorManager.BUTTON_STATE_HI : ColorManager.BUTTON_STATE_ON);
    surface.updateButton(PushControlSurface.PUSH_BUTTON_TRACK, isMixOn ? ColorManager.BUTTON_STATE_HI : ColorManager.BUTTON_STATE_ON);
    surface.updateButton(PushControlSurface.PUSH_BUTTON_VOLUME, isVolumeOn ? ColorManager.BUTTON_STATE_HI : ColorManager.BUTTON_STATE_ON);
    surface.updateButton(PushControlSurface.PUSH_BUTTON_PAN_SEND, isPanOn ? ColorManager.BUTTON_STATE_HI : ColorManager.BUTTON_STATE_ON);
    surface.updateButton(PushControlSurface.PUSH_BUTTON_DEVICE, isDeviceOn ? ColorManager.BUTTON_STATE_HI : ColorManager.BUTTON_STATE_ON);
    surface.updateButton(PushControlSurface.PUSH_BUTTON_SCALES, Modes.MODE_SCALES.equals(mode) ? ColorManager.BUTTON_STATE_HI : ColorManager.BUTTON_STATE_ON);
    surface.updateButton(PushControlSurface.PUSH_BUTTON_FIXED_LENGTH, Modes.MODE_FIXED.equals(mode) ? ColorManager.BUTTON_STATE_HI : ColorManager.BUTTON_STATE_ON);
    surface.updateButton(PushControlSurface.PUSH_BUTTON_BROWSE, Modes.MODE_BROWSER.equals(mode) ? ColorManager.BUTTON_STATE_HI : ColorManager.BUTTON_STATE_ON);
    surface.updateButton(PushControlSurface.PUSH_BUTTON_CLIP, Modes.MODE_CLIP.equals(mode) ? ColorManager.BUTTON_STATE_HI : ColorManager.BUTTON_STATE_ON);
    if (this.isPush2)
        surface.updateButton(PushControlSurface.PUSH_BUTTON_SETUP, Modes.MODE_SETUP.equals(mode) ? ColorManager.BUTTON_STATE_HI : ColorManager.BUTTON_STATE_ON);
}
Also used : PushControlSurface(de.mossgrabers.push.controller.PushControlSurface)

Example 14 with PushControlSurface

use of de.mossgrabers.push.controller.PushControlSurface 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)

Aggregations

PushControlSurface (de.mossgrabers.push.controller.PushControlSurface)14 ModeManager (de.mossgrabers.framework.mode.ModeManager)5 ViewManager (de.mossgrabers.framework.view.ViewManager)5 PlayView (de.mossgrabers.push.view.PlayView)5 ScenePlayView (de.mossgrabers.push.view.ScenePlayView)5 AbstractSequencerView (de.mossgrabers.framework.view.AbstractSequencerView)4 ClipView (de.mossgrabers.push.view.ClipView)4 ColorView (de.mossgrabers.push.view.ColorView)4 DrumView (de.mossgrabers.push.view.DrumView)4 PianoView (de.mossgrabers.push.view.PianoView)4 PrgChangeView (de.mossgrabers.push.view.PrgChangeView)4 SceneView (de.mossgrabers.framework.view.SceneView)3 View (de.mossgrabers.framework.view.View)3 IChannelBank (de.mossgrabers.framework.daw.IChannelBank)2 ITrackBank (de.mossgrabers.framework.daw.ITrackBank)2 ITrack (de.mossgrabers.framework.daw.data.ITrack)2 AccentMode (de.mossgrabers.push.mode.AccentMode)2 AutomationMode (de.mossgrabers.push.mode.AutomationMode)2 ConfigurationMode (de.mossgrabers.push.mode.ConfigurationMode)2 FixedMode (de.mossgrabers.push.mode.FixedMode)2