Search in sources :

Example 26 with IScene

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

the class SessionView method getSoloButtonColor.

/**
 * {@inheritDoc}
 */
@Override
public int getSoloButtonColor(final int index) {
    final ISceneBank sceneBank = this.model.getSceneBank();
    final IScene s = sceneBank.getItem(index);
    return s.doesExist() && s.isSelected() ? 4 : 0;
}
Also used : ISceneBank(de.mossgrabers.framework.daw.data.bank.ISceneBank) IScene(de.mossgrabers.framework.daw.data.IScene)

Example 27 with IScene

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

the class SceneModule method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final String command, final LinkedList<String> path, final Object value) throws IllegalParameterException, UnknownCommandException, MissingCommandException {
    if (!"scene".equals(command))
        throw new UnknownCommandException(command);
    final String sceneCommand = getSubCommand(path);
    final ISceneBank sceneBank = this.model.getCurrentTrackBank().getSceneBank();
    switch(sceneCommand) {
        case "bank":
            final String subCommand2 = getSubCommand(path);
            switch(subCommand2) {
                case "+":
                    if (isTrigger(value))
                        sceneBank.selectNextPage();
                    break;
                case "-":
                    if (isTrigger(value))
                        sceneBank.selectPreviousPage();
                    break;
                default:
                    throw new UnknownCommandException(subCommand2);
            }
            break;
        case "+":
            if (isTrigger(value))
                sceneBank.scrollForwards();
            break;
        case "-":
            if (isTrigger(value))
                sceneBank.scrollBackwards();
            break;
        case "create":
            if (isTrigger(value))
                this.model.getProject().createSceneFromPlayingLauncherClips();
            break;
        case "add":
            if (isTrigger(value))
                this.model.getProject().createScene();
            break;
        default:
            final int sceneIndex = Integer.parseInt(sceneCommand);
            final IScene scene = sceneBank.getItem(sceneIndex - 1);
            final String sceneCommand2 = getSubCommand(path);
            switch(sceneCommand2) {
                case "launch":
                    scene.launch();
                    break;
                case TAG_DUPLICATE:
                    scene.duplicate();
                    break;
                case TAG_REMOVE:
                    scene.remove();
                    break;
                default:
                    throw new UnknownCommandException(sceneCommand2);
            }
            break;
    }
}
Also used : ISceneBank(de.mossgrabers.framework.daw.data.bank.ISceneBank) IScene(de.mossgrabers.framework.daw.data.IScene) UnknownCommandException(de.mossgrabers.controller.osc.exception.UnknownCommandException)

Example 28 with IScene

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

the class ScenePlayView method onGridNote.

/**
 * {@inheritDoc}
 */
@Override
public void onGridNote(final int note, final int velocity) {
    if (velocity == 0)
        return;
    final IScene scene = this.sceneBank.getItem(note - 36);
    if (this.isButtonCombination(ButtonID.DUPLICATE)) {
        scene.duplicate();
        return;
    }
    if (this.isButtonCombination(ButtonID.DELETE)) {
        scene.remove();
        return;
    }
    scene.launch();
    scene.select();
}
Also used : IScene(de.mossgrabers.framework.daw.data.IScene)

Example 29 with IScene

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

the class SessionView method getButtonColor.

/**
 * {@inheritDoc}
 */
@Override
public int getButtonColor(final ButtonID buttonID) {
    if (!ButtonID.isSceneButton(buttonID))
        return super.getButtonColor(buttonID);
    final ColorManager colorManager = this.model.getColorManager();
    final IScene s = this.model.getSceneBank().getItem(buttonID.ordinal() - ButtonID.SCENE1.ordinal());
    if (!s.doesExist())
        return colorManager.getColorIndex(AbstractSessionView.COLOR_SCENE_OFF);
    return colorManager.getColorIndex(s.isSelected() ? AbstractSessionView.COLOR_SELECTED_SCENE : AbstractSessionView.COLOR_SCENE);
}
Also used : IScene(de.mossgrabers.framework.daw.data.IScene) ColorManager(de.mossgrabers.framework.controller.color.ColorManager) SLMkIIIColorManager(de.mossgrabers.controller.novation.slmkiii.controller.SLMkIIIColorManager)

Example 30 with IScene

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

the class SceneView method drawGrid.

/**
 * {@inheritDoc}
 */
@Override
public void drawGrid() {
    final IPadGrid padGrid = this.surface.getPadGrid();
    final ISceneBank sceneBank = this.model.getSceneBank();
    for (int i = 0; i < 16; i++) {
        final IScene item = sceneBank.getItem(i);
        final int x = i % 4;
        final int y = 3 - i / 4;
        if (item.doesExist()) {
            if (item.isSelected())
                padGrid.lightEx(x, y, MaschineColorManager.COLOR_WHITE);
            else
                padGrid.lightEx(x, y, DAWColor.getColorIndex(item.getColor()));
        } else
            padGrid.lightEx(x, y, AbstractFeatureGroup.BUTTON_COLOR_OFF);
    }
}
Also used : IPadGrid(de.mossgrabers.framework.controller.grid.IPadGrid) 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