Search in sources :

Example 6 with ITransport

use of de.mossgrabers.framework.daw.ITransport in project DrivenByMoss by git-moss.

the class TransportMode method updateSecondRow.

/**
 * {@inheritDoc}
 */
@Override
public void updateSecondRow() {
    final ITransport transport = this.model.getTransport();
    this.surface.updateButton(102, transport.isPrerollMetronomeEnabled() ? AbstractMode.BUTTON_COLOR2_HI : AbstractMode.BUTTON_COLOR_ON);
    this.surface.updateButton(103, AbstractMode.BUTTON_COLOR_OFF);
    this.surface.updateButton(104, AbstractMode.BUTTON_COLOR_OFF);
    this.surface.updateButton(105, AbstractMode.BUTTON_COLOR_OFF);
    this.surface.updateButton(106, AbstractMode.BUTTON_COLOR_OFF);
    this.surface.updateButton(107, AbstractMode.BUTTON_COLOR_OFF);
    this.surface.updateButton(108, AbstractMode.BUTTON_COLOR_OFF);
    this.surface.updateButton(109, AbstractMode.BUTTON_COLOR_OFF);
}
Also used : ITransport(de.mossgrabers.framework.daw.ITransport)

Example 7 with ITransport

use of de.mossgrabers.framework.daw.ITransport in project DrivenByMoss by git-moss.

the class PlayView method updateButtons.

/**
 * {@inheritDoc}
 */
@Override
public void updateButtons() {
    // Button row 1: Launch Scene
    for (int i = 0; i < 8; i++) this.surface.updateButton(SLControlSurface.MKII_BUTTON_ROW1_1 + i, SLControlSurface.MKII_BUTTON_STATE_OFF);
    // Button row 2: Track toggles
    for (int i = 0; i < 8; i++) this.surface.updateButton(SLControlSurface.MKII_BUTTON_ROW2_1 + i, SLControlSurface.MKII_BUTTON_STATE_OFF);
    // LED indications for device parameters
    ((DeviceParamsMode) this.surface.getModeManager().getMode(Modes.MODE_PARAMS)).setLEDs();
    // Transport buttons
    if (this.surface.isTransportActive()) {
        for (int i = 0; i < 8; i++) this.surface.updateButton(SLControlSurface.MKII_BUTTON_ROW3_1 + i, SLControlSurface.MKII_BUTTON_STATE_OFF);
        final ITransport transport = this.model.getTransport();
        this.surface.updateButton(SLControlSurface.MKII_BUTTON_ROW4_3, !transport.isPlaying() ? SLControlSurface.MKII_BUTTON_STATE_ON : SLControlSurface.MKII_BUTTON_STATE_OFF);
        this.surface.updateButton(SLControlSurface.MKII_BUTTON_ROW4_4, transport.isPlaying() ? SLControlSurface.MKII_BUTTON_STATE_ON : SLControlSurface.MKII_BUTTON_STATE_OFF);
        this.surface.updateButton(SLControlSurface.MKII_BUTTON_ROW4_5, transport.isLoop() ? SLControlSurface.MKII_BUTTON_STATE_ON : SLControlSurface.MKII_BUTTON_STATE_OFF);
        this.surface.updateButton(SLControlSurface.MKII_BUTTON_ROW4_6, transport.isRecording() ? SLControlSurface.MKII_BUTTON_STATE_ON : SLControlSurface.MKII_BUTTON_STATE_OFF);
    } else {
        // Draw sequencer
        this.drawDrumGrid();
    }
    final Integer mode = this.surface.getModeManager().getActiveModeId();
    final boolean isSession = mode == Modes.MODE_SESSION;
    final boolean isDevice = mode == Modes.MODE_PARAMS;
    final boolean isPlayOptions = mode == Modes.MODE_PLAY_OPTIONS;
    final boolean isTrack = mode == Modes.MODE_TRACK;
    final boolean isMaster = mode == Modes.MODE_MASTER;
    final boolean isVolume = mode == Modes.MODE_VOLUME;
    this.surface.updateButton(SLControlSurface.MKII_BUTTON_ROWSEL1, isSession ? SLControlSurface.MKII_BUTTON_STATE_ON : SLControlSurface.MKII_BUTTON_STATE_OFF);
    this.surface.updateButton(SLControlSurface.MKII_BUTTON_ROWSEL2, isDevice ? SLControlSurface.MKII_BUTTON_STATE_ON : SLControlSurface.MKII_BUTTON_STATE_OFF);
    this.surface.updateButton(SLControlSurface.MKII_BUTTON_ROWSEL3, isPlayOptions ? SLControlSurface.MKII_BUTTON_STATE_ON : SLControlSurface.MKII_BUTTON_STATE_OFF);
    this.surface.updateButton(SLControlSurface.MKII_BUTTON_ROWSEL4, isTrack || isMaster ? SLControlSurface.MKII_BUTTON_STATE_ON : SLControlSurface.MKII_BUTTON_STATE_OFF);
    this.surface.updateButton(SLControlSurface.MKII_BUTTON_ROWSEL6, isVolume ? SLControlSurface.MKII_BUTTON_STATE_ON : SLControlSurface.MKII_BUTTON_STATE_OFF);
    this.surface.updateButton(SLControlSurface.MKII_BUTTON_ROWSEL7, SLControlSurface.MKII_BUTTON_STATE_OFF);
}
Also used : ITransport(de.mossgrabers.framework.daw.ITransport) DeviceParamsMode(de.mossgrabers.sl.mode.device.DeviceParamsMode)

