use of de.mossgrabers.framework.daw.data.IScene in project DrivenByMoss by git-moss.
the class PlayView method getButtonColorID.
/**
* {@inheritDoc}
*/
@Override
public String getButtonColorID(final ButtonID buttonID) {
if (!ButtonID.isSceneButton(buttonID))
return AbstractFeatureGroup.BUTTON_COLOR_OFF;
if (this.surface.isPressed(ButtonID.REPEAT))
return NoteRepeatSceneHelper.getButtonColorID(this.surface, buttonID);
final ISceneBank sceneBank = this.model.getSceneBank();
final int scene = buttonID.ordinal() - ButtonID.SCENE1.ordinal();
final IScene s = sceneBank.getItem(scene);
if (s.doesExist())
return s.isSelected() ? AbstractSessionView.COLOR_SELECTED_SCENE : AbstractSessionView.COLOR_SCENE;
return AbstractSessionView.COLOR_SCENE_OFF;
}
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 IPadGrid padGrid = this.surface.getPadGrid();
final boolean isPush2 = this.surface.getConfiguration().isPush2();
for (int i = 0; i < 64; i++) {
final IScene scene = this.sceneBank.getItem(i);
if (scene.isSelected())
padGrid.light(36 + i, isPush2 ? PushColorManager.PUSH2_COLOR2_WHITE : PushColorManager.PUSH1_COLOR2_WHITE);
else {
final String color = scene.doesExist() ? DAWColor.getColorIndex(scene.getColor()) : IPadGrid.GRID_OFF;
padGrid.light(36 + i, color);
}
}
}
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 s.isSelected() ? AbstractSessionView.COLOR_SELECTED_SCENE : AbstractSessionView.COLOR_SCENE;
return AbstractSessionView.COLOR_SCENE_OFF;
}
use of de.mossgrabers.framework.daw.data.IScene in project DrivenByMoss by git-moss.
the class SessionMode method updateDisplay1Scenes.
private void updateDisplay1Scenes(final ITextDisplay display) {
final int maxCols = 8;
final int maxRows = this.rowDisplayMode == RowDisplayMode.ALL ? 8 : 4;
for (int col = 0; col < maxCols; col++) {
for (int row = 0; row < maxRows; row++) {
int sceneIndex = (maxRows - 1 - row) * 8 + col;
if (this.rowDisplayMode == RowDisplayMode.LOWER)
sceneIndex += 32;
final IScene scene = this.sceneBank.getItem(sceneIndex);
if (!scene.doesExist())
continue;
final boolean isSel = scene.isSelected();
final String n = StringUtils.shortenAndFixASCII(scene.getName(8), isSel ? 7 : 8);
display.setCell(row, col, isSel ? Push1Display.SELECT_ARROW + n : n);
}
}
}
use of de.mossgrabers.framework.daw.data.IScene in project DrivenByMoss by git-moss.
the class Drum64View method getButtonColorID.
/**
* {@inheritDoc}
*/
@Override
public String getButtonColorID(final ButtonID buttonID) {
if (!ButtonID.isSceneButton(buttonID))
return AbstractFeatureGroup.BUTTON_COLOR_OFF;
if (this.surface.isPressed(ButtonID.REPEAT))
return NoteRepeatSceneHelper.getButtonColorID(this.surface, buttonID);
final ISceneBank sceneBank = this.model.getSceneBank();
final int scene = buttonID.ordinal() - ButtonID.SCENE1.ordinal();
final IScene s = sceneBank.getItem(scene);
if (s.doesExist())
return s.isSelected() ? AbstractSessionView.COLOR_SELECTED_SCENE : AbstractSessionView.COLOR_SCENE;
return AbstractSessionView.COLOR_SCENE_OFF;
}
Aggregations