return -1;
    public void setMode(int n) {        if (type.hasModes()) {            if (type.hasInstantModeSwitch()) {                mode = n;            }            else if (pendingMode != n) {                pendingMode = n;            }        }    }