Example 8 with ITransport

use of de.mossgrabers.framework.daw.ITransport in project DrivenByMoss by git-moss.

the class TransportControl method onStop.

private void onStop(final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    final ITransport transport = this.model.getTransport();
    if (transport.isPlaying())
        transport.play();
    else
        transport.stopAndRewind();
    this.turnOffTransport();
}
Also used : ITransport(de.mossgrabers.framework.daw.ITransport)

Example 9 with ITransport

use of de.mossgrabers.framework.daw.ITransport in project DrivenByMoss by git-moss.

the class ControlMode method sendAdditionalMPCParameters.

/**
 * Send additional parameters specific to the MPC models.
 *
 * @param d The display
 */
private void sendAdditionalMPCParameters(final ACVSDisplay d) {
    final ITransport transport = this.model.getTransport();
    final IApplication application = this.model.getApplication();
    final IArranger arranger = this.model.getArranger();
    final ICursorDevice device = this.model.getCursorDevice();
    d.setScreenItem(ScreenItem.MPC_METRONOME, transport.isMetronomeOn() ? 127 : 0);
    // ScreenItem.MPC_CAPTURE_MIDI - not supported
    // ScreenItem.MPC_ABLETON_LINK - not supported
    final boolean isOverdub = this.surface.isShiftPressed() ? transport.isLauncherOverdub() : transport.isArrangerOverdub();
    d.setScreenItem(ScreenItem.MPC_ARRANGE_OVERDUB, isOverdub ? 127 : 0);
    final boolean isAutomation = this.surface.isShiftPressed() ? transport.isWritingClipLauncherAutomation() : transport.isWritingArrangerAutomation();
    d.setScreenItem(ScreenItem.MPC_ARRANGER_AUTOMATION_ARM, isAutomation ? 127 : 0);
    d.setScreenItem(ScreenItem.MPC_LOOP_SWITCH, transport.isLoop() ? 127 : 0);
    d.setScreenItem(ScreenItem.MPC_LAUNCH_QUANTIZE, convertLaunchQuantization(transport.getDefaultLaunchQuantization()));
    d.setScreenItem(ScreenItem.MPC_ARRANGEMENT_SESSION, application.isArrangeLayout() ? 1 : 0);
    d.setScreenItem(ScreenItem.MPC_FOLLOW, arranger.isPlaybackFollowEnabled() ? 127 : 0);
    // ScreenItem.MPC_CLIP_DEVICE_VIEW - not supported
    d.setScreenItem(ScreenItem.MPC_DEVICE_LOCK, device.isPinned() ? 127 : 0);
    d.setScreenItem(ScreenItem.MPC_DETAIL_VIEW, device.isExpanded() ? 127 : 0);
    d.setScreenItem(ScreenItem.MPC_QUANTIZE_INTERVAL, Math.max(0, Math.min(7, 10 - this.surface.getConfiguration().getQuantizeAmount() / 10)));
    d.setScreenItem(ScreenItem.MPC_CLIP_SCENE_LAUNCH, this.surface.getConfiguration().isLaunchClips() ? 0 : 1);
}
Also used : IApplication(de.mossgrabers.framework.daw.IApplication) ITransport(de.mossgrabers.framework.daw.ITransport) IArranger(de.mossgrabers.framework.daw.IArranger) ICursorDevice(de.mossgrabers.framework.daw.data.ICursorDevice)

Example 10 with ITransport

use of de.mossgrabers.framework.daw.ITransport in project DrivenByMoss by git-moss.

the class KontrolProtocolControllerSetup method registerTriggerCommands.

/**
 * {@inheritDoc}
 */
