use of de.mossgrabers.framework.daw.data.IScene in project DrivenByMoss by git-moss.
the class SessionView method getSoloButtonColor.
/**
* {@inheritDoc}
*/
@Override
public int getSoloButtonColor(final int index) {
final ISceneBank sceneBank = this.model.getSceneBank();
final IScene s = sceneBank.getItem(index);
return s.doesExist() && s.isSelected() ? 4 : 0;
}
use of de.mossgrabers.framework.daw.data.IScene in project DrivenByMoss by git-moss.
the class SceneModule method execute.
/**
* {@inheritDoc}
*/
@Override
public void execute(final String command, final LinkedList<String> path, final Object value) throws IllegalParameterException, UnknownCommandException, MissingCommandException {
if (!"scene".equals(command))
throw new UnknownCommandException(command);
final String sceneCommand = getSubCommand(path);
final ISceneBank sceneBank = this.model.getCurrentTrackBank().getSceneBank();
switch(sceneCommand) {
case "bank":
final String subCommand2 = getSubCommand(path);
switch(subCommand2) {
case "+":
if (isTrigger(value))
sceneBank.selectNextPage();
break;
case "-":
if (isTrigger(value))
sceneBank.selectPreviousPage();
break;
default:
throw new UnknownCommandException(subCommand2);
}
break;
case "+":
if (isTrigger(value))
sceneBank.scrollForwards();
break;
case "-":
if (isTrigger(value))
sceneBank.scrollBackwards();
break;
case "create":
if (isTrigger(value))
this.model.getProject().createSceneFromPlayingLauncherClips();
break;
case "add":
if (isTrigger(value))
this.model.getProject().createScene();
break;
default:
final int sceneIndex = Integer.parseInt(sceneCommand);
final IScene scene = sceneBank.getItem(sceneIndex - 1);
final String sceneCommand2 = getSubCommand(path);
switch(sceneCommand2) {
case "launch":
scene.launch();
break;
case TAG_DUPLICATE:
scene.duplicate();
break;
case TAG_REMOVE:
scene.remove();
break;
default:
throw new UnknownCommandException(sceneCommand2);
}
break;
}
}
use of de.mossgrabers.framework.daw.data.IScene in project DrivenByMoss by git-moss.
the class ScenePlayView method onGridNote.
/**
* {@inheritDoc}
*/
@Override
public void onGridNote(final int note, final int velocity) {
if (velocity == 0)
return;
final IScene scene = this.sceneBank.getItem(note - 36);
if (this.isButtonCombination(ButtonID.DUPLICATE)) {
scene.duplicate();
return;
}
if (this.isButtonCombination(ButtonID.DELETE)) {
scene.remove();
return;
}
scene.launch();
scene.select();
}
use of de.mossgrabers.framework.daw.data.IScene in project DrivenByMoss by git-moss.
the class SessionView method getButtonColor.
/**
* {@inheritDoc}
*/
@Override
public int getButtonColor(final ButtonID buttonID) {
if (!ButtonID.isSceneButton(buttonID))
return super.getButtonColor(buttonID);
final ColorManager colorManager = this.model.getColorManager();
final IScene s = this.model.getSceneBank().getItem(buttonID.ordinal() - ButtonID.SCENE1.ordinal());
if (!s.doesExist())
return colorManager.getColorIndex(AbstractSessionView.COLOR_SCENE_OFF);
return colorManager.getColorIndex(s.isSelected() ? AbstractSessionView.COLOR_SELECTED_SCENE : AbstractSessionView.COLOR_SCENE);
}
use of de.mossgrabers.framework.daw.data.IScene in project DrivenByMoss by git-moss.
the class SceneView method drawGrid.
/**
* {@inheritDoc}
*/
@Override
public void drawGrid() {
final IPadGrid padGrid = this.surface.getPadGrid();
final ISceneBank sceneBank = this.model.getSceneBank();
for (int i = 0; i < 16; i++) {
final IScene item = sceneBank.getItem(i);
final int x = i % 4;
final int y = 3 - i / 4;
if (item.doesExist()) {
if (item.isSelected())
padGrid.lightEx(x, y, MaschineColorManager.COLOR_WHITE);
else
padGrid.lightEx(x, y, DAWColor.getColorIndex(item.getColor()));
} else
padGrid.lightEx(x, y, AbstractFeatureGroup.BUTTON_COLOR_OFF);
}
}
Aggregations