Search in sources :

Example 81 with ITrackBank

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

the class StopClipCommand method executeNormal.

/**
 * {@inheritDoc}
 */
@Override
public void executeNormal(final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    final ITrackBank currentTrackBank = this.model.getCurrentTrackBank();
    final Optional<ITrack> track = this.index == -1 ? currentTrackBank.getSelectedItem() : Optional.of(currentTrackBank.getItem(this.index));
    if (track.isPresent())
        track.get().stop();
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank)

Example 82 with ITrackBank

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

the class AbstractSessionView method drawSessionGrid.

/**
 * Draw a session grid, where each pad stands for a clip.
 *
 * @param ignoreFlipCheck True to ignore the check for same columns and rows
 */
protected void drawSessionGrid(final boolean ignoreFlipCheck) {
    final boolean flipSession = this.surface.getConfiguration().isFlipSession();
    if (flipSession && this.columns != this.rows && !ignoreFlipCheck)
        throw new FrameworkException("Session flip is only supported for same size of rows and columns!");
    final ITrackBank tb = this.model.getCurrentTrackBank();
    for (int x = 0; x < this.columns; x++) {
        final ITrack t = tb.getItem(x);
        final ISlotBank slotBank = t.getSlotBank();
        for (int y = 0; y < this.rows; y++) this.drawPad(slotBank.getItem(y), flipSession ? y : x, flipSession ? x : y, t.isRecArm());
    }
}
Also used : ISlotBank(de.mossgrabers.framework.daw.data.bank.ISlotBank) FrameworkException(de.mossgrabers.framework.utils.FrameworkException) ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank)

Example 83 with ITrackBank

use of de.mossgrabers.framework.daw.data.bank.ITrackBank 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 84 with ITrackBank

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

the class AbstractKontrol1Mode method onMainKnobPressed.

/**
 * {@inheritDoc}
 */
@Override
public void onMainKnobPressed() {
    this.model.toggleCurrentTrackBank();
    final ITrackBank tb = this.model.getCurrentTrackBank();
    final Optional<ITrack> track = tb.getSelectedItem();
    if (track.isEmpty())
        tb.getItem(0).select();
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank)

Example 85 with ITrackBank

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

the class AbstractConfiguration method registerDeactivatedItemsHandler.

/**
 * Register a handler for the 'exclude deactivated items' setting.
 *
 * @param model The model for getting the banks to configure
 */
public void registerDeactivatedItemsHandler(final IModel model) {
    this.addSettingObserver(AbstractConfiguration.EXCLUDE_DEACTIVATED_ITEMS, () -> {
        final boolean exclude = this.areDeactivatedItemsExcluded();
        final ITrackBank trackBank = model.getTrackBank();
        trackBank.setSkipDisabledItems(exclude);
        for (int i = 0; i < trackBank.getPageSize(); i++) trackBank.getItem(i).getSendBank().setSkipDisabledItems(exclude);
        final ITrackBank effectTrackBank = model.getEffectTrackBank();
        if (effectTrackBank != null)
            effectTrackBank.setSkipDisabledItems(exclude);
        final ICursorDevice cursorDevice = model.getCursorDevice();
        final IDeviceBank deviceBank = cursorDevice.getDeviceBank();
        deviceBank.setSkipDisabledItems(exclude);
        cursorDevice.getLayerBank().setSkipDisabledItems(exclude);
        final IDrumPadBank drumPadBank = cursorDevice.getDrumPadBank();
        if (drumPadBank != null)
            drumPadBank.setSkipDisabledItems(exclude);
    });
}
Also used : ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank) IDeviceBank(de.mossgrabers.framework.daw.data.bank.IDeviceBank) IDrumPadBank(de.mossgrabers.framework.daw.data.bank.IDrumPadBank) ICursorDevice(de.mossgrabers.framework.daw.data.ICursorDevice)

Aggregations

ITrackBank (de.mossgrabers.framework.daw.data.bank.ITrackBank)121 ITrack (de.mossgrabers.framework.daw.data.ITrack)85 ModeManager (de.mossgrabers.framework.featuregroup.ModeManager)17 ITextDisplay (de.mossgrabers.framework.controller.display.ITextDisplay)16 Modes (de.mossgrabers.framework.mode.Modes)15 PushConfiguration (de.mossgrabers.controller.ableton.push.PushConfiguration)10 IPadGrid (de.mossgrabers.framework.controller.grid.IPadGrid)10 ISend (de.mossgrabers.framework.daw.data.ISend)10 ISendBank (de.mossgrabers.framework.daw.data.bank.ISendBank)8 ICursorDevice (de.mossgrabers.framework.daw.data.ICursorDevice)7 IMasterTrack (de.mossgrabers.framework.daw.data.IMasterTrack)7 ICursorTrack (de.mossgrabers.framework.daw.data.ICursorTrack)6 IValueChanger (de.mossgrabers.framework.controller.valuechanger.IValueChanger)5 ITransport (de.mossgrabers.framework.daw.ITransport)5 IParameterBank (de.mossgrabers.framework.daw.data.bank.IParameterBank)5 ISceneBank (de.mossgrabers.framework.daw.data.bank.ISceneBank)5 SLMkIIIDisplay (de.mossgrabers.controller.novation.slmkiii.controller.SLMkIIIDisplay)4 ColorEx (de.mossgrabers.framework.controller.color.ColorEx)4 Kontrol1Display (de.mossgrabers.controller.ni.kontrol.mki.controller.Kontrol1Display)3 IHost (de.mossgrabers.framework.daw.IHost)3