Search in sources :

Example 26 with ISceneBank

use of de.mossgrabers.framework.daw.data.bank.ISceneBank in project DrivenByMoss by git-moss.

the class CursorCommand method updateArrowStates.

/**
 * {@inheritDoc}
 */
@Override
protected void updateArrowStates() {
    final ISceneBank sceneBank = this.getSceneBank();
    this.canScrollUp = sceneBank.canScrollBackwards();
    this.canScrollDown = sceneBank.canScrollForwards();
    final IMode mode = this.surface.getModeManager().getActive();
    final boolean shiftPressed = this.surface.isShiftPressed();
    this.canScrollLeft = mode != null && (shiftPressed ? mode.hasPreviousItemPage() : mode.hasPreviousItem());
    this.canScrollRight = mode != null && (shiftPressed ? mode.hasNextItemPage() : mode.hasNextItem());
}
Also used : ISceneBank(de.mossgrabers.framework.daw.data.bank.ISceneBank) IMode(de.mossgrabers.framework.featuregroup.IMode)

Example 27 with ISceneBank

use of de.mossgrabers.framework.daw.data.bank.ISceneBank in project DrivenByMoss by git-moss.

the class AbstractSessionView method onGridNoteBirdsEyeView.

/**
 * Handle pad presses in the birds eye view (session page selection).
 *
 * @param x The x position of the pad
 * @param y The y position of the pad
 * @param yOffset Optional offset in y-direction
 */
protected void onGridNoteBirdsEyeView(final int x, final int y, final int yOffset) {
    final ITrackBank tb = this.model.getCurrentTrackBank();
    final ISceneBank sceneBank = tb.getSceneBank();
    final boolean flip = this.surface.getConfiguration().isFlipSession();
    // Calculate page offsets
    final int numTracks = tb.getPageSize();
    final int numScenes = sceneBank.getPageSize();
    final int trackPosition = tb.getItem(0).getPosition() / numTracks;
    final int scenePosition = sceneBank.getScrollPosition() / numScenes;
    final int selX = flip ? scenePosition : trackPosition;
    final int selY = flip ? trackPosition : scenePosition;
    final int padsX = flip ? this.rows : this.columns;
    final int padsY = flip ? this.columns : this.rows + yOffset;
    final int offsetX = selX / padsX * padsX;
    final int offsetY = selY / padsY * padsY;
    tb.scrollTo(offsetX * numTracks + (flip ? y : x) * padsX);
    sceneBank.scrollTo(offsetY * numScenes + (flip ? x : y) * padsY);
}
Also used : ISceneBank(de.mossgrabers.framework.daw.data.bank.ISceneBank) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank)

Example 28 with ISceneBank

use of de.mossgrabers.framework.daw.data.bank.ISceneBank in project DrivenByMoss by git-moss.

the class SessionView method onGridNote.

/**
 * {@inheritDoc}
 */
@Override
public void onGridNote(final int note, final int velocity) {
    final int index = note - 36;
    final int t = index % this.columns;
    final int s = this.rows - 1 - index / this.columns;
    final ITrackBank tb = this.model.getCurrentTrackBank();
    // Birds-eye-view navigation
    if (this.isBirdsEyeActive()) {
        final ISceneBank sceneBank = tb.getSceneBank();
        // Calculate page offsets
        final int numTracks = tb.getPageSize();
        final int numScenes = sceneBank.getPageSize();
        final int trackPosition = tb.getItem(0).getPosition() / numTracks;
        final int scenePosition = sceneBank.getScrollPosition() / numScenes;
        final int selX = trackPosition;
        final int selY = scenePosition;
        final int padsX = this.columns;
        final int padsY = this.rows;
        final int offsetX = selX / padsX * padsX;
        final int offsetY = selY / padsY * padsY;
        tb.scrollTo(offsetX * numTracks + t * padsX);
        sceneBank.scrollTo(offsetY * numScenes + s * padsY);
        return;
    }
    // Duplicate a clip
    final ITrack track = tb.getItem(t);
    if (this.isButtonCombination(ButtonID.DUPLICATE)) {
        if (track.doesExist())
            track.getSlotBank().getItem(s).duplicate();
        return;
    }
    // Stop clip with normal stop button
    if (this.isButtonCombination(ButtonID.STOP)) {
        track.stop();
        return;
    }
    super.onGridNote(note, velocity);
}
Also used : ISceneBank(de.mossgrabers.framework.daw.data.bank.ISceneBank) ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank)

Aggregations

ISceneBank (de.mossgrabers.framework.daw.data.bank.ISceneBank)28 IScene (de.mossgrabers.framework.daw.data.IScene)20 ITrackBank (de.mossgrabers.framework.daw.data.bank.ITrackBank)5 ColorManager (de.mossgrabers.framework.controller.color.ColorManager)2 IPadGrid (de.mossgrabers.framework.controller.grid.IPadGrid)2 ITrack (de.mossgrabers.framework.daw.data.ITrack)2 KontrolProtocolConfiguration (de.mossgrabers.controller.ni.kontrol.mkii.KontrolProtocolConfiguration)1 LaunchkeyMk3ColorManager (de.mossgrabers.controller.novation.launchkey.maxi.controller.LaunchkeyMk3ColorManager)1 LaunchkeyMiniMk3ColorManager (de.mossgrabers.controller.novation.launchkey.mini.controller.LaunchkeyMiniMk3ColorManager)1 UnknownCommandException (de.mossgrabers.controller.osc.exception.UnknownCommandException)1 ITextDisplay (de.mossgrabers.framework.controller.display.ITextDisplay)1 LightInfo (de.mossgrabers.framework.controller.grid.LightInfo)1 IValueChanger (de.mossgrabers.framework.controller.valuechanger.IValueChanger)1 ISlotBank (de.mossgrabers.framework.daw.data.bank.ISlotBank)1 IMode (de.mossgrabers.framework.featuregroup.IMode)1 Modes (de.mossgrabers.framework.mode.Modes)1