package com.ss.android.ugc.aweme.feed.model;

import X.2HN;
import X.AnonymousClass7WJ;
import X.M12;
import com.bytedance.covode.number.Covode;
import com.google.gson.a.c;
import java.io.Serializable;
import java.util.List;
import java.util.Objects;

public final class Audio implements Serializable {
    public static final Companion Companion = new Companion((2HN) null);
    @c(LIZ = "CdnUrlExpired")
    public long CdnUrlExpired;
    @c(LIZ = "TtsInfos")
    public List<TtsInfos> TtsInfos;
    @c(LIZ = "original_sound_infos")
    public List<OriginalSound> originalSoundInfos;

    static {
        Covode.recordClassIndex(78839);
    }

    public Audio() {
    }

    public static int INVOKESTATIC_com_ss_android_ugc_aweme_feed_model_Audio_com_ss_android_ugc_aweme_lancet_HashCodeLancet_hashCode(long j) {
        return (int) (j ^ (j >>> 32));
    }

    public static final List<AnonymousClass7WJ> convertToSimAudio(Video video, Audio audio) {
        return Companion.convertToSimAudio(video, audio);
    }

    public static /* synthetic */ Audio copy$default(Audio audio, long j, List<TtsInfos> list, List<OriginalSound> list2, int i, Object obj) {
        if ((i & 1) != 0) {
            j = audio.CdnUrlExpired;
        }
        if ((i & 2) != 0) {
            list = audio.TtsInfos;
        }
        if ((i & 4) != 0) {
            list2 = audio.originalSoundInfos;
        }
        return audio.copy(j, list, list2);
    }

    private Object[] getObjects() {
        return new Object[]{Long.valueOf(this.CdnUrlExpired), this.TtsInfos, this.originalSoundInfos};
    }

    public final Audio copy(long j, List<TtsInfos> list, List<OriginalSound> list2) {
        M12.LIZ(list, list2);
        return new Audio(j, list, list2);
    }

