Search in sources :

Example 1 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 ISceneBank sceneBank = this.trackBank.getSceneBank();
    for (int i = 0; i < 64; i++) {
        final IScene scene = sceneBank.getScene(i);
        final String color = scene.doesExist() ? this.trackBank.getColorOfFirstClipInScene(i) : PadGrid.GRID_OFF;
        this.surface.getPadGrid().light(36 + i, color);
    }
}
Also used : ISceneBank(de.mossgrabers.framework.daw.ISceneBank) IScene(de.mossgrabers.framework.daw.data.IScene)

Example 2 with IScene

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

the class SessionMode method updateDisplay.

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

Example 3 with IScene

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

the class SceneHandler method handle.

/**
 * {@inheritDoc}
 */
@Override
public void handle(final FlexiCommand command, final KnobMode knobMode, final MidiValue value) {
    final boolean isButtonPressed = this.isButtonPressed(knobMode, value);
    switch(command) {
        // Scene 1-8: Launch Scene
        case SCENE_1_LAUNCH_SCENE:
        case SCENE_2_LAUNCH_SCENE:
        case SCENE_3_LAUNCH_SCENE:
        case SCENE_4_LAUNCH_SCENE:
        case SCENE_5_LAUNCH_SCENE:
        case SCENE_6_LAUNCH_SCENE:
        case SCENE_7_LAUNCH_SCENE:
        case SCENE_8_LAUNCH_SCENE:
            if (isButtonPressed) {
                final IScene scene = this.model.getSceneBank().getItem(command.ordinal() - FlexiCommand.SCENE_1_LAUNCH_SCENE.ordinal());
                scene.select();
                scene.launch();
            }
            break;
        // Scene: Select Previous Bank
        case SCENE_SELECT_PREVIOUS_BANK:
            if (isButtonPressed)
                this.model.getSceneBank().selectPreviousPage();
            break;
        // Scene: Select Next Bank
        case SCENE_SELECT_NEXT_BANK:
            if (isButtonPressed)
                this.model.getSceneBank().selectNextPage();
            break;
        // Scene: Create Scene
        case SCENE_CREATE_SCENE:
            if (isButtonPressed)
                this.model.getProject().createScene();
            break;
        // Scene: Create Scene from playing Clips
        case SCENE_CREATE_SCENE_FROM_PLAYING_CLIPS:
            if (isButtonPressed)
                this.model.getProject().createSceneFromPlayingLauncherClips();
            break;
        default:
            throw new FlexiHandlerException(command);
    }
}
Also used : IScene(de.mossgrabers.framework.daw.data.IScene) FlexiHandlerException(de.mossgrabers.controller.generic.flexihandler.utils.FlexiHandlerException)

Example 4 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 index = buttonID.ordinal() - ButtonID.SCENE1.ordinal();
    if (index >= 0 || index < 8) {
        final ITrackBank tb = this.model.getCurrentTrackBank();
        final ISceneBank sceneBank = tb.getSceneBank();
        final IScene s = sceneBank.getItem(index);
        if (s.doesExist())
            return DAWColor.getColorIndex(s.getColor());
    }
    return AbstractFeatureGroup.BUTTON_COLOR_OFF;
}
Also used : ISceneBank(de.mossgrabers.framework.daw.data.bank.ISceneBank) IScene(de.mossgrabers.framework.daw.data.IScene) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank)

Example 5 with IScene

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

the class StartSceneCommand method getScene.

/**
 * Get the related scene.
 *
 * @return The scene
 */
public IScene getScene() {
    final ISceneBank sceneBank = this.model.getSceneBank();
    if (this.index >= 0)
        return sceneBank.getItem(this.index);
    final Optional<IScene> sceneOptional = sceneBank.getSelectedItem();
    return sceneOptional.isEmpty() ? EmptyScene.INSTANCE : sceneOptional.get();
}
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