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();
}
use of de.mossgrabers.framework.daw.data.IScene in project DrivenByMoss by git-moss.
the class StartSceneCommand method executeNormal.
/**
* {@inheritDoc}
*/
@Override
public void executeNormal(final ButtonEvent event) {
if (event != ButtonEvent.DOWN)
return;
final IScene scene = this.getScene();
if (!scene.doesExist())
return;
// Delete the scene
if (this.surface.isDeletePressed()) {
scene.remove();
return;
}
// Launch or select the scene
final boolean selectPressed = this.surface.isSelectPressed();
if (selectPressed)
this.mvHelper.delayDisplay(scene::getName);
else
scene.launch();
if (selectPressed || this.surface.getConfiguration().isSelectClipOnLaunch())
scene.select();
}
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 AbstractSessionView.COLOR_SCENE_OFF;
if (s.isSelected())
return AbstractSessionView.COLOR_SELECTED_SCENE;
return this.useClipColor ? DAWColor.getColorIndex(s.getColor()) : AbstractSessionView.COLOR_SCENE;
}
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) {
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;
}
}
Aggregations