package com.ss.android.ugc.aweme.audiorecord;

import X.C04855Fr;
import X.C38896fH;
import X.M12;
import android.os.Parcel;
import android.os.Parcelable;
import android.text.TextUtils;
import com.bytedance.covode.number.Covode;
import com.google.gson.a.c;
import java.io.Serializable;
import java.util.Objects;
import java.util.Stack;
import kotlin.h.b.n;

public final class AudioRecorderParam implements Parcelable, Serializable {
    public static final C04855Fr CREATOR = new C04855Fr((byte) 0);
    public int audioRecordIndex;
    @c(LIZ = "audiourl")
    @C38896fH
    public String audioUrl;
    @c(LIZ = "extraurl")
    public String extraUrl;
    @c(LIZ = "hasoriginalsound")
    public boolean hasOriginalSound;
    @c(LIZ = "mstack")
    public Stack<Point> mStack;
    public boolean needDel;
    @c(LIZ = "needoriginalsound")
    public boolean needOriginalSound;
    @c(LIZ = "voicevolume")
    public float voiceVolume;

    static {
        Covode.recordClassIndex(53600);
    }

    public final int describeContents() {
        return 0;
    }

    public final int getAudioRecordIndex() {
        return this.audioRecordIndex;
    }

    public final String getAudioUrl() {
        return this.audioUrl;
    }

    public final String getExtraUrl() {
        return this.extraUrl;
    }

    public final boolean getHasOriginalSound() {
        return this.hasOriginalSound;
    }

    public final Stack<Point> getMStack() {
        return this.mStack;
    }

    public final boolean getNeedDel() {
        return this.needDel;
    }

    public final boolean getNeedOriginalSound() {
        return this.needOriginalSound;
    }

    public final float getVoiceVolume() {
        return this.voiceVolume;
    }

    public AudioRecorderParam() {
        this.mStack = new Stack<>();
        this.needOriginalSound = true;
        this.hasOriginalSound = true;
        this.audioUrl = "";
        this.extraUrl = "";
        this.audioRecordIndex = -1;
    }

    public final boolean hasRecord() {
        if (TextUtils.isEmpty(this.audioUrl) || this.mStack.empty()) {
            return false;
        }
        return true;
    }

    public final void setAudioRecordIndex(int i) {
        this.audioRecordIndex = i;
    }

    public final void setHasOriginalSound(boolean z) {
        this.hasOriginalSound = z;
    }

    public final void setNeedDel(boolean z) {
        this.needDel = z;
    }

    public final void setNeedOriginalSound(boolean z) {
        this.needOriginalSound = z;
    }

    public final void setVoiceVolume(float f) {
        this.voiceVolume = f;
    }

    public final void setAudioUrl(String str) {
        M12.LIZ(str);
        this.audioUrl = str;
    }

    public final void setExtraUrl(String str) {
        M12.LIZ(str);
        this.extraUrl = str;
    }

    public final void setMStack(Stack<Point> stack) {
        M12.LIZ(stack);
        this.mStack = stack;
    }

    public final void copyFrom(AudioRecorderParam audioRecorderParam) {
        if (audioRecorderParam != null) {
            this.voiceVolume = audioRecorderParam.voiceVolume;
            this.needOriginalSound = audioRecorderParam.needOriginalSound;
            this.hasOriginalSound = audioRecorderParam.hasOriginalSound;
            this.needDel = audioRecorderParam.needDel;
            this.voiceVolume = audioRecorderParam.voiceVolume;
            this.audioRecordIndex = audioRecorderParam.audioRecordIndex;
            this.audioUrl = audioRecorderParam.audioUrl;
            this.extraUrl = audioRecorderParam.extraUrl;
            this.mStack.clear();
            this.mStack.addAll(audioRecorderParam.mStack);
        }
    }

    /* JADX INFO: this call moved to the top of the method (can break code semantics) */
    public AudioRecorderParam(Parcel parcel) {
        this();
        boolean z;
        M12.LIZ(parcel);
        Serializable readSerializable = parcel.readSerializable();
        Objects.requireNonNull(readSerializable, "null cannot be cast to non-null type java.util.Stack<com.ss.android.ugc.aweme.audiorecord.Point>");
        this.mStack = (Stack) readSerializable;
        boolean z2 = true;
        if (parcel.readByte() != 0) {
            z = true;
        } else {
            z = false;
        }
        this.needOriginalSound = z;
        this.hasOriginalSound = parcel.readByte() == 0 ? false : z2;
        String readString = parcel.readString();
        String str = "";
        this.audioUrl = readString == null ? str : readString;
        this.voiceVolume = parcel.readFloat();
        String readString2 = parcel.readString();
        this.extraUrl = readString2 != null ? readString2 : str;
    }

    public final void writeToParcel(Parcel parcel, int i) {
        M12.LIZ(parcel);
        parcel.writeSerializable(this.mStack);
        parcel.writeByte(this.needOriginalSound ? (byte) 1 : 0);
        parcel.writeByte(this.hasOriginalSound ? (byte) 1 : 0);
        parcel.writeString(this.audioUrl);
        parcel.writeFloat(this.voiceVolume);
        parcel.writeString(this.extraUrl);
    }

    public final boolean hasChange(AudioRecorderParam audioRecorderParam, boolean z) {
        if (audioRecorderParam != null) {
            Stack stack = new Stack();
            Stack stack2 = new Stack();
            stack.addAll(this.mStack);
            stack2.addAll(audioRecorderParam.mStack);
            if (stack.size() != stack2.size()) {
                return true;
            }
            while (!stack.isEmpty() && !stack2.empty()) {
                Point point = (Point) stack2.pop();
                n.LIZIZ(point, "");
                if (!((Point) stack.pop()).isEqual(point)) {
                    return true;
                }
            }
            if (this.needOriginalSound != audioRecorderParam.needOriginalSound) {
                return true;
            }
            return false;
        } else if (!this.mStack.empty() || this.needOriginalSound != z) {
            return true;
        } else {
            return false;
        }
    }

    public static /* synthetic */ boolean hasChange$default(AudioRecorderParam audioRecorderParam, AudioRecorderParam audioRecorderParam2, boolean z, int i, Object obj) {
        if ((i & 2) != 0) {
            z = true;
        }
        return audioRecorderParam.hasChange(audioRecorderParam2, z);
    }
}
