package com.mstar.android.tvapi.dtv.atsc.vo;

import android.os.Parcel;
import android.os.Parcelable;
import java.util.Hashtable;
import okhttp3.HttpUrl;

/* JADX INFO: loaded from: classes.dex */
public class AtscEpgEventInfo implements Parcelable {
    public boolean bHasCCInfo;
    public CaptionService[] captionServices;
    public int durationTime;
    public EnumAtscEpgFunctionStatus enStrStatus;
    public int endTime;
    public int genreAttributeCount;
    public String[] genreAttributeStringArr;
    public int noDimension;
    public int numOfService;
    public Region5DimensionInformation[] regin5Dimensions;
    public String sExtendedText;
    public String sName;
    public String sRegion5Name;
    public AtscEpgRating stRating;
    public int startTime;
    private static Hashtable<Integer, Integer> enumhash = new Hashtable<>();
    public static final Parcelable.Creator<AtscEpgEventInfo> CREATOR = new Parcelable.Creator<AtscEpgEventInfo>() { // from class: com.mstar.android.tvapi.dtv.atsc.vo.AtscEpgEventInfo.1
        /* JADX WARN: Can't rename method to resolve collision */
        @Override // android.os.Parcelable.Creator
        public AtscEpgEventInfo createFromParcel(Parcel parcel) {
            return new AtscEpgEventInfo(parcel);
        }

        /* JADX WARN: Can't rename method to resolve collision */
        @Override // android.os.Parcelable.Creator
        public AtscEpgEventInfo[] newArray(int i2) {
            return new AtscEpgEventInfo[i2];
        }
    };

    public class CaptionService {
        public int captionSrvNum;
        public int digital_CC;
        public int easy_reader;
        public char[] language = new char[3];
        public int lin21_field;
        public int wide_aspect_ratio;

        public CaptionService(Parcel parcel) {
            for (int i2 = 0; i2 < 3; i2++) {
                this.language[i2] = (char) parcel.readInt();
            }
            this.digital_CC = parcel.readInt();
            this.lin21_field = parcel.readInt();
            this.captionSrvNum = parcel.readInt();
            this.easy_reader = parcel.readInt();
            this.wide_aspect_ratio = parcel.readInt();
        }

        public void writeToParcel(Parcel parcel) {
            for (int i2 = 0; i2 < 3; i2++) {
                parcel.writeInt(this.language[i2]);
            }
            parcel.writeInt(this.digital_CC);
            parcel.writeInt(this.lin21_field);
            parcel.writeInt(this.captionSrvNum);
            parcel.writeInt(this.easy_reader);
            parcel.writeInt(this.wide_aspect_ratio);
        }
    }

    public enum EnumAtscEpgFunctionStatus {
        EN_ATSC_EPG_FUNC_STATUS_SUCCESS(0),
        EN_ATSC_EPG_FUNC_STATUS_INVALID(1),
        EN_ATSC_EPG_FUNC_STATUS_NO_EVENT(2),
        EN_ATSC_EPG_FUNC_STATUS_NO_STRING(3),
        EN_ATSC_EPG_FUNC_STATUS_NO_CHANNEL(4),
        EN_ATSC_EPG_FUNC_STATUS_DB_NO_CONNECT(10),
        EN_ATSC_EPG_FUNC_STATUS_DB_NO_LOCK(11),
        EN_ATSC_EPG_FUNC_STATUS_DB_NO_CHANNEL_DB(12),
        EN_ATSC_EPG_FUNC_STATUS_NO_FUNCTION(255),
        EN_ATSC_EPG_FUNC_STATUS_UNDEFINED(256);

        private static int seq = 0;
        private final int value;

        EnumAtscEpgFunctionStatus(int i2) {
            this.value = i2;
            setHashtableValue(i2);
        }

        public static int getOrdinalThroughValue(int i2) {
            Integer num = (Integer) AtscEpgEventInfo.enumhash.get(Integer.valueOf(i2));
            return num != null ? num.intValue() : ((Integer) AtscEpgEventInfo.enumhash.get(256)).intValue();
        }

        private static void setHashtableValue(int i2) {
            AtscEpgEventInfo.enumhash.put(new Integer(i2), new Integer(seq));
            seq++;
        }

        public int getValue() {
            return this.value;
        }
    }

    public class Region5DimensionInformation {
        public String[] abbRatingText;
        public String dimensionName;
        public short valuesDefined;

        /* JADX WARN: Multi-variable type inference failed */
        public Region5DimensionInformation(Parcel parcel) {
            this.dimensionName = parcel.readString();
            int i2 = (short) parcel.readInt();
            this.valuesDefined = i2;
            this.abbRatingText = new String[i2];
            for (int i3 = 0; i3 < this.valuesDefined; i3++) {
                this.abbRatingText[i3] = parcel.readString();
            }
        }

