Search in sources :

Example 41 with ViewManager

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

the class SessionView method onSession.

/**
 * The session button was pressed.
 *
 * @param event The button event
 */
public void onSession(final ButtonEvent event) {
    switch(event) {
        case LONG:
            this.isTemporary = true;
            break;
        case UP:
            if (!this.isTemporary)
                return;
            this.isTemporary = false;
            final ViewManager viewManager = this.surface.getViewManager();
            final ITrackBank tb = this.model.getTrackBank();
            final ITrack selectedTrack = tb.getSelectedTrack();
            if (selectedTrack == null)
                return;
            final Integer viewId = viewManager.getPreferredView(selectedTrack.getPosition());
            viewManager.setActiveView(viewId == null ? Views.VIEW_PLAY : viewId);
            break;
        default:
            // Intentionally empty
            return;
    }
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.ITrackBank) ViewManager(de.mossgrabers.framework.view.ViewManager)

Example 42 with ViewManager

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

the class MCUControllerSetup method registerTriggerCommands.

/**
 * {@inheritDoc}
 */
@Override
protected void registerTriggerCommands() {
    // Assignments to the main device
    final MCUControlSurface surface = this.getSurface();
    // Footswitches
    this.addTriggerCommand(COMMAND_FOOTSWITCH1, MCUControlSurface.MCU_USER_A, new AssignableCommand(0, this.model, surface));
    this.addTriggerCommand(COMMAND_FOOTSWITCH2, MCUControlSurface.MCU_USER_B, new AssignableCommand(1, this.model, surface));
    // Navigation
    this.addTriggerCommand(Commands.COMMAND_REWIND, MCUControlSurface.MCU_REWIND, new WindCommand<>(this.model, surface, false));
    this.addTriggerCommand(Commands.COMMAND_FORWARD, MCUControlSurface.MCU_FORWARD, new WindCommand<>(this.model, surface, true));
    this.addTriggerCommand(Commands.COMMAND_LOOP, MCUControlSurface.MCU_REPEAT, new ToggleLoopCommand<>(this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_STOP, MCUControlSurface.MCU_STOP, new StopCommand<>(this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_PLAY, MCUControlSurface.MCU_PLAY, new PlayCommand<>(this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_RECORD, MCUControlSurface.MCU_RECORD, new MCURecordCommand(this.model, surface));
    this.addTriggerCommand(COMMAND_SCRUB, MCUControlSurface.MCU_SCRUB, new ScrubCommand(this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_ARROW_LEFT, MCUControlSurface.MCU_ARROW_LEFT, new CursorCommand(Direction.LEFT, this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_ARROW_RIGHT, MCUControlSurface.MCU_ARROW_RIGHT, new CursorCommand(Direction.RIGHT, this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_ARROW_UP, MCUControlSurface.MCU_ARROW_UP, new CursorCommand(Direction.UP, this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_ARROW_DOWN, MCUControlSurface.MCU_ARROW_DOWN, new CursorCommand(Direction.DOWN, this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_ZOOM, MCUControlSurface.MCU_ZOOM, new ZoomCommand(this.model, surface));
    // Display Mode
    this.addTriggerCommand(COMMAND_TOGGLE_DISPLAY, MCUControlSurface.MCU_NAME_VALUE, new ToggleDisplayCommand(this.model, surface));
    this.addTriggerCommand(COMMAND_TEMPO_TICKS, MCUControlSurface.MCU_SMPTE_BEATS, new TempoTicksCommand(this.model, surface));
    // Functions
    this.addTriggerCommand(Commands.COMMAND_SHIFT, MCUControlSurface.MCU_SHIFT, new ShiftCommand(this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_SELECT, MCUControlSurface.MCU_OPTION, new NopCommand<>(this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_PUNCH_IN, MCUControlSurface.MCU_F6, new PunchInCommand<>(this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_PUNCH_OUT, MCUControlSurface.MCU_F7, new PunchOutCommand<>(this.model, surface));
    this.addTriggerCommand(COMMAND_F1, MCUControlSurface.MCU_F1, new AssignableCommand(2, this.model, surface));
    this.addTriggerCommand(COMMAND_F2, MCUControlSurface.MCU_F2, new AssignableCommand(3, this.model, surface));
    this.addTriggerCommand(COMMAND_F3, MCUControlSurface.MCU_F3, new AssignableCommand(4, this.model, surface));
    this.addTriggerCommand(COMMAND_F4, MCUControlSurface.MCU_F4, new AssignableCommand(5, this.model, surface));
    this.addTriggerCommand(COMMAND_F5, MCUControlSurface.MCU_F5, new AssignableCommand(6, this.model, surface));
    // Assignment
    this.addTriggerCommand(Commands.COMMAND_TRACK, MCUControlSurface.MCU_MODE_IO, new TracksCommand(this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_PAN_SEND, MCUControlSurface.MCU_MODE_PAN, new ModeSelectCommand<>(Modes.MODE_PAN, this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_SENDS, MCUControlSurface.MCU_MODE_SENDS, new SendSelectCommand(this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_DEVICE, MCUControlSurface.MCU_MODE_PLUGIN, new DevicesCommand(this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_MOVE_TRACK_LEFT, MCUControlSurface.MCU_MODE_EQ, new MoveTrackBankCommand<>(this.model, surface, Modes.MODE_DEVICE_PARAMS, true, true));
    this.addTriggerCommand(Commands.COMMAND_MOVE_TRACK_RIGHT, MCUControlSurface.MCU_MODE_DYN, new MoveTrackBankCommand<>(this.model, surface, Modes.MODE_DEVICE_PARAMS, true, false));
    // Automation
    this.addTriggerCommand(Commands.COMMAND_AUTOMATION_READ, MCUControlSurface.MCU_READ, new AutomationCommand(0, this.model, surface));
    final AutomationCommand writeCommand = new AutomationCommand(1, this.model, surface);
    this.addTriggerCommand(Commands.COMMAND_AUTOMATION_WRITE, MCUControlSurface.MCU_WRITE, writeCommand);
    this.addTriggerCommand(Commands.COMMAND_AUTOMATION_WRITE, MCUControlSurface.MCU_GROUP, writeCommand);
    this.addTriggerCommand(Commands.COMMAND_AUTOMATION_TRIM, MCUControlSurface.MCU_TRIM, new AutomationCommand(2, this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_AUTOMATION_TOUCH, MCUControlSurface.MCU_TOUCH, new AutomationCommand(3, this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_AUTOMATION_LATCH, MCUControlSurface.MCU_LATCH, new AutomationCommand(4, this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_UNDO, MCUControlSurface.MCU_UNDO, new UndoCommand<>(this.model, surface));
    // Panes
    this.addTriggerCommand(COMMAND_NOTE_EDITOR, MCUControlSurface.MCU_MIDI_TRACKS, new PaneCommand<>(PaneCommand.Panels.NOTE, this.model, surface));
    this.addTriggerCommand(COMMAND_AUTOMATION_EDITOR, MCUControlSurface.MCU_INPUTS, new PaneCommand<>(PaneCommand.Panels.AUTOMATION, this.model, surface));
    this.addTriggerCommand(COMMAND_TOGGLE_DEVICE, MCUControlSurface.MCU_AUDIO_TRACKS, new PaneCommand<>(PaneCommand.Panels.DEVICE, this.model, surface));
    this.addTriggerCommand(COMMAND_MIXER, MCUControlSurface.MCU_AUDIO_INSTR, new PaneCommand<>(PaneCommand.Panels.MIXER, this.model, surface));
    // Layouts
    this.addTriggerCommand(COMMAND_LAYOUT_ARRANGE, MCUControlSurface.MCU_AUX, new LayoutCommand<>(IApplication.PANEL_LAYOUT_ARRANGE, this.model, surface));
    this.addTriggerCommand(COMMAND_LAYOUT_MIX, MCUControlSurface.MCU_BUSSES, new LayoutCommand<>(IApplication.PANEL_LAYOUT_MIX, this.model, surface));
    this.addTriggerCommand(COMMAND_LAYOUT_EDIT, MCUControlSurface.MCU_OUTPUTS, new LayoutCommand<>(IApplication.PANEL_LAYOUT_EDIT, this.model, surface));
    // Utilities
    this.addTriggerCommand(Commands.COMMAND_BROWSE, MCUControlSurface.MCU_USER, new BrowserCommand<>(Modes.MODE_BROWSER, this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_METRONOME, MCUControlSurface.MCU_CLICK, new MetronomeCommand<>(this.model, surface));
    this.addTriggerCommand(COMMAND_GROOVE, MCUControlSurface.MCU_SOLO, new GrooveCommand(this.model, surface));
    this.addTriggerCommand(COMMAND_OVERDUB, MCUControlSurface.MCU_REPLACE, new OverdubCommand(this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_TAP_TEMPO, MCUControlSurface.MCU_NUDGE, new TapTempoCommand<>(this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_DUPLICATE, MCUControlSurface.MCU_DROP, new DuplicateCommand<>(this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_DEVICE_ON_OFF, MCUControlSurface.MCU_F8, new DeviceOnOffCommand<>(this.model, surface));
    // Currently not used but prevent error in console
    this.addTriggerCommand(COMMAND_CONTROL, MCUControlSurface.MCU_CONTROL, new NopCommand<>(this.model, surface));
    this.addTriggerCommand(COMMAND_ALT, MCUControlSurface.MCU_ALT, new NopCommand<>(this.model, surface));
    // Fader Controls
    this.addTriggerCommand(COMMAND_FLIP, MCUControlSurface.MCU_FLIP, new ToggleTrackBanksCommand<>(this.model, surface));
    this.addTriggerCommand(COMMAND_CANCEL, MCUControlSurface.MCU_CANCEL, new KeyCommand(Key.ESCAPE, this.model, surface));
    this.addTriggerCommand(COMMAND_ENTER, MCUControlSurface.MCU_ENTER, new KeyCommand(Key.ENTER, this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_MOVE_BANK_LEFT, MCUControlSurface.MCU_BANK_LEFT, new MoveTrackBankCommand<>(this.model, surface, Modes.MODE_DEVICE_PARAMS, false, true));
    this.addTriggerCommand(Commands.COMMAND_MOVE_BANK_RIGHT, MCUControlSurface.MCU_BANK_RIGHT, new MoveTrackBankCommand<>(this.model, surface, Modes.MODE_DEVICE_PARAMS, false, false));
    this.addTriggerCommand(Commands.COMMAND_MOVE_TRACK_LEFT, MCUControlSurface.MCU_TRACK_LEFT, new MoveTrackBankCommand<>(this.model, surface, Modes.MODE_DEVICE_PARAMS, true, true));
    this.addTriggerCommand(Commands.COMMAND_MOVE_TRACK_RIGHT, MCUControlSurface.MCU_TRACK_RIGHT, new MoveTrackBankCommand<>(this.model, surface, Modes.MODE_DEVICE_PARAMS, true, false));
    // Additional commands for footcontrollers
    final ViewManager viewManager = surface.getViewManager();
    viewManager.registerTriggerCommand(Commands.COMMAND_NEW, new NewCommand<>(this.model, surface));
    viewManager.registerTriggerCommand(Commands.COMMAND_TAP_TEMPO, new TapTempoCommand<>(this.model, surface));
    // Only MCU
    this.addTriggerCommand(Commands.COMMAND_SAVE, MCUControlSurface.MCU_SAVE, new SaveCommand<>(this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_MARKER, MCUControlSurface.MCU_MARKER, new MarkerCommand<>(this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_TOGGLE_VU, MCUControlSurface.MCU_EDIT, new ToggleVUCommand<>(this.model, surface));
    this.addTriggerCommand(Commands.COMMAND_MASTERTRACK, MCUControlSurface.MCU_FADER_MASTER, new SelectCommand(8, this.model, surface));
    this.registerTriggerCommandsToAllDevices();
}
Also used : ShiftCommand(de.mossgrabers.mcu.command.trigger.ShiftCommand) OverdubCommand(de.mossgrabers.mcu.command.trigger.OverdubCommand) ViewManager(de.mossgrabers.framework.view.ViewManager) SendSelectCommand(de.mossgrabers.mcu.command.trigger.SendSelectCommand) TracksCommand(de.mossgrabers.mcu.command.trigger.TracksCommand) CursorCommand(de.mossgrabers.mcu.command.trigger.CursorCommand) AutomationCommand(de.mossgrabers.mcu.command.trigger.AutomationCommand) KeyCommand(de.mossgrabers.mcu.command.trigger.KeyCommand) ToggleDisplayCommand(de.mossgrabers.mcu.command.trigger.ToggleDisplayCommand) GrooveCommand(de.mossgrabers.mcu.command.trigger.GrooveCommand) ScrubCommand(de.mossgrabers.mcu.command.trigger.ScrubCommand) ModeSelectCommand(de.mossgrabers.framework.command.trigger.ModeSelectCommand) SendSelectCommand(de.mossgrabers.mcu.command.trigger.SendSelectCommand) SelectCommand(de.mossgrabers.mcu.command.trigger.SelectCommand) MCURecordCommand(de.mossgrabers.mcu.command.trigger.MCURecordCommand) ZoomCommand(de.mossgrabers.mcu.command.trigger.ZoomCommand) AssignableCommand(de.mossgrabers.mcu.command.trigger.AssignableCommand) DevicesCommand(de.mossgrabers.mcu.command.trigger.DevicesCommand) TempoTicksCommand(de.mossgrabers.mcu.command.trigger.TempoTicksCommand) MCUControlSurface(de.mossgrabers.mcu.controller.MCUControlSurface)

Example 43 with ViewManager

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

the class MCUControllerSetup method registerTriggerCommandsToAllDevices.

/**
 * Common track editing - Assignment to all devices
 */
protected void registerTriggerCommandsToAllDevices() {
    for (int index = 0; index < this.numMCUDevices; index++) {
        final MCUControlSurface surface = this.getSurface(index);
        final ViewManager viewManager = surface.getViewManager();
        for (int i = 0; i < 8; i++) {
            Integer commandID = Integer.valueOf(Commands.COMMAND_ROW_SELECT_1.intValue() + i);
            viewManager.registerTriggerCommand(commandID, new SelectCommand(i, this.model, surface));
            surface.assignTriggerCommand(MCUControlSurface.MCU_SELECT1 + i, commandID);
            commandID = Integer.valueOf(Commands.COMMAND_FADER_TOUCH_1.intValue() + i);
            viewManager.registerTriggerCommand(commandID, new FaderTouchCommand(i, this.model, surface));
            surface.assignTriggerCommand(MCUControlSurface.MCU_FADER_TOUCH1 + i, commandID);
            this.addTriggerCommand(Integer.valueOf(Commands.COMMAND_ROW1_1.intValue() + i), MCUControlSurface.MCU_VSELECT1 + i, new ButtonRowModeCommand<>(0, i, this.model, surface), index);
            this.addTriggerCommand(Integer.valueOf(Commands.COMMAND_ROW2_1.intValue() + i), MCUControlSurface.MCU_ARM1 + i, new ButtonRowModeCommand<>(1, i, this.model, surface), index);
            this.addTriggerCommand(Integer.valueOf(Commands.COMMAND_ROW3_1.intValue() + i), MCUControlSurface.MCU_SOLO1 + i, new ButtonRowModeCommand<>(2, i, this.model, surface), index);
            this.addTriggerCommand(Integer.valueOf(Commands.COMMAND_ROW4_1.intValue() + i), MCUControlSurface.MCU_MUTE1 + i, new ButtonRowModeCommand<>(3, i, this.model, surface), index);
        }
        viewManager.registerPitchbendCommand(new PitchbendVolumeCommand(this.model, surface));
    }
}
Also used : ViewManager(de.mossgrabers.framework.view.ViewManager) FaderTouchCommand(de.mossgrabers.mcu.command.trigger.FaderTouchCommand) PitchbendVolumeCommand(de.mossgrabers.mcu.command.pitchbend.PitchbendVolumeCommand) ModeSelectCommand(de.mossgrabers.framework.command.trigger.ModeSelectCommand) SendSelectCommand(de.mossgrabers.mcu.command.trigger.SendSelectCommand) SelectCommand(de.mossgrabers.mcu.command.trigger.SelectCommand) MCUControlSurface(de.mossgrabers.mcu.controller.MCUControlSurface)

Example 44 with ViewManager

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

the class SelectSessionViewCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final ButtonEvent event) {
    if (event == ButtonEvent.DOWN) {
        this.isTemporary = false;
        final ViewManager viewManager = this.surface.getViewManager();
        if (Views.isSessionView(viewManager.getActiveViewId())) {
            final ModeManager modeManager = this.surface.getModeManager();
            if (modeManager.isActiveMode(Modes.MODE_SESSION_VIEW_SELECT))
                modeManager.restoreMode();
            else
                modeManager.setActiveMode(Modes.MODE_SESSION_VIEW_SELECT);
        } else
            viewManager.setActiveView(Views.VIEW_SESSION);
        return;
    }
    if (event == ButtonEvent.UP && this.isTemporary)
        this.surface.getViewManager().restoreView();
}
Also used : ViewManager(de.mossgrabers.framework.view.ViewManager) ModeManager(de.mossgrabers.framework.mode.ModeManager)

Example 45 with ViewManager

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

the class APCControllerSetup method createViews.

/**
 * {@inheritDoc}
 */
@Override
protected void createViews() {
    final APCControlSurface surface = this.getSurface();
    final ViewManager viewManager = surface.getViewManager();
    viewManager.registerView(Views.VIEW_PLAY, new PlayView(surface, this.model));
    viewManager.registerView(Views.VIEW_SESSION, new SessionView(surface, this.model));
    viewManager.registerView(Views.VIEW_SEQUENCER, new SequencerView(surface, this.model));
    viewManager.registerView(Views.VIEW_DRUM, new DrumView(surface, this.model));
    viewManager.registerView(Views.VIEW_RAINDROPS, new RaindropsView(surface, this.model));
    viewManager.registerView(Views.VIEW_SHIFT, new ShiftView(surface, this.model));
}
Also used : SequencerView(de.mossgrabers.apc.view.SequencerView) RaindropsView(de.mossgrabers.apc.view.RaindropsView) APCControlSurface(de.mossgrabers.apc.controller.APCControlSurface) ShiftView(de.mossgrabers.apc.view.ShiftView) ViewManager(de.mossgrabers.framework.view.ViewManager) SessionView(de.mossgrabers.apc.view.SessionView) DrumView(de.mossgrabers.apc.view.DrumView) PlayView(de.mossgrabers.apc.view.PlayView)

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