package x0;

import c1.C0406c;
import c1.InterfaceC0404a;
import com.jsyn.unitgen.u;

/* JADX INFO: loaded from: classes.dex */
public class j extends k {

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    private boolean f6806i;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    private boolean f6807j;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    private boolean f6808k;

    /* JADX INFO: renamed from: l, reason: collision with root package name */
    private u f6809l;

    class a implements InterfaceC0404a {

        /* JADX INFO: renamed from: b, reason: collision with root package name */
        final /* synthetic */ boolean f6810b;

        a(boolean z2) {
            this.f6810b = z2;
        }

        @Override // c1.InterfaceC0404a
        public void run() {
            j.this.O(this.f6810b);
        }
    }

    public j(String str) {
        super(str);
        this.f6806i = false;
        this.f6807j = false;
        this.f6808k = true;
    }

    private u I() {
        u uVar = this.f6809l;
        return uVar == null ? d() : uVar;
    }

    private void N(boolean z2, C0406c c0406c) {
        f(c0406c, new a(z2));
    }

    /* JADX INFO: Access modifiers changed from: private */
    public void O(boolean z2) {
        if (z2) {
            Q();
        }
        o(z2 ? 1.0d : u.FALSE);
    }

    private void Q() {
        I().setEnabled(true);
        this.f6807j = true;
    }

    public void G() {
        if (this.f6806i) {
            I().setEnabled(false);
        }
    }

    public boolean H(int i2) {
        double[] dArrL = l();
        boolean z2 = this.f6807j;
        this.f6807j = false;
        if (this.f6808k) {
            if (dArrL[i2] < 0.01d) {
                return z2;
            }
            this.f6808k = false;
            return true;
        }
        if (dArrL[i2] >= 0.01d) {
            return z2;
        }
        this.f6808k = true;
        return z2;
    }

    public boolean J() {
        return this.f6808k;
    }

    public void K(C0406c c0406c) {
        N(false, c0406c);
    }

    public void L(C0406c c0406c) {
        N(true, c0406c);
    }

    public void M(boolean z2) {
        this.f6806i = z2;
    }

    public void P(u uVar) {
        this.f6809l = uVar;
        M(true);
        this.f6809l.setEnabled(false);
    }
}
