package com.mstar.android.tvapi.common;

import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.os.Parcel;
import android.util.Log;
import com.mstar.android.tvapi.common.exception.TvCommonException;
import com.mstar.android.tvapi.common.listener.OnAudioEventListener;
import com.mstar.android.tvapi.common.listener.OnEventListener;
import com.mstar.android.tvapi.common.vo.AdvancedSoundParameter;
import com.mstar.android.tvapi.common.vo.AtvSystemStandard;
import com.mstar.android.tvapi.common.vo.AudioCommonInfoType;
import com.mstar.android.tvapi.common.vo.AudioOutParameter;
import com.mstar.android.tvapi.common.vo.AudioSrsTableEntry;
import com.mstar.android.tvapi.common.vo.DolbyDapBassParamter;
import com.mstar.android.tvapi.common.vo.DolbyDapCalibrationBoost;
import com.mstar.android.tvapi.common.vo.DolbyDapDeParamter;
import com.mstar.android.tvapi.common.vo.DolbyDapGainParamter;
import com.mstar.android.tvapi.common.vo.DolbyDapGeqParamter;
import com.mstar.android.tvapi.common.vo.DolbyDapIeqParamter;
import com.mstar.android.tvapi.common.vo.DolbyDapLevlerParamter;
import com.mstar.android.tvapi.common.vo.DolbyDapMiParamter;
import com.mstar.android.tvapi.common.vo.DolbyDapModelerParamter;
import com.mstar.android.tvapi.common.vo.DolbyDapOptimizerParamter;
import com.mstar.android.tvapi.common.vo.DolbyDapParamter;
import com.mstar.android.tvapi.common.vo.DolbyDapRegParamter;
import com.mstar.android.tvapi.common.vo.DolbyDapRegulatorParamter;
import com.mstar.android.tvapi.common.vo.DolbyDapSurroundVirtualizerParamter;
import com.mstar.android.tvapi.common.vo.DolbyDapVirtualBassParamter;
import com.mstar.android.tvapi.common.vo.DolbyDapVolMaxParamter;
import com.mstar.android.tvapi.common.vo.DtvSoundEffect;
import com.mstar.android.tvapi.common.vo.EnumAdvancedSoundParameterType;
import com.mstar.android.tvapi.common.vo.EnumAdvancedSoundSubProcessType;
import com.mstar.android.tvapi.common.vo.EnumAdvancedSoundType;
import com.mstar.android.tvapi.common.vo.EnumAtvAudioModeType;
import com.mstar.android.tvapi.common.vo.EnumAtvInfoType;
import com.mstar.android.tvapi.common.vo.EnumAudioInputLevelSourceType;
import com.mstar.android.tvapi.common.vo.EnumAudioOutType;
import com.mstar.android.tvapi.common.vo.EnumAudioProcessorType;
import com.mstar.android.tvapi.common.vo.EnumAudioReturn;
import com.mstar.android.tvapi.common.vo.EnumAudioVolumeSourceType;
import com.mstar.android.tvapi.common.vo.EnumAuidoCaptureDeviceType;
import com.mstar.android.tvapi.common.vo.EnumAuidoCaptureSource;
import com.mstar.android.tvapi.common.vo.EnumDtvSoundMode;
import com.mstar.android.tvapi.common.vo.EnumEqualizerType;
import com.mstar.android.tvapi.common.vo.EnumKtvAudioMpegSoundMode;
import com.mstar.android.tvapi.common.vo.EnumKtvMixVolumeType;
import com.mstar.android.tvapi.common.vo.EnumMuteStatusType;
import com.mstar.android.tvapi.common.vo.EnumSoundEffectType;
import com.mstar.android.tvapi.common.vo.EnumSoundGetParameterType;
import com.mstar.android.tvapi.common.vo.EnumSoundHidevMode;
import com.mstar.android.tvapi.common.vo.EnumSoundSetParamType;
import com.mstar.android.tvapi.common.vo.KtvInfoType;
import com.mstar.android.tvapi.common.vo.MuteType;
import com.mstar.android.tvapi.common.vo.TvOsType;
import com.mstar.android.tvapi.dtv.vo.AudioAc4Presentation;
import java.lang.ref.WeakReference;

/* JADX INFO: loaded from: classes.dex */
public final class AudioManager {
    public static final short AUDIO_AC3P_INFOTYPE_MIXER_BALANCE = 23;
    public static final int DOLBY_DAP_BASS_PARAMTER = 11;
    public static final int DOLBY_DAP_CALIBRATION_BOOST = 3;
    public static final int DOLBY_DAP_DE_PARAMTER = 7;
    public static final int DOLBY_DAP_GAIN_PARAMTER = 0;
    public static final int DOLBY_DAP_GEQ_PARAMTER = 9;
    public static final int DOLBY_DAP_IEQ_PARAMTER = 6;
    public static final int DOLBY_DAP_LEVLER_PARAMTER = 4;
    public static final int DOLBY_DAP_MI_PARAMTER = 2;
    public static final int DOLBY_DAP_MODELER_PARAMTER = 5;
    public static final int DOLBY_DAP_OPTIMIZER_PARAMTER = 10;
    public static final int DOLBY_DAP_REGULATOR_PARAMTER = 13;
    public static final int DOLBY_DAP_REG_PARAMTER = 12;
    public static final int DOLBY_DAP_SURROUNDVIRTUALIZER_PARAMTER = 1;
    public static final int DOLBY_DAP_VIRTUAL_BASS_PARAMTER = 14;
    public static final int DOLBY_DAP_VOL_MAX_BOOST = 8;
    public static final int E_ATVPLAYER_AUTO_TUNING_RECEIVE_EVENT_INTERVAL = 800000;
    private static final String IAUDIO_MANAGER = "mstar.IAudioManager";
    private static final String TAG = "AudioManager";
    public static final int TVAUDIO_AP_SET_VOLUME = 1;
    public static final int TVAUDIO_DOLBY_ATMOS_INFO = 1001;
    public static final int TVAUDIO_DOLBY_EVENT_END = 1999;
    public static final int TVAUDIO_DOLBY_EVENT_START = 1000;
    public static final int TVAUDIO_VOLUME_EVENT_END = 999;
    public static final int TVAUDIO_VOLUME_EVENT_START = 0;
    private static AudioManager _audioManager;
    private int mAudioManagerContext;
    private EventHandler mEventHandler;
    private long mNativeContext;
    private OnAudioEventListener mOnAudioEventListener;
    private OnEventListener mOnEventListener;

    private class EventHandler extends Handler {
        private AudioManager mMSrv;

        public EventHandler(AudioManager audioManager, Looper looper) {
            super(looper);
            this.mMSrv = audioManager;
        }

        @Override // android.os.Handler
        public void handleMessage(Message message) {
            if (this.mMSrv.mNativeContext == 0) {
                return;
            }
            if (AudioManager.this.mOnEventListener != null) {
                AudioManager.this.mOnEventListener.onEvent(message);
            }
            if (message.what == 1 && AudioManager.this.mOnAudioEventListener != null) {
                AudioManager.this.mOnAudioEventListener.onApSetVolumeEvent(message.what);
            }
        }
    }

    static {
        try {
            System.loadLibrary("audiomanager_jni");
            native_init();
        } catch (UnsatisfiedLinkError e2) {
            Log.d(TAG, "Cannot load audiomanager_jni library:\n" + e2.toString());
        }
    }

    private AudioManager() {
        Looper looperMyLooper = Looper.myLooper();
        if (looperMyLooper != null) {
            this.mEventHandler = new EventHandler(this, looperMyLooper);
        } else {
            Looper mainLooper = Looper.getMainLooper();
            if (mainLooper != null) {
                this.mEventHandler = new EventHandler(this, mainLooper);
            } else {
                this.mEventHandler = null;
            }
        }
        native_setup(new WeakReference(this));
    }

    private final native byte getDolbyDapParam(Parcel parcel, Parcel parcel2) throws TvCommonException;

    protected static AudioManager getInstance() {
        if (_audioManager == null) {
            synchronized (AudioManager.class) {
                try {
                    if (_audioManager == null) {
                        _audioManager = new AudioManager();
                    }
                } finally {
                }
            }
        }
        return _audioManager;
    }

