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 ISceneBank sceneBank = this.trackBank.getSceneBank();
for (int i = 0; i < 64; i++) {
final IScene scene = sceneBank.getScene(i);
final String color = scene.doesExist() ? this.trackBank.getColorOfFirstClipInScene(i) : PadGrid.GRID_OFF;
this.surface.getPadGrid().light(36 + i, color);
}
}
use of de.mossgrabers.framework.daw.data.IScene in project DrivenByMoss by git-moss.
the class SessionMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
final Display d = this.surface.getDisplay();
final ISceneBank sceneBank = this.model.getSceneBank();
for (int i = 0; i < 8; i++) {
final IScene scene = sceneBank.getScene(i);
final String name = StringUtils.fixASCII(scene.getName());
d.setCell(2, i, name.isEmpty() ? "Scene " + (i + 1) : name);
}
d.clearRow(0).done(0).done(2);
}
use of de.mossgrabers.framework.daw.data.IScene in project DrivenByMoss by git-moss.
the class SceneHandler method handle.
/**
* {@inheritDoc}
*/
@Override
public void handle(final FlexiCommand command, final KnobMode knobMode, final MidiValue value) {
final boolean isButtonPressed = this.isButtonPressed(knobMode, value);
switch(command) {
// Scene 1-8: Launch Scene
case SCENE_1_LAUNCH_SCENE:
case SCENE_2_LAUNCH_SCENE:
case SCENE_3_LAUNCH_SCENE:
case SCENE_4_LAUNCH_SCENE:
case SCENE_5_LAUNCH_SCENE:
case SCENE_6_LAUNCH_SCENE:
case SCENE_7_LAUNCH_SCENE:
case SCENE_8_LAUNCH_SCENE:
if (isButtonPressed) {
final IScene scene = this.model.getSceneBank().getItem(command.ordinal() - FlexiCommand.SCENE_1_LAUNCH_SCENE.ordinal());
scene.select();
scene.launch();
}
break;
// Scene: Select Previous Bank
case SCENE_SELECT_PREVIOUS_BANK:
if (isButtonPressed)
this.model.getSceneBank().selectPreviousPage();
break;
// Scene: Select Next Bank
case SCENE_SELECT_NEXT_BANK:
if (isButtonPressed)
this.model.getSceneBank().selectNextPage();
break;
// Scene: Create Scene
case SCENE_CREATE_SCENE:
if (isButtonPressed)
this.model.getProject().createScene();
break;
// Scene: Create Scene from playing Clips
case SCENE_CREATE_SCENE_FROM_PLAYING_CLIPS:
if (isButtonPressed)
this.model.getProject().createSceneFromPlayingLauncherClips();
break;
default:
throw new FlexiHandlerException(command);
}
}
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 index = buttonID.ordinal() - ButtonID.SCENE1.ordinal();
if (index >= 0 || index < 8) {
final ITrackBank tb = this.model.getCurrentTrackBank();
final ISceneBank sceneBank = tb.getSceneBank();
final IScene s = sceneBank.getItem(index);
if (s.doesExist())
return DAWColor.getColorIndex(s.getColor());
}
return AbstractFeatureGroup.BUTTON_COLOR_OFF;
}
use of de.mossgrabers.framework.daw.data.IScene in project DrivenByMoss by git-moss.
the class StartSceneCommand method getScene.
/**
* Get the related scene.
*
* @return The scene
*/
public IScene getScene() {
final ISceneBank sceneBank = this.model.getSceneBank();
if (this.index >= 0)
return sceneBank.getItem(this.index);
final Optional<IScene> sceneOptional = sceneBank.getSelectedItem();
return sceneOptional.isEmpty() ? EmptyScene.INSTANCE : sceneOptional.get();
}
Aggregations