Browse Source

added friendly name for device to MMDevice courtesy of contribution from Max

pull/1/head
markheath 15 years ago
parent
commit
fb69f66725
  1. 23
      NAudio/CoreAudioApi/MMDevice.cs
  2. 5
      NAudio/CoreAudioApi/PropertyKeys.cs

23
NAudio/CoreAudioApi/MMDevice.cs

@ -135,7 +135,7 @@ namespace NAudio.CoreAudioApi
}
/// <summary>
/// Friendly name
/// Friendly name for the endpoint
/// </summary>
public string FriendlyName
{
@ -154,6 +154,27 @@ namespace NAudio.CoreAudioApi
}
}
/// <summary>
/// Friendly name of device
/// </summary>
public string DeviceFriendlyName
{
get
{
if (_PropertyStore == null)
{
GetPropertyInformation();
}
if (_PropertyStore.Contains(PropertyKeys.PKEY_Device_FriendlyName))
{
return (string)_PropertyStore[PropertyKeys.PKEY_Device_FriendlyName].Value;
}
else
{
return "Unknown";
}
}
}
/// <summary>
/// Device ID

5
NAudio/CoreAudioApi/PropertyKeys.cs

@ -66,6 +66,9 @@ namespace NAudio.CoreAudioApi
/// PKEY_AudioEngine_DeviceFormat
/// </summary>
public static readonly Guid PKEY_AudioEngine_DeviceFormat = new Guid(0xf19f064d, 0x82c, 0x4e27, 0xbc, 0x73, 0x68, 0x82, 0xa1, 0xbb, 0x8e, 0x4c);
/// <summary>
/// PKEY _Devie_FriendlyName
/// </summary>
public static readonly Guid PKEY_Device_FriendlyName = new Guid(0x026e516e, 0xb814, 0x414b, 0x83, 0xcd, 0x85, 0x6d, 0x6f, 0xef, 0x48, 0x22);
}
}
Loading…
Cancel
Save