use of de.mossgrabers.framework.daw.data.bank.ISceneBank in project DrivenByMoss by git-moss.
the class SessionView method getButtonColor.
/**
* {@inheritDoc}
*/
@Override
public int getButtonColor(final ButtonID buttonID) {
final ISceneBank sceneBank = this.model.getSceneBank();
final ColorManager colorManager = this.model.getColorManager();
if (buttonID == ButtonID.ARROW_UP || buttonID == ButtonID.ARROW_DOWN) {
final boolean isOn = buttonID == ButtonID.ARROW_UP ? sceneBank.canScrollPageBackwards() : sceneBank.canScrollPageForwards();
return isOn ? LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_GREEN : LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_GREY_LO;
}
if (!ButtonID.isSceneButton(buttonID))
return LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_BLACK;
if (buttonID == ButtonID.SCENE1)
return colorManager.getColorIndex(getSceneColor(sceneBank.getItem(0)));
if (this.padMode == null)
return colorManager.getColorIndex(getSceneColor(sceneBank.getItem(1)));
switch(this.padMode) {
case REC_ARM:
return LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_RED_HI;
case TRACK_SELECT:
return LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_WHITE;
case MUTE:
return LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_AMBER_HI;
case SOLO:
return LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_YELLOW_HI;
case STOP_CLIP:
return LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_ROSE;
default:
return LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_BLACK;
}
}
use of de.mossgrabers.framework.daw.data.bank.ISceneBank 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.bank.ISceneBank 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();
}
}
use of de.mossgrabers.framework.daw.data.bank.ISceneBank 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);
}
}
use of de.mossgrabers.framework.daw.data.bank.ISceneBank 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;
}
Aggregations