use of de.mossgrabers.push.mode.BaseMode in project DrivenByMoss by git-moss.
the class SmallKnobTouchCommand method execute.
/**
* {@inheritDoc}
*/
@Override
public void execute(final ButtonEvent event) {
final boolean isTouched = event == ButtonEvent.DOWN;
// Avoid accidentally leaving the browser
final ModeManager modeManager = this.surface.getModeManager();
if (modeManager.isActiveMode(Modes.MODE_BROWSER))
return;
// Prevent flickering if a knob is touched accidentally while fiddling with other knobs
final Mode activeMode = modeManager.getActiveMode();
if (activeMode instanceof BaseMode && ((BaseMode) activeMode).isAKnobTouched())
return;
this.model.getTransport().setTempoIndication(isTouched);
if (isTouched)
modeManager.setActiveMode(Modes.MODE_TRANSPORT);
else
modeManager.restoreMode();
}
Aggregations