Search in sources :

Example 16 with ITransport

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

the class AutomationCommand method isLit.

/**
 * Returns true if the automation button should be lit.
 *
 * @return True if lit
 */
public boolean isLit() {
    final boolean isShift = this.surface.isShiftPressed();
    final boolean flipRecord = this.surface.getConfiguration().isFlipRecord();
    final ITransport transport = this.model.getTransport();
    if (isShift && !flipRecord || !isShift && flipRecord)
        return transport.isWritingClipLauncherAutomation();
    return transport.isWritingArrangerAutomation();
}
Also used : ITransport(de.mossgrabers.framework.daw.ITransport)

Example 17 with ITransport

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

the class RecQuantizationCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final ButtonEvent event, final int velocity) {
    if (event != ButtonEvent.DOWN)
        return;
    final ITransport transport = this.model.getTransport();
    if (this.surface.isSelectPressed()) {
        transport.nextLaunchQuantization();
        this.mvHelper.delayDisplay(() -> transport.getAutomationWriteMode().getLabel());
        return;
    }
    final boolean isShift = this.surface.isShiftPressed();
    final boolean flipRecord = this.surface.getConfiguration().isFlipRecord();
    if (isShift && !flipRecord || !isShift && flipRecord)
        transport.toggleWriteClipLauncherAutomation();
    else
        transport.toggleWriteArrangerAutomation();
}
Also used : ITransport(de.mossgrabers.framework.daw.ITransport)

Example 18 with ITransport

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

the class ShiftView method drawGrid.

/**
 * {@inheritDoc}
 */
