Search in sources :

Example 11 with ISceneBank

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

the class Drum64View method getButtonColorID.

/**
 * {@inheritDoc}
 */
@Override
public String getButtonColorID(final ButtonID buttonID) {
    if (!ButtonID.isSceneButton(buttonID))
        return AbstractFeatureGroup.BUTTON_COLOR_OFF;
    if (this.surface.isPressed(ButtonID.REPEAT))
        return NoteRepeatSceneHelper.getButtonColorID(this.surface, buttonID);
    final ISceneBank sceneBank = this.model.getSceneBank();
    final int scene = buttonID.ordinal() - ButtonID.SCENE1.ordinal();
    final IScene s = sceneBank.getItem(scene);
    if (s.doesExist())
        return s.isSelected() ? AbstractSessionView.COLOR_SELECTED_SCENE : AbstractSessionView.COLOR_SCENE;
    return AbstractSessionView.COLOR_SCENE_OFF;
}
Also used : ISceneBank(de.mossgrabers.framework.daw.data.bank.ISceneBank) IScene(de.mossgrabers.framework.daw.data.IScene)

Example 12 with ISceneBank

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

the class SessionView method getButtonColorID.

/**
 * {@inheritDoc}
 */
@Override
public String getButtonColorID(final ButtonID buttonID) {
    final int scene = buttonID.ordinal() - ButtonID.SCENE1.ordinal();
    if (scene < 0 || scene >= 8)
        return AbstractFeatureGroup.BUTTON_COLOR_OFF;
    final ISceneBank sceneBank = this.model.getSceneBank();
    final IScene s = sceneBank.getItem(scene);
    if (s.doesExist())
        return s.isSelected() ? AbstractSessionView.COLOR_SELECTED_SCENE : AbstractSessionView.COLOR_SCENE;
    return AbstractSessionView.COLOR_SCENE_OFF;
}
Also used : ISceneBank(de.mossgrabers.framework.daw.data.bank.ISceneBank) IScene(de.mossgrabers.framework.daw.data.IScene)

Example 13 with ISceneBank

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

the class SceneModule method flush.

/**
 * {@inheritDoc}
 */
@Override
public void flush(final boolean dump) {
    final ISceneBank sceneBank = this.model.getSceneBank();
    for (int i = 0; i < sceneBank.getPageSize(); i++) {
        final IScene scene = sceneBank.getItem(i);
        final String sceneAddress = "/scene/" + (i + 1) + "/";
        this.writer.sendOSC(sceneAddress + TAG_EXISTS, scene.doesExist(), dump);
        this.writer.sendOSC(sceneAddress + TAG_NAME, scene.getName(), dump);
        this.writer.sendOSC(sceneAddress + TAG_SELECTED, scene.isSelected(), dump);
    }
}
Also used : ISceneBank(de.mossgrabers.framework.daw.data.bank.ISceneBank) IScene(de.mossgrabers.framework.daw.data.IScene)

Example 14 with ISceneBank

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

the class SessionMode method updateDisplay.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay() {
    final ITextDisplay d = this.surface.getTextDisplay().clearRow(0).clearRow(1);
    final ISceneBank sceneBank = this.model.getSceneBank();
    for (int i = 0; i < 8; i++) {
        final IScene scene = sceneBank.getItem(i);
        final String name = StringUtils.fixASCII(scene.getName());
        d.setCell(1, i, name.isEmpty() ? "Scene " + (i + 1) : name);
    }
    d.done(0).done(1);
}
Also used : ISceneBank(de.mossgrabers.framework.daw.data.bank.ISceneBank) IScene(de.mossgrabers.framework.daw.data.IScene) ITextDisplay(de.mossgrabers.framework.controller.display.ITextDisplay)

Example 15 with ISceneBank

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

the class AbstractSessionView method drawBirdsEyeGrid.

/**
 * Aggregate the content of 8 pads to 1 pads for quick navigation through the clip matrix.
 */
protected void drawBirdsEyeGrid() {
    final ITrackBank tb = this.model.getCurrentTrackBank();
    final ISceneBank sceneBank = this.model.getSceneBank();
    final int numTracks = tb.getPageSize();
    final int numScenes = sceneBank.getPageSize();
    final int sceneCount = sceneBank.getItemCount();
    final int trackCount = tb.getItemCount();
    final int maxScenePads = sceneCount / numScenes + (sceneCount % numScenes > 0 ? 1 : 0);
    final int maxTrackPads = trackCount / numTracks + (trackCount % numTracks > 0 ? 1 : 0);
    final int scenePosition = sceneBank.getScrollPosition();
    final int trackPosition = tb.getItem(0).getPosition();
    final int sceneSelection = scenePosition / numScenes + (scenePosition % numScenes > 0 ? 1 : 0);
    final int trackSelection = trackPosition / numTracks + (trackPosition % numTracks > 0 ? 1 : 0);
    final boolean flipSession = this.surface.getConfiguration().isFlipSession();
    int selX = flipSession ? sceneSelection : trackSelection;
    int selY = flipSession ? trackSelection : sceneSelection;
    final int padsX = flipSession ? this.rows : this.columns;
    final int padsY = flipSession ? this.columns : this.rows;
    final int offsetX = selX / padsX * padsX;
    final int offsetY = selY / padsY * padsY;
    final int maxX = (flipSession ? maxScenePads : maxTrackPads) - offsetX;
    final int maxY = (flipSession ? maxTrackPads : maxScenePads) - offsetY;
    selX -= offsetX;
    selY -= offsetY;
    final IPadGrid padGrid = this.surface.getPadGrid();
    for (int x = 0; x < this.columns; x++) {
        final LightInfo rowColor = x < maxX ? this.birdColorHasContent : this.clipColorHasNoContent;
        for (int y = 0; y < this.rows; y++) {
            LightInfo color = y < maxY ? rowColor : this.clipColorHasNoContent;
            if (selX == x && selY == y)
                color = this.birdColorSelected;
            padGrid.lightEx(x, y, color.getColor(), color.getBlinkColor(), color.isFast());
        }
    }
}
Also used : ISceneBank(de.mossgrabers.framework.daw.data.bank.ISceneBank) IPadGrid(de.mossgrabers.framework.controller.grid.IPadGrid) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank) LightInfo(de.mossgrabers.framework.controller.grid.LightInfo)

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