using System;

namespace skyscraper5.Skyscraper.IO.CrazycatStreamReader
{
    /// <summary>
    /// FEC error correction methods.
    /// </summary>
    public enum VITERBIRATE_TYPE : int
    {
        VR_AUTO = 0, // DVB-S: automatic detection of viterbi rate
        VR_1_2 = 1,
        VR_2_3 = 2,
        VR_3_4 = 3,
        VR_4_5 = 4,
        VR_5_6 = 5,
        VR_6_7 = 6,
        VR_7_8 = 7,
        VR_8_9 = 8,
        VR_9_10 = 9,
        VR_1_4 = 10,
        VR_1_3 = 11,
        VR_2_5 = 12,
        VR_3_5 = 13,
        VR_5_9 = 14,
        VR_7_9 = 15,
        VR_8_15 = 16,
        VR_11_15 = 17,
        VR_13_18 = 18,
        VR_9_20 = 19,
        VR_11_20 = 20,
        VR_23_36 = 21,
        VR_25_36 = 22,
        VR_13_45 = 23,
        VR_26_45 = 24,
        VR_28_45 = 25,
        VR_32_45 = 26,
        VR_77_90 = 27,
    }

    /// <summary>
    /// Modulation type
    /// </summary>
    public enum MOD_TYPE : int
    {
        /// <summary>
        /// Automatic detection of modulation type
        /// </summary>
        MOD_AUTO = 0,

        /// <summary>
        /// QPSK (DVB-S)
        /// </summary>
        MOD_QPSK = 1,

        /// <summary>
        /// 8PSK (DVB-S2)
        /// </summary>
        MOD_8PSK = 2,

        /// <summary>
        /// 16APSK (DVB-S2)
        /// </summary>
        MOD_16APSK = 3,

        /// <summary>
        /// 32APSK (DVB-S2)
        /// </summary>
        MOD_32APSK = 4,

        /// <summary>
        /// QPSK (DVB-S2)
        /// </summary>
        MOD_QPSK2 = 5,

        /// <summary>
        /// Turbo QPSK
        /// </summary>
        MOD_QPSK_T = 6,

        /// <summary>
        /// Turbo 8PSK
        /// </summary>
        MOD_8PSK_T = 7,

        /// <summary>
        /// Turbo 16QAM
        /// </summary>
        MOD_16QAM_T = 8,

        /// <summary>
        /// DirectTV DSS
        /// </summary>
        MOD_DSS = 9,

        /// <summary>
        /// BPSK
        /// </summary>
        MOD_BPSK = 10,

        /// <summary>
        /// Offset QPSK
        /// </summary>
        MOD_OQPSK = 11,

        /// <summary>
        /// Digicipher II Combo
        /// </summary>
        MOD_DC2_COMBO = 12,

        /// <summary>
        /// Digicipher II Split(I)
        /// </summary>
        MOD_DC2_SPLIT_I = 13,

        /// <summary>
        /// Digicipher II Split(Q)
        /// </summary>
        MOD_DC2_SPLIT_Q = 14,

        /// <summary>
        /// Digicipher II Offset QPSK
        /// </summary>
        MOD_DC2_OQPSK = 15,

        /// <summary>
        /// 8-Level Vestigial Sideband
        /// </summary>
        MOD_8VSB = 16,

        /// <summary>
        /// 16-Level Vestigial Sideband
        /// </summary>
        MOD_16VSB = 17,
        MOD_16QAM = 18,
        MOD_32QAM = 19,
        MOD_64QAM = 20,
        MOD_128QAM = 21,
        MOD_256QAM = 22,

        /// <summary>
        /// 512QAM (DVB-C2)
        /// </summary>
        MOD_512QAM = 23,

        /// <summary>
        /// 1024QAM (DVB-C2)
        /// </summary>
        MOD_1024QAM = 24,

        /// <summary>
        /// 4096QAM (DVB-C2)
        /// </summary>
        MOD_4096QAM = 25,

        /// <summary>
        /// VL-SNR (DVB-S2X)
        /// </summary>
        MOD_VLSNR = 26,

        /// <summary>
        /// 64APSK (DVB-S2X)
        /// </summary>
        MOD_64APSK = 27,

        /// <summary>
        /// 128APSK (DVB-S2X)
        /// </summary>
        MOD_128APSK = 28,

        /// <summary>
        /// 256APSK (DVB-S2X)
        /// </summary>
        MOD_256APSK = 29,

        /// <summary>
        /// 8PSK_L (DVB-S2X)
        /// </summary>
        MOD_8PSK_L = 30,

        /// <summary>
        /// 16APSK_L (DVB-S2X)
        /// </summary>
        MOD_16APSK_L = 31,

        /// <summary>
        /// 32APSK_L (DVB-S2X)
        /// </summary>
        MOD_32APSK_L = 32,

        /// <summary>
        /// 64APSK_L (DVB-S2X)
        /// </summary>
        MOD_64APSK_L = 33,

        /// <summary>
        /// 256APSK_L (DVB-S2X)
        /// </summary>
        MOD_256APSK_L = 34,

