/// <summary> /// Initializes a new instance of the Win7APIDiseqcHandler class. /// </summary> /// <param name="tunerFilter">The tuner filter.</param> internal Win7APIDiseqcHandler(IBaseFilter tunerFilter) { IBDA_Topology topology = tunerFilter as IBDA_Topology; if (topology == null) { return; } this.tunerFilter = tunerFilter; int nodeTypeCount = 0; int[] nodeTypes = new int[10]; int reply = topology.GetNodeTypes(out nodeTypeCount, 10, nodeTypes); DsError.ThrowExceptionForHR(reply); for (int nodeTypeIndex = 0; nodeTypeIndex < nodeTypeCount; nodeTypeIndex++) { int interfaceCount; Guid[] interfaces = new Guid[32]; reply = topology.GetNodeInterfaces(nodeTypes[nodeTypeIndex], out interfaceCount, 32, interfaces); DsError.ThrowExceptionForHR(reply); for (int searchIndex = 0; searchIndex < interfaceCount; searchIndex++) { if (interfaces[searchIndex] == typeof(IBDA_DiseqCommand).GUID) { if (RunParameters.Instance.TraceIDs.Contains("BDA")) { Logger.Instance.Write("BDA DiSEqC interface located for node type " + nodeTypes[nodeTypeIndex]); } object controlNode; reply = topology.GetControlNode(0, 1, nodeTypes[nodeTypeIndex], out controlNode); DsError.ThrowExceptionForHR(reply); commandInterface = controlNode as IBDA_DiseqCommand; if (commandInterface == null) { if (RunParameters.Instance.TraceIDs.Contains("BDA")) { Logger.Instance.Write("BDA Can't use DiSEqC interface: cast of control node failed"); } } else { if (RunParameters.Instance.TraceIDs.Contains("BDA")) { Logger.Instance.Write("BDA DiSEqC interface available"); } return; } } } } }
/// <summary> /// Initializes a new instance of the Win7APIDiseqcHandler class. /// </summary> /// <param name="tunerFilter">The tuner filter.</param> internal Win7APIDiseqcHandler(IBaseFilter tunerFilter) { IBDA_Topology topology = tunerFilter as IBDA_Topology; if (topology == null) return; this.tunerFilter = tunerFilter; int nodeTypeCount = 0; int[] nodeTypes = new int[10]; int reply = topology.GetNodeTypes(out nodeTypeCount, 10, nodeTypes); DsError.ThrowExceptionForHR(reply); for (int nodeTypeIndex = 0; nodeTypeIndex < nodeTypeCount; nodeTypeIndex++) { int interfaceCount; Guid[] interfaces = new Guid[32]; reply = topology.GetNodeInterfaces(nodeTypes[nodeTypeIndex], out interfaceCount, 32, interfaces); DsError.ThrowExceptionForHR(reply); for (int searchIndex = 0; searchIndex < interfaceCount; searchIndex++) { if (interfaces[searchIndex] == typeof(IBDA_DiseqCommand).GUID) { if (RunParameters.Instance.TraceIDs.Contains("BDA")) Logger.Instance.Write("BDA DiSEqC interface located for node type " + nodeTypes[nodeTypeIndex]); object controlNode; reply = topology.GetControlNode(0, 1, nodeTypes[nodeTypeIndex], out controlNode); DsError.ThrowExceptionForHR(reply); commandInterface = controlNode as IBDA_DiseqCommand; if (commandInterface == null) { if (RunParameters.Instance.TraceIDs.Contains("BDA")) Logger.Instance.Write("BDA Can't use DiSEqC interface: cast of control node failed"); } else { if (RunParameters.Instance.TraceIDs.Contains("BDA")) Logger.Instance.Write("BDA DiSEqC interface available"); return; } } } } }