Search in sources :

Example 6 with IScene

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

the class PlayView 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 7 with IScene

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

the class ScenePlayView method drawGrid.

/**
 * {@inheritDoc}
 */
@Override
public void drawGrid() {
    final IPadGrid padGrid = this.surface.getPadGrid();
    final boolean isPush2 = this.surface.getConfiguration().isPush2();
    for (int i = 0; i < 64; i++) {
        final IScene scene = this.sceneBank.getItem(i);
        if (scene.isSelected())
            padGrid.light(36 + i, isPush2 ? PushColorManager.PUSH2_COLOR2_WHITE : PushColorManager.PUSH1_COLOR2_WHITE);
        else {
            final String color = scene.doesExist() ? DAWColor.getColorIndex(scene.getColor()) : IPadGrid.GRID_OFF;
            padGrid.light(36 + i, color);
        }
    }
}
Also used : IPadGrid(de.mossgrabers.framework.controller.grid.IPadGrid) IScene(de.mossgrabers.framework.daw.data.IScene)

Example 8 with IScene

use of de.mossgrabers.framework.daw.data.IScene 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 9 with IScene

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

the class SessionMode method updateDisplay1Scenes.

private void updateDisplay1Scenes(final ITextDisplay display) {
    final int maxCols = 8;
    final int maxRows = this.rowDisplayMode == RowDisplayMode.ALL ? 8 : 4;
    for (int col = 0; col < maxCols; col++) {
        for (int row = 0; row < maxRows; row++) {
            int sceneIndex = (maxRows - 1 - row) * 8 + col;
            if (this.rowDisplayMode == RowDisplayMode.LOWER)
                sceneIndex += 32;
            final IScene scene = this.sceneBank.getItem(sceneIndex);
            if (!scene.doesExist())
                continue;
            final boolean isSel = scene.isSelected();
            final String n = StringUtils.shortenAndFixASCII(scene.getName(8), isSel ? 7 : 8);
            display.setCell(row, col, isSel ? Push1Display.SELECT_ARROW + n : n);
        }
    }
}
Also used : IScene(de.mossgrabers.framework.daw.data.IScene)

Example 10 with IScene

use of de.mossgrabers.framework.daw.data.IScene 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)

Aggregations

IScene (de.mossgrabers.framework.daw.data.IScene)34 ISceneBank (de.mossgrabers.framework.daw.data.bank.ISceneBank)20 ColorManager (de.mossgrabers.framework.controller.color.ColorManager)2 IPadGrid (de.mossgrabers.framework.controller.grid.IPadGrid)2 ISceneBank (de.mossgrabers.framework.daw.ISceneBank)2 FlexiHandlerException (de.mossgrabers.controller.generic.flexihandler.utils.FlexiHandlerException)1 MaschineColorManager (de.mossgrabers.controller.ni.maschine.core.MaschineColorManager)1 LaunchkeyMiniMk3ColorManager (de.mossgrabers.controller.novation.launchkey.mini.controller.LaunchkeyMiniMk3ColorManager)1 SLMkIIIColorManager (de.mossgrabers.controller.novation.slmkiii.controller.SLMkIIIColorManager)1 UnknownCommandException (de.mossgrabers.controller.osc.exception.UnknownCommandException)1 Display (de.mossgrabers.framework.controller.display.Display)1 ITextDisplay (de.mossgrabers.framework.controller.display.ITextDisplay)1 ITrackBank (de.mossgrabers.framework.daw.data.bank.ITrackBank)1