        /// <summary>
        /// 1024APSK (DVB-S2X)
        /// </summary>
        MOD_1024APSK = 35,
    }

    /// <summary>
    /// Network types
    /// </summary>
    public enum STD_TYPE : int
    {
        /// <summary>
        /// Autodetect the network type.
        /// </summary>
        STD_AUTO = 0,

        /// <summary>
        /// A DVB-S compliant satellite network.
        /// </summary>
        STD_DVBS = 1,

        /// <summary>
        /// A DVB-S2 compliant satellite network.
        /// </summary>
        STD_DVBS2 = 2,

        /// <summary>
        /// The target network is DirecTV
        /// </summary>
        STD_DIRECTV = 3,

        /// <summary>
        /// A DVB-Turbo compliant satellite network.
        /// </summary>
        STD_TURBO = 4,

        /// <summary>
        /// A Digicipher II compliant cable or satellite network. Usually found in America.
        /// </summary>
        STD_DC2 = 5,

        /// <summary>
        /// A DVB-T compliant network.
        /// </summary>
        STD_DVBT = 6,

        /// <summary>
        /// A DVB-T2 compliant network.
        /// </summary>
        STD_DVBT2 = 7,

        /// <summary>
        /// A DVB-C compliant cable television network.
        /// </summary>
        STD_DVBC = 8,

        /// <summary>
        /// A DVB-C2 compliant cable television network.
        /// </summary>
        STD_DVBC2 = 9,

        /// <summary>
        /// An ATSC compliant network. American.
        /// </summary>
        STD_ATSC = 10,

        /// <summary>
        /// An ISDB-T compliant network. Commonly found in Japan or Brazil.
        /// </summary>
        STD_ISDBT = 11,

        /// <summary>
        /// An ISDB-S compliant network. Commonly found in Japan.
        /// </summary>
        STD_ISDBS = 12,
    }

    /// <summary>
    /// Possible values for the signal-curve steepness.
    /// </summary>
    public enum ROLLOFF_TYPE
    {
        ROLLOFF_AUTO = 0, // Automatic detection of S2-rolloff
        ROLLOFF_35, // 35% RollOff
        ROLLOFF_25, // 25% RollOff
        ROLLOFF_20, // 20% RollOff
        ROLLOFF_15, // 15% RollOff
        ROLLOFF_10, // 10% RollOff
        ROLLOFF_5, // 5% RollOff
    }

    /// <summary>
    /// DVB-S2 specific modulations
    /// </summary>
    public enum S2MODCODE : int
    {
        S2_DUMMY_PLF = 0,
        S2_QPSK_14 = 1,
        S2_QPSK_13 = 2,
        S2_QPSK_25 = 3,
        S2_QPSK_12 = 4,
        S2_QPSK_35 = 5,
        S2_QPSK_23 = 6,
        S2_QPSK_34 = 7,
        S2_QPSK_45 = 8,
        S2_QPSK_56 = 9,
        S2_QPSK_89 = 10,
        S2_QPSK_910 = 11,
        S2_8PSK_35 = 12,
        S2_8PSK_23 = 13,
        S2_8PSK_34 = 14,
        S2_8PSK_56 = 15,
        S2_8PSK_89 = 16,
        S2_8PSK_910 = 17,
        S2_16APSK_23 = 18,
        S2_16APSK_34 = 19,
        S2_16APSK_45 = 20,
        S2_16APSK_56 = 21,
        S2_16APSK_89 = 22,
        S2_16APSK_910 = 23,
        S2_32APSK_34 = 24,
        S2_32APSK_45 = 25,
        S2_32APSK_56 = 26,
        S2_32APSK_89 = 27,
        S2_32APSK_910 = 28,
        S2X_VLSNR1 = 64,
        S2X_VLSNR2 = 29,
        S2X_QPSK_13_45 = 30,
        S2X_QPSK_9_20 = 31,
        S2X_QPSK_11_20 = 32,
        S2X_8APSK_5_9_L = 33,
        S2X_8APSK_26_45_L = 34,
        S2X_8PSK_23_36 = 35,
        S2X_8PSK_25_36 = 36,
        S2X_8PSK_13_18 = 37,
        S2X_16APSK_1_2_L = 38,
        S2X_16APSK_8_15_L = 39,
        S2X_16APSK_5_9_L = 40,
        S2X_16APSK_26_45 = 41,
        S2X_16APSK_3_5 = 42,
        S2X_16APSK_3_5_L = 43,
        S2X_16APSK_28_45 = 44,
        S2X_16APSK_23_36 = 45,
        S2X_16APSK_2_3_L = 46,
        S2X_16APSK_25_36 = 47,
        S2X_16APSK_13_18 = 48,
        S2X_16APSK_7_9 = 49,
        S2X_16APSK_77_90 = 50,
        S2X_32APSK_2_3_L = 51,
        S2X_32APSK_32_45 = 89,
        S2X_32APSK_11_15 = 52,
        S2X_32APSK_7_9 = 53,
        S2X_64APSK_32_45_L = 54,
        S2X_64APSK_11_15 = 55,
        S2X_64APSK_7_9 = 95,
        S2X_64APSK_4_5 = 97,
        S2X_64APSK_5_6 = 99,
        S2X_128APSK_3_4 = 56,
        S2X_128APSK_7_9 = 57,
        S2X_256APSK_29_45_L = 58,
        S2X_256APSK_2_3_L = 59,
        S2X_256APSK_31_45_L = 60,
        S2X_256APSK_32_45 = 61,
        S2X_256APSK_11_15_L = 62,
        S2X_256APSK_3_4 = 63,
        S2X_QPSK_11_45 = 64,
        S2X_QPSK_4_15 = 65,
        S2X_QPSK_14_45 = 66,
        S2X_QPSK_7_15 = 67,
        S2X_QPSK_8_15 = 68,
        S2X_QPSK_32_45 = 69,
        S2X_8PSK_7_15 = 70,
        S2X_8PSK_8_15 = 71,
        S2X_8PSK_26_45 = 72,
        S2X_8PSK_32_45 = 73,
        S2X_16APSK_7_15 = 74,
        S2X_16APSK_8_15 = 75,
        S2X_16APSK_26_45_S = 76,
        S2X_16APSK_3_5_S = 77,
        S2X_16APSK_32_45 = 78,
        S2X_32APSK_2_3 = 79,
        S2X_32APSK_32_45_S = 80,