@Override
protected void registerTriggerCommands() {
    final KontrolProtocolControlSurface surface = this.getSurface();
    final ITransport t = this.model.getTransport();
    this.addButton(ButtonID.PLAY, "Play", new PlayCommand<>(this.model, surface), 15, KontrolProtocolControlSurface.KONTROL_PLAY, t::isPlaying);
    this.addButton(ButtonID.NEW, "Shift+\nPlay", new NewCommand<>(this.model, surface), 15, KontrolProtocolControlSurface.KONTROL_RESTART);
    final ConfiguredRecordCommand<KontrolProtocolControlSurface, KontrolProtocolConfiguration> recordCommand = new ConfiguredRecordCommand<>(false, this.model, surface);
    this.addButton(ButtonID.RECORD, "Record", recordCommand, 15, KontrolProtocolControlSurface.KONTROL_RECORD, recordCommand::isLit);
    final ConfiguredRecordCommand<KontrolProtocolControlSurface, KontrolProtocolConfiguration> shiftedRecordCommand = new ConfiguredRecordCommand<>(true, this.model, surface);
    this.addButton(ButtonID.REC_ARM, "Shift+\nRecord", shiftedRecordCommand, 15, KontrolProtocolControlSurface.KONTROL_COUNT_IN, shiftedRecordCommand::isLit);
    this.addButton(ButtonID.STOP, "Stop", new StopCommand<>(this.model, surface), 15, KontrolProtocolControlSurface.KONTROL_STOP, () -> !t.isPlaying());
    this.addButton(ButtonID.LOOP, "Loop", new ToggleLoopCommand<>(this.model, surface), 15, KontrolProtocolControlSurface.KONTROL_LOOP, t::isLoop);
    this.addButton(ButtonID.METRONOME, "Metronome", new MetronomeCommand<>(this.model, surface, false), 15, KontrolProtocolControlSurface.KONTROL_METRO, t::isMetronomeOn);
    this.addButton(ButtonID.TAP_TEMPO, "Tempo", new TapTempoCommand<>(this.model, surface), 15, KontrolProtocolControlSurface.KONTROL_TAP_TEMPO);
    // Note: Since there is no pressed-state with this device, in the simulator-GUI the
    // following buttons are always on
    this.addButton(ButtonID.UNDO, "Undo", new UndoCommand<>(this.model, surface), 15, KontrolProtocolControlSurface.KONTROL_UNDO, () -> this.model.getApplication().canUndo());
    this.addButton(ButtonID.REDO, "Redo", new RedoCommand<>(this.model, surface), 15, KontrolProtocolControlSurface.KONTROL_REDO, () -> this.model.getApplication().canRedo());
    this.addButton(ButtonID.QUANTIZE, "Quantize", new QuantizeCommand<>(this.model, surface), 15, KontrolProtocolControlSurface.KONTROL_QUANTIZE, () -> true);
    this.addButton(ButtonID.AUTOMATION, "Automation", new WriteArrangerAutomationCommand<>(this.model, surface), 15, KontrolProtocolControlSurface.KONTROL_AUTOMATION, t::isWritingArrangerAutomation);
    this.addButton(ButtonID.DELETE, "Modes", new ModeMultiSelectCommand<>(this.model, surface, Modes.VOLUME, Modes.SEND, Modes.DEVICE_PARAMS), 15, KontrolProtocolControlSurface.KONTROL_CLEAR, () -> true);
    this.addButton(ButtonID.CLIP, "Start Clip", new StartClipOrSceneCommand(this.model, surface), 15, KontrolProtocolControlSurface.KONTROL_PLAY_SELECTED_CLIP);
    this.addButton(ButtonID.STOP_CLIP, "Stop Clip", new StopClipCommand<>(this.model, surface), 15, KontrolProtocolControlSurface.KONTROL_STOP_CLIP);
    // Not implemented in NIHIA
    this.addButton(ButtonID.SCENE1, "Play Scene", new StartSceneCommand<>(this.model, surface), 15, KontrolProtocolControlSurface.KONTROL_PLAY_SCENE);
    // KONTROL_RECORD_SESSION - Not implemented in NIHIA
    this.addButton(ButtonID.MUTE, "Mute", new MuteCommand<>(this.model, surface), 15, KontrolProtocolControlSurface.KONTROL_SELECTED_TRACK_MUTE, () -> {
        final ITrackBank tb = this.model.getCurrentTrackBank();
        final Optional<ITrack> selectedTrack = tb.getSelectedItem();
        return selectedTrack.isPresent() && selectedTrack.get().isMute() ? 1 : 0;
    });
    this.addButton(ButtonID.SOLO, "Solo", new SoloCommand<>(this.model, surface), 15, KontrolProtocolControlSurface.KONTROL_SELECTED_TRACK_SOLO, () -> {
        final ITrackBank tb = this.model.getCurrentTrackBank();
        final Optional<ITrack> selectedTrack = tb.getSelectedItem();
        return selectedTrack.isPresent() && selectedTrack.get().isSolo() ? 1 : 0;
    });
    this.addButtons(surface, 0, 8, ButtonID.ROW_SELECT_1, "Select", (event, index) -> {
        if (event == ButtonEvent.DOWN)
            this.model.getCurrentTrackBank().getItem(index).selectOrExpandGroup();
    }, 15, KontrolProtocolControlSurface.KONTROL_TRACK_SELECTED, index -> this.model.getTrackBank().getItem(index).isSelected() ? 1 : 0);
    this.addButtons(surface, 0, 8, ButtonID.ROW1_1, "Mute", (event, index) -> {
        if (event == ButtonEvent.DOWN)
            this.model.getTrackBank().getItem(index).toggleMute();
    }, 15, KontrolProtocolControlSurface.KONTROL_TRACK_MUTE, index -> this.model.getTrackBank().getItem(index).isMute() ? 1 : 0);
    this.addButtons(surface, 0, 8, ButtonID.ROW2_1, "Solo", (event, index) -> {
        if (event == ButtonEvent.DOWN)
            this.model.getTrackBank().getItem(index).toggleSolo();
    }, 15, KontrolProtocolControlSurface.KONTROL_TRACK_SOLO, index -> this.model.getTrackBank().getItem(index).isSolo() ? 1 : 0);
    this.addButtons(surface, 0, 8, ButtonID.ROW3_1, "Arm", (event, index) -> {
        if (event == ButtonEvent.DOWN)
            this.model.getTrackBank().getItem(index).toggleRecArm();
    }, 15, KontrolProtocolControlSurface.KONTROL_TRACK_RECARM, index -> this.model.getTrackBank().getItem(index).isRecArm() ? 1 : 0);
    this.addButton(ButtonID.F1, "", NopCommand.INSTANCE, 15, KontrolProtocolControlSurface.KONTROL_SELECTED_TRACK_AVAILABLE);
    this.addButton(ButtonID.F2, "", NopCommand.INSTANCE, 15, KontrolProtocolControlSurface.KONTROL_SELECTED_TRACK_MUTED_BY_SOLO);
}
Also used : ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank) ITransport(de.mossgrabers.framework.daw.ITransport) StartClipOrSceneCommand(de.mossgrabers.controller.ni.kontrol.mkii.command.trigger.StartClipOrSceneCommand) ConfiguredRecordCommand(de.mossgrabers.framework.command.trigger.transport.ConfiguredRecordCommand) KontrolProtocolControlSurface(de.mossgrabers.controller.ni.kontrol.mkii.controller.KontrolProtocolControlSurface) ITrack(de.mossgrabers.framework.daw.data.ITrack) ButtonEvent(de.mossgrabers.framework.utils.ButtonEvent) List(java.util.List) IMidiInput(de.mossgrabers.framework.daw.midi.IMidiInput) ITransport(de.mossgrabers.framework.daw.ITransport) IHost(de.mossgrabers.framework.daw.IHost) IMidiOutput(de.mossgrabers.framework.daw.midi.IMidiOutput)