    public final boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (!(obj instanceof Audio)) {
            return false;
        }
        return M12.LIZ(((Audio) obj).getObjects(), getObjects());
    }

    public final int hashCode() {
        return Objects.hash(getObjects());
    }

    public final String toString() {
        return M12.LIZ("Audio:%s,%s,%s", getObjects());
    }

    public static final class Companion {
        static {
            Covode.recordClassIndex(78840);
        }

        public Companion() {
        }

        public /* synthetic */ Companion(2HN r1) {
            this();
        }

        /* JADX WARNING: Can't wrap try/catch for region: R(20:17|(1:19)|20|(1:24)|25|(1:27)|28|(1:32)|33|(1:37)|38|(1:42)|43|(1:47)|48|49|50|51|52|53) */
        /* JADX WARNING: Failed to process nested try/catch */
        /* JADX WARNING: Missing exception handler attribute for start block: B:51:0x00ef */
        /* Code decompiled incorrectly, please refer to instructions dump. */
        public final java.util.List<X.AnonymousClass7WJ> convertToSimAudio(com.ss.android.ugc.aweme.feed.model.Video r8, com.ss.android.ugc.aweme.feed.model.Audio r9) {
            /*
                r7 = this;
                X.M12.LIZ(r8)
                java.util.ArrayList r3 = new java.util.ArrayList
                r3.<init>()
                r6 = 0
                if (r9 == 0) goto L_0x012a
                java.util.List r0 = r9.getTtsInfos()
                if (r0 == 0) goto L_0x012a
                java.util.Iterator r2 = r0.iterator()
            L_0x0015:
                boolean r0 = r2.hasNext()
                java.lang.String r1 = "2"
                if (r0 == 0) goto L_0x0039
                java.lang.Object r5 = r2.next()
                r0 = r5
                com.ss.android.ugc.aweme.feed.model.TtsInfos r0 = (com.ss.android.ugc.aweme.feed.model.TtsInfos) r0
                java.lang.String r0 = r0.getVoiceType()
                boolean r0 = kotlin.h.b.n.LIZ((java.lang.Object) r0, (java.lang.Object) r1)
                if (r0 == 0) goto L_0x0015
            L_0x002e:
                com.ss.android.ugc.aweme.feed.model.TtsInfos r5 = (com.ss.android.ugc.aweme.feed.model.TtsInfos) r5
                if (r5 == 0) goto L_0x012a
                com.ss.android.ugc.aweme.feed.model.PlayAddress r0 = r5.getPlayAddress()
                if (r0 != 0) goto L_0x003b
                return r6
            L_0x0039:
                r5 = r6
                goto L_0x002e
            L_0x003b:
                java.lang.String r0 = r5.getVoiceType()
                boolean r0 = kotlin.h.b.n.LIZ((java.lang.Object) r0, (java.lang.Object) r1)
                if (r0 == 0) goto L_0x0116
                X.7WK r4 = new X.7WK
                r4.<init>()
                java.lang.String r1 = r5.getVoiceType()
                if (r1 == 0) goto L_0x0055
                X.7WJ r0 = r4.LIZ
                r0.setVoiceType(r1)
            L_0x0055:
                java.util.List r0 = r8.getBitRate()
                if (r0 == 0) goto L_0x0070
                java.lang.Object r0 = X.Lea.LJIIIIZZ(r0)
                com.ss.android.ugc.aweme.feed.model.BitRate r0 = (com.ss.android.ugc.aweme.feed.model.BitRate) r0
                if (r0 == 0) goto L_0x0070
                int r0 = r0.getBitRate()
                java.lang.Integer r1 = java.lang.Integer.valueOf(r0)
                X.7WJ r0 = r4.LIZ
                r0.setBitRate(r1)
            L_0x0070:
                java.lang.String r1 = r5.getLang()
                if (r1 == 0) goto L_0x007b
                X.7WJ r0 = r4.LIZ
                r0.setLang(r1)
            L_0x007b:
                com.ss.android.ugc.aweme.feed.model.PlayAddress r0 = r5.getPlayAddress()
                if (r0 == 0) goto L_0x008a
                java.util.List r0 = r0.getUrlList()
                if (r0 == 0) goto L_0x008a
                r4.LIZ((java.util.List<java.lang.String>) r0)
            L_0x008a:
                com.ss.android.ugc.aweme.feed.model.PlayAddress r0 = r5.getPlayAddress()
                if (r0 == 0) goto L_0x009b
                java.lang.String r1 = r0.getUrlKey()
                if (r1 == 0) goto L_0x009b
                X.7WJ r0 = r4.LIZ
                r0.setFileKey(r1)
            L_0x009b:
                com.ss.android.ugc.aweme.feed.model.PlayAddress r0 = r5.getPlayAddress()
                if (r0 == 0) goto L_0x00ab
                java.lang.String r1 = r0.getUrlKey()
                if (r1 == 0) goto L_0x00ab
                X.7WJ r0 = r4.LIZ
                r0.urlKey = r1
            L_0x00ab:
                long r0 = r9.getCdnUrlExpired()
                java.lang.Long r1 = java.lang.Long.valueOf(r0)
                X.7WJ r0 = r4.LIZ
                r0.setCdnUrlExpired(r1)
                com.ss.android.ugc.aweme.feed.model.PlayAddress r0 = r5.getPlayAddress()
                if (r0 == 0) goto L_0x00c7
                java.lang.String r0 = r0.getFileCS()
                if (r0 == 0) goto L_0x00c7
                r4.LIZ((java.lang.String) r0)
            L_0x00c7:
                com.ss.android.ugc.aweme.feed.model.Audio$InfoIdType r0 = com.ss.android.ugc.aweme.feed.model.Audio.InfoIdType.TRANSLATED
                int r0 = r0.getInfoId()
                java.lang.Integer r1 = java.lang.Integer.valueOf(r0)
                X.7WJ r0 = r4.LIZ
                r0.setInfoId(r1)
                org.json.JSONObject r1 = new org.json.JSONObject     // Catch:{ JSONException -> 0x00ef }
                java.lang.String r0 = r5.getVolumeInfo()     // Catch:{ JSONException -> 0x00ef }
                r1.<init>(r0)     // Catch:{ JSONException -> 0x00ef }
                java.lang.String r0 = "Loudness"
                double r1 = r1.getDouble(r0)     // Catch:{ JSONException -> 0x00ef }
                float r0 = (float) r1     // Catch:{ JSONException -> 0x00ef }
                java.lang.Float r1 = java.lang.Float.valueOf(r0)     // Catch:{ JSONException -> 0x00ef }
                X.7WJ r0 = r4.LIZ     // Catch:{ JSONException -> 0x00ef }
                r0.setLoudness(r1)     // Catch:{ JSONException -> 0x00ef }
            L_0x00ef:
                org.json.JSONObject r1 = new org.json.JSONObject     // Catch:{ JSONException -> 0x0108 }
                java.lang.String r0 = r5.getVolumeInfo()     // Catch:{ JSONException -> 0x0108 }
                r1.<init>(r0)     // Catch:{ JSONException -> 0x0108 }
                java.lang.String r0 = "Peak"
                double r1 = r1.getDouble(r0)     // Catch:{ JSONException -> 0x0108 }
                float r0 = (float) r1     // Catch:{ JSONException -> 0x0108 }
                java.lang.Float r1 = java.lang.Float.valueOf(r0)     // Catch:{ JSONException -> 0x0108 }
                X.7WJ r0 = r4.LIZ     // Catch:{ JSONException -> 0x0108 }
                r0.setPeak(r1)     // Catch:{ JSONException -> 0x0108 }
            L_0x0108:
                X.7WJ r2 = r4.LIZ
                long r0 = android.os.SystemClock.elapsedRealtime()
                r2.setCreateTime(r0)
                X.7WJ r0 = r4.LIZ
                r3.add(r0)
            L_0x0116:
                com.ss.android.ugc.aweme.feed.model.VideoUrlModel r0 = r8.playAddr
                if (r0 == 0) goto L_0x0127
                java.util.List r0 = r0.getUrlList()
                if (r0 == 0) goto L_0x0127
                java.lang.Object r0 = X.Lea.LJIIIIZZ(r0)
            L_0x0124:
                if (r0 != 0) goto L_0x0129
                return r6
            L_0x0127:
                r0 = r6
                goto L_0x0124
            L_0x0129:
                return r3
            L_0x012a:
                return r6
            */
            throw new UnsupportedOperationException("Method not decompiled: com.ss.android.ugc.aweme.feed.model.Audio.Companion.convertToSimAudio(com.ss.android.ugc.aweme.feed.model.Video, com.ss.android.ugc.aweme.feed.model.Audio):java.util.List");
        }
    }

    public enum InfoIdType {
        ORIGINAL(1),
        TRANSLATED(2);
        
        public final int infoId;

        public final int getInfoId() {
            return this.infoId;
        }

        /* access modifiers changed from: public */
        InfoIdType(int i) {
            this.infoId = i;
        }
    }

    public final long getCdnUrlExpired() {
        return this.CdnUrlExpired;
    }

    public final List<OriginalSound> getOriginalSoundInfos() {
        return this.originalSoundInfos;
    }

    public final List<TtsInfos> getTtsInfos() {
        return this.TtsInfos;
    }

    public Audio(long j, List<TtsInfos> list, List<OriginalSound> list2) {
        M12.LIZ(list, list2);
        this.CdnUrlExpired = j;
        this.TtsInfos = list;
        this.originalSoundInfos = list2;
    }

    /* JADX INFO: this call moved to the top of the method (can break code semantics) */
    public /* synthetic */ Audio(long j, List list, List list2, int i, 2HN r7) {
        this((i & 1) != 0 ? -1 : j, list, list2);
    }
}
