Search in sources :

Example 1 with ViewManager

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

the class APCControllerSetup method registerContinuousCommands.

/**
 * {@inheritDoc}
 */
@Override
protected void registerContinuousCommands() {
    final APCControlSurface surface = this.getSurface();
    final ViewManager viewManager = surface.getViewManager();
    this.addContinuousCommand(Commands.CONT_COMMAND_MASTER_KNOB, APCControlSurface.APC_KNOB_MASTER_LEVEL, new MasterFaderAbsoluteCommand<>(this.model, surface));
    this.addContinuousCommand(Commands.CONT_COMMAND_PLAY_POSITION, APCControlSurface.APC_KNOB_CUE_LEVEL, new PlayPositionCommand<>(this.model, surface));
    this.addContinuousCommand(Commands.CONT_COMMAND_CROSSFADER, APCControlSurface.APC_KNOB_CROSSFADER, new CrossfaderCommand<>(this.model, surface));
    for (int i = 0; i < 8; i++) {
        final Integer faderCommand = Integer.valueOf(Commands.CONT_COMMAND_FADER1.intValue() + i);
        viewManager.registerContinuousCommand(faderCommand, new FaderAbsoluteCommand<>(i, this.model, surface));
        surface.assignContinuousCommand(APCControlSurface.APC_KNOB_TRACK_LEVEL, i, faderCommand);
        final Integer knobCommand = Integer.valueOf(Commands.CONT_COMMAND_KNOB1.intValue() + i);
        viewManager.registerContinuousCommand(knobCommand, new KnobRowModeCommand<>(i, this.model, surface));
        surface.assignContinuousCommand(APCControlSurface.APC_KNOB_TRACK_KNOB_1 + i, knobCommand);
        final Integer deviceKnobCommand = Integer.valueOf(Commands.CONT_COMMAND_DEVICE_KNOB1.intValue() + i);
        viewManager.registerContinuousCommand(deviceKnobCommand, new DeviceKnobRowCommand(i, this.model, surface));
        surface.assignContinuousCommand(APCControlSurface.APC_KNOB_DEVICE_KNOB_1 + i, deviceKnobCommand);
    }
    if (this.isMkII)
        this.addContinuousCommand(Commands.CONT_COMMAND_TEMPO, APCControlSurface.APC_KNOB_TEMPO, new TempoCommand<>(this.model, surface));
}
Also used : APCControlSurface(de.mossgrabers.apc.controller.APCControlSurface) ViewManager(de.mossgrabers.framework.view.ViewManager) TempoCommand(de.mossgrabers.framework.command.continuous.TempoCommand) TapTempoCommand(de.mossgrabers.framework.command.trigger.transport.TapTempoCommand) DeviceKnobRowCommand(de.mossgrabers.apc.command.continuous.DeviceKnobRowCommand)

Example 2 with ViewManager

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

the class APCControllerSetup method registerTriggerCommands.

/**
 * {@inheritDoc}
 */
