public static List <AudioSourceItem> GetAudioSources(bool ForceUpdate = false) { if (audioSourceItems == null || ForceUpdate) { audioSourceItems = AudioTool.GetAudioCaptureDevices().Select(d => new AudioSourceItem(d)).ToList(); } return(new List <AudioSourceItem>(audioSourceItems)); //return AudioTool.GetAudioCaptureDevices().Select(d => new AudioSourceItem(d)).ToList(); }
private void UpdateAudioSources() { audioSourceItems = new BindingList <ComboBoxItem>(); var audioDevices = AudioTool.GetAudioCaptureDevices(); var captureProps = Config.Data.WasapiCaptureProps; foreach (var d in audioDevices) { d.Properties = captureProps; ComboBoxItem item = new ComboBoxItem { Name = d.Name, Tag = d, }; audioSourceItems.Add(item); } audioSourceComboBox.DataSource = audioSourceItems; audioSourceComboBox.DisplayMember = "Name"; }