Search in sources :

Example 1 with BaseMode

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();
}
Also used : BaseMode(de.mossgrabers.push.mode.BaseMode) Mode(de.mossgrabers.framework.mode.Mode) ModeManager(de.mossgrabers.framework.mode.ModeManager) BaseMode(de.mossgrabers.push.mode.BaseMode)

Aggregations

Mode (de.mossgrabers.framework.mode.Mode)1 ModeManager (de.mossgrabers.framework.mode.ModeManager)1 BaseMode (de.mossgrabers.push.mode.BaseMode)1