示例#1
0
        /// <summary>
        /// Get a specific tuner node.
        /// </summary>
        /// <param name="checkTunerNodeType">The tuner node type requested.</param>
        /// <returns>The tuner node of the specified type or null if not supported.</returns>
        public TunerNode GetNode(TunerNodeType checkTunerNodeType)
        {
            if (TunerNodes == null)
            {
                return(null);
            }

            foreach (TunerNode tunerNode in TunerNodes)
            {
                if (checkTunerNodeType == tunerNode.TunerNodeType)
                {
                    return(tunerNode);
                }
            }

            return(null);
        }
        private bool checkForTunerType(Collection <int> tuners, TunerNodeType tunerNodeType)
        {
            if (tuners.Count == 0)
            {
                return(true);
            }

            foreach (int tuner in tuners)
            {
                if (Tuner.TunerCollection[tuner - 1].Supports(tunerNodeType))
                {
                    return(true);
                }
            }

            return(false);
        }
示例#3
0
        /// <summary>
        /// Check if the tuner has a particular tuner node type.
        /// </summary>
        /// <param name="checkTunerNodeType">The tuner node type.</param>
        /// <returns>True if the node type is supported; false otherwise.</returns>
        public bool Supports(TunerNodeType checkTunerNodeType)
        {
            if (TunerNodes == null)
            {
                return(false);
            }

            foreach (TunerNode tunerNode in TunerNodes)
            {
                if (checkTunerNodeType == tunerNode.TunerNodeType)
                {
                    return(true);
                }
            }

            return(false);
        }
示例#4
0
 /// <summary>
 /// Intialize a new instance of the TunerNode class.
 /// </summary>
 /// <param name="nativeNodeType">The native node type.</param>
 /// <param name="tunerNodeType">The tuner node type.</param>
 public TunerNode(int nativeNodeType, TunerNodeType tunerNodeType)
 {
     this.nativeNodeType = nativeNodeType;
     this.tunerNodeType  = tunerNodeType;
 }
        private bool checkForTunerType(Collection<int> tuners, TunerNodeType tunerNodeType)
        {
            if (tuners.Count == 0)
                return (true);

            foreach (int tuner in tuners)
            {
                if (Tuner.TunerCollection[tuner - 1].Supports(tunerNodeType))
                    return (true);
            }

            return (false);
        }
示例#6
0
        /// <summary>
        /// Check if the tuner has a particular tuner node type.
        /// </summary>
        /// <param name="checkTunerNodeType">The tuner node type.</param>
        /// <returns>True if the node type is supported; false otherwise.</returns>
        public bool Supports(TunerNodeType checkTunerNodeType)
        {
            if (TunerNodes == null)
                return (false);

            foreach (TunerNode tunerNode in TunerNodes)
            {
                if (checkTunerNodeType == tunerNode.TunerNodeType)
                    return (true);
            }

            return (false);
        }
示例#7
0
        /// <summary>
        /// Get a specific tuner node.
        /// </summary>
        /// <param name="checkTunerNodeType">The tuner node type requested.</param>
        /// <returns>The tuner node of the specified type or null if not supported.</returns>
        public TunerNode GetNode(TunerNodeType checkTunerNodeType)
        {
            if (TunerNodes == null)
                return (null);

            foreach (TunerNode tunerNode in TunerNodes)
            {
                if (checkTunerNodeType == tunerNode.TunerNodeType)
                return (tunerNode);
            }

            return (null);
        }
示例#8
0
 /// <summary>
 /// Intialize a new instance of the TunerNode class.
 /// </summary>
 /// <param name="nativeNodeType">The native node type.</param>
 /// <param name="tunerNodeType">The tuner node type.</param>
 public TunerNode(int nativeNodeType, TunerNodeType tunerNodeType)
 {
     this.nativeNodeType = nativeNodeType;
     this.tunerNodeType = tunerNodeType;
 }
