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;
}
Aggregations