Table of Contents

Struct SourceRef

Namespace
OBSStudioClient.Classes
Assembly
OBSClient.dll

Identifies a source to obs-websocket: by its name or by its UUID.

public readonly struct SourceRef : IEquatable<SourceRef>
Implements
Inherited Members

Remarks

Every input and every scene is a source, so wherever a method asks for a SourceRef you can also pass an InputRef, a SceneRef, an Input, a Scene or the SceneItem that shows the source. A name ("Webcam") and a Guid convert implicitly as well. A UUID stays the same when the source is renamed.

default(SourceRef) identifies nothing; the methods refuse it with an ArgumentException.

Properties

IsSpecified

Gets a value indicating whether this identifies a source (default(SourceRef) does not).

Name

Gets the name of the source, or null when the source is identified by its UUID.

Uuid

Gets the UUID of the source, or null when the source is identified by its name.

Methods

Equals(SourceRef)

Indicates whether the current object is equal to another object of the same type.

Equals(object?)

Indicates whether this instance and a specified object are equal.

FromName(string)

Identifies a source by its name.

FromUuid(Guid)

Identifies a source by its UUID.

GetHashCode()

Returns the hash code for this instance.

ToString()

Gets the name or the UUID of the source, as text.

Operators

operator ==(SourceRef, SourceRef)

Determines whether two references are the same: the same name or the same UUID.

implicit operator SourceRef(Input)

Identifies the source that an input that OBS Studio reported is.

implicit operator SourceRef(InputRef)

Identifies the source that an input is.

implicit operator SourceRef(Scene)

Identifies the source that a scene that OBS Studio reported is.

implicit operator SourceRef(SceneItem)

Identifies the source that a scene item shows, by its UUID (or by its name when OBS Studio did not report a UUID).

implicit operator SourceRef(SceneRef)

Identifies the source that a scene is.

implicit operator SourceRef(Guid)

Identifies a source by its UUID.

implicit operator SourceRef(string)

Identifies a source by its name.

operator !=(SourceRef, SourceRef)

Determines whether two references are different.