    private final native short native_SetSoundParameter(int i2, int i3, int i4);

    private native int native_checkAtvSoundSystem() throws TvCommonException;

    private final native short native_disableKtvMixModeMute(int i2);

    private final native int native_disableMute(int i2) throws TvCommonException;

    private native int native_enableAdvancedSoundEffect(int i2, int i3) throws TvCommonException;

    private native int native_enableBasicSoundEffect(int i2, boolean z2) throws TvCommonException;

    private final native short native_enableKtvMixModeMute(int i2);

    private final native int native_enableMute(int i2) throws TvCommonException;

    private final native void native_finalize();

    private final native int native_getAdvancedSoundEffect(int i2) throws TvCommonException;

    private native int native_getAtvInfo() throws TvCommonException;

    private final native int native_getAtvMtsMode() throws TvCommonException;

    private final native int native_getAtvSoundMode() throws TvCommonException;

    private final native int native_getAtvSoundSystem() throws TvCommonException;

    private native int native_getAudioLanguage1();

    private native int native_getAudioLanguage2();

    private final native byte native_getAudioVolume(int i2) throws TvCommonException;

    private final native int native_getBasicSoundEffect(int i2) throws TvCommonException;

    private final native int native_getDtvOutputMode() throws TvCommonException;

    private final native short native_getInputLevel(int i2) throws TvCommonException;

    private final native int native_getInputSource() throws TvCommonException;

    private final native int native_getKtvSoundInfo(int i2) throws TvCommonException;

    private final native int native_getSoundParameter(int i2, int i3);

    private static final native void native_init();

    private final native boolean native_isMuteEnabled(int i2) throws TvCommonException;

    private native void native_setADAbsoluteVolume(int i2);

    private native void native_setADEnable(boolean z2);

    private final native int native_setAdvancedSoundEffect(int i2, AdvancedSoundParameter advancedSoundParameter) throws TvCommonException;

    private native void native_setAmplifierEqualizerByMode(int i2);

    private native int native_setAtvInfo(int i2, int i3) throws TvCommonException;

    private final native int native_setAtvMtsMode(int i2) throws TvCommonException;

    private final native boolean native_setAtvSoundSystem(int i2) throws TvCommonException;

    private final native short native_setAudioCaptureSource(int i2, int i3);

    private native void native_setAudioLanguage1(int i2);

    private native void native_setAudioLanguage2(int i2);

    private native int native_setAudioOutput(int i2, AudioOutParameter audioOutParameter) throws TvCommonException;

    private native int native_setAudioSource(int i2, int i3);

    private final native void native_setAudioVolume(int i2, byte b2) throws TvCommonException;

    private native void native_setAutoHOHEnable(boolean z2);

    private final native int native_setBasicSoundEffect(int i2, DtvSoundEffect dtvSoundEffect) throws TvCommonException;

    private native boolean native_setCommonAudioInfo(int i2, int i3, int i4);

    private final native void native_setDtvOutputMode(int i2) throws TvCommonException;

    private final native void native_setInputLevel(int i2, short s2) throws TvCommonException;

    private final native void native_setInputSource(int i2) throws TvCommonException;

    private final native short native_setKtvMixModeVolume(int i2, short s2, short s3);

    private final native short native_setKtvSoundInfo(int i2, int i3, int i4) throws TvCommonException;

    private native int native_setKtvSoundTrack(int i2);

    private final native boolean native_setMuteStatus(int i2, int i3) throws TvCommonException;

    private final native short native_setOutputSourceInfo(int i2, int i3);

    private final native int native_setToNextAtvMtsMode() throws TvCommonException;

    private final native void native_setup(Object obj);

    private static void postEventFromNative(Object obj, int i2, int i3, int i4, Object obj2) {
        AudioManager audioManager = (AudioManager) ((WeakReference) obj).get();
        if (audioManager == null) {
            return;
        }
        EventHandler eventHandler = audioManager.mEventHandler;
        if (eventHandler != null) {
            audioManager.mEventHandler.sendMessage(eventHandler.obtainMessage(i2, i3, i4, obj2));
        }
        Log.d(TAG, "Native Audio callback , postEventFromNative");
    }

    private final native byte setDolbyDapParam(Parcel parcel, Parcel parcel2) throws TvCommonException;

    public EnumAudioReturn checkAtvSoundSystem() throws TvCommonException {
        int iNative_checkAtvSoundSystem = native_checkAtvSoundSystem();
        if (iNative_checkAtvSoundSystem < EnumAudioReturn.E_RETURN_NOTOK.ordinal() || iNative_checkAtvSoundSystem > EnumAudioReturn.E_RETURN_UNSUPPORT.ordinal()) {
            throw new TvCommonException("native_checkAtvSoundSystem failed");
        }
        return EnumAudioReturn.values()[iNative_checkAtvSoundSystem];
    }

    public final short disableKtvMixModeMute(EnumKtvMixVolumeType enumKtvMixVolumeType) {
        return native_disableKtvMixModeMute(enumKtvMixVolumeType.ordinal());
    }

    public EnumAudioReturn disableMute(MuteType.EnumMuteType enumMuteType) throws TvCommonException {
        int iNative_disableMute = native_disableMute(enumMuteType.getValue());
        if (iNative_disableMute < EnumAudioReturn.E_RETURN_NOTOK.ordinal() || iNative_disableMute > EnumAudioReturn.E_RETURN_UNSUPPORT.ordinal()) {
            throw new TvCommonException("native_disableMute failed");
        }
        return EnumAudioReturn.values()[iNative_disableMute];
    }

    public EnumAudioReturn enableAdvancedSoundEffect(int i2, int i3) throws TvCommonException {
        int iNative_enableAdvancedSoundEffect = native_enableAdvancedSoundEffect(i2, i3);
        if (iNative_enableAdvancedSoundEffect < EnumAudioReturn.E_RETURN_NOTOK.ordinal() || iNative_enableAdvancedSoundEffect > EnumAudioReturn.E_RETURN_UNSUPPORT.ordinal()) {
            throw new TvCommonException("native_enableAdvancedSoundEffect failed");
        }
        return EnumAudioReturn.values()[iNative_enableAdvancedSoundEffect];
    }

    public EnumAudioReturn enableBasicSoundEffect(EnumSoundEffectType enumSoundEffectType, boolean z2) throws TvCommonException {
        int iNative_enableBasicSoundEffect = native_enableBasicSoundEffect(enumSoundEffectType.ordinal(), z2);
        if (iNative_enableBasicSoundEffect < EnumAudioReturn.E_RETURN_NOTOK.ordinal() || iNative_enableBasicSoundEffect > EnumAudioReturn.E_RETURN_UNSUPPORT.ordinal()) {
            throw new TvCommonException("native_checkAtvSoundSystem failed");
        }
        return EnumAudioReturn.values()[iNative_enableBasicSoundEffect];
    }

    public final short enableKtvMixModeMute(EnumKtvMixVolumeType enumKtvMixVolumeType) {
        return native_enableKtvMixModeMute(enumKtvMixVolumeType.ordinal());
    }

    public EnumAudioReturn enableMute(MuteType.EnumMuteType enumMuteType) throws TvCommonException {
        int iNative_enableMute = native_enableMute(enumMuteType.getValue());
        if (iNative_enableMute < EnumAudioReturn.E_RETURN_NOTOK.ordinal() || iNative_enableMute > EnumAudioReturn.E_RETURN_UNSUPPORT.ordinal()) {
            throw new TvCommonException("enableMute failed");
        }
        return EnumAudioReturn.values()[iNative_enableMute];
    }

    public final native short executeAmplifierExtendedCommand(short s2, int i2, int i3, int[] iArr) throws TvCommonException;

    protected void finalize() throws Throwable {
        super.finalize();
        native_finalize();
        _audioManager = null;
    }

    public final native int getAC4DialogEnhance() throws TvCommonException;

    public final native AudioAc4Presentation getAC4Presentation(int i2) throws TvCommonException;

