Search in sources :

Example 21 with INoteClip

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

the class DrumConfigView method drawGrid.

/**
 * {@inheritDoc}
 */
@Override
public void drawGrid() {
    final DrumView view = (DrumView) this.surface.getViewManager().get(Views.DRUM);
    final INoteClip clip = view.getClip();
    final IPadGrid padGrid = this.surface.getPadGrid();
    for (int x = 0; x < 8; x++) padGrid.lightEx(x, 0, view.getResolutionIndex() == x ? LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_BLUE_HI : LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_BLUE_LO);
    padGrid.lightEx(0, 1, clip.canScrollStepsBackwards() ? LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_LIME_HI : LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_LIME_LO);
    padGrid.lightEx(1, 1, clip.canScrollStepsForwards() ? LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_LIME_HI : LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_LIME_LO);
    padGrid.lightEx(2, 1, LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_BLACK);
    padGrid.lightEx(3, 1, this.model.getTransport().isMetronomeOn() ? LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_RED_HI : LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_RED_LO);
    padGrid.lightEx(4, 1, LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_BLACK);
    padGrid.lightEx(5, 1, LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_BLACK);
    padGrid.lightEx(6, 1, this.scales.canScrollDrumOctaveUp() ? LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_CYAN_HI : LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_CYAN_LO);
    padGrid.lightEx(7, 1, this.scales.canScrollDrumOctaveDown() ? LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_CYAN_HI : LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_CYAN_LO);
}
Also used : IPadGrid(de.mossgrabers.framework.controller.grid.IPadGrid) INoteClip(de.mossgrabers.framework.daw.INoteClip)

Example 22 with INoteClip

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

the class DrumConfigView method drawGrid.

/**
 * {@inheritDoc}
 */
@Override
public void drawGrid() {
    final DrumView view = (DrumView) this.surface.getViewManager().get(Views.DRUM);
    final INoteClip clip = view.getClip();
    final IPadGrid padGrid = this.surface.getPadGrid();
    for (int x = 0; x < 8; x++) padGrid.lightEx(x, 0, view.getResolutionIndex() == x ? LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_BLUE_HI : LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_BLUE_LO);
    padGrid.lightEx(0, 1, clip.canScrollStepsBackwards() ? LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_LIME_HI : LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_LIME_LO);
    padGrid.lightEx(1, 1, clip.canScrollStepsForwards() ? LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_LIME_HI : LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_LIME_LO);
    padGrid.lightEx(2, 1, LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_BLACK);
    padGrid.lightEx(3, 1, LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_BLACK);
    padGrid.lightEx(4, 1, LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_BLACK);
    padGrid.lightEx(5, 1, LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_BLACK);
    padGrid.lightEx(6, 1, LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_BLACK);
    padGrid.lightEx(7, 1, LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_BLACK);
}
Also used : IPadGrid(de.mossgrabers.framework.controller.grid.IPadGrid) INoteClip(de.mossgrabers.framework.daw.INoteClip)

Example 23 with INoteClip

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

the class DrumConfigView method onGridNote.

/**
 * {@inheritDoc}
 */
@Override
public void onGridNote(final int note, final int velocity) {
    if (velocity == 0)
        return;
    final int index = note - 36;
    final int col = index % 8;
    final DrumView view = (DrumView) this.surface.getViewManager().get(Views.DRUM);
    if (index / 8 == 1) {
        view.setResolutionIndex(col);
        return;
    }
    final INoteClip clip = view.getClip();
    switch(col) {
        case 0:
            clip.scrollStepsPageBackwards();
            this.mvHelper.notifyEditPage(clip);
            break;
        case 1:
            clip.scrollStepsPageForward();
            this.mvHelper.notifyEditPage(clip);
            break;
        default:
            // Not used
            break;
    }
}
Also used : INoteClip(de.mossgrabers.framework.daw.INoteClip)

Example 24 with INoteClip

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

the class DrumView method drawGrid.

/**
 * {@inheritDoc}
 */
