Exemplo n.º 1
0
        public void LoadFromXml(XElement xAudioDevicePool)
        {
            if (xAudioDevicePool != null)
            {
                if (Enum.TryParse(xAudioDevicePool.GetElementValueTrimmed("WaveOutDeviceSource"), out AudioDeviceSource src))
                {
                    WaveOutDeviceSource = src;
                }

                string waveOutName = xAudioDevicePool.GetElementValueTrimmed("WaveOutDeviceName");
                if (String.IsNullOrWhiteSpace(waveOutName))
                {
                    WaveOutDevice device = WaveOutDevices.Where(d => d.Name == waveOutName).FirstOrDefault();
                    ManualDevice = device ?? WaveOutDevices.FirstOrDefault();
                }
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// returns the WaveOutDevice object that has a matching Name -property
 /// </summary>
 /// <param name="name"></param>
 public static WaveOutDevice GetWaveOutDevice(string name)
 {
     return(WaveOutDevices.Where(d => d.Name == name).FirstOrDefault());
 }