    public final native int getAdvancedSoundEffect(int i2) throws TvCommonException;

    public final int getAdvancedSoundEffect(EnumAdvancedSoundParameterType enumAdvancedSoundParameterType) throws TvCommonException {
        return native_getAdvancedSoundEffect(enumAdvancedSoundParameterType.ordinal());
    }

    public EnumAtvInfoType getAtvInfo() throws TvCommonException {
        int iNative_getAtvInfo = native_getAtvInfo();
        EnumAtvInfoType enumAtvInfoType = EnumAtvInfoType.E_ATV_HIDEV_INFO;
        if (iNative_getAtvInfo < enumAtvInfoType.ordinal() || iNative_getAtvInfo > enumAtvInfoType.ordinal()) {
            throw new TvCommonException("native_getAtvInfo failed");
        }
        return EnumAtvInfoType.values()[iNative_getAtvInfo];
    }

    public EnumAtvAudioModeType getAtvMtsMode() throws TvCommonException {
        int iNative_getAtvMtsMode = native_getAtvMtsMode();
        if (iNative_getAtvMtsMode < EnumAtvAudioModeType.E_ATV_AUDIOMODE_INVALID.ordinal() || iNative_getAtvMtsMode > EnumAtvAudioModeType.E_ATV_AUDIOMODE_NUM.ordinal()) {
            throw new TvCommonException("native_getAtvMtsMode failed");
        }
        return EnumAtvAudioModeType.values()[iNative_getAtvMtsMode];
    }

    public EnumAtvAudioModeType getAtvSoundMode() throws TvCommonException {
        int iNative_getAtvSoundMode = native_getAtvSoundMode();
        if (iNative_getAtvSoundMode < EnumAtvAudioModeType.E_ATV_AUDIOMODE_INVALID.ordinal() || iNative_getAtvSoundMode > EnumAtvAudioModeType.E_ATV_AUDIOMODE_NUM.ordinal()) {
            throw new TvCommonException("native_getAtvSoundMode failed");
        }
        return EnumAtvAudioModeType.values()[iNative_getAtvSoundMode];
    }

    public AtvSystemStandard.EnumAtvSystemStandard getAtvSoundSystem() throws TvCommonException {
        int ordinalThroughValue = AtvSystemStandard.EnumAtvSystemStandard.getOrdinalThroughValue(native_getAtvSoundSystem());
        if (ordinalThroughValue < AtvSystemStandard.EnumAtvSystemStandard.E_BG.getValue() || ordinalThroughValue > AtvSystemStandard.EnumAtvSystemStandard.E_NUM.getValue()) {
            throw new TvCommonException("getAtvSoundSystem failed");
        }
        return AtvSystemStandard.EnumAtvSystemStandard.values()[ordinalThroughValue];
    }

    public final native int getAudioCapability(int i2) throws TvCommonException;

    public final native int getAudioOutmode() throws TvCommonException;

    public int getAudioPrimaryLanguage() {
        return native_getAudioLanguage1();
    }

    public int getAudioSecondaryLanguage() {
        return native_getAudioLanguage2();
    }

    public final byte getAudioVolume(EnumAudioVolumeSourceType enumAudioVolumeSourceType) throws TvCommonException {
        return native_getAudioVolume(enumAudioVolumeSourceType.ordinal());
    }

    public final native boolean getAutoVolume() throws TvCommonException;

    public final int getBasicSoundEffect(EnumSoundGetParameterType enumSoundGetParameterType) throws TvCommonException {
        return native_getBasicSoundEffect(enumSoundGetParameterType.ordinal());
    }

    public final native AudioSrsTableEntry[] getDTSSRSTable() throws TvCommonException;

    public final native int getDTSSRSTableSize() throws TvCommonException;

    public final native int getDolbyDapMode() throws TvCommonException;

