public static IBMDSwitcherInput GetSource(this IBMDSwitcher switcher, long inputId) { IBMDSwitcherInputIterator inputIterator = switcher.GetInputIterator(); if (inputIterator == null) { return(null); } IBMDSwitcherInput input; inputIterator.Next(out input); while (input != null) { long inputIdFound; input.GetInputId(out inputIdFound); if (inputIdFound == inputId) { return(input); } inputIterator.Next(out input); } return(null); }
public static List <IBMDSwitcherInput> GetPorts(this IBMDSwitcher apiSwitcher) { IBMDSwitcherInputIterator inputIterator = apiSwitcher.GetInputIterator(); if (inputIterator == null) { return(null); } List <IBMDSwitcherInput> inputs = new List <IBMDSwitcherInput>(); IBMDSwitcherInput input; inputIterator.Next(out input); while (input != null) { inputs.Add(input); inputIterator.Next(out input); } return(inputs); }