Search in sources :

Example 46 with ITransport

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

the class TapTempoCommand method executeNormal.

/**
 * {@inheritDoc}
 */
@Override
public void executeNormal(final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    final ITransport transport = this.model.getTransport();
    transport.tapTempo();
    final IDisplay display = this.surface.getDisplay();
    if (display != null)
        display.notify(String.format("Tempo: %.02f", Double.valueOf(transport.getTempo())));
}
Also used : ITransport(de.mossgrabers.framework.daw.ITransport) IDisplay(de.mossgrabers.framework.controller.display.IDisplay)

Example 47 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() {
    final IPadGrid padGrid = this.surface.getPadGrid();
    final LaunchpadConfiguration configuration = this.surface.getConfiguration();
    final ITransport transport = this.model.getTransport();
    // Add tracks
    padGrid.light(97, LaunchpadColorManager.LAUNCHPAD_COLOR_GREEN);
    padGrid.light(98, LaunchpadColorManager.LAUNCHPAD_COLOR_GREEN_SPRING);
    padGrid.light(99, LaunchpadColorManager.LAUNCHPAD_COLOR_TURQUOISE_CYAN);
    // Accent on/off
    padGrid.light(91, configuration.isAccentActive() ? LaunchpadColorManager.LAUNCHPAD_COLOR_YELLOW_HI : LaunchpadColorManager.LAUNCHPAD_COLOR_YELLOW_LO);
    // New clip length
    final int clipLengthIndex = this.surface.getConfiguration().getNewClipLength();
    for (int i = 0; i < 8; i++) padGrid.light(36 + i, i == clipLengthIndex ? LaunchpadColorManager.LAUNCHPAD_COLOR_WHITE : LaunchpadColorManager.LAUNCHPAD_COLOR_GREY_LO);
    // Note Repeat
    final INoteRepeat noteRepeat = this.surface.getMidiInput().getDefaultNoteInput().getNoteRepeat();
    padGrid.light(87, noteRepeat.isActive() ? LaunchpadColorManager.LAUNCHPAD_COLOR_ORCHID_HI : LaunchpadColorManager.LAUNCHPAD_COLOR_ORCHID_LO);
    // Note Repeat period
    final int periodIndex = Resolution.getMatch(noteRepeat.getPeriod());
    padGrid.light(79, periodIndex == 0 ? LaunchpadColorManager.LAUNCHPAD_COLOR_SKY_HI : LaunchpadColorManager.LAUNCHPAD_COLOR_SKY_LO);
    padGrid.light(71, periodIndex == 2 ? LaunchpadColorManager.LAUNCHPAD_COLOR_SKY_HI : LaunchpadColorManager.LAUNCHPAD_COLOR_SKY_LO);
    padGrid.light(63, periodIndex == 4 ? LaunchpadColorManager.LAUNCHPAD_COLOR_SKY_HI : LaunchpadColorManager.LAUNCHPAD_COLOR_SKY_LO);
    padGrid.light(55, periodIndex == 6 ? LaunchpadColorManager.LAUNCHPAD_COLOR_SKY_HI : LaunchpadColorManager.LAUNCHPAD_COLOR_SKY_LO);
    padGrid.light(80, periodIndex == 1 ? LaunchpadColorManager.LAUNCHPAD_COLOR_PINK_HI : LaunchpadColorManager.LAUNCHPAD_COLOR_PINK_LO);
    padGrid.light(72, periodIndex == 3 ? LaunchpadColorManager.LAUNCHPAD_COLOR_PINK_HI : LaunchpadColorManager.LAUNCHPAD_COLOR_PINK_LO);
    padGrid.light(64, periodIndex == 5 ? LaunchpadColorManager.LAUNCHPAD_COLOR_PINK_HI : LaunchpadColorManager.LAUNCHPAD_COLOR_PINK_LO);
    padGrid.light(56, periodIndex == 7 ? LaunchpadColorManager.LAUNCHPAD_COLOR_PINK_HI : LaunchpadColorManager.LAUNCHPAD_COLOR_PINK_LO);
    // Note Repeat length
    final int lengthIndex = Resolution.getMatch(noteRepeat.getNoteLength());
    padGrid.light(81, lengthIndex == 0 ? LaunchpadColorManager.LAUNCHPAD_COLOR_SKY_HI : LaunchpadColorManager.LAUNCHPAD_COLOR_SKY_LO);
    padGrid.light(73, lengthIndex == 2 ? LaunchpadColorManager.LAUNCHPAD_COLOR_SKY_HI : LaunchpadColorManager.LAUNCHPAD_COLOR_SKY_LO);
    padGrid.light(65, lengthIndex == 4 ? LaunchpadColorManager.LAUNCHPAD_COLOR_SKY_HI : LaunchpadColorManager.LAUNCHPAD_COLOR_SKY_LO);
    padGrid.light(57, lengthIndex == 6 ? LaunchpadColorManager.LAUNCHPAD_COLOR_SKY_HI : LaunchpadColorManager.LAUNCHPAD_COLOR_SKY_LO);
    padGrid.light(82, lengthIndex == 1 ? LaunchpadColorManager.LAUNCHPAD_COLOR_PINK_HI : LaunchpadColorManager.LAUNCHPAD_COLOR_PINK_LO);
    padGrid.light(74, lengthIndex == 3 ? LaunchpadColorManager.LAUNCHPAD_COLOR_PINK_HI : LaunchpadColorManager.LAUNCHPAD_COLOR_PINK_LO);
    padGrid.light(66, lengthIndex == 5 ? LaunchpadColorManager.LAUNCHPAD_COLOR_PINK_HI : LaunchpadColorManager.LAUNCHPAD_COLOR_PINK_LO);
    padGrid.light(58, lengthIndex == 7 ? LaunchpadColorManager.LAUNCHPAD_COLOR_PINK_HI : LaunchpadColorManager.LAUNCHPAD_COLOR_PINK_LO);
    // Stop all
    padGrid.light(51, LaunchpadColorManager.LAUNCHPAD_COLOR_RED);
    // Note Repeat Octave Range up/down
    padGrid.light(88, LaunchpadColorManager.LAUNCHPAD_COLOR_RED);
    padGrid.light(89, LaunchpadColorManager.LAUNCHPAD_COLOR_RED);
    for (int i = 90; i < 91; i++) padGrid.light(i, LaunchpadColorManager.LAUNCHPAD_COLOR_BLACK);
    if (this.surface.isPro()) {
        for (int i = 44; i < 51; i++) padGrid.light(i, LaunchpadColorManager.LAUNCHPAD_COLOR_BLACK);
        for (int i = 52; i < 55; i++) padGrid.light(i, LaunchpadColorManager.LAUNCHPAD_COLOR_BLACK);
        for (int i = 59; i < 63; i++) padGrid.light(i, LaunchpadColorManager.LAUNCHPAD_COLOR_BLACK);
        for (int i = 67; i < 71; i++) padGrid.light(i, LaunchpadColorManager.LAUNCHPAD_COLOR_BLACK);
        for (int i = 75; i < 79; i++) padGrid.light(i, LaunchpadColorManager.LAUNCHPAD_COLOR_BLACK);
        for (int i = 83; i < 87; i++) padGrid.light(i, LaunchpadColorManager.LAUNCHPAD_COLOR_BLACK);
        for (int i = 92; i < 97; i++) padGrid.light(i, LaunchpadColorManager.LAUNCHPAD_COLOR_BLACK);
        return;
    }
    // Record
    padGrid.light(44, transport.isRecording() ? LaunchpadColorManager.LAUNCHPAD_COLOR_RED_HI : LaunchpadColorManager.LAUNCHPAD_COLOR_RED_LO);
    padGrid.light(45, transport.isLauncherOverdub() ? LaunchpadColorManager.LAUNCHPAD_COLOR_ROSE : LaunchpadColorManager.LAUNCHPAD_COLOR_WHITE);
    for (int i = 46; i < 51; i++) padGrid.light(i, LaunchpadColorManager.LAUNCHPAD_COLOR_BLACK);
    // Play / New
    padGrid.light(52, transport.isPlaying() ? LaunchpadColorManager.LAUNCHPAD_COLOR_GREEN_HI : LaunchpadColorManager.LAUNCHPAD_COLOR_GREEN_LO);
    padGrid.light(53, LaunchpadColorManager.LAUNCHPAD_COLOR_GREEN_SPRING);
    padGrid.light(54, LaunchpadColorManager.LAUNCHPAD_COLOR_BLACK);
    padGrid.light(59, LaunchpadColorManager.LAUNCHPAD_COLOR_BLACK);
    // Duplicate
    if (configuration.isDuplicateModeActive())
        padGrid.light(60, LaunchpadColorManager.LAUNCHPAD_COLOR_BLUE, LaunchpadColorManager.LAUNCHPAD_COLOR_OCEAN_BLUE, true);
    else
        padGrid.light(60, LaunchpadColorManager.LAUNCHPAD_COLOR_BLUE);
    // Double
    padGrid.light(61, LaunchpadColorManager.LAUNCHPAD_COLOR_BLUE_ORCHID);
    padGrid.light(62, LaunchpadColorManager.LAUNCHPAD_COLOR_BLACK);
    padGrid.light(67, LaunchpadColorManager.LAUNCHPAD_COLOR_BLACK);
    // Quantize
    padGrid.light(68, LaunchpadColorManager.LAUNCHPAD_COLOR_GREEN);
    // Record Quantization
    padGrid.light(69, LaunchpadColorManager.LAUNCHPAD_COLOR_GREEN_SPRING);
    padGrid.light(70, LaunchpadColorManager.LAUNCHPAD_COLOR_BLACK);
    padGrid.light(75, LaunchpadColorManager.LAUNCHPAD_COLOR_BLACK);
    // Delete
    if (configuration.isDeleteModeActive())
        padGrid.light(76, LaunchpadColorManager.LAUNCHPAD_COLOR_MAGENTA, LaunchpadColorManager.LAUNCHPAD_COLOR_MAGENTA_PINK, true);
    else
        padGrid.light(76, LaunchpadColorManager.LAUNCHPAD_COLOR_MAGENTA);
    padGrid.light(77, transport.isLoop() ? LaunchpadColorManager.LAUNCHPAD_COLOR_BLUE_HI : LaunchpadColorManager.LAUNCHPAD_COLOR_BLUE_LO);
    padGrid.light(78, LaunchpadColorManager.LAUNCHPAD_COLOR_BLACK);
    padGrid.light(83, LaunchpadColorManager.LAUNCHPAD_COLOR_BLACK);
    // Undo / Redo
    padGrid.light(84, LaunchpadColorManager.LAUNCHPAD_COLOR_AMBER);
    padGrid.light(85, LaunchpadColorManager.LAUNCHPAD_COLOR_AMBER_YELLOW);
    padGrid.light(86, LaunchpadColorManager.LAUNCHPAD_COLOR_BLACK);
    // Metronome
    padGrid.light(92, transport.isMetronomeOn() ? LaunchpadColorManager.LAUNCHPAD_COLOR_GREEN_HI : LaunchpadColorManager.LAUNCHPAD_COLOR_GREEN_LO);
    // Tap Tempo
    padGrid.light(93, LaunchpadColorManager.LAUNCHPAD_COLOR_GREEN_SPRING);
    for (int i = 94; i < 97; i++) padGrid.light(i, LaunchpadColorManager.LAUNCHPAD_COLOR_BLACK);
}
Also used : IPadGrid(de.mossgrabers.framework.controller.grid.IPadGrid) INoteRepeat(de.mossgrabers.framework.daw.midi.INoteRepeat) ITransport(de.mossgrabers.framework.daw.ITransport) LaunchpadConfiguration(de.mossgrabers.controller.novation.launchpad.LaunchpadConfiguration)

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