    public final DolbyDapParamter getDolbyDapParam(int i2) throws TvCommonException {
        Parcel parcelObtain = Parcel.obtain();
        Parcel parcelObtain2 = Parcel.obtain();
        parcelObtain.writeInterfaceToken(IAUDIO_MANAGER);
        DolbyDapParamter dolbyDapParamter = new DolbyDapParamter();
        parcelObtain.writeInt(i2);
        getDolbyDapParam(parcelObtain, parcelObtain2);
        int i3 = 0;
        switch (i2) {
            case 0:
                dolbyDapParamter.preGain = parcelObtain2.readInt();
                dolbyDapParamter.postGain = parcelObtain2.readInt();
                dolbyDapParamter.systemGain = parcelObtain2.readInt();
                Log.d(TAG, "preGain = " + dolbyDapParamter.preGain);
                Log.d(TAG, "postGain = " + dolbyDapParamter.preGain);
                Log.d(TAG, "systemGain = " + dolbyDapParamter.preGain);
                break;
            case 1:
                dolbyDapParamter.surroundDecoderEnable = parcelObtain2.readInt();
                dolbyDapParamter.virtualizerEnable = parcelObtain2.readInt();
                dolbyDapParamter.headphoneReverb = parcelObtain2.readInt();
                dolbyDapParamter.speakerAngle = parcelObtain2.readInt();
                dolbyDapParamter.speakerStart = parcelObtain2.readInt();
                dolbyDapParamter.surroundBoost = parcelObtain2.readInt();
                Log.d(TAG, "surroundDecoderEnable = " + dolbyDapParamter.surroundDecoderEnable);
                Log.d(TAG, "virtualizerEnable = " + dolbyDapParamter.virtualizerEnable);
                Log.d(TAG, "headphoneReverb = " + dolbyDapParamter.headphoneReverb);
                Log.d(TAG, "speakerAngle = " + dolbyDapParamter.speakerAngle);
                Log.d(TAG, "speakerStart = " + dolbyDapParamter.speakerStart);
                Log.d(TAG, "surroundBoost = " + dolbyDapParamter.surroundBoost);
                break;
            case 2:
                dolbyDapParamter.miIeqEnable = parcelObtain2.readInt();
                dolbyDapParamter.miDvEnable = parcelObtain2.readInt();
                dolbyDapParamter.miDeEnable = parcelObtain2.readInt();
                dolbyDapParamter.miSurroundEnable = parcelObtain2.readInt();
                Log.d(TAG, "miIeqEnable = " + dolbyDapParamter.miIeqEnable);
                Log.d(TAG, "miDvEnable = " + dolbyDapParamter.miDvEnable);
                Log.d(TAG, "miDeEnable = " + dolbyDapParamter.miDeEnable);
                Log.d(TAG, "miSurroundEnable = " + dolbyDapParamter.miSurroundEnable);
                break;
            case 3:
                dolbyDapParamter.calibrationBoost = parcelObtain2.readInt();
                Log.d(TAG, "calibrationBoost = " + dolbyDapParamter.calibrationBoost);
                break;
            case 4:
                dolbyDapParamter.levelerAmount = parcelObtain2.readInt();
                dolbyDapParamter.levelerInput = parcelObtain2.readInt();
                dolbyDapParamter.levelerOutput = parcelObtain2.readInt();
                dolbyDapParamter.levelerEnable = parcelObtain2.readInt();
                Log.d(TAG, "levelerAmount = " + dolbyDapParamter.levelerAmount);
                Log.d(TAG, "levelerInput = " + dolbyDapParamter.levelerInput);
                Log.d(TAG, "levelerOutput = " + dolbyDapParamter.levelerOutput);
                Log.d(TAG, "levelerEnable = " + dolbyDapParamter.levelerEnable);
                break;
            case 5:
                dolbyDapParamter.modelerEnable = parcelObtain2.readInt();
                dolbyDapParamter.modelerCalibration = parcelObtain2.readInt();
                Log.d(TAG, "modelerEnable = " + dolbyDapParamter.modelerEnable);
                Log.d(TAG, "modelerCalibration = " + dolbyDapParamter.modelerCalibration);
                break;
            case 6:
                dolbyDapParamter.ieqEnable = parcelObtain2.readInt();
                dolbyDapParamter.ieqAmount = parcelObtain2.readInt();
                dolbyDapParamter.ieqNbBands = parcelObtain2.readInt();
                Log.d(TAG, "ieqEnable = " + dolbyDapParamter.ieqEnable);
                Log.d(TAG, "ieqAmount = " + dolbyDapParamter.ieqAmount);
                Log.d(TAG, "ieqNbBands = " + dolbyDapParamter.ieqNbBands);
                for (int i4 = 0; i4 < 20; i4++) {
                    dolbyDapParamter.aIeqBandCenter[i4] = parcelObtain2.readInt();
                    Log.d(TAG, "aIeqBandCenter[" + i4 + "] = " + dolbyDapParamter.aIeqBandCenter[i4]);
                }
                while (i3 < 20) {
                    dolbyDapParamter.aIeqBandTarget[i3] = parcelObtain2.readInt();
                    Log.d(TAG, "aIeqBandTarget[" + i3 + "] = " + dolbyDapParamter.aIeqBandTarget[i3]);
                    i3++;
                }
                break;
            case 7:
                dolbyDapParamter.deEnable = parcelObtain2.readInt();
                dolbyDapParamter.deAmount = parcelObtain2.readInt();
                dolbyDapParamter.deDucking = parcelObtain2.readInt();
                Log.d(TAG, "deEnable = " + dolbyDapParamter.deEnable);
                Log.d(TAG, "deAmount = " + dolbyDapParamter.deAmount);
                Log.d(TAG, "deDucking = " + dolbyDapParamter.deDucking);
                break;
            case 8:
                dolbyDapParamter.volmaxBoost = parcelObtain2.readInt();
                Log.d(TAG, "volmaxBoost = " + dolbyDapParamter.volmaxBoost);
                break;
            case 9:
                dolbyDapParamter.geqEnable = parcelObtain2.readInt();
                dolbyDapParamter.geqNbBands = parcelObtain2.readInt();
                Log.d(TAG, "geqEnable = " + dolbyDapParamter.geqEnable);
                Log.d(TAG, "geqNbBands = " + dolbyDapParamter.geqNbBands);
                for (int i5 = 0; i5 < 20; i5++) {
                    dolbyDapParamter.aGeqBandCenter[i5] = parcelObtain2.readInt();
                    Log.d(TAG, "aGeqBandCenter[" + i5 + "] = " + dolbyDapParamter.aGeqBandCenter[i5]);
                }
                while (i3 < 20) {
                    dolbyDapParamter.aGeqBandTarget[i3] = parcelObtain2.readInt();
                    Log.d(TAG, "aGeqBandTarget[" + i3 + "] = " + dolbyDapParamter.aGeqBandTarget[i3]);
                    i3++;
                }
                break;
            case 10:
                dolbyDapParamter.optimizerEnable = parcelObtain2.readInt();
                dolbyDapParamter.optimizerNbBands = parcelObtain2.readInt();
                Log.d(TAG, "optimizerEnable = " + dolbyDapParamter.optimizerEnable);
                Log.d(TAG, "optimizerNbBands = " + dolbyDapParamter.optimizerNbBands);
                for (int i6 = 0; i6 < 6; i6++) {
                    dolbyDapParamter.aOptBandCenterFreq[i6] = parcelObtain2.readInt();
                    Log.d(TAG, "aOptBandCenterFreq[" + i6 + "] = " + dolbyDapParamter.aOptBandCenterFreq[i6]);
                }
                for (int i7 = 0; i7 < 6; i7++) {
                    for (int i8 = 0; i8 < 20; i8++) {
                        dolbyDapParamter.aOptBandGain[i7][i8] = parcelObtain2.readInt();
                        Log.d(TAG, "aOptBandGain[" + i7 + i8 + "] = " + dolbyDapParamter.aOptBandGain[i7][i8]);
                    }
                }
                break;
            case 11:
                dolbyDapParamter.bassEnable = parcelObtain2.readInt();
                dolbyDapParamter.bassBoost = parcelObtain2.readInt();
                dolbyDapParamter.bassCutoff = parcelObtain2.readInt();
                dolbyDapParamter.bassWidth = parcelObtain2.readInt();
                Log.d(TAG, "bassEnable = " + dolbyDapParamter.bassEnable);
                Log.d(TAG, "bassBoost = " + dolbyDapParamter.bassBoost);
                Log.d(TAG, "bassCutoff = " + dolbyDapParamter.bassCutoff);
                Log.d(TAG, "bassWidth = " + dolbyDapParamter.bassWidth);
                break;
            case 12:
                dolbyDapParamter.regNbBands = parcelObtain2.readInt();
                Log.d(TAG, "regNbBands = " + dolbyDapParamter.regNbBands);
                while (i3 < 20) {
                    dolbyDapParamter.aRegBandCenter[i3] = parcelObtain2.readInt();
                    dolbyDapParamter.aRegLowThresholds[i3] = parcelObtain2.readInt();
                    dolbyDapParamter.aRegHighThresholds[i3] = parcelObtain2.readInt();
                    dolbyDapParamter.aRegIsolatedBands[i3] = parcelObtain2.readInt();
                    Log.d(TAG, "aRegBandCenter[" + i3 + "] = " + dolbyDapParamter.aRegBandCenter[i3]);
                    Log.d(TAG, "aRegLowThresholds[" + i3 + "] = " + dolbyDapParamter.aRegLowThresholds[i3]);
                    Log.d(TAG, "aRegHighThresholds[" + i3 + "] = " + dolbyDapParamter.aRegHighThresholds[i3]);
                    Log.d(TAG, "aRegIsolatedBands[" + i3 + "] = " + dolbyDapParamter.aRegIsolatedBands[i3]);
                    i3++;
                }
                break;
            case 13:
                dolbyDapParamter.regulatorOverdrive = parcelObtain2.readInt();
                dolbyDapParamter.regulatorTimbre = parcelObtain2.readInt();
                dolbyDapParamter.regulatorDistortion = parcelObtain2.readInt();
                dolbyDapParamter.regulatorMode = parcelObtain2.readInt();
                dolbyDapParamter.regulatorEnable = parcelObtain2.readInt();
                Log.d(TAG, "regulatorOverdrive = " + dolbyDapParamter.regulatorOverdrive);
                Log.d(TAG, "regulatorTimbre = " + dolbyDapParamter.regulatorTimbre);
                Log.d(TAG, "regulatorDistortion = " + dolbyDapParamter.regulatorDistortion);
                Log.d(TAG, "regulatorMode = " + dolbyDapParamter.regulatorMode);
                Log.d(TAG, "regulatorEnable = " + dolbyDapParamter.regulatorEnable);
                break;
            case 14:
                dolbyDapParamter.virtualBassMode = parcelObtain2.readInt();
                dolbyDapParamter.virtualBassLowSrcFreq = parcelObtain2.readInt();
                dolbyDapParamter.virtualBassHighSrcFreq = parcelObtain2.readInt();
                dolbyDapParamter.virtualBassOverallGain = parcelObtain2.readInt();
                dolbyDapParamter.virtualBassSlopeGain = parcelObtain2.readInt();
                Log.d(TAG, "virtualBassMode = " + dolbyDapParamter.virtualBassMode);
                Log.d(TAG, "virtualBassLowSrcFreq = " + dolbyDapParamter.virtualBassLowSrcFreq);
                Log.d(TAG, "virtualBassHighSrcFreq = " + dolbyDapParamter.virtualBassHighSrcFreq);
                Log.d(TAG, "virtualBassOverallGain = " + dolbyDapParamter.virtualBassOverallGain);
                Log.d(TAG, "virtualBassSlopeGain = " + dolbyDapParamter.virtualBassSlopeGain);
                while (i3 < 3) {
                    dolbyDapParamter.virtualBassSubgain[i3] = parcelObtain2.readInt();
                    Log.d(TAG, "virtualBassSubgain[" + i3 + "] = " + dolbyDapParamter.virtualBassSubgain[i3]);
                    i3++;
                }
                dolbyDapParamter.virtualBassMixLowFreq = parcelObtain2.readInt();
                dolbyDapParamter.virtualBassMixHighFreq = parcelObtain2.readInt();
                dolbyDapParamter.virtualBassEnable = parcelObtain2.readInt();
                Log.d(TAG, "virtualBassMixLowFreq = " + dolbyDapParamter.virtualBassMixLowFreq);
                Log.d(TAG, "virtualBassMixHighFreq = " + dolbyDapParamter.virtualBassMixHighFreq);
                Log.d(TAG, "virtualBassEnable = " + dolbyDapParamter.virtualBassEnable);
                break;
            default:
                Log.d(TAG, "DolbyDapSubType error!");
                break;
        }
        parcelObtain.recycle();
        parcelObtain2.recycle();
        return dolbyDapParamter;
    }

