diff options
Diffstat (limited to 'WhisperNet/API/CaptureDeviceId.cs')
| -rw-r--r-- | WhisperNet/API/CaptureDeviceId.cs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/WhisperNet/API/CaptureDeviceId.cs b/WhisperNet/API/CaptureDeviceId.cs new file mode 100644 index 0000000..9636e53 --- /dev/null +++ b/WhisperNet/API/CaptureDeviceId.cs @@ -0,0 +1,24 @@ +using Whisper.Internal; + +namespace Whisper +{ + /// <summary>Identifiers for an audio capture device</summary> + public record struct CaptureDeviceId + { + /// <summary>The display name is suitable for showing to the user, but might not be unique.</summary> + public string displayName; + + /// <summary>Endpoint ID for an audio capture device.<br/> + /// It uniquely identifies the device on the system, but is not a readable string.</summary> + public string endpoint; + + internal CaptureDeviceId( in sCaptureDevice rsi ) + { + displayName = rsi.displayName ?? "<display name unavailable>"; + endpoint = rsi.endpoint ?? throw new ApplicationException( "The device has no endpoint ID" ); + } + + /// <summary>Returns a String which represents the object instance</summary> + public override string ToString() => $"Capture device: \"{displayName}\""; + } +}
\ No newline at end of file |
