Search in sources :

Example 21 with ViewManager

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

the class APCPlayPositionCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final int value) {
    if (this.surface.isPressed(ButtonID.TAP_TEMPO)) {
        this.surface.setTriggerConsumed(ButtonID.TAP_TEMPO);
        this.tempoCommand.execute(value);
        final ViewManager viewManager = this.surface.getViewManager();
        if (!viewManager.isActive(Views.TEMPO))
            viewManager.setTemporary(Views.TEMPO);
        this.timeout.delay(viewManager::restore);
        return;
    }
    if (this.surface.isPressed(ButtonID.ARROW_LEFT)) {
        this.surface.setTriggerConsumed(ButtonID.ARROW_LEFT);
        this.transport.changeLoopStart(this.model.getValueChanger().isIncrease(value), this.surface.isKnobSensitivitySlow());
        this.mvHelper.delayDisplay(() -> "Loop Start: " + this.transport.getLoopStartBeatText());
        return;
    }
    if (this.surface.isPressed(ButtonID.ARROW_RIGHT)) {
        this.surface.setTriggerConsumed(ButtonID.ARROW_RIGHT);
        this.transport.changeLoopLength(this.model.getValueChanger().isIncrease(value), this.surface.isKnobSensitivitySlow());
        this.mvHelper.delayDisplay(() -> "Loop Length: " + this.transport.getLoopLengthBeatText());
        return;
    }
    super.execute(value);
}
Also used : ViewManager(de.mossgrabers.framework.featuregroup.ViewManager)

Example 22 with ViewManager

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

the class Kontrol1ControllerSetup method createViews.

/**
 * {@inheritDoc}
 */
@Override
protected void createViews() {
    final Kontrol1ControlSurface surface = this.getSurface();
    final ViewManager viewManager = surface.getViewManager();
    viewManager.register(Views.CONTROL, new ControlView(surface, this.model));
}
Also used : Kontrol1ControlSurface(de.mossgrabers.controller.ni.kontrol.mki.controller.Kontrol1ControlSurface) ViewManager(de.mossgrabers.framework.featuregroup.ViewManager) ControlView(de.mossgrabers.controller.ni.kontrol.mki.view.ControlView)

Example 23 with ViewManager

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

the class LaunchkeyMiniMk3ControllerSetup method registerTriggerCommands.

/**
 * {@inheritDoc}
 */
