Search in sources :

Example 41 with ITransport

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

the class LoopStartMode method updateDisplay.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay() {
    final ITextDisplay d = this.surface.getTextDisplay().clear();
    final ITransport transport = this.model.getTransport();
    d.setBlock(0, 0, "Arranger Loop");
    d.setBlock(0, 2, "Start:").setBlock(0, 3, "> " + transport.getLoopStartBeatText());
    d.setBlock(1, 2, "Length:").setBlock(1, 3, "  " + transport.getLoopLengthBeatText());
    d.allDone();
}
Also used : ITransport(de.mossgrabers.framework.daw.ITransport) ITextDisplay(de.mossgrabers.framework.controller.display.ITextDisplay)

Example 42 with ITransport

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

the class PositionMode 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)

Example 43 with ITransport

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

the class Kontrol1ControllerSetup method registerTriggerCommands.

/**
 * {@inheritDoc}
 */
@Override
protected void registerTriggerCommands() {
    final Kontrol1ControlSurface surface = this.getSurface();
    final ITransport t = this.model.getTransport();
    this.addButton(ButtonID.SCALES, "Scales", new ScaleButtonCommand(this.model, surface), Kontrol1ControlSurface.BUTTON_SCALE, this.configuration::isScaleIsActive);
    this.addButton(ButtonID.METRONOME, "Metronome", new MetronomeCommand<>(this.model, surface, false), Kontrol1ControlSurface.BUTTON_ARP, () -> surface.isShiftPressed() && t.isMetronomeTicksOn() || !surface.isShiftPressed() && t.isMetronomeOn());
    this.addButton(ButtonID.PLAY, "PLAY", new Kontrol1PlayCommand(this.model, surface), Kontrol1ControlSurface.BUTTON_PLAY, t::isPlaying);
    this.addButton(ButtonID.RECORD, "REC", new RecordCommand<>(this.model, surface), Kontrol1ControlSurface.BUTTON_REC, t::isRecording);
    this.addButton(ButtonID.STOP, "STOP", new StopCommand<>(this.model, surface), Kontrol1ControlSurface.BUTTON_STOP, () -> !t.isPlaying());
    this.addButton(ButtonID.REWIND, "RWD", new WindCommand<>(this.model, surface, false), Kontrol1ControlSurface.BUTTON_RWD, () -> surface.isPressed(ButtonID.REWIND));
    this.addButton(ButtonID.FORWARD, "FFW", new WindCommand<>(this.model, surface, true), Kontrol1ControlSurface.BUTTON_FWD, () -> surface.isPressed(ButtonID.FORWARD));
    this.addButton(ButtonID.LOOP, "LOOP", new ToggleLoopCommand<>(this.model, surface), Kontrol1ControlSurface.BUTTON_LOOP, t::isLoop);
    this.addButton(ButtonID.PAGE_LEFT, "Left", new ModeMultiSelectCommand<>(this.model, surface, Modes.DEVICE_PARAMS, Modes.VOLUME, Modes.TRACK), Kontrol1ControlSurface.BUTTON_PAGE_LEFT);
    this.addButton(ButtonID.PAGE_RIGHT, "Right", new ModeMultiSelectCommand<>(this.model, surface, Modes.TRACK, Modes.VOLUME, Modes.DEVICE_PARAMS), Kontrol1ControlSurface.BUTTON_PAGE_RIGHT);
    // Put this on channel 16 to not conflict with the modulation wheel
    this.addButton(ButtonID.MASTERTRACK, "Encoder", new MainEncoderButtonCommand(this.model, surface), 15, Kontrol1ControlSurface.BUTTON_MAIN_ENCODER);
    final Kontrol1CursorCommand commandDown = new Kontrol1CursorCommand(Direction.DOWN, this.model, surface);
    this.addButton(ButtonID.ARROW_DOWN, "Down", commandDown, Kontrol1ControlSurface.BUTTON_NAVIGATE_DOWN, commandDown::canScroll);
    final Kontrol1CursorCommand commandUp = new Kontrol1CursorCommand(Direction.UP, this.model, surface);
    this.addButton(ButtonID.ARROW_UP, "Up", commandUp, Kontrol1ControlSurface.BUTTON_NAVIGATE_UP, commandUp::canScroll);
    final Kontrol1CursorCommand commandLeft = new Kontrol1CursorCommand(Direction.LEFT, this.model, surface);
    this.addButton(ButtonID.ARROW_LEFT, "Left", commandLeft, Kontrol1ControlSurface.BUTTON_NAVIGATE_LEFT, commandLeft::canScroll);
    final Kontrol1CursorCommand commandRight = new Kontrol1CursorCommand(Direction.RIGHT, this.model, surface);
    this.addButton(ButtonID.ARROW_RIGHT, "Right", commandRight, Kontrol1ControlSurface.BUTTON_NAVIGATE_RIGHT, commandRight::canScroll);
    this.addButton(ButtonID.MUTE, "Back", new BackButtonCommand(this.model, surface), Kontrol1ControlSurface.BUTTON_BACK, () -> this.getModeColor(ButtonID.MUTE));
    this.addButton(ButtonID.SOLO, "Enter", new EnterButtonCommand(this.model, surface), Kontrol1ControlSurface.BUTTON_ENTER, () -> this.getModeColor(ButtonID.SOLO));
    this.addButton(ButtonID.BROWSE, "Browse", new BrowserCommand<>(this.model, surface, ButtonID.SHIFT, null), Kontrol1ControlSurface.BUTTON_BROWSE, () -> this.getModeColor(ButtonID.BROWSE));
    this.addButton(ButtonID.SHIFT, "Shift", NopCommand.INSTANCE, Kontrol1ControlSurface.BUTTON_SHIFT);
}
Also used : Kontrol1ControlSurface(de.mossgrabers.controller.ni.kontrol.mki.controller.Kontrol1ControlSurface) ITransport(de.mossgrabers.framework.daw.ITransport) EnterButtonCommand(de.mossgrabers.controller.ni.kontrol.mki.command.trigger.EnterButtonCommand) MainEncoderButtonCommand(de.mossgrabers.controller.ni.kontrol.mki.command.trigger.MainEncoderButtonCommand) ScaleButtonCommand(de.mossgrabers.controller.ni.kontrol.mki.command.trigger.ScaleButtonCommand) IMidiInput(de.mossgrabers.framework.daw.midi.IMidiInput) ITransport(de.mossgrabers.framework.daw.ITransport) IHost(de.mossgrabers.framework.daw.IHost) BackButtonCommand(de.mossgrabers.controller.ni.kontrol.mki.command.trigger.BackButtonCommand) Kontrol1PlayCommand(de.mossgrabers.controller.ni.kontrol.mki.command.trigger.Kontrol1PlayCommand) Kontrol1CursorCommand(de.mossgrabers.controller.ni.kontrol.mki.command.trigger.Kontrol1CursorCommand)

Example 44 with ITransport

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

the class AutomationCommand 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.nextAutomationWriteMode();
        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();
    if (isShift)
        this.cleanupShift();
}
Also used : ITransport(de.mossgrabers.framework.daw.ITransport)

Example 45 with ITransport

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

the class RecQuantizationCommand 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)

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