package cn.tee3.manager.service;

import cn.tee3.avd.VideoOptions;
import cn.tee3.manager.bean.CommonBean;

public class Setting {

    public static class AVDAuthentication {
        String avd_server;
        String app_key;
        String secret_key;
        String token;

        public AVDAuthentication() {
            this.avd_server = CommonBean.serverURI;
            this.app_key = CommonBean.accessKey;
            this.secret_key = CommonBean.secretKey;
        }

        public AVDAuthentication(String avd_server, String token) {
            this.avd_server = avd_server;
            this.token = token;
        }

        public AVDAuthentication(String avd_server, String app_key, String secret_key) {
            this.avd_server = avd_server;
            this.app_key = app_key;
            this.secret_key = secret_key;
        }

        public String getAvd_server() {
            return avd_server;
        }

        public void setAvd_server(String avd_server) {
            this.avd_server = avd_server;
        }

        public String getApp_key() {
            return app_key;
        }

        public void setApp_key(String app_key) {
            this.app_key = app_key;
        }

        public String getSecret_key() {
            return secret_key;
        }

        public void setSecret_key(String secret_key) {
            this.secret_key = secret_key;
        }

        public String getToken() {
            return token;
        }

        public void setToken(String token) {
            this.token = token;
        }

        @Override
        public String toString() {
            return "AVDAuthentication{" +
                    "avd_server='" + avd_server + '\'' +
                    ", app_key='" + app_key + '\'' +
                    ", secret_key='" + secret_key + '\'' +
                    ", token='" + token + '\'' +
                    '}';
        }
    }

    public static class AVDOption {
        private boolean isOpenCamera;
        private boolean isOpenMIC;
        private boolean isOpenSpeaker;
        private boolean isOpenAEC;
        private boolean isShowNetworkStats;
        private boolean isHardwareEncode;
        private boolean isHardwareDecode;
        private CommonBean.LogParams logLevel;
        private CommonBean.Resolution resolution;
        private CommonBean.VideoCodec codecType;
        private VideoOptions.VideoQuality videoQuality;
        private String logPath;

        public AVDOption() {
            isOpenCamera = true;
            isOpenMIC = true;
            isHardwareEncode = true;
            isHardwareDecode = true;
            logLevel = CommonBean.LogParams.info;
            resolution = CommonBean.Resolution.MIDDLE;
            codecType = CommonBean.VideoCodec.H264;
        }
        public AVDOption(CommonBean.Resolution resolution) {
            this.resolution = resolution;
            isOpenCamera = true;
            isOpenMIC = true;
            isHardwareEncode = true;
            isHardwareDecode = true;
            logLevel = CommonBean.LogParams.info;
            codecType = CommonBean.VideoCodec.H264;
        }

        public AVDOption(CommonBean.Resolution resolution, CommonBean.VideoCodec codecType) {
            this.resolution = resolution;
            this.codecType = codecType;

            isOpenCamera = true;
            isOpenMIC = true;
            isHardwareEncode = true;
            isHardwareDecode = true;
            logLevel = CommonBean.LogParams.info;
        }

        public AVDOption(boolean isOpenCamera, boolean isOpenMIC) {
            this.isOpenCamera = isOpenCamera;
            this.isOpenMIC = isOpenMIC;

            isHardwareEncode = true;
            isHardwareDecode = true;
            logLevel = CommonBean.LogParams.info;
            resolution = CommonBean.Resolution.LOW;
            codecType = CommonBean.VideoCodec.H264;
        }

        public AVDOption(boolean isOpenCamera, boolean isOpenMIC, CommonBean.Resolution resolution) {
            this.isOpenCamera = isOpenCamera;
            this.isOpenMIC = isOpenMIC;
            this.resolution = resolution;

            isHardwareEncode = true;
            isHardwareDecode = true;
            logLevel = CommonBean.LogParams.info;
            codecType = CommonBean.VideoCodec.H264;
        }

        public AVDOption(boolean isOpenCamera, boolean isOpenMIC, boolean isOpenSpeaker, CommonBean.Resolution resolution) {
            this.isOpenCamera = isOpenCamera;
            this.isOpenMIC = isOpenMIC;
            this.isOpenSpeaker = isOpenSpeaker;
            this.resolution = resolution;

            isHardwareEncode = true;
            isHardwareDecode = true;
            logLevel = CommonBean.LogParams.info;
            codecType = CommonBean.VideoCodec.H264;
        }

        public AVDOption(boolean isHardwareEncode, boolean isHardwareDecode, boolean isOpenCamera, boolean isOpenMIC, CommonBean.Resolution resolution) {
            this.isHardwareEncode = isHardwareEncode;
            this.isHardwareDecode = isHardwareDecode;
            this.isOpenCamera = isOpenCamera;
            this.isOpenMIC = isOpenMIC;
            this.resolution = resolution;

            this.codecType = CommonBean.VideoCodec.H264;
            this.logLevel = CommonBean.LogParams.info;
        }

        public AVDOption(boolean isHardwareEncode, boolean isHardwareDecode, boolean isOpenCamera, boolean isOpenMIC, boolean isOpenSpeaker, CommonBean.Resolution resolution) {
            this.isHardwareEncode = isHardwareEncode;
            this.isHardwareDecode = isHardwareDecode;
            this.isOpenCamera = isOpenCamera;
            this.isOpenMIC = isOpenMIC;
            this.isOpenSpeaker = isOpenSpeaker;
            this.resolution = resolution;

            this.codecType = CommonBean.VideoCodec.H264;
            this.logLevel = CommonBean.LogParams.info;
        }

