Search in sources :

Example 21 with IPadGrid

use of de.mossgrabers.framework.controller.grid.IPadGrid in project DrivenByMoss by git-moss.

the class SessionView method drawGrid.

/**
 * {@inheritDoc}
 */
@Override
public void drawGrid() {
    final boolean controlModeIsOff = this.padMode == null;
    this.rows = controlModeIsOff ? 2 : 1;
    super.drawGrid();
    if (controlModeIsOff)
        return;
    final ITrackBank tb = this.model.getCurrentTrackBank();
    final IPadGrid pads = this.surface.getPadGrid();
    for (int x = 0; x < this.columns; x++) {
        final ITrack track = tb.getItem(x);
        final boolean exists = track.doesExist();
        switch(this.padMode) {
            case REC_ARM:
                int recColor = LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_BLACK;
                if (exists)
                    recColor = track.isRecArm() ? LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_RED_HI : LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_RED_LO;
                pads.lightEx(x, 1, recColor);
                break;
            case TRACK_SELECT:
                int selectColor = LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_BLACK;
                if (exists)
                    selectColor = track.isSelected() ? LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_WHITE : LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_GREY_LO;
                pads.lightEx(x, 1, selectColor);
                break;
            case MUTE:
                int muteColor = LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_BLACK;
                if (exists)
                    muteColor = track.isMute() ? LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_AMBER_HI : LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_AMBER_LO;
                pads.lightEx(x, 1, muteColor);
                break;
            case SOLO:
                int soloColor = LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_BLACK;
                if (exists)
                    soloColor = track.isSolo() ? LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_YELLOW_HI : LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_YELLOW_LO;
                pads.lightEx(x, 1, soloColor);
                break;
            case STOP_CLIP:
                pads.lightEx(x, 1, exists ? LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_ROSE : LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_BLACK);
                break;
            default:
                // Unused
                break;
        }
    }
}
Also used : IPadGrid(de.mossgrabers.framework.controller.grid.IPadGrid) ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank)

Example 22 with IPadGrid

use of de.mossgrabers.framework.controller.grid.IPadGrid in project DrivenByMoss by git-moss.

the class DeviceConfigView method drawGrid.

/**
 * {@inheritDoc}
 */
@Override
public void drawGrid() {
    final IPadGrid padGrid = this.surface.getPadGrid();
    final ICursorDevice cursorDevice = this.model.getCursorDevice();
    if (!cursorDevice.doesExist()) {
        for (int i = 0; i < 16; i++) padGrid.light(36 + i, LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_BLACK);
    }
    final IParameterPageBank parameterPageBank = cursorDevice.getParameterPageBank();
    final int sel = parameterPageBank.getSelectedItemIndex();
    final int lastPage = Math.min(16, parameterPageBank.getItemCount());
    for (int i = 0; i < lastPage; i++) padGrid.lightEx(i % 8, i / 8, i == sel ? LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_MAGENTA_HI : LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_MAGENTA_LO);
    for (int i = lastPage; i < 16; i++) padGrid.lightEx(i % 8, i / 8, LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_GREY_LO);
}
Also used : IPadGrid(de.mossgrabers.framework.controller.grid.IPadGrid) IParameterPageBank(de.mossgrabers.framework.daw.data.bank.IParameterPageBank) ICursorDevice(de.mossgrabers.framework.daw.data.ICursorDevice)

Example 23 with IPadGrid

use of de.mossgrabers.framework.controller.grid.IPadGrid in project DrivenByMoss by git-moss.

the class SessionView method drawGrid.

/**
 * {@inheritDoc}
 */
@Override
public void drawGrid() {
    final boolean controlModeIsOff = this.padMode == null;
    this.rows = controlModeIsOff ? 2 : 1;
    super.drawGrid();
    if (controlModeIsOff)
        return;
    final ITrackBank tb = this.model.getCurrentTrackBank();
    final IPadGrid pads = this.surface.getPadGrid();
    for (int x = 0; x < this.columns; x++) {
        final ITrack track = tb.getItem(x);
        if (!track.doesExist()) {
            pads.lightEx(x, 1, LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_BLACK);
            continue;
        }
        switch(this.padMode) {
            case REC_ARM:
                pads.lightEx(x, 1, track.isRecArm() ? LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_RED_HI : LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_RED_LO);
                break;
            case TRACK_SELECT:
                pads.lightEx(x, 1, track.isSelected() ? LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_WHITE : LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_GREY_LO);
                break;
            case MUTE:
                pads.lightEx(x, 1, track.isMute() ? LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_AMBER_HI : LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_AMBER_LO);
                break;
            case SOLO:
                pads.lightEx(x, 1, track.isSolo() ? LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_YELLOW_HI : LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_YELLOW_LO);
                break;
            case STOP_CLIP:
                pads.lightEx(x, 1, LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_ROSE);
                break;
            default:
                // Unused
                break;
        }
    }
}
Also used : IPadGrid(de.mossgrabers.framework.controller.grid.IPadGrid) ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank)

Example 24 with IPadGrid

use of de.mossgrabers.framework.controller.grid.IPadGrid in project DrivenByMoss by git-moss.

the class ShiftView method drawGrid.

/**
 * {@inheritDoc}
 */
