use of de.mossgrabers.framework.featuregroup.ModeManager in project DrivenByMoss by git-moss.
the class AbstractParametersMode method getButtonColorArrowUp.
protected int getButtonColorArrowUp(final ButtonID buttonID) {
final ModeManager modeManager = this.surface.getModeManager();
final boolean isDeviceParams = modeManager.isActive(Modes.DEVICE_PARAMS);
switch(buttonID) {
case ROW1_1:
if (isDeviceParams && ((ParametersMode) modeManager.get(Modes.DEVICE_PARAMS)).isShowDevices())
return SLMkIIIColorManager.SLMKIII_MINT;
return SLMkIIIColorManager.SLMKIII_MINT_HALF;
case ROW1_2:
if (isDeviceParams && !((ParametersMode) modeManager.get(Modes.DEVICE_PARAMS)).isShowDevices())
return SLMkIIIColorManager.SLMKIII_PURPLE;
return SLMkIIIColorManager.SLMKIII_PURPLE_HALF;
case ROW1_8:
return modeManager.isActive(Modes.USER) ? SLMkIIIColorManager.SLMKIII_WHITE : SLMkIIIColorManager.SLMKIII_WHITE_HALF;
default:
return SLMkIIIColorManager.SLMKIII_BLACK;
}
}
use of de.mossgrabers.framework.featuregroup.ModeManager in project DrivenByMoss by git-moss.
the class AbstractParametersMode method drawRow4ArrowUp.
/**
* Draw the row with the mode selection.
*
* @param d The display
*/
protected void drawRow4ArrowUp(final SLMkIIIDisplay d) {
final ModeManager modeManager = this.surface.getModeManager();
for (int i = 0; i < 8; i++) {
d.setCell(3, i, MODE_MENU[i]);
boolean isActive = false;
int color = SLMkIIIColorManager.SLMKIII_BLACK;
final boolean isDeviceParams = modeManager.isActive(Modes.DEVICE_PARAMS);
switch(i) {
case 0:
if (isDeviceParams && ((ParametersMode) modeManager.get(Modes.DEVICE_PARAMS)).isShowDevices())
isActive = true;
color = SLMkIIIColorManager.SLMKIII_MINT;
break;
case 1:
if (isDeviceParams && !((ParametersMode) modeManager.get(Modes.DEVICE_PARAMS)).isShowDevices())
isActive = true;
color = SLMkIIIColorManager.SLMKIII_PURPLE;
break;
case 7:
isActive = modeManager.isActive(Modes.USER);
color = SLMkIIIColorManager.SLMKIII_WHITE;
break;
default:
// Not used
break;
}
d.setPropertyColor(i, 2, color);
d.setPropertyValue(i, 1, isActive ? 1 : 0);
}
}
use of de.mossgrabers.framework.featuregroup.ModeManager in project DrivenByMoss by git-moss.
the class AbstractParametersMode method onButtonArrowUp.
protected void onButtonArrowUp(final int index) {
final ModeManager modeManager = this.surface.getModeManager();
switch(index) {
case 0:
this.surface.getModeManager().setActive(Modes.DEVICE_PARAMS);
((ParametersMode) modeManager.get(Modes.DEVICE_PARAMS)).setShowDevices(true);
break;
case 1:
this.surface.getModeManager().setActive(Modes.DEVICE_PARAMS);
((ParametersMode) modeManager.get(Modes.DEVICE_PARAMS)).setShowDevices(false);
break;
case 7:
this.surface.getModeManager().setActive(Modes.USER);
break;
default:
// Not used
break;
}
this.surface.setTriggerConsumed(ButtonID.ARROW_UP);
}
use of de.mossgrabers.framework.featuregroup.ModeManager in project DrivenByMoss by git-moss.
the class DrumView method onButton.
/**
* {@inheritDoc}
*/
@Override
public void onButton(final ButtonID buttonID, final ButtonEvent event, final int velocity) {
if (!ButtonID.isSceneButton(buttonID) || event != ButtonEvent.DOWN)
return;
if (buttonID == ButtonID.SCENE1) {
this.isPlayMode = !this.isPlayMode;
this.updateNoteMapping();
this.surface.getDisplay().notify(this.isPlayMode ? "Play / Select" : "Steps");
} else {
if (!this.isActive())
return;
final ModeManager modeManager = this.surface.getModeManager();
if (modeManager.isActive(Modes.GROOVE))
modeManager.restore();
else
modeManager.setActive(Modes.GROOVE);
}
}
use of de.mossgrabers.framework.featuregroup.ModeManager in project DrivenByMoss by git-moss.
the class AbstractTrackMode method getButtonColor.
/**
* {@inheritDoc}
*/
@Override
public int getButtonColor(final ButtonID buttonID) {
final ITrackBank tb = this.model.getCurrentTrackBank();
final Optional<ITrack> selectedTrack = tb.getSelectedItem();
if (this.surface.isShiftPressed()) {
switch(buttonID) {
case ROW1_1:
if (selectedTrack.isEmpty())
return SLMkIIIColorManager.SLMKIII_BLACK;
return selectedTrack.get().isActivated() ? SLMkIIIColorManager.SLMKIII_RED : SLMkIIIColorManager.SLMKIII_RED_HALF;
case ROW1_2:
if (selectedTrack.isEmpty())
return SLMkIIIColorManager.SLMKIII_BLACK;
return this.model.getCursorTrack().isPinned() ? SLMkIIIColorManager.SLMKIII_RED : SLMkIIIColorManager.SLMKIII_RED_HALF;
case ROW1_3:
if (selectedTrack.isEmpty())
return SLMkIIIColorManager.SLMKIII_BLACK;
return SLMkIIIColorManager.SLMKIII_RED_HALF;
case ROW1_4:
return SLMkIIIColorManager.SLMKIII_BLACK;
default:
return SLMkIIIColorManager.SLMKIII_RED_HALF;
}
}
final int index = buttonID.ordinal() - ButtonID.ROW1_1.ordinal();
if (this.surface.isLongPressed(ButtonID.ARROW_DOWN)) {
final ModeManager modeManager = this.surface.getModeManager();
return modeManager.isActive(MODES[index]) ? SLMkIIIColorManager.SLMKIII_GREEN : SLMkIIIColorManager.SLMKIII_GREEN_HALF;
}
final ITrack t = tb.getItem(index);
if (t.doesExist()) {
if (t.isSelected()) {
final String colorIndex = DAWColor.getColorIndex(t.getColor());
return this.model.getColorManager().getColorIndex(colorIndex);
}
return SLMkIIIColorManager.SLMKIII_WHITE_HALF;
}
return SLMkIIIColorManager.SLMKIII_BLACK;
}
Aggregations