@Override
public void drawGrid() {
    // Draw the keyboard
    final int scaleOffset = this.scales.getScaleOffset();
    // 0'C', 1'G', 2'D', 3'A', 4'E', 5'B', 6'F', 7'Bb', 8'Eb', 9'Ab', 10'Db', 11'Gb'
    final IPadGrid padGrid = this.surface.getPadGrid();
    for (int i = 7; i < 64; i++) padGrid.light(36 + i, APCminiColorManager.APC_COLOR_BLACK);
    padGrid.light(36 + 0, scaleOffset == 0 ? APCminiColorManager.APC_COLOR_GREEN : APCminiColorManager.APC_COLOR_YELLOW);
    padGrid.light(36 + 1, scaleOffset == 2 ? APCminiColorManager.APC_COLOR_GREEN : APCminiColorManager.APC_COLOR_YELLOW);
    padGrid.light(36 + 2, scaleOffset == 4 ? APCminiColorManager.APC_COLOR_GREEN : APCminiColorManager.APC_COLOR_YELLOW);
    padGrid.light(36 + 3, scaleOffset == 6 ? APCminiColorManager.APC_COLOR_GREEN : APCminiColorManager.APC_COLOR_YELLOW);
    padGrid.light(36 + 4, scaleOffset == 1 ? APCminiColorManager.APC_COLOR_GREEN : APCminiColorManager.APC_COLOR_YELLOW);
    padGrid.light(36 + 5, scaleOffset == 3 ? APCminiColorManager.APC_COLOR_GREEN : APCminiColorManager.APC_COLOR_YELLOW);
    padGrid.light(36 + 6, scaleOffset == 5 ? APCminiColorManager.APC_COLOR_GREEN : APCminiColorManager.APC_COLOR_YELLOW);
    padGrid.light(36 + 9, scaleOffset == 10 ? APCminiColorManager.APC_COLOR_GREEN : APCminiColorManager.APC_COLOR_RED);
    padGrid.light(36 + 10, scaleOffset == 8 ? APCminiColorManager.APC_COLOR_GREEN : APCminiColorManager.APC_COLOR_RED);
    padGrid.light(36 + 12, scaleOffset == 11 ? APCminiColorManager.APC_COLOR_GREEN : APCminiColorManager.APC_COLOR_RED);
    padGrid.light(36 + 13, scaleOffset == 9 ? APCminiColorManager.APC_COLOR_GREEN : APCminiColorManager.APC_COLOR_RED);
    padGrid.light(36 + 14, scaleOffset == 7 ? APCminiColorManager.APC_COLOR_GREEN : APCminiColorManager.APC_COLOR_RED);
    // Device Parameters up/down
    padGrid.light(36 + 24, APCminiColorManager.APC_COLOR_YELLOW);
    padGrid.light(36 + 25, APCminiColorManager.APC_COLOR_YELLOW);
    // Device up/down
    padGrid.light(36 + 32, APCminiColorManager.APC_COLOR_GREEN);
    padGrid.light(36 + 33, APCminiColorManager.APC_COLOR_GREEN);
    // Change the scale
    padGrid.light(36 + 35, APCminiColorManager.APC_COLOR_RED);
    padGrid.light(36 + 36, APCminiColorManager.APC_COLOR_RED);
    padGrid.light(36 + 27, APCminiColorManager.APC_COLOR_GREEN);
    // Draw the view selection: Session, Note, Drum, Sequencer
    final Views previousViewId = this.surface.getViewManager().getActiveIDIgnoreTemporary();
    padGrid.light(36 + 56, Views.SESSION == previousViewId ? APCminiColorManager.APC_COLOR_GREEN : APCminiColorManager.APC_COLOR_YELLOW);
    padGrid.light(36 + 57, Views.PLAY == previousViewId ? APCminiColorManager.APC_COLOR_GREEN : APCminiColorManager.APC_COLOR_YELLOW);
    padGrid.light(36 + 58, Views.DRUM == previousViewId ? APCminiColorManager.APC_COLOR_GREEN : APCminiColorManager.APC_COLOR_YELLOW);
    padGrid.light(36 + 59, Views.SEQUENCER == previousViewId ? APCminiColorManager.APC_COLOR_GREEN : APCminiColorManager.APC_COLOR_YELLOW);
    padGrid.light(36 + 60, Views.RAINDROPS == previousViewId ? APCminiColorManager.APC_COLOR_GREEN : APCminiColorManager.APC_COLOR_YELLOW);
    // Draw transport
    final ITransport transport = this.model.getTransport();
    padGrid.light(36 + 63, transport.isPlaying() ? APCminiColorManager.APC_COLOR_GREEN_BLINK : APCminiColorManager.APC_COLOR_GREEN);
    padGrid.light(36 + 55, transport.isRecording() ? APCminiColorManager.APC_COLOR_RED_BLINK : APCminiColorManager.APC_COLOR_RED);
    padGrid.light(36 + 47, APCminiColorManager.APC_COLOR_YELLOW);
    padGrid.light(36 + 39, APCminiColorManager.APC_COLOR_YELLOW);
    padGrid.light(36 + 62, APCminiColorManager.APC_COLOR_YELLOW);
    padGrid.light(36 + 54, transport.isLauncherOverdub() ? APCminiColorManager.APC_COLOR_RED_BLINK : APCminiColorManager.APC_COLOR_RED);
    padGrid.light(36 + 46, APCminiColorManager.APC_COLOR_YELLOW);
    padGrid.light(36 + 38, APCminiColorManager.APC_COLOR_YELLOW);
}
Also used : IPadGrid(de.mossgrabers.framework.controller.grid.IPadGrid) Views(de.mossgrabers.framework.view.Views) ITransport(de.mossgrabers.framework.daw.ITransport)

Example 19 with ITransport

use of de.mossgrabers.framework.daw.ITransport 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 20 with ITransport

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

the class TempoMode method updateDisplay.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay() {
    final ITextDisplay d = this.surface.getTextDisplay().clear();
    final ITransport transport = this.model.getTransport();
    final double tempo = transport.getTempo();
    d.setCell(0, 0, "Tempo:").setBlock(0, 1, String.format("> %.02f", Double.valueOf(tempo)));
    d.setBlock(0, 2, "Time:").setBlock(0, 3, "  " + transport.getPositionText());
    d.setBlock(1, 2, "Position:").setBlock(1, 3, "  " + transport.getBeatText());
    d.allDone();
}
Also used : ITransport(de.mossgrabers.framework.daw.ITransport) ITextDisplay(de.mossgrabers.framework.controller.display.ITextDisplay)

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