using System;
using skyscraper5.Skyscraper.IO.CrazycatStreamReader;
using skyscraper5.Skyscraper.Plugins;

namespace skyscraper5.Skyscraper.IO.TunerInterface
{
    [SkyscraperPlugin]
    [TunerFactoryId(0,"No tuner")]
    public class NullTunerFactory : ITunerFactory
    {
        private static NullStreamReader nsr;
        public IStreamReader CreateStreamReader()
        {
            if (nsr == null)
                nsr = new NullStreamReader();
            return nsr;
        }
    }

    [ClassVersion(1,0,0,0)]
    internal class NullStreamReader : IStreamReader
    {
        public bool CheckForDVB()
        {
            return false;
        }

        public bool CheckForDVBEx(DvbEnumCallback func)
        {
            return false;
        }

        public bool CheckForDVBExEx(DvbEnumCallbackEx func)
        {
            return false;
        }

        public bool StartDVB()
        {
            throw new NotImplementedException();
        }

        public bool StartDvbEx(int index)
        {
            throw new NotImplementedException();
        }

        public bool StopDVB()
        {
            throw new NotImplementedException();
        }

        public bool GetTunerType(ref STD_TYPE type)
        {
            throw new NotImplementedException();
        }

        public bool SendDiSEqC(uint diseqcType, DiSEqC_Opcode data)
        {
            throw new NotImplementedException();
        }

        public bool SendDiseqCmd(byte[] buffer, int length)
        {
            throw new NotImplementedException();
        }

        public bool SendDiseqCmdEx(IntPtr pCmd, int length, IntPtr reply, int replyLength)
        {
            throw new NotImplementedException();
        }

        public bool SetChannel(int freq, int symbrate, int pol, VITERBIRATE_TYPE fec, int lof1, int lof2, int lofsw)
        {
            throw new NotImplementedException();
        }

        public bool SetChannelEx(int freq, int symbrate, int pol, VITERBIRATE_TYPE fec, int lof1, int lof2, int lofsw, MOD_TYPE mod)
        {
            throw new NotImplementedException();
        }

        public bool SetChannelExEx(int freq, int symbrate, int pol, VITERBIRATE_TYPE fec, int lof1, int lof2, int lofsw, MOD_TYPE mod,
            int inv, int pilot, ROLLOFF_TYPE rolloff)
        {
            throw new NotImplementedException();
        }

        public bool SetFilter(int pid, StdcallDvbCallback func, int callbackType, int size, ref IntPtr lpFilterNum)
        {
            throw new NotImplementedException();
        }

        public bool SetFilterEx(int pid, StdcallDvbCallbackEx lpFunc, int callbackType, int size, ref IntPtr lpFilterNum)
        {
            throw new NotImplementedException();
        }

        public bool SetBitFilter(int pid, IntPtr filterData, IntPtr filterMask, byte filterLength, StdcallDvbCallback lpFunc,
            ref IntPtr lpFilterNum)
        {
            throw new NotImplementedException();
        }

        public bool SetRemoteControl(int irtype, short devAddr, StdcallDvbCallback func, ref IntPtr lpFilterNum)
        {
            throw new NotImplementedException();
        }

        public bool DelFilter(IntPtr filterNum)
        {
            throw new NotImplementedException();
        }

        public bool GetSignal(ref int pStrength, ref int pQuality)
        {
            throw new NotImplementedException();
        }

        public bool GetSignalStrength(ref float pStrength, ref float pQuality)
        {
            throw new NotImplementedException();
        }

        public bool GetSignalEx(ref float pSNR, ref float pBER)
        {
            throw new NotImplementedException();
        }

        public bool GetSignalExEx(ref bool pPresent, ref bool pLock, ref int pRFLevel, ref float pSNR, ref float pBER)
        {
            throw new NotImplementedException();
        }

        public bool Statistic(int[] pStat)
        {
            throw new NotImplementedException();
        }

        public bool GetMAC(byte[] pMac)
        {
            throw new NotImplementedException();
        }

        public Caps GetCaps()
        {
            throw new NotImplementedException();
        }

        public bool RFScan(int freq, int pol, int lof1, int lof2, int lofsw, out double pRFLevel)
        {
            throw new NotImplementedException();
        }

        public bool FFTInit()
        {
            throw new NotImplementedException();
        }