@Override
public void drawGrid() {
    final IPadGrid padGrid = this.surface.getPadGrid();
    for (int i = 7; i < 64; i++) padGrid.light(36 + i, APCColorManager.APC_COLOR_BLACK);
    // Add tracks
    for (int i = 0; i < 3; i++) padGrid.light(36 + 32 + i, APCColorManager.COLOR_KEY_WHITE);
    padGrid.light(36 + 35, APCColorManager.COLOR_KEY_SELECTED);
    padGrid.light(36 + 36, APCColorManager.COLOR_KEY_SELECTED);
    padGrid.light(36 + 38, APCColorManager.COLOR_KEY_BLACK);
    padGrid.light(36 + 39, APCColorManager.COLOR_KEY_BLACK);
    // Draw the keyboard
    final int scaleOffset = this.model.getScales().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'
    padGrid.light(36, scaleOffset == 0 ? APCColorManager.COLOR_KEY_SELECTED : APCColorManager.COLOR_KEY_WHITE);
    padGrid.light(36 + 1, scaleOffset == 2 ? APCColorManager.COLOR_KEY_SELECTED : APCColorManager.COLOR_KEY_WHITE);
    padGrid.light(36 + 2, scaleOffset == 4 ? APCColorManager.COLOR_KEY_SELECTED : APCColorManager.COLOR_KEY_WHITE);
    padGrid.light(36 + 3, scaleOffset == 6 ? APCColorManager.COLOR_KEY_SELECTED : APCColorManager.COLOR_KEY_WHITE);
    padGrid.light(36 + 4, scaleOffset == 1 ? APCColorManager.COLOR_KEY_SELECTED : APCColorManager.COLOR_KEY_WHITE);
    padGrid.light(36 + 5, scaleOffset == 3 ? APCColorManager.COLOR_KEY_SELECTED : APCColorManager.COLOR_KEY_WHITE);
    padGrid.light(36 + 6, scaleOffset == 5 ? APCColorManager.COLOR_KEY_SELECTED : APCColorManager.COLOR_KEY_WHITE);
    padGrid.light(36 + 9, scaleOffset == 10 ? APCColorManager.COLOR_KEY_SELECTED : APCColorManager.COLOR_KEY_BLACK);
    padGrid.light(36 + 10, scaleOffset == 8 ? APCColorManager.COLOR_KEY_SELECTED : APCColorManager.COLOR_KEY_BLACK);
    padGrid.light(36 + 12, scaleOffset == 11 ? APCColorManager.COLOR_KEY_SELECTED : APCColorManager.COLOR_KEY_BLACK);
    padGrid.light(36 + 13, scaleOffset == 9 ? APCColorManager.COLOR_KEY_SELECTED : APCColorManager.COLOR_KEY_BLACK);
    padGrid.light(36 + 14, scaleOffset == 7 ? APCColorManager.COLOR_KEY_SELECTED : APCColorManager.COLOR_KEY_BLACK);
}
Also used : IPadGrid(de.mossgrabers.framework.controller.grid.IPadGrid)

Example 25 with IPadGrid

use of de.mossgrabers.framework.controller.grid.IPadGrid in project DrivenByMoss by git-moss.

the class BrowserView method drawGrid.

/**
 * {@inheritDoc}
 */
@Override
public void drawGrid() {
    final IPadGrid padGrid = this.surface.getPadGrid();
    padGrid.light(36, BeatstepColorManager.BEATSTEP_BUTTON_STATE_RED);
    padGrid.light(37, BeatstepColorManager.BEATSTEP_BUTTON_STATE_OFF);
    for (int i = 2; i < 6; i++) padGrid.light(36 + i, BeatstepColorManager.BEATSTEP_BUTTON_STATE_PINK);
    padGrid.light(42, BeatstepColorManager.BEATSTEP_BUTTON_STATE_OFF);
    padGrid.light(43, BeatstepColorManager.BEATSTEP_BUTTON_STATE_BLUE);
    padGrid.light(44, BeatstepColorManager.BEATSTEP_BUTTON_STATE_OFF);
    padGrid.light(45, BeatstepColorManager.BEATSTEP_BUTTON_STATE_OFF);
    for (int i = 10; i < 14; i++) padGrid.light(36 + i, BeatstepColorManager.BEATSTEP_BUTTON_STATE_PINK);
    padGrid.light(50, BeatstepColorManager.BEATSTEP_BUTTON_STATE_OFF);
    padGrid.light(51, BeatstepColorManager.BEATSTEP_BUTTON_STATE_OFF);
}
Also used : IPadGrid(de.mossgrabers.framework.controller.grid.IPadGrid)

Aggregations

IPadGrid (de.mossgrabers.framework.controller.grid.IPadGrid)50 INoteClip (de.mossgrabers.framework.daw.INoteClip)13 ITrack (de.mossgrabers.framework.daw.data.ITrack)11 ITrackBank (de.mossgrabers.framework.daw.data.bank.ITrackBank)10 IStepInfo (de.mossgrabers.framework.daw.IStepInfo)7 GridStep (de.mossgrabers.framework.daw.data.GridStep)7 IDrumDevice (de.mossgrabers.framework.daw.data.IDrumDevice)7 ColorEx (de.mossgrabers.framework.controller.color.ColorEx)4 ITransport (de.mossgrabers.framework.daw.ITransport)3 ICursorDevice (de.mossgrabers.framework.daw.data.ICursorDevice)3 INoteRepeat (de.mossgrabers.framework.daw.midi.INoteRepeat)3 StepState (de.mossgrabers.framework.daw.StepState)2 IScene (de.mossgrabers.framework.daw.data.IScene)2 IParameterPageBank (de.mossgrabers.framework.daw.data.bank.IParameterPageBank)2 ISceneBank (de.mossgrabers.framework.daw.data.bank.ISceneBank)2 Views (de.mossgrabers.framework.view.Views)2 LaunchpadConfiguration (de.mossgrabers.controller.novation.launchpad.LaunchpadConfiguration)1 LightInfo (de.mossgrabers.framework.controller.grid.LightInfo)1 DAWColor (de.mossgrabers.framework.daw.DAWColor)1 IHost (de.mossgrabers.framework.daw.IHost)1