package com.tencent.mm.plugin.emojicapture.proxy;

import a.f.b.j;
import a.l;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.modelvoiceaddr.g;
import com.tencent.mm.modelvoiceaddr.g.b;
import com.tencent.mm.remoteservice.a;
import com.tencent.mm.remoteservice.d;
import com.tencent.mm.remoteservice.e;
import com.tencent.mm.remoteservice.f;
import com.tencent.mm.sdk.platformtools.ab;

@l(dWo = {1, 1, 13}, dWp = {"\u00008\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0002\b\u0005\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0006\n\u0002\u0010\u000b\n\u0002\b\u0004\u0018\u0000 \u001a2\u00020\u0001:\u0002\u001a\u001bB\u0019\u0012\b\u0010\u0002\u001a\u0004\u0018\u00010\u0003\u0012\b\u0010\u0004\u001a\u0004\u0018\u00010\u0005¢\u0006\u0002\u0010\u0006J\b\u0010\r\u001a\u00020\u000eH\u0007J\b\u0010\u000f\u001a\u00020\u000eH\u0007J\b\u0010\u0010\u001a\u00020\u0011H\u0007J\u0012\u0010\u0012\u001a\u00020\u00112\b\u0010\u0013\u001a\u0004\u0018\u00010\bH\u0007J\b\u0010\u0014\u001a\u00020\u0011H\u0007J\b\u0010\u0015\u001a\u00020\u0011H\u0007J\u0010\u0010\u0016\u001a\u00020\u00112\u0006\u0010\u0017\u001a\u00020\u0018H\u0007J\u0010\u0010\u0019\u001a\u00020\u00112\u0006\u0010\u0017\u001a\u00020\u0018H\u0007R\u000e\u0010\u0007\u001a\u00020\bXD¢\u0006\u0002\n\u0000R\u001c\u0010\u0002\u001a\u0004\u0018\u00010\u0003X\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\t\u0010\n\"\u0004\b\u000b\u0010\f¨\u0006\u001c"}, dWq = {"Lcom/tencent/mm/plugin/emojicapture/proxy/VoiceInputProxy;", "Lcom/tencent/mm/remoteservice/BaseClientRequest;", "uiCallback", "Lcom/tencent/mm/plugin/emojicapture/proxy/VoiceInputProxy$UICallback;", "serverProxy", "Lcom/tencent/mm/remoteservice/RemoteServiceProxy;", "(Lcom/tencent/mm/plugin/emojicapture/proxy/VoiceInputProxy$UICallback;Lcom/tencent/mm/remoteservice/RemoteServiceProxy;)V", "TAG", "", "getUiCallback", "()Lcom/tencent/mm/plugin/emojicapture/proxy/VoiceInputProxy$UICallback;", "setUiCallback", "(Lcom/tencent/mm/plugin/emojicapture/proxy/VoiceInputProxy$UICallback;)V", "getMaxAmplitudeRate", "", "getMaxAmplitudeRateRemote", "onRecongnizeFinish", "", "onRes", "voiceText", "start", "startRemote", "stop", "fromUI", "", "stopRemote", "Companion", "UICallback", "plugin-emojicapture_release"})
public final class VoiceInputProxy extends a {
    private static g lkR;
    public static final a lkS = new a((byte) 0);
    private final String TAG = "MicroMsg.VoiceInputProxy";
    private b lkQ;

    static {
        AppMethodBeat.i(2855);
        AppMethodBeat.o(2855);
    }

    public final b getUiCallback() {
        return this.lkQ;
    }

    public final void setUiCallback(b bVar) {
        this.lkQ = bVar;
    }

    public VoiceInputProxy(b bVar, d dVar) {
        super(dVar);
        this.lkQ = bVar;
    }

    @e
    public final void start() {
        AppMethodBeat.i(2847);
        REMOTE_CALL("startRemote", new Object[0]);
        AppMethodBeat.o(2847);
    }

    @e
    public final void stop(boolean z) {
        AppMethodBeat.i(2848);
        REMOTE_CALL("stopRemote", new Object[]{Boolean.valueOf(z)});
        AppMethodBeat.o(2848);
    }

    @e
    public final void onRes(String str) {
        AppMethodBeat.i(2849);
        b bVar = this.lkQ;
        if (bVar != null) {
            bVar.onRes(str);
            AppMethodBeat.o(2849);
            return;
        }
        AppMethodBeat.o(2849);
    }

    @e
    public final void onRecongnizeFinish() {
        AppMethodBeat.i(2850);
        b bVar = this.lkQ;
        if (bVar != null) {
            bVar.amw();
            AppMethodBeat.o(2850);
            return;
        }
        AppMethodBeat.o(2850);
    }

    @e
    public final int getMaxAmplitudeRate() {
        AppMethodBeat.i(2851);
        Object REMOTE_CALL = REMOTE_CALL("getMaxAmplitudeRateRemote", new Object[0]);
        if (REMOTE_CALL == null || !(REMOTE_CALL instanceof Integer)) {
            AppMethodBeat.o(2851);
            return 0;
        }
        int intValue = ((Number) REMOTE_CALL).intValue();
        AppMethodBeat.o(2851);
        return intValue;
    }

    @f
    public final void startRemote() {
        AppMethodBeat.i(2852);
        g gVar = new g(g.gbc, 9, (b) new c(this));
        lkR = gVar;
        gVar.start();
        AppMethodBeat.o(2852);
    }

    @f
    public final int getMaxAmplitudeRateRemote() {
        AppMethodBeat.i(2853);
        ab.d(this.TAG, "getMaxAmplitudeRateRemote call " + lkR);
        if (lkR != null) {
            g gVar = lkR;
            if (gVar == null) {
                j.dWJ();
            }
            int maxAmplitudeRate = gVar.getMaxAmplitudeRate();
            AppMethodBeat.o(2853);
            return maxAmplitudeRate;
        }
        AppMethodBeat.o(2853);
        return 0;
    }

    @f
    public final void stopRemote(boolean z) {
        AppMethodBeat.i(2854);
        g gVar = lkR;
        if (gVar != null) {
            gVar.stop(z);
        }
        lkR = null;
        AppMethodBeat.o(2854);
    }
}
