Search in sources :

Example 6 with MCUControlSurface

use of de.mossgrabers.mcu.controller.MCUControlSurface in project DrivenByMoss by git-moss.

the class MCUControllerSetup method createViews.

/**
 * {@inheritDoc}
 */
@Override
protected void createViews() {
    for (int index = 0; index < this.numMCUDevices; index++) {
        final MCUControlSurface surface = this.getSurface(index);
        final ViewManager viewManager = surface.getViewManager();
        viewManager.registerView(Views.VIEW_CONTROL, new ControlView(surface, this.model));
    }
}
Also used : ViewManager(de.mossgrabers.framework.view.ViewManager) MCUControlSurface(de.mossgrabers.mcu.controller.MCUControlSurface) ControlView(de.mossgrabers.mcu.view.ControlView)

Example 7 with MCUControlSurface

use of de.mossgrabers.mcu.controller.MCUControlSurface in project DrivenByMoss by git-moss.

the class MCUControllerSetup method createObservers.

/**
 * {@inheritDoc}
 */
@Override
protected void createObservers() {
    for (int index = 0; index < this.numMCUDevices; index++) {
        final MCUControlSurface surface = this.getSurface(index);
        surface.getModeManager().addModeListener((oldMode, newMode) -> {
            for (int d = 0; d < this.numMCUDevices; d++) {
                final MCUControlSurface s = this.getSurface(d);
                if (!s.equals(surface))
                    s.getModeManager().setActiveMode(newMode);
            }
            this.updateMode(null);
            this.updateMode(newMode);
        });
    }
    this.configuration.addSettingObserver(AbstractConfiguration.ENABLE_VU_METERS, () -> {
        for (int index = 0; index < this.numMCUDevices; index++) {
            final MCUControlSurface surface = this.getSurface(index);
            surface.switchVuMode(this.configuration.isEnableVUMeters() ? MCUControlSurface.VUMODE_LED_AND_LCD : MCUControlSurface.VUMODE_OFF);
            final Mode activeMode = surface.getModeManager().getActiveMode();
            if (activeMode != null)
                activeMode.updateDisplay();
            ((MCUDisplay) surface.getDisplay()).forceFlush();
        }
    });
}
Also used : MCUDisplay(de.mossgrabers.mcu.controller.MCUDisplay) TrackMode(de.mossgrabers.mcu.mode.track.TrackMode) VolumeMode(de.mossgrabers.mcu.mode.track.VolumeMode) PanMode(de.mossgrabers.mcu.mode.track.PanMode) Mode(de.mossgrabers.framework.mode.Mode) DeviceParamsMode(de.mossgrabers.mcu.mode.device.DeviceParamsMode) DeviceBrowserMode(de.mossgrabers.mcu.mode.device.DeviceBrowserMode) SendMode(de.mossgrabers.mcu.mode.track.SendMode) MasterMode(de.mossgrabers.mcu.mode.track.MasterMode) MCUControlSurface(de.mossgrabers.mcu.controller.MCUControlSurface)

Example 8 with MCUControlSurface

use of de.mossgrabers.mcu.controller.MCUControlSurface 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 9 with MCUControlSurface

use of de.mossgrabers.mcu.controller.MCUControlSurface 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 10 with MCUControlSurface

use of de.mossgrabers.mcu.controller.MCUControlSurface in project DrivenByMoss by git-moss.

the class MCUControllerSetup method startup.

/**
 * {@inheritDoc}
 */
@Override
public void startup() {
    for (int index = 0; index < this.numMCUDevices; index++) {
        final MCUControlSurface surface = this.getSurface(index);
        surface.switchVuMode(MCUControlSurface.VUMODE_LED);
        surface.getViewManager().setActiveView(Views.VIEW_CONTROL);
        surface.getModeManager().setActiveMode(Modes.MODE_PAN);
    }
}
Also used : MCUControlSurface(de.mossgrabers.mcu.controller.MCUControlSurface)

Aggregations

MCUControlSurface (de.mossgrabers.mcu.controller.MCUControlSurface)10 ViewManager (de.mossgrabers.framework.view.ViewManager)4 ModeSelectCommand (de.mossgrabers.framework.command.trigger.ModeSelectCommand)2 IMidiOutput (de.mossgrabers.framework.daw.midi.IMidiOutput)2 SelectCommand (de.mossgrabers.mcu.command.trigger.SelectCommand)2 SendSelectCommand (de.mossgrabers.mcu.command.trigger.SendSelectCommand)2 MCUDisplay (de.mossgrabers.mcu.controller.MCUDisplay)2 DeviceBrowserMode (de.mossgrabers.mcu.mode.device.DeviceBrowserMode)2 DeviceParamsMode (de.mossgrabers.mcu.mode.device.DeviceParamsMode)2 MasterMode (de.mossgrabers.mcu.mode.track.MasterMode)2 PanMode (de.mossgrabers.mcu.mode.track.PanMode)2 SendMode (de.mossgrabers.mcu.mode.track.SendMode)2 TrackMode (de.mossgrabers.mcu.mode.track.TrackMode)2 VolumeMode (de.mossgrabers.mcu.mode.track.VolumeMode)2 ControlView (de.mossgrabers.mcu.view.ControlView)2 WindCommand (de.mossgrabers.framework.command.trigger.transport.WindCommand)1 IChannelBank (de.mossgrabers.framework.daw.IChannelBank)1 ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)1 ITransport (de.mossgrabers.framework.daw.ITransport)1 IMasterTrack (de.mossgrabers.framework.daw.data.IMasterTrack)1