internal static SwitchReply ProcessDisEqcSwitch(TuningSpec tuningSpec, Tuner tunerSpec, IBaseFilter tunerFilter)
        {
            DiseqcHandlerBase diseqcHandler = getDiseqcHandler(tunerSpec, tunerFilter);

            if (diseqcHandler == null)
            {
                Logger.Instance.Write("No DiSEqC handler available - switch request ignored");
                return(SwitchReply.NoHandler);
            }

            Logger.Instance.Write("Created " + diseqcHandler.Description + " DiSEqC handler");

            bool reply = diseqcHandler.SendDiseqcCommand(tuningSpec, ((SatelliteFrequency)tuningSpec.Frequency).SatelliteDish.DiseqcSwitch);

            if (reply)
            {
                return(SwitchReply.OK);
            }
            else
            {
                return(SwitchReply.Failed);
            }
        }
        private static DiseqcHandlerBase getDiseqcHandler(Tuner tuner, IBaseFilter tunerFilter)
        {
            if (RunParameters.Instance.DiseqcIdentity != null)
            {
                switch (RunParameters.Instance.DiseqcIdentity)
                {
                case "HAUPPAUGE":
                    return(createHauppaugeHandler(tunerFilter, true));

                case "TECHNOTREND":
                    return(createTechnoTrendHandler(tunerFilter, true));

                case "GENPIX":
                    return(createGenPixHandler(tunerFilter, true));

                case "CONEXANT":
                    return(createConexantHandler(tuner, tunerFilter, true));

                case "TWINHAN":
                case "AZUREWAVE":
                    return(createTwinhanHandler(tunerFilter, true));

                case "TEVII":
                    return(createTeviiHandler(tuner, tunerFilter, true));

                case "PROFRED":
                    return(createProfRedHandler(tunerFilter, true));

                case "DIGITALEVERYWHERE":
                    return(createDigitalEverywhereHandler(tunerFilter, true));

                case "WIN7API":
                    return(createWin7APIHandler(tunerFilter, true));

                case "GENERIC":
                    return(createGenericHandler(tunerFilter, true));

                default:
                    Logger.Instance.Write("DiSEqC handler not recognized");
                    return(null);
                }
            }

            DiseqcHandlerBase diseqcHandler = createHauppaugeHandler(tunerFilter, false);

            if (diseqcHandler != null)
            {
                Logger.Instance.Write("DiSEqC processing using Hauppauge method");
                return(diseqcHandler);
            }

            diseqcHandler = createTechnoTrendHandler(tunerFilter, false);
            if (diseqcHandler != null)
            {
                Logger.Instance.Write("DiSEqC processing using TechnoTrend method");
                return(diseqcHandler);
            }

            diseqcHandler = createTwinhanHandler(tunerFilter, false);
            if (diseqcHandler != null)
            {
                Logger.Instance.Write("DiSEqC processing using Twinhan/TechniSat method");
                return(diseqcHandler);
            }

            diseqcHandler = createConexantHandler(tuner, tunerFilter, false);
            if (diseqcHandler != null)
            {
                Logger.Instance.Write("DiSEqC processing using Conexant method");
                return(diseqcHandler);
            }

            diseqcHandler = createGenPixHandler(tunerFilter, false);
            if (diseqcHandler != null)
            {
                Logger.Instance.Write("DiSEqC processing using GenPix method");
                return(diseqcHandler);
            }

            diseqcHandler = createTeviiHandler(tuner, tunerFilter, false);
            if (diseqcHandler != null)
            {
                Logger.Instance.Write("DiSEqC processing using Tevii method");
                return(diseqcHandler);
            }

            diseqcHandler = createProfRedHandler(tunerFilter, false);
            if (diseqcHandler != null)
            {
                Logger.Instance.Write("DiSEqC processing using ProfRed/TBS method");
                return(diseqcHandler);
            }

            diseqcHandler = createDigitalEverywhereHandler(tunerFilter, false);
            if (diseqcHandler != null)
            {
                Logger.Instance.Write("DiSEqC processing using DigitalEverywhere method");
                return(diseqcHandler);
            }

            diseqcHandler = createWin7APIHandler(tunerFilter, false);
            if (diseqcHandler != null)
            {
                Logger.Instance.Write("DiSEqC processing using Win7 API method");
                return(diseqcHandler);
            }

            diseqcHandler = createGenericHandler(tunerFilter, false);
            if (diseqcHandler != null)
            {
                Logger.Instance.Write("DiSEqC processing using Generic method");
                return(diseqcHandler);
            }

            return(null);
        }