use of de.mossgrabers.framework.controller.color.ColorManager in project DrivenByMoss by git-moss.
the class SessionViewSelectMode method updateFirstRow.
/**
* {@inheritDoc}
*/
@Override
public void updateFirstRow() {
final ColorManager colorManager = this.model.getColorManager();
final ViewManager viewManager = this.surface.getViewManager();
for (int i = 0; i < 8; i++) this.surface.updateButton(20 + i, colorManager.getColor(VIEWS[i] == null ? AbstractMode.BUTTON_COLOR_OFF : this.isSelected(viewManager, i) ? AbstractMode.BUTTON_COLOR_HI : AbstractMode.BUTTON_COLOR_ON));
}
use of de.mossgrabers.framework.controller.color.ColorManager in project DrivenByMoss by git-moss.
the class FixedMode method updateFirstRow.
/**
* {@inheritDoc}
*/
@Override
public void updateFirstRow() {
final ColorManager colorManager = this.model.getColorManager();
final Configuration configuration = this.surface.getConfiguration();
for (int i = 0; i < 8; i++) this.surface.updateButton(20 + i, colorManager.getColor(configuration.getNewClipLength() == i ? AbstractMode.BUTTON_COLOR_HI : AbstractMode.BUTTON_COLOR_ON));
}
use of de.mossgrabers.framework.controller.color.ColorManager in project DrivenByMoss by git-moss.
the class MidiModule method getNoteColor.
/**
* Get the color for a note.
*
* @param note The note
* @return The color
*/
private ColorEx getNoteColor(final int note) {
final ColorManager colorManager = this.model.getColorManager();
final boolean isKeyboardEnabled = this.model.canSelectedTrackHoldNotes();
if (!isKeyboardEnabled)
return ColorEx.BLACK;
if (this.keyManager.isKeyPressed(note))
return this.model.hasRecordingState() ? ColorEx.RED : ColorEx.GREEN;
final ITrack cursorTrack = this.model.getCursorTrack();
final String colorID = AbstractView.replaceOctaveColorWithTrackColor(cursorTrack, this.keyManager.getColor(note));
final int colorIndex = colorManager.getColorIndex(colorID);
return colorManager.getColor(colorIndex, null);
}
use of de.mossgrabers.framework.controller.color.ColorManager 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;
}
}
use of de.mossgrabers.framework.controller.color.ColorManager in project DrivenByMoss by git-moss.
the class PlayView method drawGrid.
/**
* {@inheritDoc}
*/
@Override
public void drawGrid() {
final boolean isKeyboardEnabled = this.model.canSelectedTrackHoldNotes();
final PadGrid padGrid = this.surface.getPadGrid();
final ColorManager colorManager = this.model.getColorManager();
for (int i = 36; i < 52; i++) padGrid.light(i, isKeyboardEnabled ? this.pressedKeys[i] > 0 ? BeatstepColors.BEATSTEP_BUTTON_STATE_PINK : colorManager.getColor(this.scales.getColor(this.noteMap, i)) : BeatstepColors.BEATSTEP_BUTTON_STATE_OFF);
}
Aggregations