@Override
public void drawGrid() {
    if (this.isGridEditor) {
        final IPadGrid padGrid = this.surface.getPadGrid();
        for (int i = 0; i < 8; i++) padGrid.light(36 + i, this.getButtonColorID(ButtonID.get(ButtonID.SCENE1, 7 - i)));
        for (int i = 8; i < 12; i++) padGrid.light(36 + i, MaschineColorManager.COLOR_BLACK);
        for (int i = 12; i < 14; i++) padGrid.light(36 + i, MaschineColorManager.COLOR_BLUE);
        for (int i = 14; i < 16; i++) padGrid.light(36 + i, MaschineColorManager.COLOR_BLACK);
        return;
    }
    if (this.isSequencerVisible) {
        final INoteClip clip = this.getClip();
        final boolean isActive = this.isActive();
        final IDrumDevice primary = this.model.getDrumDevice();
        this.drawSequencerSteps(clip, isActive, this.scales.getDrumOffset() + this.selectedPad, this.getPadColor(primary, this.selectedPad), y -> 3 - y);
        return;
    }
    if (this.isShifted)
        this.drawShiftedGrid();
    else
        super.drawGrid();
}
Also used : IPadGrid(de.mossgrabers.framework.controller.grid.IPadGrid) IDrumDevice(de.mossgrabers.framework.daw.data.IDrumDevice) INoteClip(de.mossgrabers.framework.daw.INoteClip)

Example 25 with INoteClip

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

the class DrumView method onGridNote.

/**
 * {@inheritDoc}
 */
@Override
public void onGridNote(final int key, final int velocity) {
    final int index = key - DRUM_START_KEY;
    if (!this.model.canSelectedTrackHoldNotes())
        return;
    if (this.isGridEditor) {
        if (velocity == 0)
            return;
        if (index < 8)
            this.setResolutionIndex(index);
        else {
            final INoteClip clip = this.getClip();
            if (index == 12)
                clip.scrollStepsPageBackwards();
            else if (index == 13)
                clip.scrollStepsPageForward();
            this.mvHelper.notifyEditPage(clip);
        }
        return;
    }
    if (this.isSequencerVisible) {
        final int x = index % this.numColumns;
        final int y = index / this.numColumns;
        final int offsetY = this.scales.getDrumOffset();
        if (this.isActive())
            this.handleSequencerArea(index, x, y, offsetY, velocity);
        return;
    }
    if (!this.isShifted) {
        super.onGridNote(key, velocity);
        return;
    }
    if (velocity == 0)
        return;
    switch(index) {
        case 14:
            this.onOctaveDown(ButtonEvent.DOWN);
            break;
        case 15:
            this.onOctaveUp(ButtonEvent.DOWN);
            break;
        default:
            // Not used
            break;
    }
    this.updateNoteMapping();
}
Also used : INoteClip(de.mossgrabers.framework.daw.INoteClip)

Aggregations

INoteClip (de.mossgrabers.framework.daw.INoteClip)41 IPadGrid (de.mossgrabers.framework.controller.grid.IPadGrid)13 IStepInfo (de.mossgrabers.framework.daw.IStepInfo)6 StepState (de.mossgrabers.framework.daw.StepState)6 GridStep (de.mossgrabers.framework.daw.data.GridStep)6 IDrumDevice (de.mossgrabers.framework.daw.data.IDrumDevice)6 ColorEx (de.mossgrabers.framework.controller.color.ColorEx)5 ITrack (de.mossgrabers.framework.daw.data.ITrack)3 ModeManager (de.mossgrabers.framework.featuregroup.ModeManager)3 NoteMode (de.mossgrabers.controller.akai.apc.mode.NoteMode)2 UnknownCommandException (de.mossgrabers.controller.osc.exception.UnknownCommandException)1 ICursorTrack (de.mossgrabers.framework.daw.data.ICursorTrack)1 ISlot (de.mossgrabers.framework.daw.data.ISlot)1 ISlotBank (de.mossgrabers.framework.daw.data.bank.ISlotBank)1