        public void writeToParcel(Parcel parcel) {
            parcel.writeString(this.dimensionName);
            parcel.writeInt(this.valuesDefined);
            for (int i2 = 0; i2 < this.valuesDefined; i2++) {
                parcel.writeString(this.abbRatingText[i2]);
            }
        }
    }

    public AtscEpgEventInfo(Parcel parcel) {
        this.startTime = parcel.readInt();
        this.endTime = parcel.readInt();
        this.durationTime = parcel.readInt();
        this.enStrStatus = EnumAtscEpgFunctionStatus.values()[EnumAtscEpgFunctionStatus.getOrdinalThroughValue(parcel.readInt())];
        this.sName = parcel.readString();
        this.bHasCCInfo = parcel.readInt() == 1;
        this.stRating = AtscEpgRating.CREATOR.createFromParcel(parcel);
        this.sExtendedText = parcel.readString();
        if (parcel.dataSize() > parcel.dataPosition()) {
            int i2 = parcel.readInt();
            this.genreAttributeCount = i2;
            this.genreAttributeStringArr = new String[i2];
            for (int i3 = 0; i3 < this.genreAttributeCount; i3++) {
                this.genreAttributeStringArr[i3] = parcel.readString();
            }
        }
        if (parcel.dataSize() > parcel.dataPosition()) {
            String string = parcel.readString();
            this.sRegion5Name = string;
            if (string != null) {
                this.sRegion5Name = string.substring(0, Math.min(string.length(), 32));
            }
            int i4 = parcel.readInt();
            this.noDimension = i4;
            this.regin5Dimensions = new Region5DimensionInformation[i4];
            for (int i5 = 0; i5 < this.noDimension; i5++) {
                this.regin5Dimensions[i5] = new Region5DimensionInformation(parcel);
            }
        }
        if (parcel.dataSize() > parcel.dataPosition()) {
            int i6 = parcel.readInt();
            this.numOfService = i6;
            if (i6 > 0) {
                this.captionServices = new CaptionService[i6];
                for (int i7 = 0; i7 < this.numOfService; i7++) {
                    this.captionServices[i7] = new CaptionService(parcel);
                }
            }
        }
    }

    @Override // android.os.Parcelable
    public int describeContents() {
        return 0;
    }

    @Override // android.os.Parcelable
    public void writeToParcel(Parcel parcel, int i2) {
        parcel.writeInt(this.startTime);
        parcel.writeInt(this.endTime);
        parcel.writeInt(this.durationTime);
        parcel.writeInt(this.enStrStatus.getValue());
        parcel.writeString(this.sName);
        parcel.writeInt(this.bHasCCInfo ? 1 : 0);
        this.stRating.writeToParcel(parcel, 0);
        parcel.writeString(this.sExtendedText);
        parcel.writeInt(this.genreAttributeCount);
        if (this.genreAttributeCount > 0) {
            for (int i3 = 0; i3 < this.genreAttributeCount; i3++) {
                parcel.writeString(this.genreAttributeStringArr[i3]);
            }
        }
        String str = this.sRegion5Name;
        if (str != null) {
            parcel.writeString(str);
            parcel.writeInt(this.noDimension);
            if (this.noDimension > 0) {
                for (int i4 = 0; i4 < this.noDimension; i4++) {
                    this.regin5Dimensions[i4].writeToParcel(parcel);
                }
            }
        }
        parcel.writeInt(this.numOfService);
        if (this.numOfService > 0) {
            for (int i5 = 0; i5 < this.numOfService; i5++) {
                this.captionServices[i5].writeToParcel(parcel);
            }
        }
    }

    public AtscEpgEventInfo() {
        this.startTime = 0;
        this.endTime = 0;
        this.durationTime = 0;
        this.enStrStatus = EnumAtscEpgFunctionStatus.EN_ATSC_EPG_FUNC_STATUS_UNDEFINED;
        this.sName = HttpUrl.FRAGMENT_ENCODE_SET;
        this.bHasCCInfo = false;
        this.stRating = new AtscEpgRating();
        this.sExtendedText = HttpUrl.FRAGMENT_ENCODE_SET;
        this.genreAttributeCount = 0;
        this.genreAttributeStringArr = null;
        this.sRegion5Name = HttpUrl.FRAGMENT_ENCODE_SET;
        this.noDimension = 0;
        this.numOfService = 0;
        this.regin5Dimensions = null;
        this.captionServices = null;
    }
}