    public final native int getDolbyDapUserParam(int i2) throws TvCommonException;

    public EnumDtvSoundMode getDtvOutputMode() throws TvCommonException {
        int iNative_getDtvOutputMode = native_getDtvOutputMode();
        if (iNative_getDtvOutputMode < EnumDtvSoundMode.E_STEREO.ordinal() || iNative_getDtvOutputMode > EnumDtvSoundMode.E_NUM.ordinal()) {
            throw new TvCommonException("getDtvOutputMode failed");
        }
        return EnumDtvSoundMode.values()[iNative_getDtvOutputMode];
    }

    public final native boolean getHDMITx_HDBypass() throws TvCommonException;

    public final native boolean getHDMITx_HDBypass_Capability() throws TvCommonException;

    public short getInputLevel(EnumAudioInputLevelSourceType enumAudioInputLevelSourceType) throws TvCommonException {
        return native_getInputLevel(enumAudioInputLevelSourceType.ordinal());
    }

    public TvOsType.EnumInputSource getInputSource() throws TvCommonException {
        int iNative_getInputSource = native_getInputSource();
        if ((iNative_getInputSource >= TvOsType.EnumInputSource.E_INPUT_SOURCE_VGA.ordinal() && iNative_getInputSource <= TvOsType.EnumInputSource.E_INPUT_SOURCE_NONE.ordinal()) || iNative_getInputSource == TvOsType.EnumInputSource.E_INPUT_SOURCE_VGA2.ordinal() || iNative_getInputSource == TvOsType.EnumInputSource.E_INPUT_SOURCE_VGA3.ordinal()) {
            return TvOsType.EnumInputSource.values()[iNative_getInputSource];
        }
        throw new TvCommonException("getInputSource failed");
    }

    public final int getKtvSoundInfo(KtvInfoType.EnumKtvInfoType enumKtvInfoType) throws TvCommonException {
        return native_getKtvSoundInfo(enumKtvInfoType.getValue());
    }

    public final native int getSoundAC3PlusInfo(int i2) throws TvCommonException;

    public final int getSoundParameter(EnumSoundSetParamType enumSoundSetParamType, int i2) {
        return native_getSoundParameter(enumSoundSetParamType.ordinal(), i2);
    }

    public final native int isEnableAdvancedSoundEffect(int i2) throws TvCommonException;

    public final boolean isMuteEnabled(EnumMuteStatusType enumMuteStatusType) throws TvCommonException {
        return native_isMuteEnabled(enumMuteStatusType.ordinal());
    }

    protected void release() throws Throwable {
        _audioManager = null;
    }

    public final native int setAC4DialogEnhance(int i2, int i3) throws TvCommonException;

    public final native int setAC4Presentation(int i2, int i3) throws TvCommonException;

    public void setADAbsoluteVolume(int i2) {
        native_setADAbsoluteVolume(i2);
    }

    public void setADEnable(boolean z2) {
        native_setADEnable(z2);
    }

    public final native byte setAdvancedSoundEffect(int i2, int i3) throws TvCommonException;

    public final EnumAudioReturn setAdvancedSoundEffect(EnumAdvancedSoundParameterType enumAdvancedSoundParameterType, AdvancedSoundParameter advancedSoundParameter) throws TvCommonException {
        int iNative_setAdvancedSoundEffect = native_setAdvancedSoundEffect(enumAdvancedSoundParameterType.ordinal(), advancedSoundParameter);
        if (iNative_setAdvancedSoundEffect < EnumAudioReturn.E_RETURN_NOTOK.ordinal() || iNative_setAdvancedSoundEffect > EnumAudioReturn.E_RETURN_UNSUPPORT.ordinal()) {
            throw new TvCommonException("native_setAdvancedSoundEffect failed");
        }
        return EnumAudioReturn.values()[iNative_setAdvancedSoundEffect];
    }

    public final void setAmplifierEqualizerByMode(EnumEqualizerType enumEqualizerType) throws TvCommonException {
        native_setAmplifierEqualizerByMode(enumEqualizerType.ordinal());
    }

    public final native boolean setAmplifierMute(boolean z2) throws TvCommonException;

    public EnumAudioReturn setAtvInfo(EnumAtvInfoType enumAtvInfoType, EnumSoundHidevMode enumSoundHidevMode) throws TvCommonException {
        int iNative_setAtvInfo = native_setAtvInfo(enumAtvInfoType.ordinal(), enumSoundHidevMode.ordinal());
        if (iNative_setAtvInfo < EnumAudioReturn.E_RETURN_NOTOK.ordinal() || iNative_setAtvInfo > EnumAudioReturn.E_RETURN_UNSUPPORT.ordinal()) {
            throw new TvCommonException("native_setAtvInfo failed");
        }
        return EnumAudioReturn.values()[iNative_setAtvInfo];
    }

    public EnumAudioReturn setAtvMtsMode(EnumAtvAudioModeType enumAtvAudioModeType) throws TvCommonException {
        int iNative_setAtvMtsMode = native_setAtvMtsMode(enumAtvAudioModeType.ordinal());
        if (iNative_setAtvMtsMode < EnumAudioReturn.E_RETURN_NOTOK.ordinal() || iNative_setAtvMtsMode > EnumAudioReturn.E_RETURN_UNSUPPORT.ordinal()) {
            throw new TvCommonException("native_SetAtvMtsMode failed");
        }
        return EnumAudioReturn.values()[iNative_setAtvMtsMode];
    }

    public boolean setAtvSoundSystem(AtvSystemStandard.EnumAtvSystemStandard enumAtvSystemStandard) throws TvCommonException {
        return native_setAtvSoundSystem(enumAtvSystemStandard.getValue());
    }

    public final EnumAudioReturn setAudioCaptureSource(EnumAuidoCaptureDeviceType enumAuidoCaptureDeviceType, EnumAuidoCaptureSource enumAuidoCaptureSource) throws TvCommonException {
        short sNative_setAudioCaptureSource = native_setAudioCaptureSource(enumAuidoCaptureDeviceType.ordinal(), enumAuidoCaptureSource.ordinal());
        if (sNative_setAudioCaptureSource < EnumAudioReturn.E_RETURN_NOTOK.ordinal() || sNative_setAudioCaptureSource > EnumAudioReturn.E_RETURN_UNSUPPORT.ordinal()) {
            throw new TvCommonException("native_setAudioCaptureSource  failed");
        }
        return EnumAudioReturn.values()[sNative_setAudioCaptureSource];
    }

    public final native boolean setAudioOutmode(int i2) throws TvCommonException;

    public EnumAudioReturn setAudioOutput(EnumAudioOutType enumAudioOutType, AudioOutParameter audioOutParameter) throws TvCommonException {
        int iNative_setAudioOutput = native_setAudioOutput(enumAudioOutType.ordinal(), audioOutParameter);
        if (iNative_setAudioOutput < EnumAudioReturn.E_RETURN_NOTOK.ordinal() || iNative_setAudioOutput > EnumAudioReturn.E_RETURN_UNSUPPORT.ordinal()) {
            throw new TvCommonException("setAudioOutput failed");
        }
        return EnumAudioReturn.values()[iNative_setAudioOutput];
    }

    public void setAudioPrimaryLanguage(int i2) {
        native_setAudioLanguage1(i2);
    }

    public void setAudioSecondaryLanguage(int i2) {
        native_setAudioLanguage2(i2);
    }

    public int setAudioSource(TvOsType.EnumInputSource enumInputSource, EnumAudioProcessorType enumAudioProcessorType) {
        return native_setAudioSource(enumInputSource.ordinal(), enumAudioProcessorType.ordinal());
    }