Aggregations

ITransport (de.mossgrabers.framework.daw.ITransport)47 ITrack (de.mossgrabers.framework.daw.data.ITrack)9 ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)5 IHost (de.mossgrabers.framework.daw.IHost)5 IMidiInput (de.mossgrabers.framework.daw.midi.IMidiInput)5 ConfiguredRecordCommand (de.mossgrabers.framework.command.trigger.transport.ConfiguredRecordCommand)4 ITextDisplay (de.mossgrabers.framework.controller.display.ITextDisplay)4 IChannelBank (de.mossgrabers.framework.daw.IChannelBank)4 ITrackBank (de.mossgrabers.framework.daw.data.bank.ITrackBank)4 IMidiOutput (de.mossgrabers.framework.daw.midi.IMidiOutput)4 ViewManager (de.mossgrabers.framework.featuregroup.ViewManager)4 View (de.mossgrabers.framework.view.View)4 FeatureGroupButtonColorSupplier (de.mossgrabers.framework.command.trigger.view.FeatureGroupButtonColorSupplier)3 ICursorDevice (de.mossgrabers.framework.daw.data.ICursorDevice)3 ModeManager (de.mossgrabers.framework.mode.ModeManager)3 ButtonEvent (de.mossgrabers.framework.utils.ButtonEvent)3 SceneView (de.mossgrabers.framework.view.SceneView)3 ViewManager (de.mossgrabers.framework.view.ViewManager)3 SLMkIIIDisplay (de.mossgrabers.controller.novation.slmkiii.controller.SLMkIIIDisplay)2 ButtonID (de.mossgrabers.framework.controller.ButtonID)2