use of de.mossgrabers.framework.daw.data.bank.ISceneBank in project DrivenByMoss by git-moss.
the class SessionView method onGridNote.
/**
* {@inheritDoc}
*/
@Override
public void onGridNote(final int note, final int velocity) {
if (velocity == 0)
return;
final ISceneBank sceneBank = this.model.getCurrentTrackBank().getSceneBank();
final int index = note - 36;
switch(index) {
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
// Not used
break;
case 6:
sceneBank.selectPreviousPage();
break;
case 7:
sceneBank.selectNextPage();
break;
case 8:
case 9:
case 10:
case 11:
case 12:
case 13:
case 14:
case 15:
sceneBank.getItem(index - 8).launch();
break;
default:
// Not used
break;
}
}
use of de.mossgrabers.framework.daw.data.bank.ISceneBank 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.bank.ISceneBank 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.bank.ISceneBank in project DrivenByMoss by git-moss.
the class ShiftView method getTrackButtonColor.
/**
* {@inheritDoc}
*/
@Override
public int getTrackButtonColor(final int index) {
final ITrackBank tb = this.model.getCurrentTrackBank();
final ISceneBank sceneBank = tb.getSceneBank();
final Modes mode = this.surface.getModeManager().getActiveID();
switch(index) {
case 0:
return sceneBank.canScrollPageBackwards() ? APCminiControlSurface.APC_BUTTON_STATE_ON : APCminiControlSurface.APC_BUTTON_STATE_OFF;
case 1:
return sceneBank.canScrollPageForwards() ? APCminiControlSurface.APC_BUTTON_STATE_ON : APCminiControlSurface.APC_BUTTON_STATE_OFF;
case 2:
return tb.canScrollPageBackwards() ? APCminiControlSurface.APC_BUTTON_STATE_ON : APCminiControlSurface.APC_BUTTON_STATE_OFF;
case 3:
return tb.canScrollPageForwards() ? APCminiControlSurface.APC_BUTTON_STATE_ON : APCminiControlSurface.APC_BUTTON_STATE_OFF;
case 4:
return Modes.VOLUME.equals(mode) ? APCminiControlSurface.APC_BUTTON_STATE_ON : APCminiControlSurface.APC_BUTTON_STATE_OFF;
case 5:
return Modes.PAN.equals(mode) ? APCminiControlSurface.APC_BUTTON_STATE_ON : APCminiControlSurface.APC_BUTTON_STATE_OFF;
case 6:
return Modes.isSendMode(mode) ? APCminiControlSurface.APC_BUTTON_STATE_ON : APCminiControlSurface.APC_BUTTON_STATE_OFF;
case 7:
return Modes.DEVICE_PARAMS.equals(mode) ? APCminiControlSurface.APC_BUTTON_STATE_ON : APCminiControlSurface.APC_BUTTON_STATE_OFF;
default:
// Never reached
break;
}
return APCminiColorManager.APC_COLOR_BLACK;
}
use of de.mossgrabers.framework.daw.data.bank.ISceneBank 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;
}
Aggregations