@Override
protected void registerTriggerCommands() {
    final LaunchkeyMiniMk3ControlSurface surface = this.getSurface();
    final ITransport t = this.model.getTransport();
    final ViewManager viewManager = surface.getViewManager();
    this.addButton(ButtonID.SHIFT, "Shift", NopCommand.INSTANCE, LaunchkeyMiniMk3ControlSurface.LAUNCHKEY_SHIFT);
    this.addButton(ButtonID.PLAY, "Play", new PlayCommand<>(this.model, surface), 15, LaunchkeyMiniMk3ControlSurface.LAUNCHKEY_PLAY, t::isPlaying);
    final ConfiguredRecordCommand<LaunchkeyMiniMk3ControlSurface, LaunchkeyMiniMk3Configuration> recordCommand = new ConfiguredRecordCommand<>(this.model, surface);
    this.addButton(ButtonID.RECORD, "Record", recordCommand, 15, LaunchkeyMiniMk3ControlSurface.LAUNCHKEY_RECORD, recordCommand::isLit);
    final ModeCursorCommand<LaunchkeyMiniMk3ControlSurface, LaunchkeyMiniMk3Configuration> leftCommand = new ModeCursorCommand<>(Direction.LEFT, this.model, surface, true);
    this.addButton(ButtonID.MOVE_TRACK_LEFT, "Previous", leftCommand, 15, LaunchkeyMiniMk3ControlSurface.LAUNCHKEY_LEFT, leftCommand::canScroll);
    final ModeCursorCommand<LaunchkeyMiniMk3ControlSurface, LaunchkeyMiniMk3Configuration> rightCommand = new ModeCursorCommand<>(Direction.RIGHT, this.model, surface, true);
    this.addButton(ButtonID.MOVE_TRACK_RIGHT, "Next", rightCommand, 15, LaunchkeyMiniMk3ControlSurface.LAUNCHKEY_RIGHT, rightCommand::canScroll);
    // Scene buttons
    this.addButton(ButtonID.SCENE1, "Scene 1", new ViewButtonCommand<>(ButtonID.SCENE1, surface), LaunchkeyMiniMk3ControlSurface.LAUNCHKEY_SCENE1, new FeatureGroupButtonColorSupplier(viewManager, ButtonID.SCENE1));
    this.addButton(ButtonID.SCENE2, "Scene 2", new ViewButtonCommand<>(ButtonID.SCENE2, surface), LaunchkeyMiniMk3ControlSurface.LAUNCHKEY_SCENE2, new FeatureGroupButtonColorSupplier(viewManager, ButtonID.SCENE2));
    // View selection with Pads in Shift mode
    this.createViewButton(ButtonID.ROW2_1, OutputID.LED_RING1, "Session", Views.SESSION, LaunchkeyMiniMk3ControlSurface.PAD_MODE_SESSION);
    this.createViewButton(ButtonID.ROW2_2, OutputID.LED_RING2, "Drum", Views.DRUM, LaunchkeyMiniMk3ControlSurface.PAD_MODE_DRUM);
    this.createViewButton(ButtonID.ROW2_3, OutputID.LED_RING3, "Custom", Views.PLAY, LaunchkeyMiniMk3ControlSurface.PAD_MODE_CUSTOM);
    // Knob mode selection with Pads in Shift mode
    this.createModeButton(ButtonID.ROW1_1, OutputID.LED1, "Device", Modes.DEVICE_PARAMS, LaunchkeyMiniMk3ControlSurface.KNOB_MODE_PARAMS);
    this.createModeButton(ButtonID.ROW1_2, OutputID.LED2, "Volume", Modes.VOLUME, LaunchkeyMiniMk3ControlSurface.KNOB_MODE_VOLUME);
    this.createModeButton(ButtonID.ROW1_3, OutputID.LED3, "Pan", Modes.PAN, LaunchkeyMiniMk3ControlSurface.KNOB_MODE_PAN);
    this.createModeButton(ButtonID.ROW1_4, OutputID.LED4, "Send 1", Modes.SEND1, LaunchkeyMiniMk3ControlSurface.KNOB_MODE_SEND1);
    this.createModeButton(ButtonID.ROW1_5, OutputID.LED5, "Send 2", Modes.SEND2, LaunchkeyMiniMk3ControlSurface.KNOB_MODE_SEND2);
    this.createModeButton(ButtonID.ROW1_6, OutputID.LED6, "Custom", Modes.USER, LaunchkeyMiniMk3ControlSurface.KNOB_MODE_CUSTOM);
    // Online state
    this.addButton(ButtonID.CONTROL, "DAW Online", (event, velocity) -> surface.setDAWConnected(velocity > 0), 15, LaunchkeyMiniMk3ControlSurface.LAUNCHKEY_DAW_ONLINE, surface::isDAWConnected);
}
Also used : ITransport(de.mossgrabers.framework.daw.ITransport) LaunchkeyMiniMk3ControlSurface(de.mossgrabers.controller.novation.launchkey.mini.controller.LaunchkeyMiniMk3ControlSurface) ViewManager(de.mossgrabers.framework.featuregroup.ViewManager) ConfiguredRecordCommand(de.mossgrabers.framework.command.trigger.transport.ConfiguredRecordCommand) IMidiInput(de.mossgrabers.framework.daw.midi.IMidiInput) ITransport(de.mossgrabers.framework.daw.ITransport) IHost(de.mossgrabers.framework.daw.IHost) IHwLight(de.mossgrabers.framework.controller.hardware.IHwLight) IMidiOutput(de.mossgrabers.framework.daw.midi.IMidiOutput) ModeCursorCommand(de.mossgrabers.framework.command.trigger.mode.ModeCursorCommand) FeatureGroupButtonColorSupplier(de.mossgrabers.framework.command.trigger.view.FeatureGroupButtonColorSupplier)

Example 24 with ViewManager

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

the class LaunchkeyMiniMk3ControllerSetup method createViews.

/**
 * {@inheritDoc}
 */
