/// <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); }
/// <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); }
/// <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); }
/// <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); }
/// <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); }
/// <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); }
/// <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)); }
/// <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"))); }