    public void setAudioVolume(EnumAudioVolumeSourceType enumAudioVolumeSourceType, byte b2) throws TvCommonException {
        native_setAudioVolume(enumAudioVolumeSourceType.ordinal(), b2);
    }

    public void setAutoHOHEnable(boolean z2) {
        native_setAutoHOHEnable(z2);
    }

    public final native void setAutoVolume(boolean z2) throws TvCommonException;

    public final EnumAudioReturn setBasicSoundEffect(EnumSoundEffectType enumSoundEffectType, DtvSoundEffect dtvSoundEffect) throws TvCommonException {
        int iNative_setBasicSoundEffect = native_setBasicSoundEffect(enumSoundEffectType.ordinal(), dtvSoundEffect);
        if (iNative_setBasicSoundEffect < EnumAudioReturn.E_RETURN_NOTOK.ordinal() || iNative_setBasicSoundEffect > EnumAudioReturn.E_RETURN_UNSUPPORT.ordinal()) {
            throw new TvCommonException("setBasicSoundEffect failed");
        }
        return EnumAudioReturn.values()[iNative_setBasicSoundEffect];
    }

    public boolean setCommonAudioInfo(AudioCommonInfoType.EnumAudioCommonInfoType enumAudioCommonInfoType, int i2, int i3) {
        return native_setCommonAudioInfo(enumAudioCommonInfoType.getValue(), i2, i3);
    }

    public final native boolean setDTSSRSTable(AudioSrsTableEntry[] audioSrsTableEntryArr) throws TvCommonException;

    public final native void setDebugMode(boolean z2) throws TvCommonException;

    public final native void setDigitalOut(int i2) throws TvCommonException;

    public final native byte setDolbyDapMode(int i2) throws TvCommonException;

