Search in sources :

Example 16 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 17 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)

Example 18 with IScene

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

the class StartSceneCommand method executeNormal.

/**
 * {@inheritDoc}
 */
@Override
public void executeNormal(final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    final IScene scene = this.getScene();
    if (!scene.doesExist())
        return;
    // Delete the scene
    if (this.surface.isDeletePressed()) {
        scene.remove();
        return;
    }
    // Launch or select the scene
    final boolean selectPressed = this.surface.isSelectPressed();
    if (selectPressed)
        this.mvHelper.delayDisplay(scene::getName);
    else
        scene.launch();
    if (selectPressed || this.surface.getConfiguration().isSelectClipOnLaunch())
        scene.select();
}
Also used : IScene(de.mossgrabers.framework.daw.data.IScene)

Example 19 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 AbstractSessionView.COLOR_SCENE_OFF;
    if (s.isSelected())
        return AbstractSessionView.COLOR_SELECTED_SCENE;
    return this.useClipColor ? DAWColor.getColorIndex(s.getColor()) : AbstractSessionView.COLOR_SCENE;
}
Also used : ISceneBank(de.mossgrabers.framework.daw.data.bank.ISceneBank) IScene(de.mossgrabers.framework.daw.data.IScene)

Example 20 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) {
    final ColorManager colorManager = this.model.getColorManager();
    final int colorScene = colorManager.getColorIndex(AbstractSessionView.COLOR_SCENE);
    final int colorSceneSelected = colorManager.getColorIndex(AbstractSessionView.COLOR_SELECTED_SCENE);
    final int colorSceneOff = colorManager.getColorIndex(AbstractSessionView.COLOR_SCENE_OFF);
    final ISceneBank sceneBank = this.model.getSceneBank();
    IScene s = sceneBank.getItem(0);
    if (buttonID == ButtonID.SCENE1) {
        if (!s.doesExist())
            return colorSceneOff;
        return s.isSelected() ? colorSceneSelected : colorScene;
    }
    if (this.padMode == null) {
        s = sceneBank.getItem(1);
        if (!s.doesExist())
            return colorSceneOff;
        return s.isSelected() ? colorSceneSelected : colorScene;
    }
    switch(this.padMode) {
        case REC_ARM:
            return LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_RED_HI;
        case TRACK_SELECT:
            return LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_WHITE;
        case MUTE:
            return LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_AMBER_HI;
        case SOLO:
            return LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_YELLOW_HI;
        case STOP_CLIP:
            return LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_ROSE;
        default:
            return LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_BLACK;
    }
}
Also used : ISceneBank(de.mossgrabers.framework.daw.data.bank.ISceneBank) IScene(de.mossgrabers.framework.daw.data.IScene) LaunchkeyMiniMk3ColorManager(de.mossgrabers.controller.novation.launchkey.mini.controller.LaunchkeyMiniMk3ColorManager) ColorManager(de.mossgrabers.framework.controller.color.ColorManager)

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