use of de.mossgrabers.framework.daw.data.bank.ISceneBank 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;
}
use of de.mossgrabers.framework.daw.data.bank.ISceneBank 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.bank.ISceneBank in project DrivenByMoss by git-moss.
the class SceneModule method flush.
/**
* {@inheritDoc}
*/
@Override
public void flush(final boolean dump) {
final ISceneBank sceneBank = this.model.getSceneBank();
for (int i = 0; i < sceneBank.getPageSize(); i++) {
final IScene scene = sceneBank.getItem(i);
final String sceneAddress = "/scene/" + (i + 1) + "/";
this.writer.sendOSC(sceneAddress + TAG_EXISTS, scene.doesExist(), dump);
this.writer.sendOSC(sceneAddress + TAG_NAME, scene.getName(), dump);
this.writer.sendOSC(sceneAddress + TAG_SELECTED, scene.isSelected(), dump);
}
}
use of de.mossgrabers.framework.daw.data.bank.ISceneBank in project DrivenByMoss by git-moss.
the class SessionMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
final ITextDisplay d = this.surface.getTextDisplay().clearRow(0).clearRow(1);
final ISceneBank sceneBank = this.model.getSceneBank();
for (int i = 0; i < 8; i++) {
final IScene scene = sceneBank.getItem(i);
final String name = StringUtils.fixASCII(scene.getName());
d.setCell(1, i, name.isEmpty() ? "Scene " + (i + 1) : name);
}
d.done(0).done(1);
}
use of de.mossgrabers.framework.daw.data.bank.ISceneBank in project DrivenByMoss by git-moss.
the class AbstractSessionView method drawBirdsEyeGrid.
/**
* Aggregate the content of 8 pads to 1 pads for quick navigation through the clip matrix.
*/
protected void drawBirdsEyeGrid() {
final ITrackBank tb = this.model.getCurrentTrackBank();
final ISceneBank sceneBank = this.model.getSceneBank();
final int numTracks = tb.getPageSize();
final int numScenes = sceneBank.getPageSize();
final int sceneCount = sceneBank.getItemCount();
final int trackCount = tb.getItemCount();
final int maxScenePads = sceneCount / numScenes + (sceneCount % numScenes > 0 ? 1 : 0);
final int maxTrackPads = trackCount / numTracks + (trackCount % numTracks > 0 ? 1 : 0);
final int scenePosition = sceneBank.getScrollPosition();
final int trackPosition = tb.getItem(0).getPosition();
final int sceneSelection = scenePosition / numScenes + (scenePosition % numScenes > 0 ? 1 : 0);
final int trackSelection = trackPosition / numTracks + (trackPosition % numTracks > 0 ? 1 : 0);
final boolean flipSession = this.surface.getConfiguration().isFlipSession();
int selX = flipSession ? sceneSelection : trackSelection;
int selY = flipSession ? trackSelection : sceneSelection;
final int padsX = flipSession ? this.rows : this.columns;
final int padsY = flipSession ? this.columns : this.rows;
final int offsetX = selX / padsX * padsX;
final int offsetY = selY / padsY * padsY;
final int maxX = (flipSession ? maxScenePads : maxTrackPads) - offsetX;
final int maxY = (flipSession ? maxTrackPads : maxScenePads) - offsetY;
selX -= offsetX;
selY -= offsetY;
final IPadGrid padGrid = this.surface.getPadGrid();
for (int x = 0; x < this.columns; x++) {
final LightInfo rowColor = x < maxX ? this.birdColorHasContent : this.clipColorHasNoContent;
for (int y = 0; y < this.rows; y++) {
LightInfo color = y < maxY ? rowColor : this.clipColorHasNoContent;
if (selX == x && selY == y)
color = this.birdColorSelected;
padGrid.lightEx(x, y, color.getColor(), color.getBlinkColor(), color.isFast());
}
}
}
Aggregations