示例#9
0
        /// <summary>
        /// Find a tuner.
        /// </summary>
        /// <param name="tuners">The list of tuners to try.</param>
        /// <param name="tunerNodeType">The node type the tuner must have.</param>
        /// <param name="tuningSpec">A tuning spec instance with tuning details.</param>
        /// <param name="lastTuner">The last tuner used or null if all are to be considered.</param>
        /// <param name="repeatDiseqc">True to repeat a failed diseqc command; false otherwise.</param>
        /// <param name="switchAfterPlay">True to change diseqc switch after graph running; false otherwise.</param>
        /// <param name="dumpFileName">The name of the dump file.</param>
        /// <returns>A graph instance.</returns>
        public static BDAGraph FindTuner(Collection<int> tuners, TunerNodeType tunerNodeType, TuningSpec tuningSpec, Tuner lastTuner, bool repeatDiseqc, bool switchAfterPlay, string dumpFileName)
        {
            bool process = (lastTuner == null);

            if (tuners.Count != 0)
            {
                for (int index = 0; index < tuners.Count; index++)
                {
                    int tunerNumber = tuners[index] - 1;

                    if (tunerNumber < Tuner.TunerCollection.Count && Tuner.TunerCollection[tunerNumber].Supports(tunerNodeType))
                    {
                        Tuner tuner = Tuner.TunerCollection[tunerNumber];

                        if (process)
                        {
                            BDAGraph graph = checkTunerAvailability(tuner, tuningSpec, repeatDiseqc, switchAfterPlay, dumpFileName);
                            if (graph != null)
                            {
                                Logger.Instance.Write("Using tuner " + (tunerNumber + 1) + ": " + tuner.Name);
                                return (graph);
                            }
                        }

                        if (!process)
                            process = (tuner == lastTuner);
                    }
                }
                return (null);
            }

            for (int index = 0; index < Tuner.TunerCollection.Count; index++)
            {
                Tuner tuner = Tuner.TunerCollection[index];

                if (process)
                {
                    if (tuner.Supports(tunerNodeType))
                    {
                        BDAGraph graph = checkTunerAvailability(tuner, tuningSpec, repeatDiseqc, switchAfterPlay, dumpFileName);
                        if (graph != null)
                        {
                            Logger.Instance.Write("Using tuner " + (Tuner.TunerCollection.IndexOf(tuner) + 1) + ": " + tuner.Name);
                            return (graph);
                        }
                    }
                }

                if (!process)
                    process = (tuner == lastTuner);
            }

            return (null);
        }
示例#10
0
 /// <summary>
 /// Find a tuner.
 /// </summary>
 /// <param name="tuners">The list of tuners to try.</param>
 /// <param name="tunerNodeType">The node type the tuner must have.</param>
 /// <param name="tuningSpec">A tuning spec instance with tuning details.</param>
 /// <param name="lastTuner">The last tuner used or null if all are to be considered.</param>
 /// <param name="repeatDiseqc">True to repeat a failed diseqc command; false otherwise.</param>
 /// <param name="switchAfterPlay">True to change diseqc switch after graph running; false otherwise.</param>
 /// <returns>A graph instance.</returns>
 public static BDAGraph FindTuner(Collection<int> tuners, TunerNodeType tunerNodeType, TuningSpec tuningSpec, Tuner lastTuner, bool repeatDiseqc, bool switchAfterPlay)
 {
     return (FindTuner(tuners, tunerNodeType, tuningSpec, lastTuner, repeatDiseqc, switchAfterPlay, null));
 }
示例#11
0
 /// <summary>
 /// Find a tuner.
 /// </summary>
 /// <param name="tuners">The list of tuners to try.</param>
 /// <param name="tunerNodeType">The node type the tuner must have.</param>
 /// <param name="tuningSpec">A tuning spec instance with tuning details.</param>
 /// <param name="lastTuner">The last tuner used or null if all are to be considered.</param>
 /// <returns>A graph instance.</returns>
 public static BDAGraph FindTuner(Collection<int> tuners, TunerNodeType tunerNodeType, TuningSpec tuningSpec, Tuner lastTuner)
 {
     return (FindTuner(tuners, tunerNodeType, tuningSpec, lastTuner,
         RunParameters.Instance.Options.Contains("REPEATDISEQC"),
         RunParameters.Instance.Options.Contains("SWITCHAFTERPLAY")));
 }