    public final byte setDolbyDapParam(int i2, DolbyDapParamter dolbyDapParamter) throws TvCommonException {
        Parcel parcelObtain = Parcel.obtain();
        Parcel parcelObtain2 = Parcel.obtain();
        parcelObtain.writeInterfaceToken(IAUDIO_MANAGER);
        parcelObtain.writeInt(i2);
        switch (i2) {
            case 0:
                DolbyDapGainParamter dolbyDapGainParamter = new DolbyDapGainParamter();
                dolbyDapGainParamter.preGain = dolbyDapParamter.preGain;
                dolbyDapGainParamter.postGain = dolbyDapParamter.postGain;
                dolbyDapGainParamter.systemGain = dolbyDapParamter.systemGain;
                Log.d(TAG, "preGain = " + dolbyDapParamter.preGain);
                Log.d(TAG, "postGain = " + dolbyDapParamter.preGain);
                Log.d(TAG, "systemGain = " + dolbyDapParamter.preGain);
                dolbyDapGainParamter.writeToParcel(parcelObtain, 0);
                break;
            case 1:
                DolbyDapSurroundVirtualizerParamter dolbyDapSurroundVirtualizerParamter = new DolbyDapSurroundVirtualizerParamter();
                dolbyDapSurroundVirtualizerParamter.surroundDecoderEnable = dolbyDapParamter.surroundDecoderEnable;
                dolbyDapSurroundVirtualizerParamter.virtualizerEnable = dolbyDapParamter.virtualizerEnable;
                dolbyDapSurroundVirtualizerParamter.headphoneReverb = dolbyDapParamter.headphoneReverb;
                dolbyDapSurroundVirtualizerParamter.speakerAngle = dolbyDapParamter.speakerAngle;
                dolbyDapSurroundVirtualizerParamter.speakerStart = dolbyDapParamter.speakerStart;
                dolbyDapSurroundVirtualizerParamter.surroundBoost = dolbyDapParamter.surroundBoost;
                Log.d(TAG, "surroundDecoderEnable = " + dolbyDapParamter.surroundDecoderEnable);
                Log.d(TAG, "virtualizerEnable = " + dolbyDapParamter.virtualizerEnable);
                Log.d(TAG, "headphoneReverb = " + dolbyDapParamter.headphoneReverb);
                Log.d(TAG, "speakerAngle = " + dolbyDapParamter.speakerAngle);
                Log.d(TAG, "speakerStart = " + dolbyDapParamter.speakerStart);
                Log.d(TAG, "surroundBoost = " + dolbyDapParamter.surroundBoost);
                dolbyDapSurroundVirtualizerParamter.writeToParcel(parcelObtain, 0);
                break;
            case 2:
                DolbyDapMiParamter dolbyDapMiParamter = new DolbyDapMiParamter();
                dolbyDapMiParamter.miIeqEnable = dolbyDapParamter.miIeqEnable;
                dolbyDapMiParamter.miDvEnable = dolbyDapParamter.miDvEnable;
                dolbyDapMiParamter.miDeEnable = dolbyDapParamter.miDeEnable;
                dolbyDapMiParamter.miSurroundEnable = dolbyDapParamter.miSurroundEnable;
                Log.d(TAG, "miIeqEnable = " + dolbyDapParamter.miIeqEnable);
                Log.d(TAG, "miDvEnable = " + dolbyDapParamter.miDvEnable);
                Log.d(TAG, "miDeEnable = " + dolbyDapParamter.miDeEnable);
                Log.d(TAG, "miSurroundEnable = " + dolbyDapParamter.miSurroundEnable);
                dolbyDapMiParamter.writeToParcel(parcelObtain, 0);
                break;
            case 3:
                DolbyDapCalibrationBoost dolbyDapCalibrationBoost = new DolbyDapCalibrationBoost();
                dolbyDapCalibrationBoost.calibrationBoost = dolbyDapParamter.calibrationBoost;
                Log.d(TAG, "calibrationBoost = " + dolbyDapParamter.calibrationBoost);
                dolbyDapCalibrationBoost.writeToParcel(parcelObtain, 0);
                break;
            case 4:
                DolbyDapLevlerParamter dolbyDapLevlerParamter = new DolbyDapLevlerParamter();
                dolbyDapLevlerParamter.levelerAmount = dolbyDapParamter.levelerAmount;
                dolbyDapLevlerParamter.levelerInput = dolbyDapParamter.levelerInput;
                dolbyDapLevlerParamter.levelerOutput = dolbyDapParamter.levelerOutput;
                dolbyDapLevlerParamter.levelerEnable = dolbyDapParamter.levelerEnable;
                Log.d(TAG, "levelerAmount = " + dolbyDapParamter.levelerAmount);
                Log.d(TAG, "levelerInput = " + dolbyDapParamter.levelerInput);
                Log.d(TAG, "levelerOutput = " + dolbyDapParamter.levelerOutput);
                Log.d(TAG, "levelerEnable = " + dolbyDapParamter.levelerEnable);
                dolbyDapLevlerParamter.writeToParcel(parcelObtain, 0);
                break;
            case 5:
                DolbyDapModelerParamter dolbyDapModelerParamter = new DolbyDapModelerParamter();
                dolbyDapModelerParamter.modelerEnable = dolbyDapParamter.modelerEnable;
                dolbyDapModelerParamter.modelerCalibration = dolbyDapParamter.modelerCalibration;
                Log.d(TAG, "modelerEnable = " + dolbyDapParamter.modelerEnable);
                Log.d(TAG, "modelerCalibration = " + dolbyDapParamter.modelerCalibration);
                dolbyDapModelerParamter.writeToParcel(parcelObtain, 0);
                break;
            case 6:
                DolbyDapIeqParamter dolbyDapIeqParamter = new DolbyDapIeqParamter();
                dolbyDapIeqParamter.ieqEnable = dolbyDapParamter.ieqEnable;
                dolbyDapIeqParamter.ieqAmount = dolbyDapParamter.ieqAmount;
                dolbyDapIeqParamter.ieqNbBands = dolbyDapParamter.ieqNbBands;
                Log.d(TAG, "ieqEnable = " + dolbyDapParamter.ieqEnable);
                Log.d(TAG, "ieqAmount = " + dolbyDapParamter.ieqAmount);
                Log.d(TAG, "ieqNbBands = " + dolbyDapParamter.ieqNbBands);
                for (int i3 = 0; i3 < 20; i3++) {
                    dolbyDapIeqParamter.aIeqBandCenter[i3] = dolbyDapParamter.aIeqBandCenter[i3];
                    dolbyDapIeqParamter.aIeqBandTarget[i3] = dolbyDapParamter.aIeqBandTarget[i3];
                    Log.d(TAG, "aIeqBandCenter[" + i3 + "] = " + dolbyDapParamter.aIeqBandCenter[i3]);
                    Log.d(TAG, "aIeqBandTarget[" + i3 + "] = " + dolbyDapParamter.aIeqBandTarget[i3]);
                }
                dolbyDapIeqParamter.writeToParcel(parcelObtain, 0);
                break;
            case 7:
                DolbyDapDeParamter dolbyDapDeParamter = new DolbyDapDeParamter();
                dolbyDapDeParamter.deEnable = dolbyDapParamter.deEnable;
                dolbyDapDeParamter.deAmount = dolbyDapParamter.deAmount;
                dolbyDapDeParamter.deDucking = dolbyDapParamter.deDucking;
                Log.d(TAG, "deEnable = " + dolbyDapParamter.deEnable);
                Log.d(TAG, "deAmount = " + dolbyDapParamter.deAmount);
                Log.d(TAG, "deDucking = " + dolbyDapParamter.deDucking);
                dolbyDapDeParamter.writeToParcel(parcelObtain, 0);
                break;
            case 8:
                DolbyDapVolMaxParamter dolbyDapVolMaxParamter = new DolbyDapVolMaxParamter();
                dolbyDapVolMaxParamter.volmaxBoost = dolbyDapParamter.volmaxBoost;
                Log.d(TAG, "volmaxBoost = " + dolbyDapParamter.volmaxBoost);
                dolbyDapVolMaxParamter.writeToParcel(parcelObtain, 0);
                break;
            case 9:
                DolbyDapGeqParamter dolbyDapGeqParamter = new DolbyDapGeqParamter();
                dolbyDapGeqParamter.geqEnable = dolbyDapParamter.geqEnable;
                dolbyDapGeqParamter.geqNbBands = dolbyDapParamter.geqNbBands;
                Log.d(TAG, "geqEnable = " + dolbyDapParamter.geqEnable);
                Log.d(TAG, "geqNbBands = " + dolbyDapParamter.geqNbBands);
                for (int i4 = 0; i4 < 20; i4++) {
                    dolbyDapGeqParamter.aGeqBandCenter[i4] = dolbyDapParamter.aGeqBandCenter[i4];
                    dolbyDapGeqParamter.aGeqBandTarget[i4] = dolbyDapParamter.aGeqBandTarget[i4];
                    Log.d(TAG, "aGeqBandCenter[" + i4 + "] = " + dolbyDapParamter.aGeqBandCenter[i4]);
                    Log.d(TAG, "aGeqBandTarget[" + i4 + "] = " + dolbyDapParamter.aGeqBandTarget[i4]);
                }
                dolbyDapGeqParamter.writeToParcel(parcelObtain, 0);
                break;
            case 10:
                DolbyDapOptimizerParamter dolbyDapOptimizerParamter = new DolbyDapOptimizerParamter();
                dolbyDapOptimizerParamter.optimizerEnable = dolbyDapParamter.optimizerEnable;
                dolbyDapOptimizerParamter.optimizerNbBands = dolbyDapParamter.optimizerNbBands;
                Log.d(TAG, "optimizerEnable = " + dolbyDapParamter.optimizerEnable);
                Log.d(TAG, "optimizerNbBands = " + dolbyDapParamter.optimizerNbBands);
                for (int i5 = 0; i5 < 6; i5++) {
                    dolbyDapOptimizerParamter.aOptBandCenterFreq[i5] = dolbyDapParamter.aOptBandCenterFreq[i5];
                    Log.d(TAG, "aOptBandCenterFreq[" + i5 + "] = " + dolbyDapParamter.aOptBandCenterFreq[i5]);
                }
                for (int i6 = 0; i6 < 6; i6++) {
                    for (int i7 = 0; i7 < 20; i7++) {
                        dolbyDapOptimizerParamter.aOptBandGain[i6][i7] = dolbyDapParamter.aOptBandGain[i6][i7];
                        Log.d(TAG, "aOptBandGain[" + i6 + i7 + "] = " + dolbyDapParamter.aOptBandGain[i6][i7]);
                    }
                }
                dolbyDapOptimizerParamter.writeToParcel(parcelObtain, 0);
                break;
            case 11:
                DolbyDapBassParamter dolbyDapBassParamter = new DolbyDapBassParamter();
                dolbyDapBassParamter.bassEnable = dolbyDapParamter.bassEnable;
                dolbyDapBassParamter.bassBoost = dolbyDapParamter.bassBoost;
                dolbyDapBassParamter.bassCutoff = dolbyDapParamter.bassCutoff;
                dolbyDapBassParamter.bassWidth = dolbyDapParamter.bassWidth;
                Log.d(TAG, "bassEnable = " + dolbyDapParamter.bassEnable);
                Log.d(TAG, "bassBoost = " + dolbyDapParamter.bassBoost);
                Log.d(TAG, "bassCutoff = " + dolbyDapParamter.bassCutoff);
                Log.d(TAG, "bassWidth = " + dolbyDapParamter.bassWidth);
                dolbyDapBassParamter.writeToParcel(parcelObtain, 0);
                break;
            case 12:
                DolbyDapRegParamter dolbyDapRegParamter = new DolbyDapRegParamter();
                dolbyDapRegParamter.regNbBands = dolbyDapParamter.regNbBands;
                Log.d(TAG, "regNbBands = " + dolbyDapParamter.regNbBands);
                for (int i8 = 0; i8 < 20; i8++) {
                    dolbyDapRegParamter.aRegBandCenter[i8] = dolbyDapParamter.aRegBandCenter[i8];
                    dolbyDapRegParamter.aRegLowThresholds[i8] = dolbyDapParamter.aRegLowThresholds[i8];
                    dolbyDapRegParamter.aRegHighThresholds[i8] = dolbyDapParamter.aRegHighThresholds[i8];
                    dolbyDapRegParamter.aRegIsolatedBands[i8] = dolbyDapParamter.aRegIsolatedBands[i8];
                    Log.d(TAG, "aRegBandCenter[" + i8 + "] = " + dolbyDapParamter.aRegBandCenter[i8]);
                    Log.d(TAG, "aRegLowThresholds[" + i8 + "] = " + dolbyDapParamter.aRegLowThresholds[i8]);
                    Log.d(TAG, "aRegHighThresholds[" + i8 + "] = " + dolbyDapParamter.aRegHighThresholds[i8]);
                    Log.d(TAG, "aRegIsolatedBands[" + i8 + "] = " + dolbyDapParamter.aRegIsolatedBands[i8]);
                }
                dolbyDapRegParamter.writeToParcel(parcelObtain, 0);
                break;
            case 13:
                DolbyDapRegulatorParamter dolbyDapRegulatorParamter = new DolbyDapRegulatorParamter();
                dolbyDapRegulatorParamter.regulatorOverdrive = dolbyDapParamter.regulatorOverdrive;
                dolbyDapRegulatorParamter.regulatorTimbre = dolbyDapParamter.regulatorTimbre;
                dolbyDapRegulatorParamter.regulatorDistortion = dolbyDapParamter.regulatorDistortion;
                dolbyDapRegulatorParamter.regulatorMode = dolbyDapParamter.regulatorMode;
                dolbyDapRegulatorParamter.regulatorEnable = dolbyDapParamter.regulatorEnable;
                Log.d(TAG, "regulatorOverdrive = " + dolbyDapParamter.regulatorOverdrive);
                Log.d(TAG, "regulatorTimbre = " + dolbyDapParamter.regulatorTimbre);
                Log.d(TAG, "regulatorDistortion = " + dolbyDapParamter.regulatorDistortion);
                Log.d(TAG, "regulatorMode = " + dolbyDapParamter.regulatorMode);
                Log.d(TAG, "regulatorEnable = " + dolbyDapParamter.regulatorEnable);
                dolbyDapRegulatorParamter.writeToParcel(parcelObtain, 0);
                break;
            case 14:
                DolbyDapVirtualBassParamter dolbyDapVirtualBassParamter = new DolbyDapVirtualBassParamter();
                dolbyDapVirtualBassParamter.virtualBassMode = dolbyDapParamter.virtualBassMode;
                dolbyDapVirtualBassParamter.virtualBassLowSrcFreq = dolbyDapParamter.virtualBassLowSrcFreq;
                dolbyDapVirtualBassParamter.virtualBassHighSrcFreq = dolbyDapParamter.virtualBassHighSrcFreq;
                dolbyDapVirtualBassParamter.virtualBassOverallGain = dolbyDapParamter.virtualBassOverallGain;
                dolbyDapVirtualBassParamter.virtualBassSlopeGain = dolbyDapParamter.virtualBassSlopeGain;
                Log.d(TAG, "virtualBassMode = " + dolbyDapParamter.virtualBassMode);
                Log.d(TAG, "virtualBassLowSrcFreq = " + dolbyDapParamter.virtualBassLowSrcFreq);
                Log.d(TAG, "virtualBassHighSrcFreq = " + dolbyDapParamter.virtualBassHighSrcFreq);
                Log.d(TAG, "virtualBassOverallGain = " + dolbyDapParamter.virtualBassOverallGain);
                Log.d(TAG, "virtualBassSlopeGain = " + dolbyDapParamter.virtualBassSlopeGain);
                for (int i9 = 0; i9 < 3; i9++) {
                    dolbyDapVirtualBassParamter.virtualBassSubgain[i9] = dolbyDapParamter.virtualBassSubgain[i9];
                    Log.d(TAG, "virtualBassSubgain[" + i9 + "] = " + dolbyDapParamter.virtualBassSubgain[i9]);
                }
                dolbyDapVirtualBassParamter.virtualBassMixLowFreq = dolbyDapParamter.virtualBassMixLowFreq;
                dolbyDapVirtualBassParamter.virtualBassMixHighFreq = dolbyDapParamter.virtualBassMixHighFreq;
                dolbyDapVirtualBassParamter.virtualBassEnable = dolbyDapParamter.virtualBassEnable;
                Log.d(TAG, "virtualBassMixLowFreq = " + dolbyDapParamter.virtualBassMixLowFreq);
                Log.d(TAG, "virtualBassMixHighFreq = " + dolbyDapParamter.virtualBassMixHighFreq);
                Log.d(TAG, "virtualBassEnable = " + dolbyDapParamter.virtualBassEnable);
                dolbyDapVirtualBassParamter.writeToParcel(parcelObtain, 0);
                break;
            default:
                Log.d(TAG, "DolbyDapSubType error!");
                break;
        }
        parcelObtain.writeInt(i2);
        setDolbyDapParam(parcelObtain, parcelObtain2);
        int i10 = parcelObtain2.readInt();
        parcelObtain.recycle();
        parcelObtain2.recycle();
        return (byte) i10;
    }