        public AVDOption(boolean isHardwareEncode, boolean isHardwareDecode, CommonBean.LogParams logLevel, CommonBean.Resolution resolution, CommonBean.VideoCodec codecType) {
            this.isHardwareEncode = isHardwareEncode;
            this.isHardwareDecode = isHardwareDecode;
            this.logLevel = logLevel;
            this.resolution = resolution;
            this.codecType = codecType;

            isOpenCamera = true;
            isOpenMIC = true;
        }

        public AVDOption(boolean isOpenCamera, boolean isOpenMIC, CommonBean.Resolution resolution, CommonBean.VideoCodec codecType) {
            this.isOpenCamera = isOpenCamera;
            this.isOpenMIC = isOpenMIC;
            this.resolution = resolution;
            this.codecType = codecType;

            isHardwareEncode = true;
            isHardwareDecode = true;
            logLevel = CommonBean.LogParams.verbose;
        }

        public AVDOption(boolean isOpenCamera, boolean isOpenMIC, boolean isHardwareEncode, boolean isHardwareDecode,
                         CommonBean.LogParams logLevel, CommonBean.Resolution resolution, CommonBean.VideoCodec codecType) {
            this.isOpenCamera = isOpenCamera;
            this.isOpenMIC = isOpenMIC;
            this.isHardwareEncode = isHardwareEncode;
            this.isHardwareDecode = isHardwareDecode;
            this.logLevel = logLevel;
            this.resolution = resolution;
            this.codecType = codecType;
        }

        public AVDOption(boolean isOpenCamera, boolean isOpenMIC, boolean isOpenSpeaker, boolean isHardwareEncode, boolean isHardwareDecode,
                         CommonBean.LogParams logLevel, CommonBean.Resolution resolution, CommonBean.VideoCodec codecType) {
            this(isOpenCamera, isOpenMIC, isHardwareEncode, isHardwareDecode, logLevel, resolution, codecType);
            this.isOpenSpeaker = isOpenSpeaker;
        }

        public AVDOption(String logPath, boolean isOpenCamera, boolean isOpenMIC, boolean isOpenSpeaker, boolean isHardwareEncode, boolean isHardwareDecode,
                         CommonBean.LogParams logLevel, CommonBean.Resolution resolution, CommonBean.VideoCodec codecType) {
            this(isOpenCamera, isOpenMIC, isOpenSpeaker, isHardwareEncode, isHardwareDecode, logLevel, resolution, codecType);
            this.logPath = logPath;
        }

        public boolean isOpenCamera() {
            return isOpenCamera;
        }

        public void setOpenCamera(boolean openCamera) {
            isOpenCamera = openCamera;
        }

        public boolean isOpenMIC() {
            return isOpenMIC;
        }

        public void setOpenMIC(boolean openMIC) {
            isOpenMIC = openMIC;
        }

        public boolean isOpenSpeaker() {
            return isOpenSpeaker;
        }

        public void setOpenSpeaker(boolean openSpeaker) {
            isOpenSpeaker = openSpeaker;
        }

        public boolean isOpenAEC() {
            return isOpenAEC;
        }

        public void setOpenAEC(boolean openAEC) {
            isOpenAEC = openAEC;
        }

        public boolean isShowNetworkStats() {
            return isShowNetworkStats;
        }

        public void setShowNetworkStats(boolean showNetworkStats) {
            isShowNetworkStats = showNetworkStats;
        }

        public boolean isHardwareEncode() {
            return isHardwareEncode;
        }

        public void setHardwareEncode(boolean hardwareEncode) {
            isHardwareEncode = hardwareEncode;
        }

        public boolean isHardwareDecode() {
            return isHardwareDecode;
        }

        public void setHardwareDecode(boolean hardwareDecode) {
            isHardwareDecode = hardwareDecode;
        }

        public CommonBean.LogParams getLogLevel() {
            return logLevel;
        }

        public void setLogLevel(CommonBean.LogParams logLevel) {
            this.logLevel = logLevel;
        }

        public CommonBean.Resolution getResolution() {
            return resolution;
        }

        public void setResolution(CommonBean.Resolution resolution) {
            this.resolution = resolution;
        }

        public CommonBean.VideoCodec getCodecType() {
            return codecType;
        }

        public void setCodecType(CommonBean.VideoCodec codecType) {
            this.codecType = codecType;
        }

        public VideoOptions.VideoQuality getVideoQuality() {
            return videoQuality;
        }

        public void setVideoQuality(VideoOptions.VideoQuality videoQuality) {
            this.videoQuality = videoQuality;
        }

        public String getLogPath() {
            return logPath;
        }

        public void setLogPath(String logPath) {
            this.logPath = logPath;
        }

        @Override
        public String toString() {
            return "AVDOption{" +
                    "isOpenCamera=" + isOpenCamera +
                    ", isOpenMIC=" + isOpenMIC +
                    ", isOpenSpeaker=" + isOpenSpeaker +
                    ", isOpenAEC=" + isOpenAEC +
                    ", isShowNetworkStats=" + isShowNetworkStats +
                    ", isHardwareEncode=" + isHardwareEncode +
                    ", isHardwareDecode=" + isHardwareDecode +
                    ", logLevel=" + logLevel +
                    ", resolution=" + resolution +
                    ", codecType=" + codecType +
                    ", videoQuality=" + videoQuality +
                    ", logPath='" + logPath + '\'' +
                    '}';
        }
    }

}