@Override
protected void createViews() {
    final LaunchkeyMiniMk3ControlSurface surface = this.getSurface();
    final ViewManager viewManager = surface.getViewManager();
    viewManager.register(Views.SESSION, new SessionView(surface, this.model));
    viewManager.register(Views.CONTROL, new PadModeSelectView(surface, this.model));
    viewManager.register(Views.DRUM, new DrumView(surface, this.model));
    viewManager.register(Views.PLAY, new UserPadView(surface, this.model));
    viewManager.register(Views.SHIFT, new DrumConfigView(surface, this.model));
}
Also used : PadModeSelectView(de.mossgrabers.controller.novation.launchkey.mini.view.PadModeSelectView) LaunchkeyMiniMk3ControlSurface(de.mossgrabers.controller.novation.launchkey.mini.controller.LaunchkeyMiniMk3ControlSurface) ViewManager(de.mossgrabers.framework.featuregroup.ViewManager) SessionView(de.mossgrabers.controller.novation.launchkey.mini.view.SessionView) UserPadView(de.mossgrabers.controller.novation.launchkey.mini.view.UserPadView) DrumConfigView(de.mossgrabers.controller.novation.launchkey.mini.view.DrumConfigView) DrumView(de.mossgrabers.controller.novation.launchkey.mini.view.DrumView)

Example 25 with ViewManager

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

the class AbstractTrackCommand method onModeButton.

protected void onModeButton(final ButtonEvent event, final Modes controlMode, final String notification) {
    final ModeManager modeManager = this.surface.getModeManager();
    final ViewManager viewManager = this.surface.getViewManager();
    switch(event) {
        case DOWN:
            this.firstRowUsed = false;
            if (modeManager.isActive(controlMode)) {
                modeManager.setActive(Modes.DUMMY);
                return;
            }
            modeManager.setActive(controlMode);
            this.wasSession = viewManager.isActive(Views.SESSION);
            if (!this.wasSession)
                viewManager.setActive(Views.SESSION);
            this.surface.getDisplay().notify(notification);
            break;
        case LONG:
            this.firstRowUsed = true;
            break;
        case UP:
            if (this.firstRowUsed) {
                modeManager.setActive(Modes.DUMMY);
                if (!this.wasSession)
                    viewManager.restore();
            }
            break;
    }
}
Also used : ViewManager(de.mossgrabers.framework.featuregroup.ViewManager) ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Aggregations

ViewManager (de.mossgrabers.framework.featuregroup.ViewManager)58 ITrack (de.mossgrabers.framework.daw.data.ITrack)12 ModeManager (de.mossgrabers.framework.featuregroup.ModeManager)11 Views (de.mossgrabers.framework.view.Views)11 INoteMode (de.mossgrabers.framework.mode.INoteMode)5 BeatstepControlSurface (de.mossgrabers.controller.arturia.beatstep.controller.BeatstepControlSurface)4 MaschineControlSurface (de.mossgrabers.controller.ni.maschine.mk3.controller.MaschineControlSurface)4 IView (de.mossgrabers.framework.featuregroup.IView)4 DrumView (de.mossgrabers.controller.ni.maschine.mk3.view.DrumView)3 ConfiguredRecordCommand (de.mossgrabers.framework.command.trigger.transport.ConfiguredRecordCommand)3 FeatureGroupButtonColorSupplier (de.mossgrabers.framework.command.trigger.view.FeatureGroupButtonColorSupplier)3 IHost (de.mossgrabers.framework.daw.IHost)3 ITransport (de.mossgrabers.framework.daw.ITransport)3 ITrackBank (de.mossgrabers.framework.daw.data.bank.ITrackBank)3 PlayView (de.mossgrabers.controller.arturia.beatstep.view.PlayView)2 LaunchkeyMk3ControlSurface (de.mossgrabers.controller.novation.launchkey.maxi.controller.LaunchkeyMk3ControlSurface)2 LaunchkeyMiniMk3ControlSurface (de.mossgrabers.controller.novation.launchkey.mini.controller.LaunchkeyMiniMk3ControlSurface)2 SLMkIIIControlSurface (de.mossgrabers.controller.novation.slmkiii.controller.SLMkIIIControlSurface)2 DrumView (de.mossgrabers.controller.novation.slmkiii.view.DrumView)2 Configuration (de.mossgrabers.framework.configuration.Configuration)2