Search in sources :

Example 6 with APCminiControlSurface

use of de.mossgrabers.apcmini.controller.APCminiControlSurface in project DrivenByMoss by git-moss.

the class APCminiControllerSetup method registerTriggerCommands.

/**
 * {@inheritDoc}
 */
@Override
protected void registerTriggerCommands() {
    final APCminiControlSurface surface = this.getSurface();
    this.addNoteCommand(Commands.COMMAND_SHIFT, APCminiControlSurface.APC_BUTTON_SHIFT, new ShiftCommand(this.model, surface));
    for (int i = 0; i < 8; i++) {
        this.addNoteCommand(Integer.valueOf(Commands.COMMAND_ROW_SELECT_1.intValue() + i), APCminiControlSurface.APC_BUTTON_TRACK_BUTTON1 + i, new TrackSelectCommand(i, this.model, surface));
        this.addNoteCommand(Integer.valueOf(Commands.COMMAND_SCENE1.intValue() + i), APCminiControlSurface.APC_BUTTON_SCENE_BUTTON1 + i, new SceneCommand<>(7 - i, this.model, surface));
    }
}
Also used : APCminiControlSurface(de.mossgrabers.apcmini.controller.APCminiControlSurface) ShiftCommand(de.mossgrabers.apcmini.command.trigger.ShiftCommand) TrackSelectCommand(de.mossgrabers.apcmini.command.trigger.TrackSelectCommand)

Example 7 with APCminiControlSurface

use of de.mossgrabers.apcmini.controller.APCminiControlSurface in project DrivenByMoss by git-moss.

the class APCminiControllerSetup method createViews.

/**
 * {@inheritDoc}
 */
@Override
protected void createViews() {
    final APCminiControlSurface surface = this.getSurface();
    final ViewManager viewManager = surface.getViewManager();
    viewManager.registerView(Views.VIEW_PLAY, new PlayView(surface, this.model));
    viewManager.registerView(Views.VIEW_SHIFT, new ShiftView(surface, this.model));
    viewManager.registerView(Views.VIEW_BROWSER, new BrowserView(surface, this.model));
    if (this.host.hasClips()) {
        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));
    }
}
Also used : SequencerView(de.mossgrabers.apcmini.view.SequencerView) RaindropsView(de.mossgrabers.apcmini.view.RaindropsView) APCminiControlSurface(de.mossgrabers.apcmini.controller.APCminiControlSurface) ShiftView(de.mossgrabers.apcmini.view.ShiftView) ViewManager(de.mossgrabers.framework.view.ViewManager) SessionView(de.mossgrabers.apcmini.view.SessionView) BrowserView(de.mossgrabers.apcmini.view.BrowserView) DrumView(de.mossgrabers.apcmini.view.DrumView) PlayView(de.mossgrabers.apcmini.view.PlayView)

Example 8 with APCminiControlSurface

use of de.mossgrabers.apcmini.controller.APCminiControlSurface in project DrivenByMoss by git-moss.

the class APCminiControllerSetup method registerContinuousCommands.

/**
 * {@inheritDoc}
 */
@Override
protected void registerContinuousCommands() {
    final APCminiControlSurface surface = this.getSurface();
    this.addContinuousCommand(Commands.CONT_COMMAND_MASTER_KNOB, APCminiControlSurface.APC_KNOB_MASTER_LEVEL, new MasterFaderAbsoluteCommand<>(this.model, surface));
    for (int i = 0; i < 8; i++) {
        final Integer knobCommand = Integer.valueOf(Commands.CONT_COMMAND_FADER1.intValue() + i);
        this.addContinuousCommand(knobCommand, APCminiControlSurface.APC_KNOB_TRACK_LEVEL1 + i, new KnobRowModeCommand<>(i, this.model, surface));
    }
}
Also used : APCminiControlSurface(de.mossgrabers.apcmini.controller.APCminiControlSurface)

Example 9 with APCminiControlSurface

use of de.mossgrabers.apcmini.controller.APCminiControlSurface in project DrivenByMoss by git-moss.

the class APCminiControllerSetup method handleTrackChange.

/**
 * Handle a track selection change.
 *
 * @param index The index of the track
 * @param isSelected Has the track been selected?
 */
private void handleTrackChange(final int index, final boolean isSelected) {
    if (!isSelected)
        return;
    final APCminiControlSurface surface = this.getSurface();
    final ViewManager viewManager = surface.getViewManager();
    if (viewManager.isActiveView(Views.VIEW_PLAY))
        viewManager.getActiveView().updateNoteMapping();
    if (viewManager.isActiveView(Views.VIEW_PLAY))
        viewManager.getActiveView().updateNoteMapping();
    // Reset drum octave because the drum pad bank is also reset
    this.scales.setDrumOctave(0);
    if (viewManager.isActiveView(Views.VIEW_DRUM))
        viewManager.getView(Views.VIEW_DRUM).updateNoteMapping();
}
Also used : APCminiControlSurface(de.mossgrabers.apcmini.controller.APCminiControlSurface) ViewManager(de.mossgrabers.framework.view.ViewManager)

Aggregations

APCminiControlSurface (de.mossgrabers.apcmini.controller.APCminiControlSurface)9 ViewManager (de.mossgrabers.framework.view.ViewManager)3 ModeManager (de.mossgrabers.framework.mode.ModeManager)2 ShiftCommand (de.mossgrabers.apcmini.command.trigger.ShiftCommand)1 TrackSelectCommand (de.mossgrabers.apcmini.command.trigger.TrackSelectCommand)1 DeviceMode (de.mossgrabers.apcmini.mode.DeviceMode)1 PanMode (de.mossgrabers.apcmini.mode.PanMode)1 SendMode (de.mossgrabers.apcmini.mode.SendMode)1 VolumeMode (de.mossgrabers.apcmini.mode.VolumeMode)1 BrowserView (de.mossgrabers.apcmini.view.BrowserView)1 DrumView (de.mossgrabers.apcmini.view.DrumView)1 PlayView (de.mossgrabers.apcmini.view.PlayView)1 RaindropsView (de.mossgrabers.apcmini.view.RaindropsView)1 SequencerView (de.mossgrabers.apcmini.view.SequencerView)1 SessionView (de.mossgrabers.apcmini.view.SessionView)1 ShiftView (de.mossgrabers.apcmini.view.ShiftView)1 DummyDisplay (de.mossgrabers.framework.controller.display.DummyDisplay)1 IChannelBank (de.mossgrabers.framework.daw.IChannelBank)1 ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)1 ITrackBank (de.mossgrabers.framework.daw.ITrackBank)1