    public final native byte setDolbyDapUserParam(int i2, int i3) throws TvCommonException;

    public void setDtvOutputMode(EnumDtvSoundMode enumDtvSoundMode) throws TvCommonException {
        native_setDtvOutputMode(enumDtvSoundMode.ordinal());
    }

    public final native void setHDMITx_HDBypass(boolean z2) throws TvCommonException;

    public void setInputLevel(EnumAudioInputLevelSourceType enumAudioInputLevelSourceType, short s2) throws TvCommonException {
        native_setInputLevel(enumAudioInputLevelSourceType.ordinal(), s2);
    }

    public void setInputSource(TvOsType.EnumInputSource enumInputSource) throws TvCommonException {
        native_setInputSource(enumInputSource.ordinal());
    }

    public final short setKtvMixModeVolume(EnumKtvMixVolumeType enumKtvMixVolumeType, short s2, short s3) {
        return native_setKtvMixModeVolume(enumKtvMixVolumeType.ordinal(), s2, s3);
    }

    public final short setKtvSoundInfo(KtvInfoType.EnumKtvInfoType enumKtvInfoType, int i2, int i3) throws TvCommonException {
        return native_setKtvSoundInfo(enumKtvInfoType.getValue(), i2, i3);
    }

    public int setKtvSoundTrack(EnumKtvAudioMpegSoundMode enumKtvAudioMpegSoundMode) {
        return native_setKtvSoundTrack(enumKtvAudioMpegSoundMode.ordinal());
    }

    public final boolean setMuteStatus(int i2, TvOsType.EnumInputSource enumInputSource) throws TvCommonException {
        return native_setMuteStatus(i2, enumInputSource.ordinal());
    }

    public void setOnAudioEventListener(OnAudioEventListener onAudioEventListener) {
        this.mOnAudioEventListener = onAudioEventListener;
    }

    public void setOnEventListener(OnEventListener onEventListener) {
        this.mOnEventListener = onEventListener;
    }

    public final EnumAudioReturn setOutputSourceInfo(EnumAudioVolumeSourceType enumAudioVolumeSourceType, EnumAudioProcessorType enumAudioProcessorType) throws TvCommonException {
        short sNative_setOutputSourceInfo = native_setOutputSourceInfo(enumAudioVolumeSourceType.ordinal(), enumAudioProcessorType.ordinal());
        if (sNative_setOutputSourceInfo < EnumAudioReturn.E_RETURN_NOTOK.ordinal() || sNative_setOutputSourceInfo > EnumAudioReturn.E_RETURN_UNSUPPORT.ordinal()) {
            throw new TvCommonException("native_setAudioCaptureSource  failed");
        }
        return EnumAudioReturn.values()[sNative_setOutputSourceInfo];
    }

    public final native short setOutputSourceInfo(int i2, int i3) throws TvCommonException;

    public native void setSNDAC3PInfo(int i2, int i3, int i4);

    public final native boolean setSoundAC3PlusInfo(int i2, int i3, int i4) throws TvCommonException;

    public final short setSoundParameter(EnumSoundSetParamType enumSoundSetParamType, int i2, int i3) {
        return native_SetSoundParameter(enumSoundSetParamType.ordinal(), i2, i3);
    }

    @Deprecated
    public final native short setSoundSpdifDelay(int i2);

    @Deprecated
    public final native short setSoundSpeakerDelay(int i2);

    public final native short setSpdifDelay(int i2);

    public final native short setSpeakerDelay(int i2);

    public final native short setSubWooferVolume(boolean z2, short s2) throws TvCommonException;

    public EnumAudioReturn setToNextAtvMtsMode() throws TvCommonException {
        int iNative_setToNextAtvMtsMode = native_setToNextAtvMtsMode();
        if (iNative_setToNextAtvMtsMode < EnumAudioReturn.E_RETURN_NOTOK.ordinal() || iNative_setToNextAtvMtsMode > EnumAudioReturn.E_RETURN_UNSUPPORT.ordinal()) {
            throw new TvCommonException("setToNextAtvMtsMode failed");
        }
        return EnumAudioReturn.values()[iNative_setToNextAtvMtsMode];
    }

    public native void setVDEnable(boolean z2);

    public EnumAudioReturn enableAdvancedSoundEffect(EnumAdvancedSoundType enumAdvancedSoundType, EnumAdvancedSoundSubProcessType enumAdvancedSoundSubProcessType) throws TvCommonException {
        int iNative_enableAdvancedSoundEffect = native_enableAdvancedSoundEffect(enumAdvancedSoundType.ordinal(), enumAdvancedSoundSubProcessType.ordinal());
        if (iNative_enableAdvancedSoundEffect >= EnumAudioReturn.E_RETURN_NOTOK.ordinal() && iNative_enableAdvancedSoundEffect <= EnumAudioReturn.E_RETURN_UNSUPPORT.ordinal()) {
            return EnumAudioReturn.values()[iNative_enableAdvancedSoundEffect];
        }
        throw new TvCommonException("native_enableAdvancedSoundEffect failed");
    }
}