        /* POFF Modes */
        S2X_8PSK = 81,
        S2X_32APSK = 82,
        S2X_256APSK = 83,

        /* PON Modes  */
        S2X_16APSK = 84,
        S2X_64APSK = 85,
        S2X_1024APSK = 86,
    }

    /// <summary>
    /// These flags can be OR-ed together to form a DISEqC Switch Opcode
    /// </summary>
    [Flags]
    public enum DiSEqC_Opcode : byte
    {
        /// <summary>
        /// Magic bits, set this.
        /// </summary>
        DISEQC_HIGH_NIBBLE = 0xF0,
        DISEQC_LOW_BAND = 0x00,
        DISEQC_HIGH_BAND = 0x01,
        DISEQC_VERTICAL = 0x00,
        DISEQC_HORIZONTAL = 0x02,
        DISEQC_POSITION_A = 0x00,
        DISEQC_POSITION_B = 0x04,
        DISEQC_OPTION_A = 0x00,
        DISEQC_OPTION_B = 0x08
    }


    [Flags]
    public enum Caps : int
    {
        BitFilter = 0x01,
        SR_RC = 0x02,

        /// <summary>
        /// The tuner can act as a networking interface.
        /// </summary>
        SR_GETMAC = 0x04,
        SR_SIGNALEX = 0x08,
        SR_SIMPLETB = 0x10,

        /// <summary>
        /// The tuner supports up to 4 LNBs.
        /// </summary>
        SR_DISEQC10 = 0x20,

        /// <summary>
        /// The tuner supports up to 16 LNBs.
        /// </summary>
        SR_DISEQC1X = 0x40,

        /// <summary>
        /// The tuner supports rotatable satellite dishes.
        /// </summary>
        SR_DISEQC2X = 0x80,

        /// <summary>
        /// The tuner can mearue RF Strengths of satellite frequencies.
        /// </summary>
        SR_RFSCAN = 0x100,

        /// <summary>
        /// The tuner is happy with approximate frequencies.
        /// </summary>
        SR_BLSCAN = 0x200,

        /// <summary>
        /// The tuner can measure constellation data for satellite networks.
        /// </summary>
        SR_IQSCAN = 0x400,
        SR_MISSEL = 0x800,

        /// <summary>
        /// The tuner has an EEPROM
        /// </summary>
        SR_EEPROM = 0x1000,

        /// <summary>
        /// The tuner can report signal information for satellite networks.
        /// </summary>
        SR_SIGINFO = 0x2000,

        /// <summary>
        /// The tuner can report signal information for non-satellite networks.
        /// </summary>
        SR_SIGINFO2 = 0x4000,
        SR_RFSCAN2 = 0x10000,

        /// <summary>
        /// The tuner can blind-scan satellite networks.
        /// </summary>
        SR_BLSCAN2 = 0x20000,

        /// <summary>
        /// The tuner supports Physical Layer scrambling
        /// </summary>
        SR_PLSSEL = 0x40000,

        /// <summary>
        /// The tuner can measure constellations for non-satellite networks.
        /// </summary>
        SR_IQSCAN2 = 0x80000,
        SR_BBFRAME = 0x100000,
        SR_MODSEL = 0x200000,
        SR_MODINV = 0x400000,

        /// <summary>
        /// The tuner can blind-scan non-satellite networks.
        /// </summary>
        SR_AIRSCAN = 0x800000,
        SR_CIRSCAN = 0x1000000,
        SR_FFTSCAN = 0x2000000,
        SR_CARESNO = 0x4000000,
        SR_SETPOL = 0x8000000
	}

}