@Override
protected void registerTriggerCommands() {
    final APCControlSurface surface = this.getSurface();
    final ViewManager viewManager = surface.getViewManager();
    this.addTriggerCommand(Commands.COMMAND_SHIFT, APCControlSurface.APC_BUTTON_SHIFT, new ShiftCommand(this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_PLAY, APCControlSurface.APC_BUTTON_PLAY, new PlayCommand<>(this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_RECORD, APCControlSurface.APC_BUTTON_RECORD, new APCRecordCommand(this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_TAP_TEMPO, APCControlSurface.APC_BUTTON_TAP_TEMPO, new TapTempoCommand<>(this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_QUANTIZE, APCControlSurface.APC_BUTTON_REC_QUANT, new APCQuantizeCommand(this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_PAN_SEND, APCControlSurface.APC_BUTTON_PAN, new ModeSelectCommand<>(Modes.MODE_PAN, this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_MASTERTRACK, APCControlSurface.APC_BUTTON_MASTER, new MasterCommand(this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_STOP_ALL_CLIPS, APCControlSurface.APC_BUTTON_STOP_ALL_CLIPS, new StopAllClipsCommand<>(this.model, surface));
    this.addTriggerCommand(Integer.valueOf(COMMAND_SEND), APCControlSurface.APC_BUTTON_SEND_A, new SendCommand(0, this.model, surface));
    this.addTriggerCommand(Integer.valueOf(COMMAND_SEND + 1), APCControlSurface.APC_BUTTON_SEND_B, new SendCommand(1, this.model, surface));
    for (int i = 0; i < 8; i++) {
        final Integer selectCommand = Integer.valueOf(COMMAND_SELECT + i);
        final Integer soloCommand = Integer.valueOf(COMMAND_SOLO + i);
        final Integer muteCommand = Integer.valueOf(COMMAND_MUTE + i);
        final Integer recArmCommand = Integer.valueOf(COMMAND_REC_ARM + i);
        final Integer crossfadeCommand = Integer.valueOf(COMMAND_CROSSFADER + i);
        final Integer stopClipCommand = Integer.valueOf(COMMAND_STOP_CLIP + i);
        viewManager.registerTriggerCommand(selectCommand, new SelectCommand(i, this.model, surface));
        viewManager.registerTriggerCommand(soloCommand, new SoloCommand<>(i, this.model, surface));
        viewManager.registerTriggerCommand(muteCommand, new MuteCommand<>(i, this.model, surface));
        viewManager.registerTriggerCommand(recArmCommand, new RecArmCommand(i, this.model, surface));
        viewManager.registerTriggerCommand(crossfadeCommand, new CrossfadeModeCommand<>(i, this.model, surface));
        viewManager.registerTriggerCommand(stopClipCommand, new StopClipCommand<>(i, this.model, surface));
        surface.assignTriggerCommand(APCControlSurface.APC_BUTTON_TRACK_SELECTION, i, selectCommand);
        surface.assignTriggerCommand(APCControlSurface.APC_BUTTON_SOLO, i, soloCommand);
        surface.assignTriggerCommand(APCControlSurface.APC_BUTTON_ACTIVATOR, i, muteCommand);
        surface.assignTriggerCommand(APCControlSurface.APC_BUTTON_RECORD_ARM, i, recArmCommand);
        surface.assignTriggerCommand(APCControlSurface.APC_BUTTON_A_B, i, crossfadeCommand);
        surface.assignTriggerCommand(APCControlSurface.APC_BUTTON_CLIP_STOP, i, stopClipCommand);
    }
    viewManager.registerTriggerCommand(COMMAND_DEVICE_LEFT, new DeviceLeftCommand(this.model, surface));
    viewManager.registerTriggerCommand(COMMAND_DEVICE_RIGHT, new DeviceRightCommand(this.model, surface));
    viewManager.registerTriggerCommand(Commands.COMMAND_CLIP, new SessionRecordCommand(this.model, surface));
    viewManager.registerTriggerCommand(Commands.COMMAND_METRONOME, new MetronomeCommand<>(this.model, surface));
    viewManager.registerTriggerCommand(Commands.COMMAND_NUDGE_MINUS, new NudgeCommand(true, this.model, surface));
    viewManager.registerTriggerCommand(Commands.COMMAND_NUDGE_PLUS, new NudgeCommand(false, this.model, surface));
    viewManager.registerTriggerCommand(Commands.COMMAND_LAYOUT, new PanelLayoutCommand(this.model, surface));
    viewManager.registerTriggerCommand(Commands.COMMAND_DEVICE_ON_OFF, new DeviceOnOffCommand<>(this.model, surface));
    viewManager.registerTriggerCommand(COMMAND_TOGGLE_DEVICES, new PaneCommand<>(Panels.DEVICE, this.model, surface));
    if (this.isMkII) {
        surface.assignTriggerCommand(APCControlSurface.APC_BUTTON_SESSION, Commands.COMMAND_CLIP);
        surface.assignTriggerCommand(APCControlSurface.APC_BUTTON_SEND_C, Commands.COMMAND_METRONOME);
        surface.assignTriggerCommand(APCControlSurface.APC_BUTTON_NUDGE_MINUS, Commands.COMMAND_NUDGE_MINUS);
        surface.assignTriggerCommand(APCControlSurface.APC_BUTTON_NUDGE_PLUS, Commands.COMMAND_NUDGE_PLUS);
        // Detail View
        surface.assignTriggerCommand(APCControlSurface.APC_BUTTON_METRONOME, Commands.COMMAND_LAYOUT);
        // Device on/off
        surface.assignTriggerCommand(APCControlSurface.APC_BUTTON_DETAIL_VIEW, Commands.COMMAND_DEVICE_ON_OFF);
        surface.assignTriggerCommand(APCControlSurface.APC_BUTTON_CLIP_TRACK, COMMAND_DEVICE_LEFT);
        surface.assignTriggerCommand(APCControlSurface.APC_BUTTON_DEVICE_ON_OFF, COMMAND_DEVICE_RIGHT);
        surface.assignTriggerCommand(APCControlSurface.APC_BUTTON_MIDI_OVERDUB, COMMAND_TOGGLE_DEVICES);
    } else {
        surface.assignTriggerCommand(APCControlSurface.APC_BUTTON_MIDI_OVERDUB, Commands.COMMAND_CLIP);
        surface.assignTriggerCommand(APCControlSurface.APC_BUTTON_METRONOME, Commands.COMMAND_METRONOME);
        surface.assignTriggerCommand(APCControlSurface.APC_BUTTON_NUDGE_PLUS, Commands.COMMAND_NUDGE_MINUS);
        surface.assignTriggerCommand(APCControlSurface.APC_BUTTON_NUDGE_MINUS, Commands.COMMAND_NUDGE_PLUS);
        surface.assignTriggerCommand(APCControlSurface.APC_BUTTON_DETAIL_VIEW, Commands.COMMAND_LAYOUT);
        surface.assignTriggerCommand(APCControlSurface.APC_BUTTON_DEVICE_ON_OFF, Commands.COMMAND_DEVICE_ON_OFF);
        surface.assignTriggerCommand(APCControlSurface.APC_BUTTON_CLIP_TRACK, COMMAND_TOGGLE_DEVICES);
        this.addTriggerCommand(Commands.COMMAND_STOP, APCControlSurface.APC_BUTTON_STOP, new StopCommand<>(this.model, surface));
        this.addTriggerCommand(Integer.valueOf(COMMAND_SEND + 2), APCControlSurface.APC_BUTTON_SEND_C, new SendCommand(2, this.model, surface));
        this.addTriggerCommand(Commands.COMMAND_NEW, APCControlSurface.APC_FOOTSWITCH_2, new NewCommand<>(this.model, surface));
    }
    this.addTriggerCommand(Commands.COMMAND_BROWSE, APCControlSurface.APC_BUTTON_BANK, new APCBrowserCommand(this.model, surface));
    this.addTriggerCommand(COMMAND_BANK_LEFT, APCControlSurface.APC_BUTTON_DEVICE_LEFT, new BankLeftCommand(this.model, surface));
    this.addTriggerCommand(COMMAND_BANK_RIGHT, APCControlSurface.APC_BUTTON_DEVICE_RIGHT, new BankRightCommand(this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_ARROW_DOWN, surface.getDownButtonId(), new APCCursorCommand(Direction.DOWN, this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_ARROW_UP, surface.getUpButtonId(), new APCCursorCommand(Direction.UP, this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_ARROW_LEFT, surface.getLeftButtonId(), new APCCursorCommand(Direction.LEFT, this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_ARROW_RIGHT, surface.getRightButtonId(), new APCCursorCommand(Direction.RIGHT, this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_SCENE1, APCControlSurface.APC_BUTTON_SCENE_LAUNCH_1, new SceneCommand<>(7, this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_SCENE2, APCControlSurface.APC_BUTTON_SCENE_LAUNCH_2, new SceneCommand<>(6, this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_SCENE3, APCControlSurface.APC_BUTTON_SCENE_LAUNCH_3, new SceneCommand<>(5, this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_SCENE4, APCControlSurface.APC_BUTTON_SCENE_LAUNCH_4, new SceneCommand<>(4, this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_SCENE5, APCControlSurface.APC_BUTTON_SCENE_LAUNCH_5, new SceneCommand<>(3, this.model, surface));
}
Also used : ShiftCommand(de.mossgrabers.apc.command.trigger.ShiftCommand) RecArmCommand(de.mossgrabers.apc.command.trigger.RecArmCommand) NudgeCommand(de.mossgrabers.apc.command.trigger.NudgeCommand) APCCursorCommand(de.mossgrabers.apc.command.trigger.APCCursorCommand) ViewManager(de.mossgrabers.framework.view.ViewManager) BankRightCommand(de.mossgrabers.apc.command.trigger.BankRightCommand) MasterCommand(de.mossgrabers.apc.command.trigger.MasterCommand) DeviceRightCommand(de.mossgrabers.apc.command.trigger.DeviceRightCommand) SessionRecordCommand(de.mossgrabers.apc.command.trigger.SessionRecordCommand) SendCommand(de.mossgrabers.apc.command.trigger.SendCommand) APCQuantizeCommand(de.mossgrabers.apc.command.trigger.APCQuantizeCommand) ModeSelectCommand(de.mossgrabers.framework.command.trigger.ModeSelectCommand) SelectCommand(de.mossgrabers.apc.command.trigger.SelectCommand) PanelLayoutCommand(de.mossgrabers.apc.command.trigger.PanelLayoutCommand) APCRecordCommand(de.mossgrabers.apc.command.trigger.APCRecordCommand) APCControlSurface(de.mossgrabers.apc.controller.APCControlSurface) APCBrowserCommand(de.mossgrabers.apc.command.trigger.APCBrowserCommand) BankLeftCommand(de.mossgrabers.apc.command.trigger.BankLeftCommand) DeviceLeftCommand(de.mossgrabers.apc.command.trigger.DeviceLeftCommand)

Example 3 with ViewManager

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

the class APCminiControllerSetup method updateIndication.

private void updateIndication(final Integer mode) {
    final ITrackBank tb = this.model.getTrackBank();
    final IChannelBank tbe = this.model.getEffectTrackBank();
    final APCminiControlSurface surface = this.getSurface();
    final ViewManager viewManager = surface.getViewManager();
    final boolean isShiftView = viewManager.isActiveView(Views.VIEW_SHIFT);
    final boolean isSession = viewManager.isActiveView(Views.VIEW_SESSION) || isShiftView;
    final boolean isEffect = this.model.isEffectTrackBankActive();
    final boolean isPan = Modes.MODE_PAN.equals(mode);
    final boolean isDevice = Modes.MODE_DEVICE.equals(mode);
    tb.setIndication(!isEffect && isSession);
    tbe.setIndication(isEffect && isSession);
    final ICursorDevice cursorDevice = this.model.getCursorDevice();
    for (int i = 0; i < 8; i++) {
        final ITrack track = tb.getTrack(i);
        track.setVolumeIndication(!isEffect);
        track.setPanIndication(!isEffect && isPan);
        for (int j = 0; j < 8; j++) track.getSend(j).setIndication(!isEffect && (Modes.MODE_SEND1.equals(mode) && j == 0 || Modes.MODE_SEND2.equals(mode) && j == 1 || Modes.MODE_SEND3.equals(mode) && j == 2 || Modes.MODE_SEND4.equals(mode) && j == 3 || Modes.MODE_SEND5.equals(mode) && j == 4 || Modes.MODE_SEND6.equals(mode) && j == 5 || Modes.MODE_SEND7.equals(mode) && j == 6 || Modes.MODE_SEND8.equals(mode) && j == 7));
        final ITrack fxTrack = tbe.getTrack(i);
        fxTrack.setVolumeIndication(isEffect);
        fxTrack.setPanIndication(isEffect && isPan);
        cursorDevice.indicateParameter(i, isDevice || isShiftView);
    }
}
Also used : APCminiControlSurface(de.mossgrabers.apcmini.controller.APCminiControlSurface) 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) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice)

Example 4 with ViewManager

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

the class ShiftCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final ButtonEvent event) {
    final ViewManager viewManager = this.surface.getViewManager();
    if (event == ButtonEvent.DOWN && !viewManager.isActiveView(Views.VIEW_SHIFT))
        viewManager.setActiveView(Views.VIEW_SHIFT);
    else if (event == ButtonEvent.UP && viewManager.isActiveView(Views.VIEW_SHIFT))
        viewManager.restoreView();
    this.model.getValueChanger().setSpeed(this.surface.isShiftPressed());
}
Also used : ViewManager(de.mossgrabers.framework.view.ViewManager)

Example 5 with ViewManager

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

the class BrowserView method onKnob.

/**
 * {@inheritDoc}
 */
@Override
public void onKnob(final int index, final int value) {
    final IBrowser browser = this.model.getBrowser();
    if (!browser.isActive()) {
        final ViewManager viewManager = this.surface.getViewManager();
        if (viewManager.isActiveView(Views.VIEW_BROWSER))
            viewManager.restoreView();
        return;
    }
    int column;
    switch(index) {
        case 8:
        case 9:
        case 10:
        case 11:
        case 12:
        case 13:
        case 14:
            column = index - 8;
            if (value > 64) {
                for (int i = 0; i < value - 64; i++) browser.selectNextFilterItem(column);
            } else {
                for (int i = 0; i < 64 - value; i++) browser.selectPreviousFilterItem(column);
            }
            break;
        case 15:
            if (value > 64) {
                for (int i = 0; i < value - 64; i++) browser.selectNextResult();
            } else {
                for (int i = 0; i < 64 - value; i++) browser.selectPreviousResult();
            }
            break;
    }
}
Also used : IBrowser(de.mossgrabers.framework.daw.IBrowser) ViewManager(de.mossgrabers.framework.view.ViewManager)

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