use of de.mossgrabers.framework.daw.data.IScene in project DrivenByMoss by git-moss.
the class PadModeSelectView method onButton.
/**
* {@inheritDoc}
*/
@Override
public void onButton(final ButtonID buttonID, final ButtonEvent event, final int velocity) {
if (!ButtonID.isSceneButton(buttonID))
return;
if (event == ButtonEvent.UP) {
this.surface.getViewManager().restore();
if (this.isConsumed)
return;
final ISceneBank sceneBank = this.model.getCurrentTrackBank().getSceneBank();
final int index = buttonID.ordinal() - ButtonID.SCENE1.ordinal();
final IScene scene = sceneBank.getItem(index);
scene.select();
scene.launch();
} else if (event == ButtonEvent.LONG)
this.isConsumed = true;
}
use of de.mossgrabers.framework.daw.data.IScene in project DrivenByMoss by git-moss.
the class MaschineJamStartSceneCommand method getButtonColor.
/**
* Get the index of the color to use for current state.
*
* @return The index of the button color
*/
public int getButtonColor() {
final MaschineColorManager colorManager = (MaschineColorManager) this.model.getColorManager();
if (this.surface.isPressed(ButtonID.SEQUENCER)) {
if (SEQUENCER_VIEWS[this.index] == null)
return colorManager.getColorIndex(ColorManager.BUTTON_STATE_OFF);
return this.surface.getViewManager().isActive(SEQUENCER_VIEWS[this.index]) ? MaschineColorManager.COLOR_GREEN : MaschineColorManager.COLOR_GREY;
}
if (this.surface.isPressed(ButtonID.NOTE)) {
if (PLAY_VIEWS[this.index] == null)
return colorManager.getColorIndex(ColorManager.BUTTON_STATE_OFF);
return this.surface.getViewManager().isActive(PLAY_VIEWS[this.index]) ? MaschineColorManager.COLOR_BLUE : MaschineColorManager.COLOR_GREY;
}
final IScene scene = this.getScene();
if (scene.doesExist())
return colorManager.dimOrHighlightColor(scene.getColor(), scene.isSelected());
return 0;
}
use of de.mossgrabers.framework.daw.data.IScene in project DrivenByMoss by git-moss.
the class SessionView method onButton.
/**
* {@inheritDoc}
*/
@Override
public void onButton(final ButtonID buttonID, final ButtonEvent event, final int velocity) {
final ISceneBank sceneBank = this.model.getCurrentTrackBank().getSceneBank();
if (buttonID == ButtonID.ARROW_UP || buttonID == ButtonID.ARROW_DOWN) {
if (event != ButtonEvent.UP)
return;
if (buttonID == ButtonID.ARROW_UP)
sceneBank.scrollBackwards();
else
sceneBank.scrollForwards();
return;
}
if (!ButtonID.isSceneButton(buttonID))
return;
final int index = buttonID.ordinal() - ButtonID.SCENE1.ordinal();
if (event == ButtonEvent.DOWN) {
if (index == 1)
this.surface.getViewManager().setActive(Views.CONTROL);
return;
}
if (event == ButtonEvent.UP) {
final IScene scene = sceneBank.getItem(index);
scene.select();
scene.launch();
}
}
use of de.mossgrabers.framework.daw.data.IScene in project DrivenByMoss by git-moss.
the class SessionView method onButton.
/**
* {@inheritDoc}
*/
@Override
public void onButton(final ButtonID buttonID, final ButtonEvent event, final int velocity) {
if (!ButtonID.isSceneButton(buttonID))
return;
final int index = buttonID.ordinal() - ButtonID.SCENE1.ordinal();
final ISceneBank sceneBank = this.model.getCurrentTrackBank().getSceneBank();
if (this.surface.isShiftPressed()) {
if (event != ButtonEvent.UP)
return;
if (index == 0)
sceneBank.selectPreviousPage();
else
sceneBank.selectNextPage();
return;
}
if (event == ButtonEvent.DOWN) {
if (index == 1)
this.surface.getViewManager().setActive(Views.CONTROL);
return;
}
if (event == ButtonEvent.UP) {
final IScene scene = sceneBank.getItem(index);
scene.select();
scene.launch();
}
}
Aggregations