Search in sources :

Example 1 with MaschineColorManager

use of de.mossgrabers.controller.ni.maschine.core.MaschineColorManager in project DrivenByMoss by git-moss.

the class MaschineJamStartSceneCommand method getButtonColor.

/**
 * Get the index of the color to use for current state.
 *
 * @return The index of the button color
 */
public int getButtonColor() {
    final MaschineColorManager colorManager = (MaschineColorManager) this.model.getColorManager();
    if (this.surface.isPressed(ButtonID.SEQUENCER)) {
        if (SEQUENCER_VIEWS[this.index] == null)
            return colorManager.getColorIndex(ColorManager.BUTTON_STATE_OFF);
        return this.surface.getViewManager().isActive(SEQUENCER_VIEWS[this.index]) ? MaschineColorManager.COLOR_GREEN : MaschineColorManager.COLOR_GREY;
    }
    if (this.surface.isPressed(ButtonID.NOTE)) {
        if (PLAY_VIEWS[this.index] == null)
            return colorManager.getColorIndex(ColorManager.BUTTON_STATE_OFF);
        return this.surface.getViewManager().isActive(PLAY_VIEWS[this.index]) ? MaschineColorManager.COLOR_BLUE : MaschineColorManager.COLOR_GREY;
    }
    final IScene scene = this.getScene();
    if (scene.doesExist())
        return colorManager.dimOrHighlightColor(scene.getColor(), scene.isSelected());
    return 0;
}
Also used : IScene(de.mossgrabers.framework.daw.data.IScene) MaschineColorManager(de.mossgrabers.controller.ni.maschine.core.MaschineColorManager)

Aggregations

MaschineColorManager (de.mossgrabers.controller.ni.maschine.core.MaschineColorManager)1 IScene (de.mossgrabers.framework.daw.data.IScene)1