        public bool FFTScan(int freq, int pol, int lof1, int lof2, int lofsw, uint range, byte mode, byte nb_acc, uint[] pTab, ref uint pBegin, ref uint pNum)
        {
            throw new NotImplementedException();
        }

        public bool BLScan(int freq, int freq_range, int pol, int lof1, int lof2, int lofsw, int minsr,
            ref SearchResult pSearchResult)
        {
            throw new NotImplementedException();
        }

        public bool BLScanEx(int freq, int freq_range, int pol, int lof1, int lof2, int lofsw, int minsr, STD_TYPE std,
            ref SearchResult pSearchResult)
        {
            throw new NotImplementedException();
        }

        public bool BLScan2(int freq_start, int freq_stop, int pol, int lof1, int lof2, int lofsw, IntPtr pSearchResult,
            ref int pTpNum, BlScanCallback lpFunc)
        {
            throw new NotImplementedException();
        }

        public bool SignalInfo(ref SearchResult pSearchResult)
        {
            throw new NotImplementedException();
        }

        public bool IQScan(uint input, sbyte[] pIQ, uint num)
        {
            throw new NotImplementedException();
        }

        public bool IQScan2(uint point, short[] pIQ, uint num)
        {
            throw new NotImplementedException();
        }

        public bool IQScan2Range(byte input, ref ushort pMinPoint, ref ushort pMaxPoint)
        {
            throw new NotImplementedException();
        }

        public bool CIRScanRange(bool bHiRes, ref ushort pMinCnum, ref ushort pMaxCnum, ref int pMinDelayNs, ref int pMaxDelayNs)
        {
            throw new NotImplementedException();
        }

        public bool CIRScan(bool bHiRes, int[] pPowers, int[] pDelays)
        {
            throw new NotImplementedException();
        }

        public bool CarRange(ref ushort pMinCnum, ref ushort pMaxCnum)
        {
            throw new NotImplementedException();
        }

        public bool CarEsNo(ref ushort cnum, ref double pEsNo)
        {
            throw new NotImplementedException();
        }

        public bool MISSel(bool bEnable, byte misFilter, byte misFilterMask)
        {
            throw new NotImplementedException();
        }

        public bool PLSSel(byte plsMode, uint code)
        {
            throw new NotImplementedException();
        }

        public bool PLSGet(byte pMode, ref uint pCode)
        {
            throw new NotImplementedException();
        }

        public bool ModSel(ref S2Mode ps2Modes, uint num)
        {
            throw new NotImplementedException();
        }

        public bool ModInv(uint WaitMs, ref S2Mode pS2Modes, ref uint pNum)
        {
            throw new NotImplementedException();
        }

        public bool SetChannel2(uint freq, uint bandwidth)
        {
            throw new NotImplementedException();
        }

        public bool SetChannel2Ex(uint freq, uint bandwidth, STD_TYPE std, int stream)
        {
            throw new NotImplementedException();
        }

        public bool SetChannel2ExEx(uint freq, uint bandwidth, uint symbrate, STD_TYPE std, int stream)
        {
            throw new NotImplementedException();
        }

        public bool SignalInfo2(ref SearchResult2 si2)
        {
            throw new NotImplementedException();
        }

        public bool RFScan2(uint freq, STD_TYPE std, ref double pRFLevel)
        {
            throw new NotImplementedException();
        }

        public bool AirScan(int freq_start, int freq_stop, uint step, uint bandwidth, int std, IntPtr pSearchResult, ref int pTpNum,
            AirScanCallback lpFunc)
        {
            throw new NotImplementedException();
        }

        public bool GetEEPROM(byte[] buffer, int offset, int len)
        {
            throw new NotImplementedException();
        }

        public bool SetEEPROM(byte[] buffer, int offset, int len)
        {
            throw new NotImplementedException();
        }

        public void Dispose()
        {
        }

		public Version GetEngineVersion()
		{
            Type t = this.GetType();
            object[] objArray = t.GetCustomAttributes(typeof(ClassVersionAttribute),false);
            ClassVersionAttribute versionAttrib = (ClassVersionAttribute)objArray[0];
            return versionAttrib.ToVersion();
		}

		public string GetEngineName()
		{
            return this.GetType().Name;
		}

		public bool FFTTerm()
		{
            return false;
		}
	}
}
