diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 35212ea..2b17001 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -52,6 +52,11 @@ jobs:
- name: Restore dependencies
run: dotnet restore ObsWebSocket.sln
+ - name: Check formatting
+ run: |
+ dotnet tool restore
+ dotnet csharpier check .
+
- name: Build Solution
run: dotnet build ObsWebSocket.sln --configuration Release --no-restore
diff --git a/ObsWebSocket.Codegen.Tasks/GenerateObsWebSocketSourcesTask.cs b/ObsWebSocket.Codegen.Tasks/GenerateObsWebSocketSourcesTask.cs
index 64861e1..54f15d0 100644
--- a/ObsWebSocket.Codegen.Tasks/GenerateObsWebSocketSourcesTask.cs
+++ b/ObsWebSocket.Codegen.Tasks/GenerateObsWebSocketSourcesTask.cs
@@ -14,7 +14,8 @@ public sealed class GenerateObsWebSocketSourcesTask : Microsoft.Build.Utilities.
public override bool Execute()
{
- int exitCode = ProtocolCodegenRunner.GenerateAsync(
+ int exitCode = ProtocolCodegenRunner
+ .GenerateAsync(
protocolPath: ProtocolPath,
outputDirectory: OutputDirectory,
downloadIfMissing: DownloadIfMissing,
diff --git a/ObsWebSocket.Codegen.Tasks/Generation/Diagnostics.cs b/ObsWebSocket.Codegen.Tasks/Generation/Diagnostics.cs
index cfc6549..e48f96e 100644
--- a/ObsWebSocket.Codegen.Tasks/Generation/Diagnostics.cs
+++ b/ObsWebSocket.Codegen.Tasks/Generation/Diagnostics.cs
@@ -113,6 +113,20 @@ internal static class Diagnostics
isEnabledByDefault: true
);
+ ///
+ /// Reported when the protocol defines a Number field the numeric table does not
+ /// classify. The field still maps to double, which is the safe fallback, but a whole
+ /// number field left unclassified reaches callers as a floating point value.
+ ///
+ public static readonly DiagnosticDescriptor UnclassifiedNumberField = new(
+ id: "OBSWSGEN012",
+ title: "Unclassified Number field",
+ messageFormat: "Number field '{0}' in '{1}' is not listed in NumericFieldTable. Mapping to 'double'. Add it to the table if it holds whole numbers.",
+ category: Category,
+ defaultSeverity: DiagnosticSeverity.Warning,
+ isEnabledByDefault: true
+ );
+
///
/// Informational diagnostic reported when an optional field that is a value type (struct) is generated as a nullable value type.
///
diff --git a/ObsWebSocket.Codegen.Tasks/Generation/Emitter.DtoGeneration.cs b/ObsWebSocket.Codegen.Tasks/Generation/Emitter.DtoGeneration.cs
index 03adcbd..3ace87f 100644
--- a/ObsWebSocket.Codegen.Tasks/Generation/Emitter.DtoGeneration.cs
+++ b/ObsWebSocket.Codegen.Tasks/Generation/Emitter.DtoGeneration.cs
@@ -729,6 +729,7 @@ out bool isRootOfNested
|| f.ValueName.EndsWith("." + objectNode.Name)
);
}
+
///
/// Reports whether a field's description says it can be null, which the protocol states in
/// prose for fields it does not otherwise mark optional.
@@ -736,5 +737,4 @@ out bool isRootOfNested
private static bool DescriptionAllowsNull(string? description) =>
!string.IsNullOrEmpty(description)
&& description.IndexOf("null", StringComparison.OrdinalIgnoreCase) >= 0;
-
}
diff --git a/ObsWebSocket.Codegen.Tasks/Generation/Emitter.EventStreams.cs b/ObsWebSocket.Codegen.Tasks/Generation/Emitter.EventStreams.cs
index cb57817..b48f3a6 100644
--- a/ObsWebSocket.Codegen.Tasks/Generation/Emitter.EventStreams.cs
+++ b/ObsWebSocket.Codegen.Tasks/Generation/Emitter.EventStreams.cs
@@ -12,7 +12,9 @@ internal static partial class Emitter
{
///
/// Generates one stream accessor per protocol event, each wrapping the corresponding
- /// classic event so it can be consumed with await foreach.
+ /// classic event so it can be consumed with await foreach. The accessors go onto the
+ /// same category group as that category's requests, because the protocol documents requests
+ /// and events under one set of category headings.
///
/// The source production context.
/// The parsed protocol definition.
@@ -26,6 +28,12 @@ ProtocolDefinition protocol
return;
}
+ HashSet requestCategories = new(StringComparer.OrdinalIgnoreCase);
+ foreach (RequestDefinition request in protocol.Requests ?? [])
+ {
+ _ = requestCategories.Add(request.Category ?? "general");
+ }
+
StringBuilder builder = BuildSourceHeader("// Helper: per-event IAsyncEnumerable streams");
builder.AppendLine("using System;");
builder.AppendLine("using System.Collections.Generic;");
@@ -36,86 +44,113 @@ ProtocolDefinition protocol
builder.AppendLine();
builder.AppendLine($"namespace {ExtensionsNamespace};");
builder.AppendLine();
- builder.AppendLine("/// ");
- builder.AppendLine(
- "/// Observes OBS events as async sequences. Each accessor subscribes for the lifetime"
- );
- builder.AppendLine(
- "/// of the enumeration and unsubscribes when it ends, so the caller never manages handlers."
- );
- builder.AppendLine("/// ");
- builder.AppendLine("public static class ObsWebSocketClientEventStreams");
- builder.AppendLine("{");
- foreach (OBSEvent? eventDef in protocol.Events)
+ foreach (
+ IGrouping group in protocol
+ .Events.GroupBy(e => e.Category ?? "general", StringComparer.OrdinalIgnoreCase)
+ .OrderBy(g => g.Key, StringComparer.Ordinal)
+ )
{
- try
- {
- string eventName = SanitizeIdentifier(eventDef.EventType);
- if (string.IsNullOrEmpty(eventName))
- {
- continue;
- }
+ string groupName = ToGroupName(group.Key);
- string eventArgsTypeName = $"{GeneratedEventArgsNamespace}.{eventName}EventArgs";
+ builder.AppendLine("/// ");
+ builder.AppendLine(
+ $"/// Events in the {System.Security.SecurityElement.Escape(group.Key)} category, as async sequences."
+ );
+ builder.AppendLine(
+ "/// Each accessor subscribes for the lifetime of the enumeration and unsubscribes"
+ );
+ builder.AppendLine("/// when it ends, so the caller never manages handlers.");
+ builder.AppendLine("/// ");
- builder.AppendLine(" /// ");
+ // A category with events but no requests has no group declared elsewhere, so this
+ // part has to carry the primary constructor.
+ if (requestCategories.Contains(group.Key))
+ {
+ builder.AppendLine($"public readonly partial struct {groupName}Group");
+ }
+ else
+ {
builder.AppendLine(
- $" /// Streams {eventName} events as they arrive."
+ "/// The client these events are observed on."
);
- if (!string.IsNullOrWhiteSpace(eventDef.Description))
+ builder.AppendLine(
+ $"public readonly partial struct {groupName}Group(ObsWebSocketClient client)"
+ );
+ }
+
+ builder.AppendLine("{");
+
+ foreach (OBSEvent eventDef in group)
+ {
+ try
{
+ string eventName = SanitizeIdentifier(eventDef.EventType);
+ if (string.IsNullOrEmpty(eventName))
+ {
+ continue;
+ }
+
+ string eventArgsTypeName =
+ $"{GeneratedEventArgsNamespace}.{eventName}EventArgs";
+
+ builder.AppendLine(" /// ");
builder.AppendLine(
- $" /// {FlattenDescription(eventDef.Description)}"
+ $" /// Streams {eventName} events as they arrive."
);
- }
+ if (!string.IsNullOrWhiteSpace(eventDef.Description))
+ {
+ builder.AppendLine(
+ $" /// {FlattenDescription(eventDef.Description)}"
+ );
+ }
- builder.AppendLine(" /// ");
- builder.AppendLine(" /// The ObsWebSocketClient instance.");
- builder.AppendLine(
- " /// Events buffered before the oldest is dropped."
- );
- builder.AppendLine(
- " /// Ends the enumeration and unsubscribes."
- );
- if (!string.IsNullOrWhiteSpace(eventDef.EventSubscription))
- {
+ builder.AppendLine(" /// ");
builder.AppendLine(
- $" /// Requires the {System.Security.SecurityElement.Escape(eventDef.EventSubscription)} subscription."
+ " /// Events buffered before the oldest is dropped."
);
- }
+ builder.AppendLine(
+ " /// Ends the enumeration and unsubscribes."
+ );
+ if (!string.IsNullOrWhiteSpace(eventDef.EventSubscription))
+ {
+ builder.AppendLine(
+ $" /// Requires the {System.Security.SecurityElement.Escape(eventDef.EventSubscription)} subscription."
+ );
+ }
- builder.AppendLine(
- $" public static IAsyncEnumerable<{eventArgsTypeName}> {eventName}Stream("
- );
- builder.AppendLine(" this ObsWebSocketClient client,");
- builder.AppendLine(" int capacity = EventStream.DefaultCapacity,");
- builder.AppendLine(" CancellationToken cancellationToken = default)");
- builder.AppendLine(" {");
- builder.AppendLine(" ArgumentNullException.ThrowIfNull(client);");
- builder.AppendLine($" return EventStream.Create<{eventArgsTypeName}>(");
- builder.AppendLine($" handler => client.{eventName} += handler,");
- builder.AppendLine($" handler => client.{eventName} -= handler,");
- builder.AppendLine(" capacity,");
- builder.AppendLine(" cancellationToken);");
- builder.AppendLine(" }");
- builder.AppendLine();
- }
- catch (Exception ex)
- {
- context.ReportDiagnostic(
- Diagnostic.Create(
- Diagnostics.IdentifierGenerationError,
- Location.None,
- eventDef.EventType,
- $"Generating event stream for {eventDef.EventType}",
- ex.Message
- )
- );
+ builder.AppendLine(
+ $" public IAsyncEnumerable<{eventArgsTypeName}> {eventName}Stream("
+ );
+ builder.AppendLine(" int capacity = EventStream.DefaultCapacity,");
+ builder.AppendLine(" CancellationToken cancellationToken = default)");
+ builder.AppendLine(" {");
+ builder.AppendLine(" ObsWebSocketClient source = client;");
+ builder.AppendLine($" return EventStream.Create<{eventArgsTypeName}>(");
+ builder.AppendLine($" handler => source.{eventName} += handler,");
+ builder.AppendLine($" handler => source.{eventName} -= handler,");
+ builder.AppendLine(" capacity,");
+ builder.AppendLine(" cancellationToken);");
+ builder.AppendLine(" }");
+ builder.AppendLine();
+ }
+ catch (Exception ex)
+ {
+ context.ReportDiagnostic(
+ Diagnostic.Create(
+ Diagnostics.IdentifierGenerationError,
+ Location.None,
+ eventDef.EventType,
+ $"Generating event stream for {eventDef.EventType}",
+ ex.Message
+ )
+ );
+ }
}
- }
- builder.AppendLine("}");
+ builder.AppendLine("}");
+ builder.AppendLine();
+ }
context.AddSource(
"ObsWebSocketClient.EventStreams.g.cs",
diff --git a/ObsWebSocket.Codegen.Tasks/Generation/Emitter.Helpers.cs b/ObsWebSocket.Codegen.Tasks/Generation/Emitter.Helpers.cs
index d6f643b..60054c5 100644
--- a/ObsWebSocket.Codegen.Tasks/Generation/Emitter.Helpers.cs
+++ b/ObsWebSocket.Codegen.Tasks/Generation/Emitter.Helpers.cs
@@ -238,16 +238,33 @@ string parentDtoName
// Map specifically named 'Object' field to Stub record
// Use the fully qualified name to avoid potential namespace conflicts
return ($"{GeneratedCommonNamespace}.SceneItemTransformStub?", false);
- // Add other specific 'Object' mappings here if needed in the future
+ // Add other specific 'Object' mappings here if needed in the future
}
// If not handled above, it falls through to the general 'Object'/'Any' handling below
}
// --- Basic Type Mapping ---
+ string? numberType = null;
+ if (obsType == "Number")
+ {
+ numberType = NumericFieldTable.MapNumber(fieldName, out bool classified);
+ if (!classified)
+ {
+ context.ReportDiagnostic(
+ Diagnostic.Create(
+ Diagnostics.UnclassifiedNumberField,
+ Location.None,
+ fieldName,
+ parentDtoName
+ )
+ );
+ }
+ }
+
string? mappedType = obsType switch
{
"String" => "string",
- "Number" => "double",
+ "Number" => numberType,
"Boolean" => "bool",
"Uuid" => "string",
"Object" or "Any" => "System.Text.Json.JsonElement?", // Fallback for unhandled Object/Any
diff --git a/ObsWebSocket.Codegen.Tasks/Generation/Emitter.Hierarchy.cs b/ObsWebSocket.Codegen.Tasks/Generation/Emitter.Hierarchy.cs
index df97d58..36d75ca 100644
--- a/ObsWebSocket.Codegen.Tasks/Generation/Emitter.Hierarchy.cs
+++ b/ObsWebSocket.Codegen.Tasks/Generation/Emitter.Hierarchy.cs
@@ -88,7 +88,7 @@ SourceProductionContext context
currentNode = newNode;
}
}
- NextFieldPass1:
+ NextFieldPass1:
;
}
diff --git a/ObsWebSocket.Codegen.Tasks/Generation/Emitter.JsonContext.cs b/ObsWebSocket.Codegen.Tasks/Generation/Emitter.JsonContext.cs
index f91863e..aea9103 100644
--- a/ObsWebSocket.Codegen.Tasks/Generation/Emitter.JsonContext.cs
+++ b/ObsWebSocket.Codegen.Tasks/Generation/Emitter.JsonContext.cs
@@ -19,7 +19,9 @@ ProtocolDefinition protocol
{
try
{
- StringBuilder builder = BuildSourceHeader("// Serialization Context: ObsWebSocketJsonContext");
+ StringBuilder builder = BuildSourceHeader(
+ "// Serialization Context: ObsWebSocketJsonContext"
+ );
_ = builder.AppendLine("using System.Collections.Generic;");
_ = builder.AppendLine("using System.Text.Json;");
@@ -34,16 +36,26 @@ ProtocolDefinition protocol
_ = builder.AppendLine();
_ = builder.AppendLine("[JsonSourceGenerationOptions(");
_ = builder.AppendLine(" PropertyNamingPolicy = JsonKnownNamingPolicy.CamelCase,");
- _ = builder.AppendLine(" DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull)]");
+ _ = builder.AppendLine(
+ " DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull)]"
+ );
// Fixed protocol wrapper and payload types.
_ = builder.AppendLine("[JsonSerializable(typeof(OutgoingMessage))]");
_ = builder.AppendLine("[JsonSerializable(typeof(OutgoingMessage))]");
- _ = builder.AppendLine("[JsonSerializable(typeof(OutgoingMessage))]");
- _ = builder.AppendLine("[JsonSerializable(typeof(OutgoingMessage))]");
+ _ = builder.AppendLine(
+ "[JsonSerializable(typeof(OutgoingMessage))]"
+ );
+ _ = builder.AppendLine(
+ "[JsonSerializable(typeof(OutgoingMessage))]"
+ );
_ = builder.AppendLine("[JsonSerializable(typeof(IncomingMessage))]");
- _ = builder.AppendLine("[JsonSerializable(typeof(RequestResponsePayload))]");
- _ = builder.AppendLine("[JsonSerializable(typeof(RequestBatchResponsePayload))]");
+ _ = builder.AppendLine(
+ "[JsonSerializable(typeof(RequestResponsePayload))]"
+ );
+ _ = builder.AppendLine(
+ "[JsonSerializable(typeof(RequestBatchResponsePayload))]"
+ );
_ = builder.AppendLine("[JsonSerializable(typeof(EventPayloadBase))]");
_ = builder.AppendLine("[JsonSerializable(typeof(HelloPayload))]");
_ = builder.AppendLine("[JsonSerializable(typeof(IdentifiedPayload))]");
@@ -111,7 +123,9 @@ ProtocolDefinition protocol
);
}
- _ = builder.AppendLine("internal sealed partial class ObsWebSocketJsonContext : JsonSerializerContext");
+ _ = builder.AppendLine(
+ "internal sealed partial class ObsWebSocketJsonContext : JsonSerializerContext"
+ );
_ = builder.AppendLine("{");
_ = builder.AppendLine("}");
diff --git a/ObsWebSocket.Codegen.Tasks/Generation/Emitter.MsgPackResolver.cs b/ObsWebSocket.Codegen.Tasks/Generation/Emitter.MsgPackResolver.cs
index 2d1d188..b488f8e 100644
--- a/ObsWebSocket.Codegen.Tasks/Generation/Emitter.MsgPackResolver.cs
+++ b/ObsWebSocket.Codegen.Tasks/Generation/Emitter.MsgPackResolver.cs
@@ -105,12 +105,18 @@ void AddFixedType(string typeName)
context.AddSource(
"ObsWebSocketMsgPackResolver.RequestTypes.g.cs",
- SourceText.From(BuildKnownTypeSource("IsRequestType", requestTypeNames), Encoding.UTF8)
+ SourceText.From(
+ BuildKnownTypeSource("IsRequestType", requestTypeNames),
+ Encoding.UTF8
+ )
);
context.AddSource(
"ObsWebSocketMsgPackResolver.ResponseTypes.g.cs",
- SourceText.From(BuildKnownTypeSource("IsResponseType", responseTypeNames), Encoding.UTF8)
+ SourceText.From(
+ BuildKnownTypeSource("IsResponseType", responseTypeNames),
+ Encoding.UTF8
+ )
);
context.AddSource(
@@ -120,7 +126,10 @@ void AddFixedType(string typeName)
context.AddSource(
"ObsWebSocketMsgPackResolver.NestedTypes.g.cs",
- SourceText.From(BuildKnownTypeSource("IsNestedType", nestedTypeNames), Encoding.UTF8)
+ SourceText.From(
+ BuildKnownTypeSource("IsNestedType", nestedTypeNames),
+ Encoding.UTF8
+ )
);
}
catch (Exception ex)
@@ -139,7 +148,9 @@ void AddFixedType(string typeName)
private static string BuildResolverRootSource()
{
- StringBuilder builder = BuildSourceHeader("// Serialization Resolver: ObsWebSocketMsgPackResolver");
+ StringBuilder builder = BuildSourceHeader(
+ "// Serialization Resolver: ObsWebSocketMsgPackResolver"
+ );
builder.AppendLine("using System;");
builder.AppendLine("using MessagePack;");
builder.AppendLine("using MessagePack.Formatters;");
@@ -162,7 +173,9 @@ private static string BuildResolverRootSource()
builder.AppendLine(" private ObsWebSocketMsgPackResolver() { }");
builder.AppendLine();
builder.AppendLine(" /// ");
- builder.AppendLine(" /// Gets a formatter for when this resolver supports it.");
+ builder.AppendLine(
+ " /// Gets a formatter for when this resolver supports it."
+ );
builder.AppendLine(" /// ");
builder.AppendLine(
" public IMessagePackFormatter? GetFormatter() => ObsWebSocketMsgPackResolverCore.GetFormatter();"
@@ -179,7 +192,9 @@ private static string BuildResolverRootSource()
builder.AppendLine(" return null;");
builder.AppendLine(" }");
builder.AppendLine();
- builder.AppendLine(" return SourceGeneratedFormatterResolver.Instance.GetFormatter();");
+ builder.AppendLine(
+ " return SourceGeneratedFormatterResolver.Instance.GetFormatter();"
+ );
builder.AppendLine(" }");
builder.AppendLine();
builder.AppendLine(" private static bool IsKnownType(Type type)");
diff --git a/ObsWebSocket.Codegen.Tasks/Generation/Emitter.cs b/ObsWebSocket.Codegen.Tasks/Generation/Emitter.cs
index dc4c3a9..f05d358 100644
--- a/ObsWebSocket.Codegen.Tasks/Generation/Emitter.cs
+++ b/ObsWebSocket.Codegen.Tasks/Generation/Emitter.cs
@@ -48,8 +48,12 @@ public static void GenerateEnums(SourceProductionContext context, ProtocolDefini
{
string suffix =
valueKind == EnumValueKind.Numeric ? ".Enum.g.cs" : ".Class.g.cs";
+ string fileStem =
+ valueKind == EnumValueKind.Numeric
+ ? MapEnumTypeName(SanitizeIdentifier(enumDef.EnumType))
+ : SanitizeIdentifier(enumDef.EnumType);
context.AddSource(
- $"{SanitizeIdentifier(enumDef.EnumType)}{suffix}",
+ $"{fileStem}{suffix}",
SourceText.From(source, Encoding.UTF8)
);
}
@@ -88,7 +92,7 @@ public static void GenerateEnums(SourceProductionContext context, ProtocolDefini
///
private static string? GenerateNumericEnumSource(EnumDefinition enumDef, string underlyingType)
{
- string enumName = SanitizeIdentifier(enumDef.EnumType);
+ string enumName = MapEnumTypeName(SanitizeIdentifier(enumDef.EnumType));
StringBuilder builder = BuildSourceHeader($"// Type: Numeric Enum ({underlyingType})");
builder.AppendLine($"namespace {GeneratedEnumsNamespace};");
builder.AppendLine();
@@ -222,6 +226,19 @@ EnumDefinition enumDef
return builder.ToString();
}
+ ///
+ /// Renames protocol enums whose name already belongs to a message type, so a caller writing a
+ /// catch filter does not have to disambiguate two types called RequestStatus in
+ /// neighbouring namespaces.
+ ///
+ private static string MapEnumTypeName(string enumTypeName) =>
+ enumTypeName switch
+ {
+ // Protocol.RequestStatus is the record carried on a response; this is the code on it.
+ "RequestStatus" => "RequestStatusCode",
+ _ => enumTypeName,
+ };
+
///
/// Drops the leading Obs from a protocol enum type name, so ObsMediaInputAction
/// yields MediaInputAction and does not collide with the string-constant class.
@@ -248,7 +265,11 @@ private static string FindCommonMemberPrefix(List identifiers)
{
string[] parts = identifier.Split('_');
int i = 0;
- while (i < shared && i < parts.Length && string.Equals(parts[i], first[i], StringComparison.Ordinal))
+ while (
+ i < shared
+ && i < parts.Length
+ && string.Equals(parts[i], first[i], StringComparison.Ordinal)
+ )
{
i++;
}
@@ -317,7 +338,9 @@ private static string SnakeToPascalCase(string upperSnake) =>
string prefix = FindCommonMemberPrefix([.. members.Select(m => m.Member)]);
- StringBuilder builder = BuildSourceHeader("// Type: Typed Enum for a string-valued protocol enum");
+ StringBuilder builder = BuildSourceHeader(
+ "// Type: Typed Enum for a string-valued protocol enum"
+ );
builder.AppendLine("using System;");
builder.AppendLine("using System.Text.Json.Serialization;");
builder.AppendLine();
@@ -328,7 +351,9 @@ private static string SnakeToPascalCase(string upperSnake) =>
$"Typed form of the {constantsClass} protocol enum. Use to obtain the string OBS expects.",
0
);
- builder.AppendLine("/// Generated from OBS WebSocket Protocol definition.");
+ builder.AppendLine(
+ "/// Generated from OBS WebSocket Protocol definition."
+ );
builder.AppendLine($"public enum {enumName}");
builder.AppendLine("{");
foreach ((string memberIdentifier, string wire) in members)
@@ -340,7 +365,9 @@ private static string SnakeToPascalCase(string upperSnake) =>
}
string memberName = SnakeToPascalCase(shortName);
- builder.AppendLine($" /// Maps to {System.Security.SecurityElement.Escape(wire)}.");
+ builder.AppendLine(
+ $" /// Maps to {System.Security.SecurityElement.Escape(wire)}."
+ );
builder.AppendLine($" [JsonStringEnumMemberName(\"{wire}\")]");
builder.AppendLine($" {memberName},");
builder.AppendLine();
@@ -352,8 +379,12 @@ private static string SnakeToPascalCase(string upperSnake) =>
AppendXmlDocSummary(builder, $"Wire-value conversions for .", 0);
builder.AppendLine($"public static class {enumName}Extensions");
builder.AppendLine("{");
- builder.AppendLine($" /// Returns the protocol string OBS expects for this value.");
- builder.AppendLine($" public static string ToWireValue(this {enumName} value) => value switch");
+ builder.AppendLine(
+ $" /// Returns the protocol string OBS expects for this value."
+ );
+ builder.AppendLine(
+ $" public static string ToWireValue(this {enumName} value) => value switch"
+ );
builder.AppendLine(" {");
foreach ((string memberIdentifier, string wire) in members)
{
@@ -363,14 +394,22 @@ private static string SnakeToPascalCase(string upperSnake) =>
shortName = shortName.Substring(prefix.Length);
}
- builder.AppendLine($" {enumName}.{SnakeToPascalCase(shortName)} => {constantsClass}.{memberIdentifier},");
+ builder.AppendLine(
+ $" {enumName}.{SnakeToPascalCase(shortName)} => {constantsClass}.{memberIdentifier},"
+ );
}
- builder.AppendLine($" _ => throw new ArgumentOutOfRangeException(nameof(value), value, null),");
+ builder.AppendLine(
+ $" _ => throw new ArgumentOutOfRangeException(nameof(value), value, null),"
+ );
builder.AppendLine(" };");
builder.AppendLine();
- builder.AppendLine($" /// Parses a protocol string into a , returning null when unrecognised.");
- builder.AppendLine($" public static {enumName}? FromWireValue(string? value) => value switch");
+ builder.AppendLine(
+ $" /// Parses a protocol string into a , returning null when unrecognised."
+ );
+ builder.AppendLine(
+ $" public static {enumName}? FromWireValue(string? value) => value switch"
+ );
builder.AppendLine(" {");
foreach ((string memberIdentifier, string wire) in members)
{
@@ -380,7 +419,9 @@ private static string SnakeToPascalCase(string upperSnake) =>
shortName = shortName.Substring(prefix.Length);
}
- builder.AppendLine($" {constantsClass}.{memberIdentifier} => {enumName}.{SnakeToPascalCase(shortName)},");
+ builder.AppendLine(
+ $" {constantsClass}.{memberIdentifier} => {enumName}.{SnakeToPascalCase(shortName)},"
+ );
}
builder.AppendLine(" _ => null,");
@@ -712,9 +753,11 @@ IGrouping group in protocol
$"/// Requests in the {System.Security.SecurityElement.Escape(group.Key)} category."
);
builder.AppendLine("/// ");
- builder.AppendLine("/// The client these requests are sent on.");
builder.AppendLine(
- $"public readonly partial struct {groupName}RequestGroup(ObsWebSocketClient client)"
+ "/// The client these requests are sent on."
+ );
+ builder.AppendLine(
+ $"public readonly partial struct {groupName}Group(ObsWebSocketClient client)"
);
builder.AppendLine("{");
@@ -744,7 +787,9 @@ IGrouping group in protocol
}
builder.AppendLine("/// ");
- builder.AppendLine("/// Exposes the request categories defined by the OBS WebSocket protocol.");
+ builder.AppendLine(
+ "/// Exposes the request categories defined by the OBS WebSocket protocol."
+ );
builder.AppendLine("/// ");
builder.AppendLine("public static class ObsWebSocketClientExtensions");
builder.AppendLine("{");
@@ -757,9 +802,7 @@ IGrouping group in protocol
$" /// Requests in the {System.Security.SecurityElement.Escape(category)} category."
);
builder.AppendLine(" /// ");
- builder.AppendLine(
- $" public {groupName}RequestGroup {groupName} => new(client);"
- );
+ builder.AppendLine($" public {groupName}Group {groupName} => new(client);");
builder.AppendLine(" }");
builder.AppendLine();
}
@@ -828,15 +871,11 @@ RequestDefinition reqDef
{
if (baseCallMethod == "CallAsyncValue")
{
- builder.Append(
- $"Yields the response data."
- );
+ builder.Append($"Yields the response data.");
}
else // Assumed CallAsync (reference type)
{
- builder.Append(
- $"Yields the response data."
- );
+ builder.Append($"Yields the response data.");
}
}
else // No response data
@@ -876,9 +915,7 @@ RequestDefinition reqDef
);
}
- builder.AppendLine(
- $" public async {returnType} {methodName}({parameterList})"
- );
+ builder.AppendLine($" public async {returnType} {methodName}({parameterList})");
builder.AppendLine(" {");
// Method Body
string callParams = hasRequestData ? requestParamName : "null";
diff --git a/ObsWebSocket.Codegen.Tasks/Generation/GenerationContext.cs b/ObsWebSocket.Codegen.Tasks/Generation/GenerationContext.cs
index 5176b21..68e94d5 100644
--- a/ObsWebSocket.Codegen.Tasks/Generation/GenerationContext.cs
+++ b/ObsWebSocket.Codegen.Tasks/Generation/GenerationContext.cs
@@ -26,13 +26,19 @@ public void AddSource(string hintName, SourceText sourceText)
private static string ResolveOutputPath(string hintName, string source)
{
string fileName = Path.GetFileName(hintName);
- string namespaceLine = source
- .Split('\n')
- .Select(line => line.Trim())
- .FirstOrDefault(line => line.StartsWith("namespace ", StringComparison.Ordinal))
+ string namespaceLine =
+ source
+ .Split('\n')
+ .Select(line => line.Trim())
+ .FirstOrDefault(line => line.StartsWith("namespace ", StringComparison.Ordinal))
?? string.Empty;
- if (namespaceLine.Contains("ObsWebSocket.Core.Protocol.Common.NestedTypes", StringComparison.Ordinal))
+ if (
+ namespaceLine.Contains(
+ "ObsWebSocket.Core.Protocol.Common.NestedTypes",
+ StringComparison.Ordinal
+ )
+ )
{
return Path.Combine("Protocol", "Common", "NestedTypes", fileName);
}
@@ -42,7 +48,9 @@ private static string ResolveOutputPath(string hintName, string source)
return Path.Combine("Protocol", "Requests", fileName);
}
- if (namespaceLine.Contains("ObsWebSocket.Core.Protocol.Responses", StringComparison.Ordinal))
+ if (
+ namespaceLine.Contains("ObsWebSocket.Core.Protocol.Responses", StringComparison.Ordinal)
+ )
{
return Path.Combine("Protocol", "Responses", fileName);
}
@@ -52,15 +60,20 @@ private static string ResolveOutputPath(string hintName, string source)
return Path.Combine("Protocol", "Events", fileName);
}
- if (namespaceLine.Contains("ObsWebSocket.Core.Protocol.Generated", StringComparison.Ordinal))
+ if (
+ namespaceLine.Contains("ObsWebSocket.Core.Protocol.Generated", StringComparison.Ordinal)
+ )
{
return Path.Combine("Protocol", "Generated", fileName);
}
- return namespaceLine.Contains("ObsWebSocket.Core.Events.Generated", StringComparison.Ordinal)
- ? Path.Combine("Events", "Generated", fileName)
+ return namespaceLine.Contains(
+ "ObsWebSocket.Core.Events.Generated",
+ StringComparison.Ordinal
+ )
+ ? Path.Combine("Events", "Generated", fileName)
: namespaceLine.Contains("ObsWebSocket.Core.Serialization", StringComparison.Ordinal)
- ? Path.Combine("Serialization", fileName)
+ ? Path.Combine("Serialization", fileName)
: Path.Combine("Client", fileName);
}
}
diff --git a/ObsWebSocket.Codegen.Tasks/Generation/NumericFieldTable.cs b/ObsWebSocket.Codegen.Tasks/Generation/NumericFieldTable.cs
new file mode 100644
index 0000000..f984c79
--- /dev/null
+++ b/ObsWebSocket.Codegen.Tasks/Generation/NumericFieldTable.cs
@@ -0,0 +1,112 @@
+// ObsWebSocket.Codegen.Tasks/Generation/NumericFieldTable.cs
+namespace ObsWebSocket.Codegen.Tasks.Generation;
+
+///
+/// Decides which of the protocol's Number fields are whole numbers.
+///
+///
+/// The protocol has one numeric type because JSON has one numeric type, so sceneItemId and
+/// inputVolumeMul are indistinguishable in the definition: both are Number with a
+/// >= 0 restriction. This table is written out by hand rather than inferred from the
+/// field name, because a rule that guesses wrong on a volume field truncates it silently, while a
+/// field missing from the table only stays double, which is what it would have been anyway.
+/// A refresh that introduces an unlisted Number field reports OBSWSGEN012 so it gets
+/// classified deliberately instead of drifting in.
+///
+internal static class NumericFieldTable
+{
+ /// Whole-number fields whose values fit comfortably in 32 bits.
+ private static readonly HashSet s_int32Fields = new(StringComparer.Ordinal)
+ {
+ // Identity and ordering.
+ "sceneItemId",
+ "sceneItemIndex",
+ "filterIndex",
+ "monitorIndex",
+ "position",
+ "searchOffset",
+ // Resolutions, in pixels.
+ "baseWidth",
+ "baseHeight",
+ "outputWidth",
+ "outputHeight",
+ "imageWidth",
+ "imageHeight",
+ "imageCompressionQuality",
+ // Frame rate, expressed as a fraction.
+ "fpsNumerator",
+ "fpsDenominator",
+ // Durations and offsets that OBS reports in whole milliseconds or frames.
+ "inputAudioSyncOffset",
+ "transitionDuration",
+ "sleepFrames",
+ "sleepMillis",
+ // Counters.
+ "renderSkippedFrames",
+ "renderTotalFrames",
+ "outputSkippedFrames",
+ "outputTotalFrames",
+ "webSocketSessionIncomingMessages",
+ "webSocketSessionOutgoingMessages",
+ // Protocol version.
+ "rpcVersion",
+ };
+
+ ///
+ /// Whole-number fields that can exceed 32 bits: byte counts, millisecond durations over a long
+ /// session, and the input capability bitflag, which OBS defines as an unsigned 32 bit mask.
+ ///
+ private static readonly HashSet s_int64Fields = new(StringComparer.Ordinal)
+ {
+ "outputBytes",
+ "outputDuration",
+ "mediaCursor",
+ "mediaCursorOffset",
+ "mediaDuration",
+ "inputKindCaps",
+ };
+
+ ///
+ /// Fields deliberately left fractional, listed so an unclassified field is distinguishable
+ /// from one that was considered and left alone.
+ ///
+ private static readonly HashSet s_doubleFields = new(StringComparer.Ordinal)
+ {
+ "inputVolumeMul",
+ "inputVolumeDb",
+ "inputAudioBalance",
+ "transitionCursor",
+ "outputCongestion",
+ "cpuUsage",
+ "memoryUsage",
+ "availableDiskSpace",
+ "activeFps",
+ "averageFrameRenderTime",
+ };
+
+ ///
+ /// Returns the C# type for a protocol Number field.
+ ///
+ /// The protocol field name, matched case sensitively.
+ ///
+ /// Whether the field appears in the table at all. An unclassified field still maps to
+ /// double; the flag lets the caller report it.
+ ///
+ public static string MapNumber(string fieldName, out bool classified)
+ {
+ if (s_int32Fields.Contains(fieldName))
+ {
+ classified = true;
+ return "int";
+ }
+
+ if (s_int64Fields.Contains(fieldName))
+ {
+ classified = true;
+ return "long";
+ }
+
+ classified = s_doubleFields.Contains(fieldName);
+ return "double";
+ }
+}
diff --git a/ObsWebSocket.Codegen.Tasks/Generation/ProtocolCodeGenerator.cs b/ObsWebSocket.Codegen.Tasks/Generation/ProtocolCodeGenerator.cs
index c2d09b2..65192a7 100644
--- a/ObsWebSocket.Codegen.Tasks/Generation/ProtocolCodeGenerator.cs
+++ b/ObsWebSocket.Codegen.Tasks/Generation/ProtocolCodeGenerator.cs
@@ -12,15 +12,27 @@ internal static class ProtocolCodeGenerator
NumberHandling = JsonNumberHandling.AllowReadingFromString,
};
- public static (IReadOnlyDictionary Sources, IReadOnlyList Diagnostics) Generate(string protocolJson)
+ public static (
+ IReadOnlyDictionary Sources,
+ IReadOnlyList Diagnostics
+ ) Generate(string protocolJson)
{
ArgumentException.ThrowIfNullOrEmpty(protocolJson);
GenerationContext context = new();
- ProtocolDefinition? protocol = JsonSerializer.Deserialize(protocolJson, s_jsonOptions);
+ ProtocolDefinition? protocol = JsonSerializer.Deserialize(
+ protocolJson,
+ s_jsonOptions
+ );
if (protocol is null)
{
- context.ReportDiagnostic(Diagnostic.Create(Diagnostics.ProtocolJsonParseError, Location.None, "Deserialization returned null."));
+ context.ReportDiagnostic(
+ Diagnostic.Create(
+ Diagnostics.ProtocolJsonParseError,
+ Location.None,
+ "Deserialization returned null."
+ )
+ );
return (context.Sources, context.Diagnostics);
}
diff --git a/ObsWebSocket.Codegen.Tasks/ObsWebSocket.Codegen.Tasks.csproj b/ObsWebSocket.Codegen.Tasks/ObsWebSocket.Codegen.Tasks.csproj
index bd89f22..ee7162c 100644
--- a/ObsWebSocket.Codegen.Tasks/ObsWebSocket.Codegen.Tasks.csproj
+++ b/ObsWebSocket.Codegen.Tasks/ObsWebSocket.Codegen.Tasks.csproj
@@ -1,5 +1,4 @@
-
net9.0
enable
@@ -12,5 +11,4 @@
-
diff --git a/ObsWebSocket.Codegen.Tasks/ProtocolCodegenRunner.cs b/ObsWebSocket.Codegen.Tasks/ProtocolCodegenRunner.cs
index cb4bbeb..9965c0d 100644
--- a/ObsWebSocket.Codegen.Tasks/ProtocolCodegenRunner.cs
+++ b/ObsWebSocket.Codegen.Tasks/ProtocolCodegenRunner.cs
@@ -6,7 +6,8 @@ namespace ObsWebSocket.Codegen.Tasks;
internal static class ProtocolCodegenRunner
{
- private const string ProtocolUrl = "https://raw.githubusercontent.com/obsproject/obs-websocket/master/docs/generated/protocol.json";
+ private const string ProtocolUrl =
+ "https://raw.githubusercontent.com/obsproject/obs-websocket/master/docs/generated/protocol.json";
public static async Task GenerateAsync(
string protocolPath,
@@ -34,15 +35,24 @@ public static async Task GenerateAsync(
return 2;
}
- await DownloadProtocolAsync(fullProtocolPath, cancellationToken).ConfigureAwait(false);
+ await DownloadProtocolAsync(fullProtocolPath, cancellationToken)
+ .ConfigureAwait(false);
logInfo?.Invoke($"Downloaded protocol.json to '{fullProtocolPath}'.");
}
- string protocolJson = await File.ReadAllTextAsync(fullProtocolPath, cancellationToken).ConfigureAwait(false);
- (IReadOnlyDictionary sources, IReadOnlyList diagnostics) = ProtocolCodeGenerator.Generate(protocolJson);
-
- Diagnostic[] errors = [.. diagnostics.Where(d => d.Severity == DiagnosticSeverity.Error)];
- Diagnostic[] warnings = [.. diagnostics.Where(d => d.Severity == DiagnosticSeverity.Warning)];
+ string protocolJson = await File.ReadAllTextAsync(fullProtocolPath, cancellationToken)
+ .ConfigureAwait(false);
+ (IReadOnlyDictionary sources, IReadOnlyList diagnostics) =
+ ProtocolCodeGenerator.Generate(protocolJson);
+
+ Diagnostic[] errors =
+ [
+ .. diagnostics.Where(d => d.Severity == DiagnosticSeverity.Error),
+ ];
+ Diagnostic[] warnings =
+ [
+ .. diagnostics.Where(d => d.Severity == DiagnosticSeverity.Warning),
+ ];
Diagnostic[] infos = [.. diagnostics.Where(d => d.Severity == DiagnosticSeverity.Info)];
if (errors.Length > 0)
{
@@ -79,27 +89,50 @@ public static async Task GenerateAsync(
}
}
- private static async Task DownloadProtocolAsync(string protocolPath, CancellationToken cancellationToken)
+ private static async Task DownloadProtocolAsync(
+ string protocolPath,
+ CancellationToken cancellationToken
+ )
{
_ = Directory.CreateDirectory(Path.GetDirectoryName(protocolPath)!);
using HttpClient http = new();
- using HttpResponseMessage response = await http.GetAsync(ProtocolUrl, cancellationToken).ConfigureAwait(false);
+ using HttpResponseMessage response = await http.GetAsync(ProtocolUrl, cancellationToken)
+ .ConfigureAwait(false);
_ = response.EnsureSuccessStatusCode();
- string protocolJson = await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);
- await File.WriteAllTextAsync(protocolPath, protocolJson, new UTF8Encoding(false), cancellationToken).ConfigureAwait(false);
+ string protocolJson = await response
+ .Content.ReadAsStringAsync(cancellationToken)
+ .ConfigureAwait(false);
+ await File.WriteAllTextAsync(
+ protocolPath,
+ protocolJson,
+ new UTF8Encoding(false),
+ cancellationToken
+ )
+ .ConfigureAwait(false);
}
- private static void WriteSources(string outputDirectory, IReadOnlyDictionary sources)
+ private static void WriteSources(
+ string outputDirectory,
+ IReadOnlyDictionary sources
+ )
{
_ = Directory.CreateDirectory(outputDirectory);
- HashSet generatedRelativePaths = sources.Keys
- .Select(NormalizeRelativePath)
+ HashSet generatedRelativePaths = sources
+ .Keys.Select(NormalizeRelativePath)
.ToHashSet(StringComparer.OrdinalIgnoreCase);
- foreach (string existingFile in Directory.GetFiles(outputDirectory, "*.g.cs", SearchOption.AllDirectories))
+ foreach (
+ string existingFile in Directory.GetFiles(
+ outputDirectory,
+ "*.g.cs",
+ SearchOption.AllDirectories
+ )
+ )
{
- string relativePath = NormalizeRelativePath(Path.GetRelativePath(outputDirectory, existingFile));
+ string relativePath = NormalizeRelativePath(
+ Path.GetRelativePath(outputDirectory, existingFile)
+ );
if (!generatedRelativePaths.Contains(relativePath))
{
File.Delete(existingFile);
@@ -115,7 +148,7 @@ private static void WriteSources(string outputDirectory, IReadOnlyDictionary path
- .Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar)
+ private static string NormalizeRelativePath(string path) =>
+ path.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar)
.TrimStart(Path.DirectorySeparatorChar);
}
diff --git a/ObsWebSocket.Core/AuthenticationFailureException.cs b/ObsWebSocket.Core/AuthenticationFailureException.cs
index 2db843b..74d8383 100644
--- a/ObsWebSocket.Core/AuthenticationFailureException.cs
+++ b/ObsWebSocket.Core/AuthenticationFailureException.cs
@@ -31,5 +31,11 @@ public AuthenticationFailureException(string message)
/// a specified error message and a reference to the inner exception that caused this one.
///
public AuthenticationFailureException(string message, Exception? innerException)
- : base(message, innerException ?? new InvalidOperationException("OBS authentication failed without a more specific cause.")) { }
+ : base(
+ message,
+ innerException
+ ?? new InvalidOperationException(
+ "OBS authentication failed without a more specific cause."
+ )
+ ) { }
}
diff --git a/ObsWebSocket.Core/BatchRef.cs b/ObsWebSocket.Core/BatchRef.cs
index cad2fb4..957c5b2 100644
--- a/ObsWebSocket.Core/BatchRef.cs
+++ b/ObsWebSocket.Core/BatchRef.cs
@@ -18,8 +18,7 @@ public readonly record struct BatchRef(int Index)
{
/// Drops the response type, leaving a plain reference.
/// The reference to convert.
- public static implicit operator BatchRef(BatchRef reference) =>
- new(reference.Index);
+ public static implicit operator BatchRef(BatchRef reference) => new(reference.Index);
/// Drops the response type, leaving a plain reference.
public BatchRef ToBatchRef() => new(Index);
diff --git a/ObsWebSocket.Core/BatchResultExtensions.cs b/ObsWebSocket.Core/BatchResultExtensions.cs
index 4712509..c7e40c3 100644
--- a/ObsWebSocket.Core/BatchResultExtensions.cs
+++ b/ObsWebSocket.Core/BatchResultExtensions.cs
@@ -11,6 +11,13 @@ namespace ObsWebSocket.Core;
///
/// returns results whose payloads are transport-shaped, because a batch may mix request types.
/// These helpers turn a result into the response record for its request.
+///
+/// They exist for that low level path. A batch built with comes back
+/// as , which addresses results by the reference the builder handed out
+/// and carries its own AllSucceeded and GetFailures. Those members win over the
+/// extensions of the same name here, so reaching for a builder-built batch gets the typed path
+/// either way; prefer it, and use these when holding a raw result list.
+///
///
public static class BatchResultExtensions
{
@@ -84,7 +91,8 @@ public static class BatchResultExtensions
);
#endif
}
- catch (Exception ex) when (ex is JsonException or InvalidOperationException or NotSupportedException)
+ catch (Exception ex)
+ when (ex is JsonException or InvalidOperationException or NotSupportedException)
{
throw new ObsWebSocketSerializationException(
$"Failed to read batch result for '{result.RequestType}' as {typeof(TResponse).Name}.",
diff --git a/ObsWebSocket.Core/ConnectionAttemptFailedException.cs b/ObsWebSocket.Core/ConnectionAttemptFailedException.cs
index 53b62f1..02061f0 100644
--- a/ObsWebSocket.Core/ConnectionAttemptFailedException.cs
+++ b/ObsWebSocket.Core/ConnectionAttemptFailedException.cs
@@ -26,5 +26,11 @@ public ConnectionAttemptFailedException(string message)
/// with a specified error message and a reference to the inner exception that caused this one.
///
public ConnectionAttemptFailedException(string message, Exception? innerException)
- : base(message, innerException ?? new InvalidOperationException("OBS connection attempt failed without a more specific cause.")) { }
+ : base(
+ message,
+ innerException
+ ?? new InvalidOperationException(
+ "OBS connection attempt failed without a more specific cause."
+ )
+ ) { }
}
diff --git a/ObsWebSocket.Core/Generated/Client/ObsWebSocketClient.EventStreams.g.cs b/ObsWebSocket.Core/Generated/Client/ObsWebSocketClient.EventStreams.g.cs
index a6636e6..ace3b09 100644
--- a/ObsWebSocket.Core/Generated/Client/ObsWebSocketClient.EventStreams.g.cs
+++ b/ObsWebSocket.Core/Generated/Client/ObsWebSocketClient.EventStreams.g.cs
@@ -12,28 +12,27 @@
namespace ObsWebSocket.Core;
///
-/// Observes OBS events as async sequences. Each accessor subscribes for the lifetime
-/// of the enumeration and unsubscribes when it ends, so the caller never manages handlers.
+/// Events in the canvases category, as async sequences.
+/// Each accessor subscribes for the lifetime of the enumeration and unsubscribes
+/// when it ends, so the caller never manages handlers.
///
-public static class ObsWebSocketClientEventStreams
+public readonly partial struct CanvasesGroup
{
///
/// Streams CanvasCreated events as they arrive.
/// A new canvas has been created.
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the Canvases subscription.
- public static IAsyncEnumerable CanvasCreatedStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable CanvasCreatedStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.CanvasCreated += handler,
- handler => client.CanvasCreated -= handler,
+ handler => source.CanvasCreated += handler,
+ handler => source.CanvasCreated -= handler,
capacity,
cancellationToken);
}
@@ -42,19 +41,17 @@ public static class ObsWebSocketClientEventStreams
/// Streams CanvasRemoved events as they arrive.
/// A canvas has been removed.
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the Canvases subscription.
- public static IAsyncEnumerable CanvasRemovedStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable CanvasRemovedStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.CanvasRemoved += handler,
- handler => client.CanvasRemoved -= handler,
+ handler => source.CanvasRemoved += handler,
+ handler => source.CanvasRemoved -= handler,
capacity,
cancellationToken);
}
@@ -63,40 +60,45 @@ public static class ObsWebSocketClientEventStreams
/// Streams CanvasNameChanged events as they arrive.
/// The name of a canvas has changed.
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the Canvases subscription.
- public static IAsyncEnumerable CanvasNameChangedStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable CanvasNameChangedStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.CanvasNameChanged += handler,
- handler => client.CanvasNameChanged -= handler,
+ handler => source.CanvasNameChanged += handler,
+ handler => source.CanvasNameChanged -= handler,
capacity,
cancellationToken);
}
+}
+
+///
+/// Events in the config category, as async sequences.
+/// Each accessor subscribes for the lifetime of the enumeration and unsubscribes
+/// when it ends, so the caller never manages handlers.
+///
+public readonly partial struct ConfigGroup
+{
///
/// Streams CurrentSceneCollectionChanging events as they arrive.
/// The current scene collection has begun changing. Note: We recommend using this event to trigger a pause of all polling requests, as performing any requests during a scene collection change is considered undefined behavior and can cause crashes!
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the Config subscription.
- public static IAsyncEnumerable CurrentSceneCollectionChangingStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable CurrentSceneCollectionChangingStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.CurrentSceneCollectionChanging += handler,
- handler => client.CurrentSceneCollectionChanging -= handler,
+ handler => source.CurrentSceneCollectionChanging += handler,
+ handler => source.CurrentSceneCollectionChanging -= handler,
capacity,
cancellationToken);
}
@@ -105,19 +107,17 @@ public static class ObsWebSocketClientEventStreams
/// Streams CurrentSceneCollectionChanged events as they arrive.
/// The current scene collection has changed. Note: If polling has been paused during `CurrentSceneCollectionChanging`, this is the que to restart polling.
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the Config subscription.
- public static IAsyncEnumerable CurrentSceneCollectionChangedStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable CurrentSceneCollectionChangedStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.CurrentSceneCollectionChanged += handler,
- handler => client.CurrentSceneCollectionChanged -= handler,
+ handler => source.CurrentSceneCollectionChanged += handler,
+ handler => source.CurrentSceneCollectionChanged -= handler,
capacity,
cancellationToken);
}
@@ -126,19 +126,17 @@ public static class ObsWebSocketClientEventStreams
/// Streams SceneCollectionListChanged events as they arrive.
/// The scene collection list has changed.
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the Config subscription.
- public static IAsyncEnumerable SceneCollectionListChangedStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable SceneCollectionListChangedStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.SceneCollectionListChanged += handler,
- handler => client.SceneCollectionListChanged -= handler,
+ handler => source.SceneCollectionListChanged += handler,
+ handler => source.SceneCollectionListChanged -= handler,
capacity,
cancellationToken);
}
@@ -147,19 +145,17 @@ public static class ObsWebSocketClientEventStreams
/// Streams CurrentProfileChanging events as they arrive.
/// The current profile has begun changing.
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the Config subscription.
- public static IAsyncEnumerable CurrentProfileChangingStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable CurrentProfileChangingStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.CurrentProfileChanging += handler,
- handler => client.CurrentProfileChanging -= handler,
+ handler => source.CurrentProfileChanging += handler,
+ handler => source.CurrentProfileChanging -= handler,
capacity,
cancellationToken);
}
@@ -168,19 +164,17 @@ public static class ObsWebSocketClientEventStreams
/// Streams CurrentProfileChanged events as they arrive.
/// The current profile has changed.
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the Config subscription.
- public static IAsyncEnumerable CurrentProfileChangedStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable CurrentProfileChangedStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.CurrentProfileChanged += handler,
- handler => client.CurrentProfileChanged -= handler,
+ handler => source.CurrentProfileChanged += handler,
+ handler => source.CurrentProfileChanged -= handler,
capacity,
cancellationToken);
}
@@ -189,40 +183,45 @@ public static class ObsWebSocketClientEventStreams
/// Streams ProfileListChanged events as they arrive.
/// The profile list has changed.
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the Config subscription.
- public static IAsyncEnumerable ProfileListChangedStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable ProfileListChangedStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.ProfileListChanged += handler,
- handler => client.ProfileListChanged -= handler,
+ handler => source.ProfileListChanged += handler,
+ handler => source.ProfileListChanged -= handler,
capacity,
cancellationToken);
}
+}
+
+///
+/// Events in the filters category, as async sequences.
+/// Each accessor subscribes for the lifetime of the enumeration and unsubscribes
+/// when it ends, so the caller never manages handlers.
+///
+public readonly partial struct FiltersGroup
+{
///
/// Streams SourceFilterListReindexed events as they arrive.
/// A source's filter list has been reindexed.
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the Filters subscription.
- public static IAsyncEnumerable SourceFilterListReindexedStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable SourceFilterListReindexedStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.SourceFilterListReindexed += handler,
- handler => client.SourceFilterListReindexed -= handler,
+ handler => source.SourceFilterListReindexed += handler,
+ handler => source.SourceFilterListReindexed -= handler,
capacity,
cancellationToken);
}
@@ -231,19 +230,17 @@ public static class ObsWebSocketClientEventStreams
/// Streams SourceFilterCreated events as they arrive.
/// A filter has been added to a source.
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the Filters subscription.
- public static IAsyncEnumerable SourceFilterCreatedStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable SourceFilterCreatedStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.SourceFilterCreated += handler,
- handler => client.SourceFilterCreated -= handler,
+ handler => source.SourceFilterCreated += handler,
+ handler => source.SourceFilterCreated -= handler,
capacity,
cancellationToken);
}
@@ -252,19 +249,17 @@ public static class ObsWebSocketClientEventStreams
/// Streams SourceFilterRemoved events as they arrive.
/// A filter has been removed from a source.
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the Filters subscription.
- public static IAsyncEnumerable SourceFilterRemovedStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable SourceFilterRemovedStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.SourceFilterRemoved += handler,
- handler => client.SourceFilterRemoved -= handler,
+ handler => source.SourceFilterRemoved += handler,
+ handler => source.SourceFilterRemoved -= handler,
capacity,
cancellationToken);
}
@@ -273,19 +268,17 @@ public static class ObsWebSocketClientEventStreams
/// Streams SourceFilterNameChanged events as they arrive.
/// The name of a source filter has changed.
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the Filters subscription.
- public static IAsyncEnumerable SourceFilterNameChangedStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable SourceFilterNameChangedStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.SourceFilterNameChanged += handler,
- handler => client.SourceFilterNameChanged -= handler,
+ handler => source.SourceFilterNameChanged += handler,
+ handler => source.SourceFilterNameChanged -= handler,
capacity,
cancellationToken);
}
@@ -294,19 +287,17 @@ public static class ObsWebSocketClientEventStreams
/// Streams SourceFilterSettingsChanged events as they arrive.
/// An source filter's settings have changed (been updated).
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the Filters subscription.
- public static IAsyncEnumerable SourceFilterSettingsChangedStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable SourceFilterSettingsChangedStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.SourceFilterSettingsChanged += handler,
- handler => client.SourceFilterSettingsChanged -= handler,
+ handler => source.SourceFilterSettingsChanged += handler,
+ handler => source.SourceFilterSettingsChanged -= handler,
capacity,
cancellationToken);
}
@@ -315,61 +306,111 @@ public static class ObsWebSocketClientEventStreams
/// Streams SourceFilterEnableStateChanged events as they arrive.
/// A source filter's enable state has changed.
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the Filters subscription.
- public static IAsyncEnumerable SourceFilterEnableStateChangedStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable SourceFilterEnableStateChangedStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.SourceFilterEnableStateChanged += handler,
- handler => client.SourceFilterEnableStateChanged -= handler,
+ handler => source.SourceFilterEnableStateChanged += handler,
+ handler => source.SourceFilterEnableStateChanged -= handler,
capacity,
cancellationToken);
}
+}
+
+///
+/// Events in the general category, as async sequences.
+/// Each accessor subscribes for the lifetime of the enumeration and unsubscribes
+/// when it ends, so the caller never manages handlers.
+///
+public readonly partial struct GeneralGroup
+{
///
/// Streams ExitStarted events as they arrive.
/// OBS has begun the shutdown process.
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the General subscription.
- public static IAsyncEnumerable ExitStartedStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable ExitStartedStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.ExitStarted += handler,
- handler => client.ExitStarted -= handler,
+ handler => source.ExitStarted += handler,
+ handler => source.ExitStarted -= handler,
+ capacity,
+ cancellationToken);
+ }
+
+ ///
+ /// Streams VendorEvent events as they arrive.
+ /// An event has been emitted from a vendor. A vendor is a unique name registered by a third-party plugin or script, which allows for custom requests and events to be added to obs-websocket. If a plugin or script implements vendor requests or events, documentation is expected to be provided with them.
+ ///
+ /// Events buffered before the oldest is dropped.
+ /// Ends the enumeration and unsubscribes.
+ /// Requires the Vendors subscription.
+ public IAsyncEnumerable VendorEventStream(
+ int capacity = EventStream.DefaultCapacity,
+ CancellationToken cancellationToken = default)
+ {
+ ObsWebSocketClient source = client;
+ return EventStream.Create(
+ handler => source.VendorEvent += handler,
+ handler => source.VendorEvent -= handler,
+ capacity,
+ cancellationToken);
+ }
+
+ ///
+ /// Streams CustomEvent events as they arrive.
+ /// Custom event emitted by `BroadcastCustomEvent`.
+ ///
+ /// Events buffered before the oldest is dropped.
+ /// Ends the enumeration and unsubscribes.
+ /// Requires the General subscription.
+ public IAsyncEnumerable CustomEventStream(
+ int capacity = EventStream.DefaultCapacity,
+ CancellationToken cancellationToken = default)
+ {
+ ObsWebSocketClient source = client;
+ return EventStream.Create(
+ handler => source.CustomEvent += handler,
+ handler => source.CustomEvent -= handler,
capacity,
cancellationToken);
}
+}
+
+///
+/// Events in the inputs category, as async sequences.
+/// Each accessor subscribes for the lifetime of the enumeration and unsubscribes
+/// when it ends, so the caller never manages handlers.
+///
+public readonly partial struct InputsGroup
+{
///
/// Streams InputCreated events as they arrive.
/// An input has been created.
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the Inputs subscription.
- public static IAsyncEnumerable InputCreatedStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable InputCreatedStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.InputCreated += handler,
- handler => client.InputCreated -= handler,
+ handler => source.InputCreated += handler,
+ handler => source.InputCreated -= handler,
capacity,
cancellationToken);
}
@@ -378,19 +419,17 @@ public static class ObsWebSocketClientEventStreams
/// Streams InputRemoved events as they arrive.
/// An input has been removed.
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the Inputs subscription.
- public static IAsyncEnumerable InputRemovedStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable InputRemovedStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.InputRemoved += handler,
- handler => client.InputRemoved -= handler,
+ handler => source.InputRemoved += handler,
+ handler => source.InputRemoved -= handler,
capacity,
cancellationToken);
}
@@ -399,19 +438,17 @@ public static class ObsWebSocketClientEventStreams
/// Streams InputNameChanged events as they arrive.
/// The name of an input has changed.
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the Inputs subscription.
- public static IAsyncEnumerable InputNameChangedStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable InputNameChangedStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.InputNameChanged += handler,
- handler => client.InputNameChanged -= handler,
+ handler => source.InputNameChanged += handler,
+ handler => source.InputNameChanged -= handler,
capacity,
cancellationToken);
}
@@ -420,19 +457,17 @@ public static class ObsWebSocketClientEventStreams
/// Streams InputSettingsChanged events as they arrive.
/// An input's settings have changed (been updated). Note: On some inputs, changing values in the properties dialog will cause an immediate update. Pressing the "Cancel" button will revert the settings, resulting in another event being fired.
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the Inputs subscription.
- public static IAsyncEnumerable InputSettingsChangedStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable InputSettingsChangedStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.InputSettingsChanged += handler,
- handler => client.InputSettingsChanged -= handler,
+ handler => source.InputSettingsChanged += handler,
+ handler => source.InputSettingsChanged -= handler,
capacity,
cancellationToken);
}
@@ -441,19 +476,17 @@ public static class ObsWebSocketClientEventStreams
/// Streams InputActiveStateChanged events as they arrive.
/// An input's active state has changed. When an input is active, it means it's being shown by the program feed.
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the InputActiveStateChanged subscription.
- public static IAsyncEnumerable InputActiveStateChangedStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable InputActiveStateChangedStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.InputActiveStateChanged += handler,
- handler => client.InputActiveStateChanged -= handler,
+ handler => source.InputActiveStateChanged += handler,
+ handler => source.InputActiveStateChanged -= handler,
capacity,
cancellationToken);
}
@@ -462,19 +495,17 @@ public static class ObsWebSocketClientEventStreams
/// Streams InputShowStateChanged events as they arrive.
/// An input's show state has changed. When an input is showing, it means it's being shown by the preview or a dialog.
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the InputShowStateChanged subscription.
- public static IAsyncEnumerable InputShowStateChangedStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable InputShowStateChangedStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.InputShowStateChanged += handler,
- handler => client.InputShowStateChanged -= handler,
+ handler => source.InputShowStateChanged += handler,
+ handler => source.InputShowStateChanged -= handler,
capacity,
cancellationToken);
}
@@ -483,19 +514,17 @@ public static class ObsWebSocketClientEventStreams
/// Streams InputMuteStateChanged events as they arrive.
/// An input's mute state has changed.
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the Inputs subscription.
- public static IAsyncEnumerable InputMuteStateChangedStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable InputMuteStateChangedStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.InputMuteStateChanged += handler,
- handler => client.InputMuteStateChanged -= handler,
+ handler => source.InputMuteStateChanged += handler,
+ handler => source.InputMuteStateChanged -= handler,
capacity,
cancellationToken);
}
@@ -504,19 +533,17 @@ public static class ObsWebSocketClientEventStreams
/// Streams InputVolumeChanged events as they arrive.
/// An input's volume level has changed.
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the Inputs subscription.
- public static IAsyncEnumerable InputVolumeChangedStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable InputVolumeChangedStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.InputVolumeChanged += handler,
- handler => client.InputVolumeChanged -= handler,
+ handler => source.InputVolumeChanged += handler,
+ handler => source.InputVolumeChanged -= handler,
capacity,
cancellationToken);
}
@@ -525,19 +552,17 @@ public static class ObsWebSocketClientEventStreams
/// Streams InputAudioBalanceChanged events as they arrive.
/// The audio balance value of an input has changed.
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the Inputs subscription.
- public static IAsyncEnumerable InputAudioBalanceChangedStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable InputAudioBalanceChangedStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.InputAudioBalanceChanged += handler,
- handler => client.InputAudioBalanceChanged -= handler,
+ handler => source.InputAudioBalanceChanged += handler,
+ handler => source.InputAudioBalanceChanged -= handler,
capacity,
cancellationToken);
}
@@ -546,19 +571,17 @@ public static class ObsWebSocketClientEventStreams
/// Streams InputAudioSyncOffsetChanged events as they arrive.
/// The sync offset of an input has changed.
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the Inputs subscription.
- public static IAsyncEnumerable InputAudioSyncOffsetChangedStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable InputAudioSyncOffsetChangedStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.InputAudioSyncOffsetChanged += handler,
- handler => client.InputAudioSyncOffsetChanged -= handler,
+ handler => source.InputAudioSyncOffsetChanged += handler,
+ handler => source.InputAudioSyncOffsetChanged -= handler,
capacity,
cancellationToken);
}
@@ -567,19 +590,17 @@ public static class ObsWebSocketClientEventStreams
/// Streams InputAudioTracksChanged events as they arrive.
/// The audio tracks of an input have changed.
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the Inputs subscription.
- public static IAsyncEnumerable InputAudioTracksChangedStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable InputAudioTracksChangedStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.InputAudioTracksChanged += handler,
- handler => client.InputAudioTracksChanged -= handler,
+ handler => source.InputAudioTracksChanged += handler,
+ handler => source.InputAudioTracksChanged -= handler,
capacity,
cancellationToken);
}
@@ -588,19 +609,17 @@ public static class ObsWebSocketClientEventStreams
/// Streams InputAudioMonitorTypeChanged events as they arrive.
/// The monitor type of an input has changed. Available types are: - `OBS_MONITORING_TYPE_NONE` - `OBS_MONITORING_TYPE_MONITOR_ONLY` - `OBS_MONITORING_TYPE_MONITOR_AND_OUTPUT`
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the Inputs subscription.
- public static IAsyncEnumerable InputAudioMonitorTypeChangedStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable InputAudioMonitorTypeChangedStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.InputAudioMonitorTypeChanged += handler,
- handler => client.InputAudioMonitorTypeChanged -= handler,
+ handler => source.InputAudioMonitorTypeChanged += handler,
+ handler => source.InputAudioMonitorTypeChanged -= handler,
capacity,
cancellationToken);
}
@@ -609,40 +628,45 @@ public static class ObsWebSocketClientEventStreams
/// Streams InputVolumeMeters events as they arrive.
/// A high-volume event providing volume levels of all active inputs every 50 milliseconds.
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the InputVolumeMeters subscription.
- public static IAsyncEnumerable InputVolumeMetersStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable InputVolumeMetersStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.InputVolumeMeters += handler,
- handler => client.InputVolumeMeters -= handler,
+ handler => source.InputVolumeMeters += handler,
+ handler => source.InputVolumeMeters -= handler,
capacity,
cancellationToken);
}
+}
+
+///
+/// Events in the media inputs category, as async sequences.
+/// Each accessor subscribes for the lifetime of the enumeration and unsubscribes
+/// when it ends, so the caller never manages handlers.
+///
+public readonly partial struct MediaInputsGroup
+{
///
/// Streams MediaInputPlaybackStarted events as they arrive.
/// A media input has started playing.
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the MediaInputs subscription.
- public static IAsyncEnumerable MediaInputPlaybackStartedStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable MediaInputPlaybackStartedStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.MediaInputPlaybackStarted += handler,
- handler => client.MediaInputPlaybackStarted -= handler,
+ handler => source.MediaInputPlaybackStarted += handler,
+ handler => source.MediaInputPlaybackStarted -= handler,
capacity,
cancellationToken);
}
@@ -651,19 +675,17 @@ public static class ObsWebSocketClientEventStreams
/// Streams MediaInputPlaybackEnded events as they arrive.
/// A media input has finished playing.
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the MediaInputs subscription.
- public static IAsyncEnumerable MediaInputPlaybackEndedStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable MediaInputPlaybackEndedStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.MediaInputPlaybackEnded += handler,
- handler => client.MediaInputPlaybackEnded -= handler,
+ handler => source.MediaInputPlaybackEnded += handler,
+ handler => source.MediaInputPlaybackEnded -= handler,
capacity,
cancellationToken);
}
@@ -672,40 +694,45 @@ public static class ObsWebSocketClientEventStreams
/// Streams MediaInputActionTriggered events as they arrive.
/// An action has been performed on an input.
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the MediaInputs subscription.
- public static IAsyncEnumerable MediaInputActionTriggeredStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable MediaInputActionTriggeredStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.MediaInputActionTriggered += handler,
- handler => client.MediaInputActionTriggered -= handler,
+ handler => source.MediaInputActionTriggered += handler,
+ handler => source.MediaInputActionTriggered -= handler,
capacity,
cancellationToken);
}
+}
+
+///
+/// Events in the outputs category, as async sequences.
+/// Each accessor subscribes for the lifetime of the enumeration and unsubscribes
+/// when it ends, so the caller never manages handlers.
+///
+public readonly partial struct OutputsGroup
+{
///
/// Streams StreamStateChanged events as they arrive.
/// The state of the stream output has changed.
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the Outputs subscription.
- public static IAsyncEnumerable StreamStateChangedStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable StreamStateChangedStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.StreamStateChanged += handler,
- handler => client.StreamStateChanged -= handler,
+ handler => source.StreamStateChanged += handler,
+ handler => source.StreamStateChanged -= handler,
capacity,
cancellationToken);
}
@@ -714,19 +741,17 @@ public static class ObsWebSocketClientEventStreams
/// Streams RecordStateChanged events as they arrive.
/// The state of the record output has changed.
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the Outputs subscription.
- public static IAsyncEnumerable RecordStateChangedStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable RecordStateChangedStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.RecordStateChanged += handler,
- handler => client.RecordStateChanged -= handler,
+ handler => source.RecordStateChanged += handler,
+ handler => source.RecordStateChanged -= handler,
capacity,
cancellationToken);
}
@@ -735,19 +760,17 @@ public static class ObsWebSocketClientEventStreams
/// Streams RecordFileChanged events as they arrive.
/// The record output has started writing to a new file. For example, when a file split happens.
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the Outputs subscription.
- public static IAsyncEnumerable RecordFileChangedStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable RecordFileChangedStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.RecordFileChanged += handler,
- handler => client.RecordFileChanged -= handler,
+ handler => source.RecordFileChanged += handler,
+ handler => source.RecordFileChanged -= handler,
capacity,
cancellationToken);
}
@@ -756,19 +779,17 @@ public static class ObsWebSocketClientEventStreams
/// Streams ReplayBufferStateChanged events as they arrive.
/// The state of the replay buffer output has changed.
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the Outputs subscription.
- public static IAsyncEnumerable ReplayBufferStateChangedStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable ReplayBufferStateChangedStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.ReplayBufferStateChanged += handler,
- handler => client.ReplayBufferStateChanged -= handler,
+ handler => source.ReplayBufferStateChanged += handler,
+ handler => source.ReplayBufferStateChanged -= handler,
capacity,
cancellationToken);
}
@@ -777,19 +798,17 @@ public static class ObsWebSocketClientEventStreams
/// Streams VirtualcamStateChanged events as they arrive.
/// The state of the virtualcam output has changed.
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the Outputs subscription.
- public static IAsyncEnumerable VirtualcamStateChangedStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable VirtualcamStateChangedStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.VirtualcamStateChanged += handler,
- handler => client.VirtualcamStateChanged -= handler,
+ handler => source.VirtualcamStateChanged += handler,
+ handler => source.VirtualcamStateChanged -= handler,
capacity,
cancellationToken);
}
@@ -798,40 +817,45 @@ public static class ObsWebSocketClientEventStreams
/// Streams ReplayBufferSaved events as they arrive.
/// The replay buffer has been saved.
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the Outputs subscription.
- public static IAsyncEnumerable ReplayBufferSavedStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable ReplayBufferSavedStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.ReplayBufferSaved += handler,
- handler => client.ReplayBufferSaved -= handler,
+ handler => source.ReplayBufferSaved += handler,
+ handler => source.ReplayBufferSaved -= handler,
capacity,
cancellationToken);
}
+}
+
+///
+/// Events in the scene items category, as async sequences.
+/// Each accessor subscribes for the lifetime of the enumeration and unsubscribes
+/// when it ends, so the caller never manages handlers.
+///
+public readonly partial struct SceneItemsGroup
+{
///
/// Streams SceneItemCreated events as they arrive.
/// A scene item has been created.
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the SceneItems subscription.
- public static IAsyncEnumerable SceneItemCreatedStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable SceneItemCreatedStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.SceneItemCreated += handler,
- handler => client.SceneItemCreated -= handler,
+ handler => source.SceneItemCreated += handler,
+ handler => source.SceneItemCreated -= handler,
capacity,
cancellationToken);
}
@@ -840,19 +864,17 @@ public static class ObsWebSocketClientEventStreams
/// Streams SceneItemRemoved events as they arrive.
/// A scene item has been removed. This event is not emitted when the scene the item is in is removed.
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the SceneItems subscription.
- public static IAsyncEnumerable SceneItemRemovedStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable SceneItemRemovedStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.SceneItemRemoved += handler,
- handler => client.SceneItemRemoved -= handler,
+ handler => source.SceneItemRemoved += handler,
+ handler => source.SceneItemRemoved -= handler,
capacity,
cancellationToken);
}
@@ -861,19 +883,17 @@ public static class ObsWebSocketClientEventStreams
/// Streams SceneItemListReindexed events as they arrive.
/// A scene's item list has been reindexed.
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the SceneItems subscription.
- public static IAsyncEnumerable SceneItemListReindexedStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable SceneItemListReindexedStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.SceneItemListReindexed += handler,
- handler => client.SceneItemListReindexed -= handler,
+ handler => source.SceneItemListReindexed += handler,
+ handler => source.SceneItemListReindexed -= handler,
capacity,
cancellationToken);
}
@@ -882,19 +902,17 @@ public static class ObsWebSocketClientEventStreams
/// Streams SceneItemEnableStateChanged events as they arrive.
/// A scene item's enable state has changed.
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the SceneItems subscription.
- public static IAsyncEnumerable SceneItemEnableStateChangedStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable SceneItemEnableStateChangedStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.SceneItemEnableStateChanged += handler,
- handler => client.SceneItemEnableStateChanged -= handler,
+ handler => source.SceneItemEnableStateChanged += handler,
+ handler => source.SceneItemEnableStateChanged -= handler,
capacity,
cancellationToken);
}
@@ -903,19 +921,17 @@ public static class ObsWebSocketClientEventStreams
/// Streams SceneItemLockStateChanged events as they arrive.
/// A scene item's lock state has changed.
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the SceneItems subscription.
- public static IAsyncEnumerable SceneItemLockStateChangedStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable SceneItemLockStateChangedStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.SceneItemLockStateChanged += handler,
- handler => client.SceneItemLockStateChanged -= handler,
+ handler => source.SceneItemLockStateChanged += handler,
+ handler => source.SceneItemLockStateChanged -= handler,
capacity,
cancellationToken);
}
@@ -924,19 +940,17 @@ public static class ObsWebSocketClientEventStreams
/// Streams SceneItemSelected events as they arrive.
/// A scene item has been selected in the Ui.
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the SceneItems subscription.
- public static IAsyncEnumerable SceneItemSelectedStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable SceneItemSelectedStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.SceneItemSelected += handler,
- handler => client.SceneItemSelected -= handler,
+ handler => source.SceneItemSelected += handler,
+ handler => source.SceneItemSelected -= handler,
capacity,
cancellationToken);
}
@@ -945,40 +959,45 @@ public static class ObsWebSocketClientEventStreams
/// Streams SceneItemTransformChanged events as they arrive.
/// The transform/crop of a scene item has changed.
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the SceneItemTransformChanged subscription.
- public static IAsyncEnumerable SceneItemTransformChangedStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable SceneItemTransformChangedStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.SceneItemTransformChanged += handler,
- handler => client.SceneItemTransformChanged -= handler,
+ handler => source.SceneItemTransformChanged += handler,
+ handler => source.SceneItemTransformChanged -= handler,
capacity,
cancellationToken);
}
+}
+
+///
+/// Events in the scenes category, as async sequences.
+/// Each accessor subscribes for the lifetime of the enumeration and unsubscribes
+/// when it ends, so the caller never manages handlers.
+///
+public readonly partial struct ScenesGroup
+{
///
/// Streams SceneCreated events as they arrive.
/// A new scene has been created.
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the Scenes subscription.
- public static IAsyncEnumerable SceneCreatedStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable SceneCreatedStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.SceneCreated += handler,
- handler => client.SceneCreated -= handler,
+ handler => source.SceneCreated += handler,
+ handler => source.SceneCreated -= handler,
capacity,
cancellationToken);
}
@@ -987,19 +1006,17 @@ public static class ObsWebSocketClientEventStreams
/// Streams SceneRemoved events as they arrive.
/// A scene has been removed.
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the Scenes subscription.
- public static IAsyncEnumerable SceneRemovedStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable SceneRemovedStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.SceneRemoved += handler,
- handler => client.SceneRemoved -= handler,
+ handler => source.SceneRemoved += handler,
+ handler => source.SceneRemoved -= handler,
capacity,
cancellationToken);
}
@@ -1008,19 +1025,17 @@ public static class ObsWebSocketClientEventStreams
/// Streams SceneNameChanged events as they arrive.
/// The name of a scene has changed.
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the Scenes subscription.
- public static IAsyncEnumerable SceneNameChangedStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable SceneNameChangedStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.SceneNameChanged += handler,
- handler => client.SceneNameChanged -= handler,
+ handler => source.SceneNameChanged += handler,
+ handler => source.SceneNameChanged -= handler,
capacity,
cancellationToken);
}
@@ -1029,19 +1044,17 @@ public static class ObsWebSocketClientEventStreams
/// Streams CurrentProgramSceneChanged events as they arrive.
/// The current program scene has changed.
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the Scenes subscription.
- public static IAsyncEnumerable CurrentProgramSceneChangedStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable CurrentProgramSceneChangedStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.CurrentProgramSceneChanged += handler,
- handler => client.CurrentProgramSceneChanged -= handler,
+ handler => source.CurrentProgramSceneChanged += handler,
+ handler => source.CurrentProgramSceneChanged -= handler,
capacity,
cancellationToken);
}
@@ -1050,19 +1063,17 @@ public static class ObsWebSocketClientEventStreams
/// Streams CurrentPreviewSceneChanged events as they arrive.
/// The current preview scene has changed.
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the Scenes subscription.
- public static IAsyncEnumerable CurrentPreviewSceneChangedStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable CurrentPreviewSceneChangedStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.CurrentPreviewSceneChanged += handler,
- handler => client.CurrentPreviewSceneChanged -= handler,
+ handler => source.CurrentPreviewSceneChanged += handler,
+ handler => source.CurrentPreviewSceneChanged -= handler,
capacity,
cancellationToken);
}
@@ -1071,40 +1082,45 @@ public static class ObsWebSocketClientEventStreams
/// Streams SceneListChanged events as they arrive.
/// The list of scenes has changed. TODO: Make OBS fire this event when scenes are reordered.
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the Scenes subscription.
- public static IAsyncEnumerable SceneListChangedStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable SceneListChangedStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.SceneListChanged += handler,
- handler => client.SceneListChanged -= handler,
+ handler => source.SceneListChanged += handler,
+ handler => source.SceneListChanged -= handler,
capacity,
cancellationToken);
}
+}
+
+///
+/// Events in the transitions category, as async sequences.
+/// Each accessor subscribes for the lifetime of the enumeration and unsubscribes
+/// when it ends, so the caller never manages handlers.
+///
+public readonly partial struct TransitionsGroup
+{
///
/// Streams CurrentSceneTransitionChanged events as they arrive.
/// The current scene transition has changed.
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the Transitions subscription.
- public static IAsyncEnumerable CurrentSceneTransitionChangedStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable CurrentSceneTransitionChangedStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.CurrentSceneTransitionChanged += handler,
- handler => client.CurrentSceneTransitionChanged -= handler,
+ handler => source.CurrentSceneTransitionChanged += handler,
+ handler => source.CurrentSceneTransitionChanged -= handler,
capacity,
cancellationToken);
}
@@ -1113,19 +1129,17 @@ public static class ObsWebSocketClientEventStreams
/// Streams CurrentSceneTransitionDurationChanged events as they arrive.
/// The current scene transition duration has changed.
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the Transitions subscription.
- public static IAsyncEnumerable CurrentSceneTransitionDurationChangedStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable CurrentSceneTransitionDurationChangedStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.CurrentSceneTransitionDurationChanged += handler,
- handler => client.CurrentSceneTransitionDurationChanged -= handler,
+ handler => source.CurrentSceneTransitionDurationChanged += handler,
+ handler => source.CurrentSceneTransitionDurationChanged -= handler,
capacity,
cancellationToken);
}
@@ -1134,19 +1148,17 @@ public static class ObsWebSocketClientEventStreams
/// Streams SceneTransitionStarted events as they arrive.
/// A scene transition has started.
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the Transitions subscription.
- public static IAsyncEnumerable SceneTransitionStartedStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable SceneTransitionStartedStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.SceneTransitionStarted += handler,
- handler => client.SceneTransitionStarted -= handler,
+ handler => source.SceneTransitionStarted += handler,
+ handler => source.SceneTransitionStarted -= handler,
capacity,
cancellationToken);
}
@@ -1155,19 +1167,17 @@ public static class ObsWebSocketClientEventStreams
/// Streams SceneTransitionEnded events as they arrive.
/// A scene transition has completed fully. Note: Does not appear to trigger when the transition is interrupted by the user.
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the Transitions subscription.
- public static IAsyncEnumerable SceneTransitionEndedStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable SceneTransitionEndedStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.SceneTransitionEnded += handler,
- handler => client.SceneTransitionEnded -= handler,
+ handler => source.SceneTransitionEnded += handler,
+ handler => source.SceneTransitionEnded -= handler,
capacity,
cancellationToken);
}
@@ -1176,40 +1186,45 @@ public static class ObsWebSocketClientEventStreams
/// Streams SceneTransitionVideoEnded events as they arrive.
/// A scene transition's video has completed fully. Useful for stinger transitions to tell when the video *actually* ends. `SceneTransitionEnded` only signifies the cut point, not the completion of transition playback. Note: Appears to be called by every transition, regardless of relevance.
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the Transitions subscription.
- public static IAsyncEnumerable SceneTransitionVideoEndedStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable SceneTransitionVideoEndedStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.SceneTransitionVideoEnded += handler,
- handler => client.SceneTransitionVideoEnded -= handler,
+ handler => source.SceneTransitionVideoEnded += handler,
+ handler => source.SceneTransitionVideoEnded -= handler,
capacity,
cancellationToken);
}
+}
+
+///
+/// Events in the ui category, as async sequences.
+/// Each accessor subscribes for the lifetime of the enumeration and unsubscribes
+/// when it ends, so the caller never manages handlers.
+///
+public readonly partial struct UiGroup
+{
///
/// Streams StudioModeStateChanged events as they arrive.
/// Studio mode has been enabled or disabled.
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the Ui subscription.
- public static IAsyncEnumerable StudioModeStateChangedStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable StudioModeStateChangedStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.StudioModeStateChanged += handler,
- handler => client.StudioModeStateChanged -= handler,
+ handler => source.StudioModeStateChanged += handler,
+ handler => source.StudioModeStateChanged -= handler,
capacity,
cancellationToken);
}
@@ -1218,63 +1233,20 @@ public static class ObsWebSocketClientEventStreams
/// Streams ScreenshotSaved events as they arrive.
/// A screenshot has been saved. Note: Triggered for the screenshot feature available in `Settings -> Hotkeys -> Screenshot Output` ONLY. Applications using `Get/SaveSourceScreenshot` should implement a `CustomEvent` if this kind of inter-client communication is desired.
///
- /// The ObsWebSocketClient instance.
/// Events buffered before the oldest is dropped.
/// Ends the enumeration and unsubscribes.
/// Requires the Ui subscription.
- public static IAsyncEnumerable ScreenshotSavedStream(
- this ObsWebSocketClient client,
+ public IAsyncEnumerable ScreenshotSavedStream(
int capacity = EventStream.DefaultCapacity,
CancellationToken cancellationToken = default)
{
- ArgumentNullException.ThrowIfNull(client);
+ ObsWebSocketClient source = client;
return EventStream.Create(
- handler => client.ScreenshotSaved += handler,
- handler => client.ScreenshotSaved -= handler,
- capacity,
- cancellationToken);
- }
-
- ///
- /// Streams VendorEvent events as they arrive.
- /// An event has been emitted from a vendor. A vendor is a unique name registered by a third-party plugin or script, which allows for custom requests and events to be added to obs-websocket. If a plugin or script implements vendor requests or events, documentation is expected to be provided with them.
- ///
- /// The ObsWebSocketClient instance.
- /// Events buffered before the oldest is dropped.
- /// Ends the enumeration and unsubscribes.
- /// Requires the Vendors subscription.
- public static IAsyncEnumerable VendorEventStream(
- this ObsWebSocketClient client,
- int capacity = EventStream.DefaultCapacity,
- CancellationToken cancellationToken = default)
- {
- ArgumentNullException.ThrowIfNull(client);
- return EventStream.Create(
- handler => client.VendorEvent += handler,
- handler => client.VendorEvent -= handler,
- capacity,
- cancellationToken);
- }
-
- ///
- /// Streams CustomEvent events as they arrive.
- /// Custom event emitted by `BroadcastCustomEvent`.
- ///
- /// The ObsWebSocketClient instance.
- /// Events buffered before the oldest is dropped.
- /// Ends the enumeration and unsubscribes.
- /// Requires the General subscription.
- public static IAsyncEnumerable CustomEventStream(
- this ObsWebSocketClient client,
- int capacity = EventStream.DefaultCapacity,
- CancellationToken cancellationToken = default)
- {
- ArgumentNullException.ThrowIfNull(client);
- return EventStream.Create(
- handler => client.CustomEvent += handler,
- handler => client.CustomEvent -= handler,
+ handler => source.ScreenshotSaved += handler,
+ handler => source.ScreenshotSaved -= handler,
capacity,
cancellationToken);
}
}
+
diff --git a/ObsWebSocket.Core/Generated/Client/ObsWebSocketClient.Extensions.g.cs b/ObsWebSocket.Core/Generated/Client/ObsWebSocketClient.Extensions.g.cs
index fe45c15..d122759 100644
--- a/ObsWebSocket.Core/Generated/Client/ObsWebSocketClient.Extensions.g.cs
+++ b/ObsWebSocket.Core/Generated/Client/ObsWebSocketClient.Extensions.g.cs
@@ -17,7 +17,7 @@ namespace ObsWebSocket.Core;
/// Requests in the canvases category.
///
/// The client these requests are sent on.
-public readonly partial struct CanvasesRequestGroup(ObsWebSocketClient client)
+public readonly partial struct CanvasesGroup(ObsWebSocketClient client)
{
///
/// Gets an array of canvases in OBS.
@@ -43,7 +43,7 @@ public readonly partial struct CanvasesRequestGroup(ObsWebSocketClient client)
/// Requests in the config category.
///
/// The client these requests are sent on.
-public readonly partial struct ConfigRequestGroup(ObsWebSocketClient client)
+public readonly partial struct ConfigGroup(ObsWebSocketClient client)
{
///
/// Gets the value of a "slot" from the selected persistent data realm.
@@ -379,7 +379,7 @@ public async Task SetRecordDirectoryAsync(ObsWebSocket.Core.Protocol.Requests.Se
/// Requests in the filters category.
///
/// The client these requests are sent on.
-public readonly partial struct FiltersRequestGroup(ObsWebSocketClient client)
+public readonly partial struct FiltersGroup(ObsWebSocketClient client)
{
///
/// Gets an array of all available source filter kinds.
@@ -578,7 +578,7 @@ public async Task SetSourceFilterEnabledAsync(ObsWebSocket.Core.Protocol.Request
/// Requests in the general category.
///
/// The client these requests are sent on.
-public readonly partial struct GeneralRequestGroup(ObsWebSocketClient client)
+public readonly partial struct GeneralGroup(ObsWebSocketClient client)
{
///
/// Gets data about the current plugin and RPC version.
@@ -744,7 +744,7 @@ public async Task SleepAsync(ObsWebSocket.Core.Protocol.Requests.SleepRequestDat
/// Requests in the inputs category.
///
/// The client these requests are sent on.
-public readonly partial struct InputsRequestGroup(ObsWebSocketClient client)
+public readonly partial struct InputsGroup(ObsWebSocketClient client)
{
///
/// Gets an array of all inputs in OBS.
@@ -1328,7 +1328,7 @@ public async Task PressInputPropertiesButtonAsync(ObsWebSocket.Core.Protocol.Req
/// Requests in the media inputs category.
///
/// The client these requests are sent on.
-public readonly partial struct MediaInputsRequestGroup(ObsWebSocketClient client)
+public readonly partial struct MediaInputsGroup(ObsWebSocketClient client)
{
///
/// Gets the status of a media input.
@@ -1427,7 +1427,7 @@ public async Task TriggerMediaInputActionAsync(ObsWebSocket.Core.Protocol.Reques
/// Requests in the outputs category.
///
/// The client these requests are sent on.
-public readonly partial struct OutputsRequestGroup(ObsWebSocketClient client)
+public readonly partial struct OutputsGroup(ObsWebSocketClient client)
{
///
/// Gets the status of the virtualcam output.
@@ -1747,7 +1747,7 @@ public async Task SetOutputSettingsAsync(ObsWebSocket.Core.Protocol.Requests.Set
/// Requests in the record category.
///
/// The client these requests are sent on.
-public readonly partial struct RecordRequestGroup(ObsWebSocketClient client)
+public readonly partial struct RecordGroup(ObsWebSocketClient client)
{
///
/// Gets the status of the record output.
@@ -1920,7 +1920,7 @@ public async Task CreateRecordChapterAsync(ObsWebSocket.Core.Protocol.Requests.C
/// Requests in the scene items category.
///
/// The client these requests are sent on.
-public readonly partial struct SceneItemsRequestGroup(ObsWebSocketClient client)
+public readonly partial struct SceneItemsGroup(ObsWebSocketClient client)
{
///
/// Gets a list of all scene items in a scene.
@@ -2295,7 +2295,7 @@ public async Task SetSceneItemBlendModeAsync(ObsWebSocket.Core.Protocol.Requests
/// Requests in the scenes category.
///
/// The client these requests are sent on.
-public readonly partial struct ScenesRequestGroup(ObsWebSocketClient client)
+public readonly partial struct ScenesGroup(ObsWebSocketClient client)
{
///
/// Gets an array of scenes in OBS.
@@ -2523,7 +2523,7 @@ public async Task SetSceneSceneTransitionOverrideAsync(ObsWebSocket.Core.Protoco
/// Requests in the sources category.
///
/// The client these requests are sent on.
-public readonly partial struct SourcesRequestGroup(ObsWebSocketClient client)
+public readonly partial struct SourcesGroup(ObsWebSocketClient client)
{
///
/// Gets the active and show state of a source.
@@ -2600,7 +2600,7 @@ public async Task SaveSourceScreenshotAsync(ObsWebSocket.Core.Protocol.Requests.
/// Requests in the stream category.
///
/// The client these requests are sent on.
-public readonly partial struct StreamRequestGroup(ObsWebSocketClient client)
+public readonly partial struct StreamGroup(ObsWebSocketClient client)
{
///
/// Gets the status of the stream output.
@@ -2699,7 +2699,7 @@ public async Task SendStreamCaptionAsync(ObsWebSocket.Core.Protocol.Requests.Sen
/// Requests in the transitions category.
///
/// The client these requests are sent on.
-public readonly partial struct TransitionsRequestGroup(ObsWebSocketClient client)
+public readonly partial struct TransitionsGroup(ObsWebSocketClient client)
{
///
/// Gets an array of all available transition kinds.
@@ -2881,7 +2881,7 @@ public async Task SetTBarPositionAsync(ObsWebSocket.Core.Protocol.Requests.SetTB
/// Requests in the ui category.
///
/// The client these requests are sent on.
-public readonly partial struct UiRequestGroup(ObsWebSocketClient client)
+public readonly partial struct UiGroup(ObsWebSocketClient client)
{
///
/// Gets whether studio is enabled.
@@ -3055,7 +3055,7 @@ public static class ObsWebSocketClientExtensions
///
/// Requests in the canvases category.
///
- public CanvasesRequestGroup Canvases => new(client);
+ public CanvasesGroup Canvases => new(client);
}
extension(ObsWebSocketClient client)
@@ -3063,7 +3063,7 @@ public static class ObsWebSocketClientExtensions
///
/// Requests in the config category.
///
- public ConfigRequestGroup Config => new(client);
+ public ConfigGroup Config => new(client);
}
extension(ObsWebSocketClient client)
@@ -3071,7 +3071,7 @@ public static class ObsWebSocketClientExtensions
///
/// Requests in the filters category.
///
- public FiltersRequestGroup Filters => new(client);
+ public FiltersGroup Filters => new(client);
}
extension(ObsWebSocketClient client)
@@ -3079,7 +3079,7 @@ public static class ObsWebSocketClientExtensions
///
/// Requests in the general category.
///
- public GeneralRequestGroup General => new(client);
+ public GeneralGroup General => new(client);
}
extension(ObsWebSocketClient client)
@@ -3087,7 +3087,7 @@ public static class ObsWebSocketClientExtensions
///
/// Requests in the inputs category.
///
- public InputsRequestGroup Inputs => new(client);
+ public InputsGroup Inputs => new(client);
}
extension(ObsWebSocketClient client)
@@ -3095,7 +3095,7 @@ public static class ObsWebSocketClientExtensions
///
/// Requests in the media inputs category.
///
- public MediaInputsRequestGroup MediaInputs => new(client);
+ public MediaInputsGroup MediaInputs => new(client);
}
extension(ObsWebSocketClient client)
@@ -3103,7 +3103,7 @@ public static class ObsWebSocketClientExtensions
///
/// Requests in the outputs category.
///
- public OutputsRequestGroup Outputs => new(client);
+ public OutputsGroup Outputs => new(client);
}
extension(ObsWebSocketClient client)
@@ -3111,7 +3111,7 @@ public static class ObsWebSocketClientExtensions
///
/// Requests in the record category.
///
- public RecordRequestGroup Record => new(client);
+ public RecordGroup Record => new(client);
}
extension(ObsWebSocketClient client)
@@ -3119,7 +3119,7 @@ public static class ObsWebSocketClientExtensions
///
/// Requests in the scene items category.
///
- public SceneItemsRequestGroup SceneItems => new(client);
+ public SceneItemsGroup SceneItems => new(client);
}
extension(ObsWebSocketClient client)
@@ -3127,7 +3127,7 @@ public static class ObsWebSocketClientExtensions
///
/// Requests in the scenes category.
///
- public ScenesRequestGroup Scenes => new(client);
+ public ScenesGroup Scenes => new(client);
}
extension(ObsWebSocketClient client)
@@ -3135,7 +3135,7 @@ public static class ObsWebSocketClientExtensions
///
/// Requests in the sources category.
///
- public SourcesRequestGroup Sources => new(client);
+ public SourcesGroup Sources => new(client);
}
extension(ObsWebSocketClient client)
@@ -3143,7 +3143,7 @@ public static class ObsWebSocketClientExtensions
///
/// Requests in the stream category.
///
- public StreamRequestGroup Stream => new(client);
+ public StreamGroup Stream => new(client);
}
extension(ObsWebSocketClient client)
@@ -3151,7 +3151,7 @@ public static class ObsWebSocketClientExtensions
///
/// Requests in the transitions category.
///
- public TransitionsRequestGroup Transitions => new(client);
+ public TransitionsGroup Transitions => new(client);
}
extension(ObsWebSocketClient client)
@@ -3159,7 +3159,7 @@ public static class ObsWebSocketClientExtensions
///
/// Requests in the ui category.
///
- public UiRequestGroup Ui => new(client);
+ public UiGroup Ui => new(client);
}
}
diff --git a/ObsWebSocket.Core/Generated/Protocol/Events/CurrentSceneTransitionDurationChanged.EventPayload.g.cs b/ObsWebSocket.Core/Generated/Protocol/Events/CurrentSceneTransitionDurationChanged.EventPayload.g.cs
index b31234b..443a405 100644
--- a/ObsWebSocket.Core/Generated/Protocol/Events/CurrentSceneTransitionDurationChanged.EventPayload.g.cs
+++ b/ObsWebSocket.Core/Generated/Protocol/Events/CurrentSceneTransitionDurationChanged.EventPayload.g.cs
@@ -29,7 +29,7 @@ public sealed partial record CurrentSceneTransitionDurationChangedPayload
///
[JsonPropertyName("transitionDuration")]
[Key("transitionDuration")]
- public required double TransitionDuration { get; init; }
+ public required int TransitionDuration { get; init; }
/// Initializes a new instance for deserialization via .
[JsonConstructor]
@@ -40,7 +40,7 @@ public CurrentSceneTransitionDurationChangedPayload() { }
/// Parameters are ordered with required properties first, then optional properties (with defaults). Follows protocol definition order where possible.
///
[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
- public CurrentSceneTransitionDurationChangedPayload(double transitionDuration)
+ public CurrentSceneTransitionDurationChangedPayload(int transitionDuration)
{
this.TransitionDuration = transitionDuration;
}
diff --git a/ObsWebSocket.Core/Generated/Protocol/Events/InputAudioSyncOffsetChanged.EventPayload.g.cs b/ObsWebSocket.Core/Generated/Protocol/Events/InputAudioSyncOffsetChanged.EventPayload.g.cs
index 41ccd26..027ebf4 100644
--- a/ObsWebSocket.Core/Generated/Protocol/Events/InputAudioSyncOffsetChanged.EventPayload.g.cs
+++ b/ObsWebSocket.Core/Generated/Protocol/Events/InputAudioSyncOffsetChanged.EventPayload.g.cs
@@ -29,7 +29,7 @@ public sealed partial record InputAudioSyncOffsetChangedPayload
///
[JsonPropertyName("inputAudioSyncOffset")]
[Key("inputAudioSyncOffset")]
- public required double InputAudioSyncOffset { get; init; }
+ public required int InputAudioSyncOffset { get; init; }
///
/// Name of the input
@@ -54,7 +54,7 @@ public InputAudioSyncOffsetChangedPayload() { }
/// Parameters are ordered with required properties first, then optional properties (with defaults). Follows protocol definition order where possible.
///
[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
- public InputAudioSyncOffsetChangedPayload(double inputAudioSyncOffset, string? inputName = null, string? inputUuid = null)
+ public InputAudioSyncOffsetChangedPayload(int inputAudioSyncOffset, string? inputName = null, string? inputUuid = null)
{
this.InputName = inputName;
this.InputUuid = inputUuid;
diff --git a/ObsWebSocket.Core/Generated/Protocol/Events/InputCreated.EventPayload.g.cs b/ObsWebSocket.Core/Generated/Protocol/Events/InputCreated.EventPayload.g.cs
index 1d86762..a57cb9d 100644
--- a/ObsWebSocket.Core/Generated/Protocol/Events/InputCreated.EventPayload.g.cs
+++ b/ObsWebSocket.Core/Generated/Protocol/Events/InputCreated.EventPayload.g.cs
@@ -43,7 +43,7 @@ public sealed partial record InputCreatedPayload
///
[JsonPropertyName("inputKindCaps")]
[Key("inputKindCaps")]
- public required double InputKindCaps { get; init; }
+ public required long InputKindCaps { get; init; }
///
/// Name of the input
@@ -82,7 +82,7 @@ public InputCreatedPayload() { }
/// Parameters are ordered with required properties first, then optional properties (with defaults). Follows protocol definition order where possible.
///
[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
- public InputCreatedPayload(double inputKindCaps, string? inputName = null, string? inputUuid = null, string? inputKind = null, string? unversionedInputKind = null, System.Text.Json.JsonElement? inputSettings = null, System.Text.Json.JsonElement? defaultInputSettings = null)
+ public InputCreatedPayload(long inputKindCaps, string? inputName = null, string? inputUuid = null, string? inputKind = null, string? unversionedInputKind = null, System.Text.Json.JsonElement? inputSettings = null, System.Text.Json.JsonElement? defaultInputSettings = null)
{
this.InputName = inputName;
this.InputUuid = inputUuid;
diff --git a/ObsWebSocket.Core/Generated/Protocol/Events/SceneItemCreated.EventPayload.g.cs b/ObsWebSocket.Core/Generated/Protocol/Events/SceneItemCreated.EventPayload.g.cs
index 025c25e..76dad2f 100644
--- a/ObsWebSocket.Core/Generated/Protocol/Events/SceneItemCreated.EventPayload.g.cs
+++ b/ObsWebSocket.Core/Generated/Protocol/Events/SceneItemCreated.EventPayload.g.cs
@@ -29,14 +29,14 @@ public sealed partial record SceneItemCreatedPayload
///
[JsonPropertyName("sceneItemId")]
[Key("sceneItemId")]
- public required double SceneItemId { get; init; }
+ public required int SceneItemId { get; init; }
///
/// Index position of the item
///
[JsonPropertyName("sceneItemIndex")]
[Key("sceneItemIndex")]
- public required double SceneItemIndex { get; init; }
+ public required int SceneItemIndex { get; init; }
///
/// Name of the scene the item was added to
@@ -75,7 +75,7 @@ public SceneItemCreatedPayload() { }
/// Parameters are ordered with required properties first, then optional properties (with defaults). Follows protocol definition order where possible.
///
[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
- public SceneItemCreatedPayload(double sceneItemId, double sceneItemIndex, string? sceneName = null, string? sceneUuid = null, string? sourceName = null, string? sourceUuid = null)
+ public SceneItemCreatedPayload(int sceneItemId, int sceneItemIndex, string? sceneName = null, string? sceneUuid = null, string? sourceName = null, string? sourceUuid = null)
{
this.SceneName = sceneName;
this.SceneUuid = sceneUuid;
diff --git a/ObsWebSocket.Core/Generated/Protocol/Events/SceneItemEnableStateChanged.EventPayload.g.cs b/ObsWebSocket.Core/Generated/Protocol/Events/SceneItemEnableStateChanged.EventPayload.g.cs
index 86e8a26..48a8e4e 100644
--- a/ObsWebSocket.Core/Generated/Protocol/Events/SceneItemEnableStateChanged.EventPayload.g.cs
+++ b/ObsWebSocket.Core/Generated/Protocol/Events/SceneItemEnableStateChanged.EventPayload.g.cs
@@ -36,7 +36,7 @@ public sealed partial record SceneItemEnableStateChangedPayload
///
[JsonPropertyName("sceneItemId")]
[Key("sceneItemId")]
- public required double SceneItemId { get; init; }
+ public required int SceneItemId { get; init; }
///
/// Name of the scene the item is in
@@ -61,7 +61,7 @@ public SceneItemEnableStateChangedPayload() { }
/// Parameters are ordered with required properties first, then optional properties (with defaults). Follows protocol definition order where possible.
///
[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
- public SceneItemEnableStateChangedPayload(double sceneItemId, bool sceneItemEnabled, string? sceneName = null, string? sceneUuid = null)
+ public SceneItemEnableStateChangedPayload(int sceneItemId, bool sceneItemEnabled, string? sceneName = null, string? sceneUuid = null)
{
this.SceneName = sceneName;
this.SceneUuid = sceneUuid;
diff --git a/ObsWebSocket.Core/Generated/Protocol/Events/SceneItemLockStateChanged.EventPayload.g.cs b/ObsWebSocket.Core/Generated/Protocol/Events/SceneItemLockStateChanged.EventPayload.g.cs
index 7680fb5..6ce7abd 100644
--- a/ObsWebSocket.Core/Generated/Protocol/Events/SceneItemLockStateChanged.EventPayload.g.cs
+++ b/ObsWebSocket.Core/Generated/Protocol/Events/SceneItemLockStateChanged.EventPayload.g.cs
@@ -29,7 +29,7 @@ public sealed partial record SceneItemLockStateChangedPayload
///
[JsonPropertyName("sceneItemId")]
[Key("sceneItemId")]
- public required double SceneItemId { get; init; }
+ public required int SceneItemId { get; init; }
///
/// Whether the scene item is locked
@@ -61,7 +61,7 @@ public SceneItemLockStateChangedPayload() { }
/// Parameters are ordered with required properties first, then optional properties (with defaults). Follows protocol definition order where possible.
///
[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
- public SceneItemLockStateChangedPayload(double sceneItemId, bool sceneItemLocked, string? sceneName = null, string? sceneUuid = null)
+ public SceneItemLockStateChangedPayload(int sceneItemId, bool sceneItemLocked, string? sceneName = null, string? sceneUuid = null)
{
this.SceneName = sceneName;
this.SceneUuid = sceneUuid;
diff --git a/ObsWebSocket.Core/Generated/Protocol/Events/SceneItemRemoved.EventPayload.g.cs b/ObsWebSocket.Core/Generated/Protocol/Events/SceneItemRemoved.EventPayload.g.cs
index cd52e03..4a4293e 100644
--- a/ObsWebSocket.Core/Generated/Protocol/Events/SceneItemRemoved.EventPayload.g.cs
+++ b/ObsWebSocket.Core/Generated/Protocol/Events/SceneItemRemoved.EventPayload.g.cs
@@ -31,7 +31,7 @@ public sealed partial record SceneItemRemovedPayload
///
[JsonPropertyName("sceneItemId")]
[Key("sceneItemId")]
- public required double SceneItemId { get; init; }
+ public required int SceneItemId { get; init; }
///
/// Name of the scene the item was removed from
@@ -70,7 +70,7 @@ public SceneItemRemovedPayload() { }
/// Parameters are ordered with required properties first, then optional properties (with defaults). Follows protocol definition order where possible.
///
[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
- public SceneItemRemovedPayload(double sceneItemId, string? sceneName = null, string? sceneUuid = null, string? sourceName = null, string? sourceUuid = null)
+ public SceneItemRemovedPayload(int sceneItemId, string? sceneName = null, string? sceneUuid = null, string? sourceName = null, string? sourceUuid = null)
{
this.SceneName = sceneName;
this.SceneUuid = sceneUuid;
diff --git a/ObsWebSocket.Core/Generated/Protocol/Events/SceneItemSelected.EventPayload.g.cs b/ObsWebSocket.Core/Generated/Protocol/Events/SceneItemSelected.EventPayload.g.cs
index 84b6077..762d26b 100644
--- a/ObsWebSocket.Core/Generated/Protocol/Events/SceneItemSelected.EventPayload.g.cs
+++ b/ObsWebSocket.Core/Generated/Protocol/Events/SceneItemSelected.EventPayload.g.cs
@@ -29,7 +29,7 @@ public sealed partial record SceneItemSelectedPayload
///
[JsonPropertyName("sceneItemId")]
[Key("sceneItemId")]
- public required double SceneItemId { get; init; }
+ public required int SceneItemId { get; init; }
///
/// Name of the scene the item is in
@@ -54,7 +54,7 @@ public SceneItemSelectedPayload() { }
/// Parameters are ordered with required properties first, then optional properties (with defaults). Follows protocol definition order where possible.
///
[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
- public SceneItemSelectedPayload(double sceneItemId, string? sceneName = null, string? sceneUuid = null)
+ public SceneItemSelectedPayload(int sceneItemId, string? sceneName = null, string? sceneUuid = null)
{
this.SceneName = sceneName;
this.SceneUuid = sceneUuid;
diff --git a/ObsWebSocket.Core/Generated/Protocol/Events/SceneItemTransformChanged.EventPayload.g.cs b/ObsWebSocket.Core/Generated/Protocol/Events/SceneItemTransformChanged.EventPayload.g.cs
index 545617b..bd2c2e0 100644
--- a/ObsWebSocket.Core/Generated/Protocol/Events/SceneItemTransformChanged.EventPayload.g.cs
+++ b/ObsWebSocket.Core/Generated/Protocol/Events/SceneItemTransformChanged.EventPayload.g.cs
@@ -29,7 +29,7 @@ public sealed partial record SceneItemTransformChangedPayload
///
[JsonPropertyName("sceneItemId")]
[Key("sceneItemId")]
- public required double SceneItemId { get; init; }
+ public required int SceneItemId { get; init; }
///
/// New transform/crop info of the scene item
@@ -61,7 +61,7 @@ public SceneItemTransformChangedPayload() { }
/// Parameters are ordered with required properties first, then optional properties (with defaults). Follows protocol definition order where possible.
///
[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
- public SceneItemTransformChangedPayload(double sceneItemId, string? sceneName = null, string? sceneUuid = null, ObsWebSocket.Core.Protocol.Common.SceneItemTransformStub? sceneItemTransform = null)
+ public SceneItemTransformChangedPayload(int sceneItemId, string? sceneName = null, string? sceneUuid = null, ObsWebSocket.Core.Protocol.Common.SceneItemTransformStub? sceneItemTransform = null)
{
this.SceneName = sceneName;
this.SceneUuid = sceneUuid;
diff --git a/ObsWebSocket.Core/Generated/Protocol/Events/SourceFilterCreated.EventPayload.g.cs b/ObsWebSocket.Core/Generated/Protocol/Events/SourceFilterCreated.EventPayload.g.cs
index a4512ca..7632912 100644
--- a/ObsWebSocket.Core/Generated/Protocol/Events/SourceFilterCreated.EventPayload.g.cs
+++ b/ObsWebSocket.Core/Generated/Protocol/Events/SourceFilterCreated.EventPayload.g.cs
@@ -36,7 +36,7 @@ public sealed partial record SourceFilterCreatedPayload
///
[JsonPropertyName("filterIndex")]
[Key("filterIndex")]
- public required double FilterIndex { get; init; }
+ public required int FilterIndex { get; init; }
///
/// The kind of the filter
@@ -75,7 +75,7 @@ public SourceFilterCreatedPayload() { }
/// Parameters are ordered with required properties first, then optional properties (with defaults). Follows protocol definition order where possible.
///
[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
- public SourceFilterCreatedPayload(double filterIndex, string? sourceName = null, string? filterName = null, string? filterKind = null, System.Text.Json.JsonElement? filterSettings = null, System.Text.Json.JsonElement? defaultFilterSettings = null)
+ public SourceFilterCreatedPayload(int filterIndex, string? sourceName = null, string? filterName = null, string? filterKind = null, System.Text.Json.JsonElement? filterSettings = null, System.Text.Json.JsonElement? defaultFilterSettings = null)
{
this.SourceName = sourceName;
this.FilterName = filterName;
diff --git a/ObsWebSocket.Core/Generated/Protocol/Generated/RequestStatus.Enum.g.cs b/ObsWebSocket.Core/Generated/Protocol/Generated/RequestStatusCode.Enum.g.cs
similarity index 98%
rename from ObsWebSocket.Core/Generated/Protocol/Generated/RequestStatus.Enum.g.cs
rename to ObsWebSocket.Core/Generated/Protocol/Generated/RequestStatusCode.Enum.g.cs
index 83ede42..982201e 100644
--- a/ObsWebSocket.Core/Generated/Protocol/Generated/RequestStatus.Enum.g.cs
+++ b/ObsWebSocket.Core/Generated/Protocol/Generated/RequestStatusCode.Enum.g.cs
@@ -5,10 +5,10 @@
namespace ObsWebSocket.Core.Protocol.Generated;
///
-/// Represents the RequestStatus options defined in the OBS WebSocket protocol.
+/// Represents the RequestStatusCode options defined in the OBS WebSocket protocol.
///
/// Generated from OBS WebSocket Protocol definition.
-public enum RequestStatus : int
+public enum RequestStatusCode : int
{
///
/// Unknown status, should never be used.
diff --git a/ObsWebSocket.Core/Generated/Protocol/Requests/DuplicateSceneItem.Request.g.cs b/ObsWebSocket.Core/Generated/Protocol/Requests/DuplicateSceneItem.Request.g.cs
index b370bb9..a9f3e2e 100644
--- a/ObsWebSocket.Core/Generated/Protocol/Requests/DuplicateSceneItem.Request.g.cs
+++ b/ObsWebSocket.Core/Generated/Protocol/Requests/DuplicateSceneItem.Request.g.cs
@@ -68,7 +68,7 @@ public sealed partial record DuplicateSceneItemRequestData
///
[JsonPropertyName("sceneItemId")]
[Key("sceneItemId")]
- public required double SceneItemId { get; init; }
+ public required int SceneItemId { get; init; }
///
/// Name of the scene the item is in
@@ -101,7 +101,7 @@ public DuplicateSceneItemRequestData() { }
/// Parameters are ordered with required properties first, then optional properties (with defaults). Follows protocol definition order where possible.
///
[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
- public DuplicateSceneItemRequestData(double sceneItemId, string? canvasUuid = null, string? sceneName = null, string? sceneUuid = null, string? destinationSceneName = null, string? destinationSceneUuid = null)
+ public DuplicateSceneItemRequestData(int sceneItemId, string? canvasUuid = null, string? sceneName = null, string? sceneUuid = null, string? destinationSceneName = null, string? destinationSceneUuid = null)
{
this.CanvasUuid = canvasUuid;
this.SceneName = sceneName;
diff --git a/ObsWebSocket.Core/Generated/Protocol/Requests/GetSceneItemBlendMode.Request.g.cs b/ObsWebSocket.Core/Generated/Protocol/Requests/GetSceneItemBlendMode.Request.g.cs
index 4959de8..bc37f79 100644
--- a/ObsWebSocket.Core/Generated/Protocol/Requests/GetSceneItemBlendMode.Request.g.cs
+++ b/ObsWebSocket.Core/Generated/Protocol/Requests/GetSceneItemBlendMode.Request.g.cs
@@ -56,7 +56,7 @@ public sealed partial record GetSceneItemBlendModeRequestData
///
[JsonPropertyName("sceneItemId")]
[Key("sceneItemId")]
- public required double SceneItemId { get; init; }
+ public required int SceneItemId { get; init; }
///
/// Name of the scene the item is in
@@ -89,7 +89,7 @@ public GetSceneItemBlendModeRequestData() { }
/// Parameters are ordered with required properties first, then optional properties (with defaults). Follows protocol definition order where possible.
///
[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
- public GetSceneItemBlendModeRequestData(double sceneItemId, string? canvasUuid = null, string? sceneName = null, string? sceneUuid = null)
+ public GetSceneItemBlendModeRequestData(int sceneItemId, string? canvasUuid = null, string? sceneName = null, string? sceneUuid = null)
{
this.CanvasUuid = canvasUuid;
this.SceneName = sceneName;
diff --git a/ObsWebSocket.Core/Generated/Protocol/Requests/GetSceneItemEnabled.Request.g.cs b/ObsWebSocket.Core/Generated/Protocol/Requests/GetSceneItemEnabled.Request.g.cs
index 8d11dff..7308cf6 100644
--- a/ObsWebSocket.Core/Generated/Protocol/Requests/GetSceneItemEnabled.Request.g.cs
+++ b/ObsWebSocket.Core/Generated/Protocol/Requests/GetSceneItemEnabled.Request.g.cs
@@ -46,7 +46,7 @@ public sealed partial record GetSceneItemEnabledRequestData
///
[JsonPropertyName("sceneItemId")]
[Key("sceneItemId")]
- public required double SceneItemId { get; init; }
+ public required int SceneItemId { get; init; }
///
/// Name of the scene the item is in
@@ -79,7 +79,7 @@ public GetSceneItemEnabledRequestData() { }
/// Parameters are ordered with required properties first, then optional properties (with defaults). Follows protocol definition order where possible.
///
[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
- public GetSceneItemEnabledRequestData(double sceneItemId, string? canvasUuid = null, string? sceneName = null, string? sceneUuid = null)
+ public GetSceneItemEnabledRequestData(int sceneItemId, string? canvasUuid = null, string? sceneName = null, string? sceneUuid = null)
{
this.CanvasUuid = canvasUuid;
this.SceneName = sceneName;
diff --git a/ObsWebSocket.Core/Generated/Protocol/Requests/GetSceneItemId.Request.g.cs b/ObsWebSocket.Core/Generated/Protocol/Requests/GetSceneItemId.Request.g.cs
index 70659e4..0b1b90f 100644
--- a/ObsWebSocket.Core/Generated/Protocol/Requests/GetSceneItemId.Request.g.cs
+++ b/ObsWebSocket.Core/Generated/Protocol/Requests/GetSceneItemId.Request.g.cs
@@ -69,7 +69,7 @@ public sealed partial record GetSceneItemIdRequestData
///
[JsonPropertyName("searchOffset")]
[Key("searchOffset")]
- public double? SearchOffset { get; init; }
+ public int? SearchOffset { get; init; }
///
/// Name of the source to find
@@ -90,7 +90,7 @@ public GetSceneItemIdRequestData() { }
/// Parameters are ordered with required properties first, then optional properties (with defaults). Follows protocol definition order where possible.
///
[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
- public GetSceneItemIdRequestData(string sourceName, string? canvasUuid = null, string? sceneName = null, string? sceneUuid = null, double? searchOffset = null)
+ public GetSceneItemIdRequestData(string sourceName, string? canvasUuid = null, string? sceneName = null, string? sceneUuid = null, int? searchOffset = null)
{
this.CanvasUuid = canvasUuid;
this.SceneName = sceneName;
diff --git a/ObsWebSocket.Core/Generated/Protocol/Requests/GetSceneItemIndex.Request.g.cs b/ObsWebSocket.Core/Generated/Protocol/Requests/GetSceneItemIndex.Request.g.cs
index bfe0227..c4b96b7 100644
--- a/ObsWebSocket.Core/Generated/Protocol/Requests/GetSceneItemIndex.Request.g.cs
+++ b/ObsWebSocket.Core/Generated/Protocol/Requests/GetSceneItemIndex.Request.g.cs
@@ -48,7 +48,7 @@ public sealed partial record GetSceneItemIndexRequestData
///
[JsonPropertyName("sceneItemId")]
[Key("sceneItemId")]
- public required double SceneItemId { get; init; }
+ public required int SceneItemId { get; init; }
///
/// Name of the scene the item is in
@@ -81,7 +81,7 @@ public GetSceneItemIndexRequestData() { }
/// Parameters are ordered with required properties first, then optional properties (with defaults). Follows protocol definition order where possible.
///
[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
- public GetSceneItemIndexRequestData(double sceneItemId, string? canvasUuid = null, string? sceneName = null, string? sceneUuid = null)
+ public GetSceneItemIndexRequestData(int sceneItemId, string? canvasUuid = null, string? sceneName = null, string? sceneUuid = null)
{
this.CanvasUuid = canvasUuid;
this.SceneName = sceneName;
diff --git a/ObsWebSocket.Core/Generated/Protocol/Requests/GetSceneItemLocked.Request.g.cs b/ObsWebSocket.Core/Generated/Protocol/Requests/GetSceneItemLocked.Request.g.cs
index c06fe7d..6afb955 100644
--- a/ObsWebSocket.Core/Generated/Protocol/Requests/GetSceneItemLocked.Request.g.cs
+++ b/ObsWebSocket.Core/Generated/Protocol/Requests/GetSceneItemLocked.Request.g.cs
@@ -46,7 +46,7 @@ public sealed partial record GetSceneItemLockedRequestData
///
[JsonPropertyName("sceneItemId")]
[Key("sceneItemId")]
- public required double SceneItemId { get; init; }
+ public required int SceneItemId { get; init; }
///
/// Name of the scene the item is in
@@ -79,7 +79,7 @@ public GetSceneItemLockedRequestData() { }
/// Parameters are ordered with required properties first, then optional properties (with defaults). Follows protocol definition order where possible.
///
[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
- public GetSceneItemLockedRequestData(double sceneItemId, string? canvasUuid = null, string? sceneName = null, string? sceneUuid = null)
+ public GetSceneItemLockedRequestData(int sceneItemId, string? canvasUuid = null, string? sceneName = null, string? sceneUuid = null)
{
this.CanvasUuid = canvasUuid;
this.SceneName = sceneName;
diff --git a/ObsWebSocket.Core/Generated/Protocol/Requests/GetSceneItemSource.Request.g.cs b/ObsWebSocket.Core/Generated/Protocol/Requests/GetSceneItemSource.Request.g.cs
index 809bc14..34415b4 100644
--- a/ObsWebSocket.Core/Generated/Protocol/Requests/GetSceneItemSource.Request.g.cs
+++ b/ObsWebSocket.Core/Generated/Protocol/Requests/GetSceneItemSource.Request.g.cs
@@ -44,7 +44,7 @@ public sealed partial record GetSceneItemSourceRequestData
///
[JsonPropertyName("sceneItemId")]
[Key("sceneItemId")]
- public required double SceneItemId { get; init; }
+ public required int SceneItemId { get; init; }
///
/// Name of the scene the item is in
@@ -77,7 +77,7 @@ public GetSceneItemSourceRequestData() { }
/// Parameters are ordered with required properties first, then optional properties (with defaults). Follows protocol definition order where possible.
///
[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
- public GetSceneItemSourceRequestData(double sceneItemId, string? canvasUuid = null, string? sceneName = null, string? sceneUuid = null)
+ public GetSceneItemSourceRequestData(int sceneItemId, string? canvasUuid = null, string? sceneName = null, string? sceneUuid = null)
{
this.CanvasUuid = canvasUuid;
this.SceneName = sceneName;
diff --git a/ObsWebSocket.Core/Generated/Protocol/Requests/GetSceneItemTransform.Request.g.cs b/ObsWebSocket.Core/Generated/Protocol/Requests/GetSceneItemTransform.Request.g.cs
index fc811e2..af05154 100644
--- a/ObsWebSocket.Core/Generated/Protocol/Requests/GetSceneItemTransform.Request.g.cs
+++ b/ObsWebSocket.Core/Generated/Protocol/Requests/GetSceneItemTransform.Request.g.cs
@@ -46,7 +46,7 @@ public sealed partial record GetSceneItemTransformRequestData
///
[JsonPropertyName("sceneItemId")]
[Key("sceneItemId")]
- public required double SceneItemId { get; init; }
+ public required int SceneItemId { get; init; }
///
/// Name of the scene the item is in
@@ -79,7 +79,7 @@ public GetSceneItemTransformRequestData() { }
/// Parameters are ordered with required properties first, then optional properties (with defaults). Follows protocol definition order where possible.
///
[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
- public GetSceneItemTransformRequestData(double sceneItemId, string? canvasUuid = null, string? sceneName = null, string? sceneUuid = null)
+ public GetSceneItemTransformRequestData(int sceneItemId, string? canvasUuid = null, string? sceneName = null, string? sceneUuid = null)
{
this.CanvasUuid = canvasUuid;
this.SceneName = sceneName;
diff --git a/ObsWebSocket.Core/Generated/Protocol/Requests/GetSourceScreenshot.Request.g.cs b/ObsWebSocket.Core/Generated/Protocol/Requests/GetSourceScreenshot.Request.g.cs
index 2ba81c5..5160ad6 100644
--- a/ObsWebSocket.Core/Generated/Protocol/Requests/GetSourceScreenshot.Request.g.cs
+++ b/ObsWebSocket.Core/Generated/Protocol/Requests/GetSourceScreenshot.Request.g.cs
@@ -50,7 +50,7 @@ public sealed partial record GetSourceScreenshotRequestData
///
[JsonPropertyName("imageCompressionQuality")]
[Key("imageCompressionQuality")]
- public double? ImageCompressionQuality { get; init; }
+ public int? ImageCompressionQuality { get; init; }
///
/// Image compression format to use. Use `GetVersion` to get compatible image formats
@@ -72,7 +72,7 @@ public sealed partial record GetSourceScreenshotRequestData
///
[JsonPropertyName("imageHeight")]
[Key("imageHeight")]
- public double? ImageHeight { get; init; }
+ public int? ImageHeight { get; init; }
///
/// Width to scale the screenshot to
@@ -84,7 +84,7 @@ public sealed partial record GetSourceScreenshotRequestData
///
[JsonPropertyName("imageWidth")]
[Key("imageWidth")]
- public double? ImageWidth { get; init; }
+ public int? ImageWidth { get; init; }
///
/// Name of the source to take a screenshot of
@@ -117,7 +117,7 @@ public GetSourceScreenshotRequestData() { }
/// Parameters are ordered with required properties first, then optional properties (with defaults). Follows protocol definition order where possible.
///
[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
- public GetSourceScreenshotRequestData(string imageFormat, string? canvasUuid = null, string? sourceName = null, string? sourceUuid = null, double? imageWidth = null, double? imageHeight = null, double? imageCompressionQuality = null)
+ public GetSourceScreenshotRequestData(string imageFormat, string? canvasUuid = null, string? sourceName = null, string? sourceUuid = null, int? imageWidth = null, int? imageHeight = null, int? imageCompressionQuality = null)
{
this.CanvasUuid = canvasUuid;
this.SourceName = sourceName;
diff --git a/ObsWebSocket.Core/Generated/Protocol/Requests/OffsetMediaInputCursor.Request.g.cs b/ObsWebSocket.Core/Generated/Protocol/Requests/OffsetMediaInputCursor.Request.g.cs
index e000f03..9cb4b13 100644
--- a/ObsWebSocket.Core/Generated/Protocol/Requests/OffsetMediaInputCursor.Request.g.cs
+++ b/ObsWebSocket.Core/Generated/Protocol/Requests/OffsetMediaInputCursor.Request.g.cs
@@ -56,7 +56,7 @@ public sealed partial record OffsetMediaInputCursorRequestData
///
[JsonPropertyName("mediaCursorOffset")]
[Key("mediaCursorOffset")]
- public required double MediaCursorOffset { get; init; }
+ public required long MediaCursorOffset { get; init; }
/// Initializes a new instance for deserialization via .
[JsonConstructor]
@@ -67,7 +67,7 @@ public OffsetMediaInputCursorRequestData() { }
/// Parameters are ordered with required properties first, then optional properties (with defaults). Follows protocol definition order where possible.
///
[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
- public OffsetMediaInputCursorRequestData(double mediaCursorOffset, string? inputName = null, string? inputUuid = null)
+ public OffsetMediaInputCursorRequestData(long mediaCursorOffset, string? inputName = null, string? inputUuid = null)
{
this.InputName = inputName;
this.InputUuid = inputUuid;
diff --git a/ObsWebSocket.Core/Generated/Protocol/Requests/OpenSourceProjector.Request.g.cs b/ObsWebSocket.Core/Generated/Protocol/Requests/OpenSourceProjector.Request.g.cs
index 1d4aa57..248b87c 100644
--- a/ObsWebSocket.Core/Generated/Protocol/Requests/OpenSourceProjector.Request.g.cs
+++ b/ObsWebSocket.Core/Generated/Protocol/Requests/OpenSourceProjector.Request.g.cs
@@ -46,7 +46,7 @@ public sealed partial record OpenSourceProjectorRequestData
///
[JsonPropertyName("monitorIndex")]
[Key("monitorIndex")]
- public double? MonitorIndex { get; init; }
+ public int? MonitorIndex { get; init; }
///
/// Size/Position data for a windowed projector, in Qt Base64 encoded format. Mutually exclusive with `monitorIndex`
@@ -89,7 +89,7 @@ public OpenSourceProjectorRequestData() { }
/// Initializes a new instance with all properties specified.
/// Parameters are ordered with required properties first, then optional properties (with defaults). Follows protocol definition order where possible.
///
- public OpenSourceProjectorRequestData(string? canvasUuid = null, string? sourceName = null, string? sourceUuid = null, double? monitorIndex = null, string? projectorGeometry = null)
+ public OpenSourceProjectorRequestData(string? canvasUuid = null, string? sourceName = null, string? sourceUuid = null, int? monitorIndex = null, string? projectorGeometry = null)
{
this.CanvasUuid = canvasUuid;
this.SourceName = sourceName;
diff --git a/ObsWebSocket.Core/Generated/Protocol/Requests/OpenVideoMixProjector.Request.g.cs b/ObsWebSocket.Core/Generated/Protocol/Requests/OpenVideoMixProjector.Request.g.cs
index d0d7277..aebe232 100644
--- a/ObsWebSocket.Core/Generated/Protocol/Requests/OpenVideoMixProjector.Request.g.cs
+++ b/ObsWebSocket.Core/Generated/Protocol/Requests/OpenVideoMixProjector.Request.g.cs
@@ -41,7 +41,7 @@ public sealed partial record OpenVideoMixProjectorRequestData
///
[JsonPropertyName("monitorIndex")]
[Key("monitorIndex")]
- public double? MonitorIndex { get; init; }
+ public int? MonitorIndex { get; init; }
///
/// Size/Position data for a windowed projector, in Qt Base64 encoded format. Mutually exclusive with `monitorIndex`
@@ -73,7 +73,7 @@ public OpenVideoMixProjectorRequestData() { }
/// Parameters are ordered with required properties first, then optional properties (with defaults). Follows protocol definition order where possible.
///
[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
- public OpenVideoMixProjectorRequestData(string videoMixType, double? monitorIndex = null, string? projectorGeometry = null)
+ public OpenVideoMixProjectorRequestData(string videoMixType, int? monitorIndex = null, string? projectorGeometry = null)
{
this.VideoMixType = videoMixType;
this.MonitorIndex = monitorIndex;
diff --git a/ObsWebSocket.Core/Generated/Protocol/Requests/RemoveSceneItem.Request.g.cs b/ObsWebSocket.Core/Generated/Protocol/Requests/RemoveSceneItem.Request.g.cs
index bbdc107..7a3b6ae 100644
--- a/ObsWebSocket.Core/Generated/Protocol/Requests/RemoveSceneItem.Request.g.cs
+++ b/ObsWebSocket.Core/Generated/Protocol/Requests/RemoveSceneItem.Request.g.cs
@@ -46,7 +46,7 @@ public sealed partial record RemoveSceneItemRequestData
///
[JsonPropertyName("sceneItemId")]
[Key("sceneItemId")]
- public required double SceneItemId { get; init; }
+ public required int SceneItemId { get; init; }
///
/// Name of the scene the item is in
@@ -79,7 +79,7 @@ public RemoveSceneItemRequestData() { }
/// Parameters are ordered with required properties first, then optional properties (with defaults). Follows protocol definition order where possible.
///
[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
- public RemoveSceneItemRequestData(double sceneItemId, string? canvasUuid = null, string? sceneName = null, string? sceneUuid = null)
+ public RemoveSceneItemRequestData(int sceneItemId, string? canvasUuid = null, string? sceneName = null, string? sceneUuid = null)
{
this.CanvasUuid = canvasUuid;
this.SceneName = sceneName;
diff --git a/ObsWebSocket.Core/Generated/Protocol/Requests/SaveSourceScreenshot.Request.g.cs b/ObsWebSocket.Core/Generated/Protocol/Requests/SaveSourceScreenshot.Request.g.cs
index 307bb32..a559bd4 100644
--- a/ObsWebSocket.Core/Generated/Protocol/Requests/SaveSourceScreenshot.Request.g.cs
+++ b/ObsWebSocket.Core/Generated/Protocol/Requests/SaveSourceScreenshot.Request.g.cs
@@ -50,7 +50,7 @@ public sealed partial record SaveSourceScreenshotRequestData
///
[JsonPropertyName("imageCompressionQuality")]
[Key("imageCompressionQuality")]
- public double? ImageCompressionQuality { get; init; }
+ public int? ImageCompressionQuality { get; init; }
///
/// Path to save the screenshot file to. Eg. `C:\Users\user\Desktop\screenshot.png`
@@ -82,7 +82,7 @@ public sealed partial record SaveSourceScreenshotRequestData
///
[JsonPropertyName("imageHeight")]
[Key("imageHeight")]
- public double? ImageHeight { get; init; }
+ public int? ImageHeight { get; init; }
///
/// Width to scale the screenshot to
@@ -94,7 +94,7 @@ public sealed partial record SaveSourceScreenshotRequestData
///
[JsonPropertyName("imageWidth")]
[Key("imageWidth")]
- public double? ImageWidth { get; init; }
+ public int? ImageWidth { get; init; }
///
/// Name of the source to take a screenshot of
@@ -127,7 +127,7 @@ public SaveSourceScreenshotRequestData() { }
/// Parameters are ordered with required properties first, then optional properties (with defaults). Follows protocol definition order where possible.
///
[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
- public SaveSourceScreenshotRequestData(string imageFormat, string imageFilePath, string? canvasUuid = null, string? sourceName = null, string? sourceUuid = null, double? imageWidth = null, double? imageHeight = null, double? imageCompressionQuality = null)
+ public SaveSourceScreenshotRequestData(string imageFormat, string imageFilePath, string? canvasUuid = null, string? sourceName = null, string? sourceUuid = null, int? imageWidth = null, int? imageHeight = null, int? imageCompressionQuality = null)
{
this.CanvasUuid = canvasUuid;
this.SourceName = sourceName;
diff --git a/ObsWebSocket.Core/Generated/Protocol/Requests/SetCurrentSceneTransitionDuration.Request.g.cs b/ObsWebSocket.Core/Generated/Protocol/Requests/SetCurrentSceneTransitionDuration.Request.g.cs
index 6af8b2b..6236fe9 100644
--- a/ObsWebSocket.Core/Generated/Protocol/Requests/SetCurrentSceneTransitionDuration.Request.g.cs
+++ b/ObsWebSocket.Core/Generated/Protocol/Requests/SetCurrentSceneTransitionDuration.Request.g.cs
@@ -33,7 +33,7 @@ public sealed partial record SetCurrentSceneTransitionDurationRequestData
///
[JsonPropertyName("transitionDuration")]
[Key("transitionDuration")]
- public required double TransitionDuration { get; init; }
+ public required int TransitionDuration { get; init; }
/// Initializes a new instance for deserialization via .
[JsonConstructor]
@@ -44,7 +44,7 @@ public SetCurrentSceneTransitionDurationRequestData() { }
/// Parameters are ordered with required properties first, then optional properties (with defaults). Follows protocol definition order where possible.
///
[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
- public SetCurrentSceneTransitionDurationRequestData(double transitionDuration)
+ public SetCurrentSceneTransitionDurationRequestData(int transitionDuration)
{
this.TransitionDuration = transitionDuration;
}
diff --git a/ObsWebSocket.Core/Generated/Protocol/Requests/SetInputAudioSyncOffset.Request.g.cs b/ObsWebSocket.Core/Generated/Protocol/Requests/SetInputAudioSyncOffset.Request.g.cs
index 95dbf74..f8038e1 100644
--- a/ObsWebSocket.Core/Generated/Protocol/Requests/SetInputAudioSyncOffset.Request.g.cs
+++ b/ObsWebSocket.Core/Generated/Protocol/Requests/SetInputAudioSyncOffset.Request.g.cs
@@ -33,7 +33,7 @@ public sealed partial record SetInputAudioSyncOffsetRequestData
///
[JsonPropertyName("inputAudioSyncOffset")]
[Key("inputAudioSyncOffset")]
- public required double InputAudioSyncOffset { get; init; }
+ public required int InputAudioSyncOffset { get; init; }
///
/// Name of the input to set the audio sync offset of
@@ -66,7 +66,7 @@ public SetInputAudioSyncOffsetRequestData() { }
/// Parameters are ordered with required properties first, then optional properties (with defaults). Follows protocol definition order where possible.
///
[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
- public SetInputAudioSyncOffsetRequestData(double inputAudioSyncOffset, string? inputName = null, string? inputUuid = null)
+ public SetInputAudioSyncOffsetRequestData(int inputAudioSyncOffset, string? inputName = null, string? inputUuid = null)
{
this.InputName = inputName;
this.InputUuid = inputUuid;
diff --git a/ObsWebSocket.Core/Generated/Protocol/Requests/SetMediaInputCursor.Request.g.cs b/ObsWebSocket.Core/Generated/Protocol/Requests/SetMediaInputCursor.Request.g.cs
index 35adc7f..58a3d4d 100644
--- a/ObsWebSocket.Core/Generated/Protocol/Requests/SetMediaInputCursor.Request.g.cs
+++ b/ObsWebSocket.Core/Generated/Protocol/Requests/SetMediaInputCursor.Request.g.cs
@@ -57,7 +57,7 @@ public sealed partial record SetMediaInputCursorRequestData
///
[JsonPropertyName("mediaCursor")]
[Key("mediaCursor")]
- public required double MediaCursor { get; init; }
+ public required long MediaCursor { get; init; }
/// Initializes a new instance for deserialization via .
[JsonConstructor]
@@ -68,7 +68,7 @@ public SetMediaInputCursorRequestData() { }
/// Parameters are ordered with required properties first, then optional properties (with defaults). Follows protocol definition order where possible.
///
[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
- public SetMediaInputCursorRequestData(double mediaCursor, string? inputName = null, string? inputUuid = null)
+ public SetMediaInputCursorRequestData(long mediaCursor, string? inputName = null, string? inputUuid = null)
{
this.InputName = inputName;
this.InputUuid = inputUuid;
diff --git a/ObsWebSocket.Core/Generated/Protocol/Requests/SetSceneItemBlendMode.Request.g.cs b/ObsWebSocket.Core/Generated/Protocol/Requests/SetSceneItemBlendMode.Request.g.cs
index ee4c5e9..2f83328 100644
--- a/ObsWebSocket.Core/Generated/Protocol/Requests/SetSceneItemBlendMode.Request.g.cs
+++ b/ObsWebSocket.Core/Generated/Protocol/Requests/SetSceneItemBlendMode.Request.g.cs
@@ -56,7 +56,7 @@ public sealed partial record SetSceneItemBlendModeRequestData
///
[JsonPropertyName("sceneItemId")]
[Key("sceneItemId")]
- public required double SceneItemId { get; init; }
+ public required int SceneItemId { get; init; }
///
/// Name of the scene the item is in
@@ -89,7 +89,7 @@ public SetSceneItemBlendModeRequestData() { }
/// Parameters are ordered with required properties first, then optional properties (with defaults). Follows protocol definition order where possible.
///
[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
- public SetSceneItemBlendModeRequestData(double sceneItemId, string sceneItemBlendMode, string? canvasUuid = null, string? sceneName = null, string? sceneUuid = null)
+ public SetSceneItemBlendModeRequestData(int sceneItemId, string sceneItemBlendMode, string? canvasUuid = null, string? sceneName = null, string? sceneUuid = null)
{
this.CanvasUuid = canvasUuid;
this.SceneName = sceneName;
diff --git a/ObsWebSocket.Core/Generated/Protocol/Requests/SetSceneItemEnabled.Request.g.cs b/ObsWebSocket.Core/Generated/Protocol/Requests/SetSceneItemEnabled.Request.g.cs
index d09803e..4f488fc 100644
--- a/ObsWebSocket.Core/Generated/Protocol/Requests/SetSceneItemEnabled.Request.g.cs
+++ b/ObsWebSocket.Core/Generated/Protocol/Requests/SetSceneItemEnabled.Request.g.cs
@@ -56,7 +56,7 @@ public sealed partial record SetSceneItemEnabledRequestData
///
[JsonPropertyName("sceneItemId")]
[Key("sceneItemId")]
- public required double SceneItemId { get; init; }
+ public required int SceneItemId { get; init; }
///
/// Name of the scene the item is in
@@ -89,7 +89,7 @@ public SetSceneItemEnabledRequestData() { }
/// Parameters are ordered with required properties first, then optional properties (with defaults). Follows protocol definition order where possible.
///
[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
- public SetSceneItemEnabledRequestData(double sceneItemId, bool sceneItemEnabled, string? canvasUuid = null, string? sceneName = null, string? sceneUuid = null)
+ public SetSceneItemEnabledRequestData(int sceneItemId, bool sceneItemEnabled, string? canvasUuid = null, string? sceneName = null, string? sceneUuid = null)
{
this.CanvasUuid = canvasUuid;
this.SceneName = sceneName;
diff --git a/ObsWebSocket.Core/Generated/Protocol/Requests/SetSceneItemIndex.Request.g.cs b/ObsWebSocket.Core/Generated/Protocol/Requests/SetSceneItemIndex.Request.g.cs
index 4eaf6b6..9b52d13 100644
--- a/ObsWebSocket.Core/Generated/Protocol/Requests/SetSceneItemIndex.Request.g.cs
+++ b/ObsWebSocket.Core/Generated/Protocol/Requests/SetSceneItemIndex.Request.g.cs
@@ -46,7 +46,7 @@ public sealed partial record SetSceneItemIndexRequestData
///
[JsonPropertyName("sceneItemId")]
[Key("sceneItemId")]
- public required double SceneItemId { get; init; }
+ public required int SceneItemId { get; init; }
///
/// New index position of the scene item
@@ -57,7 +57,7 @@ public sealed partial record SetSceneItemIndexRequestData
///
[JsonPropertyName("sceneItemIndex")]
[Key("sceneItemIndex")]
- public required double SceneItemIndex { get; init; }
+ public required int SceneItemIndex { get; init; }
///
/// Name of the scene the item is in
@@ -90,7 +90,7 @@ public SetSceneItemIndexRequestData() { }
/// Parameters are ordered with required properties first, then optional properties (with defaults). Follows protocol definition order where possible.
///
[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
- public SetSceneItemIndexRequestData(double sceneItemId, double sceneItemIndex, string? canvasUuid = null, string? sceneName = null, string? sceneUuid = null)
+ public SetSceneItemIndexRequestData(int sceneItemId, int sceneItemIndex, string? canvasUuid = null, string? sceneName = null, string? sceneUuid = null)
{
this.CanvasUuid = canvasUuid;
this.SceneName = sceneName;
diff --git a/ObsWebSocket.Core/Generated/Protocol/Requests/SetSceneItemLocked.Request.g.cs b/ObsWebSocket.Core/Generated/Protocol/Requests/SetSceneItemLocked.Request.g.cs
index aef6429..540613b 100644
--- a/ObsWebSocket.Core/Generated/Protocol/Requests/SetSceneItemLocked.Request.g.cs
+++ b/ObsWebSocket.Core/Generated/Protocol/Requests/SetSceneItemLocked.Request.g.cs
@@ -46,7 +46,7 @@ public sealed partial record SetSceneItemLockedRequestData
///
[JsonPropertyName("sceneItemId")]
[Key("sceneItemId")]
- public required double SceneItemId { get; init; }
+ public required int SceneItemId { get; init; }
///
/// New lock state of the scene item
@@ -89,7 +89,7 @@ public SetSceneItemLockedRequestData() { }
/// Parameters are ordered with required properties first, then optional properties (with defaults). Follows protocol definition order where possible.
///
[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
- public SetSceneItemLockedRequestData(double sceneItemId, bool sceneItemLocked, string? canvasUuid = null, string? sceneName = null, string? sceneUuid = null)
+ public SetSceneItemLockedRequestData(int sceneItemId, bool sceneItemLocked, string? canvasUuid = null, string? sceneName = null, string? sceneUuid = null)
{
this.CanvasUuid = canvasUuid;
this.SceneName = sceneName;
diff --git a/ObsWebSocket.Core/Generated/Protocol/Requests/SetSceneItemTransform.Request.g.cs b/ObsWebSocket.Core/Generated/Protocol/Requests/SetSceneItemTransform.Request.g.cs
index bd9f746..af872c0 100644
--- a/ObsWebSocket.Core/Generated/Protocol/Requests/SetSceneItemTransform.Request.g.cs
+++ b/ObsWebSocket.Core/Generated/Protocol/Requests/SetSceneItemTransform.Request.g.cs
@@ -44,7 +44,7 @@ public sealed partial record SetSceneItemTransformRequestData
///
[JsonPropertyName("sceneItemId")]
[Key("sceneItemId")]
- public required double SceneItemId { get; init; }
+ public required int SceneItemId { get; init; }
///
/// Object containing scene item transform info to update
@@ -87,7 +87,7 @@ public SetSceneItemTransformRequestData() { }
/// Parameters are ordered with required properties first, then optional properties (with defaults). Follows protocol definition order where possible.
///
[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
- public SetSceneItemTransformRequestData(double sceneItemId, ObsWebSocket.Core.Protocol.Common.SceneItemTransformStub? sceneItemTransform, string? canvasUuid = null, string? sceneName = null, string? sceneUuid = null)
+ public SetSceneItemTransformRequestData(int sceneItemId, ObsWebSocket.Core.Protocol.Common.SceneItemTransformStub? sceneItemTransform, string? canvasUuid = null, string? sceneName = null, string? sceneUuid = null)
{
this.CanvasUuid = canvasUuid;
this.SceneName = sceneName;
diff --git a/ObsWebSocket.Core/Generated/Protocol/Requests/SetSceneSceneTransitionOverride.Request.g.cs b/ObsWebSocket.Core/Generated/Protocol/Requests/SetSceneSceneTransitionOverride.Request.g.cs
index bbaf034..ac2de92 100644
--- a/ObsWebSocket.Core/Generated/Protocol/Requests/SetSceneSceneTransitionOverride.Request.g.cs
+++ b/ObsWebSocket.Core/Generated/Protocol/Requests/SetSceneSceneTransitionOverride.Request.g.cs
@@ -67,7 +67,7 @@ public sealed partial record SetSceneSceneTransitionOverrideRequestData
///
[JsonPropertyName("transitionDuration")]
[Key("transitionDuration")]
- public double? TransitionDuration { get; init; }
+ public int? TransitionDuration { get; init; }
///
/// Name of the scene transition to use as override. Specify `null` to remove
@@ -88,7 +88,7 @@ public SetSceneSceneTransitionOverrideRequestData() { }
/// Initializes a new instance with all properties specified.
/// Parameters are ordered with required properties first, then optional properties (with defaults). Follows protocol definition order where possible.
///
- public SetSceneSceneTransitionOverrideRequestData(string? canvasUuid = null, string? sceneName = null, string? sceneUuid = null, string? transitionName = null, double? transitionDuration = null)
+ public SetSceneSceneTransitionOverrideRequestData(string? canvasUuid = null, string? sceneName = null, string? sceneUuid = null, string? transitionName = null, int? transitionDuration = null)
{
this.CanvasUuid = canvasUuid;
this.SceneName = sceneName;
diff --git a/ObsWebSocket.Core/Generated/Protocol/Requests/SetSourceFilterIndex.Request.g.cs b/ObsWebSocket.Core/Generated/Protocol/Requests/SetSourceFilterIndex.Request.g.cs
index 60ab30a..ebe980f 100644
--- a/ObsWebSocket.Core/Generated/Protocol/Requests/SetSourceFilterIndex.Request.g.cs
+++ b/ObsWebSocket.Core/Generated/Protocol/Requests/SetSourceFilterIndex.Request.g.cs
@@ -44,7 +44,7 @@ public sealed partial record SetSourceFilterIndexRequestData
///
[JsonPropertyName("filterIndex")]
[Key("filterIndex")]
- public required double FilterIndex { get; init; }
+ public required int FilterIndex { get; init; }
///
/// Name of the filter
@@ -87,7 +87,7 @@ public SetSourceFilterIndexRequestData() { }
/// Parameters are ordered with required properties first, then optional properties (with defaults). Follows protocol definition order where possible.
///
[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
- public SetSourceFilterIndexRequestData(string filterName, double filterIndex, string? canvasUuid = null, string? sourceName = null, string? sourceUuid = null)
+ public SetSourceFilterIndexRequestData(string filterName, int filterIndex, string? canvasUuid = null, string? sourceName = null, string? sourceUuid = null)
{
this.CanvasUuid = canvasUuid;
this.SourceName = sourceName;
diff --git a/ObsWebSocket.Core/Generated/Protocol/Requests/SetTBarPosition.Request.g.cs b/ObsWebSocket.Core/Generated/Protocol/Requests/SetTBarPosition.Request.g.cs
index fffc0c3..411dfd4 100644
--- a/ObsWebSocket.Core/Generated/Protocol/Requests/SetTBarPosition.Request.g.cs
+++ b/ObsWebSocket.Core/Generated/Protocol/Requests/SetTBarPosition.Request.g.cs
@@ -35,7 +35,7 @@ public sealed partial record SetTBarPositionRequestData
///
[JsonPropertyName("position")]
[Key("position")]
- public required double Position { get; init; }
+ public required int Position { get; init; }
///
/// Whether to release the TBar. Only set `false` if you know that you will be sending another position update
@@ -57,7 +57,7 @@ public SetTBarPositionRequestData() { }
/// Parameters are ordered with required properties first, then optional properties (with defaults). Follows protocol definition order where possible.
///
[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
- public SetTBarPositionRequestData(double position, bool? release = null)
+ public SetTBarPositionRequestData(int position, bool? release = null)
{
this.Position = position;
this.Release = release;
diff --git a/ObsWebSocket.Core/Generated/Protocol/Requests/SetVideoSettings.Request.g.cs b/ObsWebSocket.Core/Generated/Protocol/Requests/SetVideoSettings.Request.g.cs
index f37cbdb..5749d84 100644
--- a/ObsWebSocket.Core/Generated/Protocol/Requests/SetVideoSettings.Request.g.cs
+++ b/ObsWebSocket.Core/Generated/Protocol/Requests/SetVideoSettings.Request.g.cs
@@ -36,7 +36,7 @@ public sealed partial record SetVideoSettingsRequestData
///
[JsonPropertyName("baseHeight")]
[Key("baseHeight")]
- public double? BaseHeight { get; init; }
+ public int? BaseHeight { get; init; }
///
/// Width of the base (canvas) resolution in pixels
@@ -48,7 +48,7 @@ public sealed partial record SetVideoSettingsRequestData
///
[JsonPropertyName("baseWidth")]
[Key("baseWidth")]
- public double? BaseWidth { get; init; }
+ public int? BaseWidth { get; init; }
///
/// Denominator of the fractional FPS value
@@ -60,7 +60,7 @@ public sealed partial record SetVideoSettingsRequestData
///
[JsonPropertyName("fpsDenominator")]
[Key("fpsDenominator")]
- public double? FpsDenominator { get; init; }
+ public int? FpsDenominator { get; init; }
///
/// Numerator of the fractional FPS value
@@ -72,7 +72,7 @@ public sealed partial record SetVideoSettingsRequestData
///
[JsonPropertyName("fpsNumerator")]
[Key("fpsNumerator")]
- public double? FpsNumerator { get; init; }
+ public int? FpsNumerator { get; init; }
///
/// Height of the output resolution in pixels
@@ -84,7 +84,7 @@ public sealed partial record SetVideoSettingsRequestData
///
[JsonPropertyName("outputHeight")]
[Key("outputHeight")]
- public double? OutputHeight { get; init; }
+ public int? OutputHeight { get; init; }
///
/// Width of the output resolution in pixels
@@ -96,7 +96,7 @@ public sealed partial record SetVideoSettingsRequestData
///
[JsonPropertyName("outputWidth")]
[Key("outputWidth")]
- public double? OutputWidth { get; init; }
+ public int? OutputWidth { get; init; }
/// Initializes a new instance for deserialization via .
[JsonConstructor]
@@ -106,7 +106,7 @@ public SetVideoSettingsRequestData() { }
/// Initializes a new instance with all properties specified.
/// Parameters are ordered with required properties first, then optional properties (with defaults). Follows protocol definition order where possible.
///
- public SetVideoSettingsRequestData(double? fpsNumerator = null, double? fpsDenominator = null, double? baseWidth = null, double? baseHeight = null, double? outputWidth = null, double? outputHeight = null)
+ public SetVideoSettingsRequestData(int? fpsNumerator = null, int? fpsDenominator = null, int? baseWidth = null, int? baseHeight = null, int? outputWidth = null, int? outputHeight = null)
{
this.FpsNumerator = fpsNumerator;
this.FpsDenominator = fpsDenominator;
diff --git a/ObsWebSocket.Core/Generated/Protocol/Requests/Sleep.Request.g.cs b/ObsWebSocket.Core/Generated/Protocol/Requests/Sleep.Request.g.cs
index 02cf715..485e8c5 100644
--- a/ObsWebSocket.Core/Generated/Protocol/Requests/Sleep.Request.g.cs
+++ b/ObsWebSocket.Core/Generated/Protocol/Requests/Sleep.Request.g.cs
@@ -34,7 +34,7 @@ public sealed partial record SleepRequestData
///
[JsonPropertyName("sleepFrames")]
[Key("sleepFrames")]
- public double? SleepFrames { get; init; }
+ public int? SleepFrames { get; init; }
///
/// Number of milliseconds to sleep for (if `SERIAL_REALTIME` mode)
@@ -46,7 +46,7 @@ public sealed partial record SleepRequestData
///
[JsonPropertyName("sleepMillis")]
[Key("sleepMillis")]
- public double? SleepMillis { get; init; }
+ public int? SleepMillis { get; init; }
/// Initializes a new instance for deserialization via .
[JsonConstructor]
@@ -56,7 +56,7 @@ public SleepRequestData() { }
/// Initializes a new instance with all properties specified.
/// Parameters are ordered with required properties first, then optional properties (with defaults). Follows protocol definition order where possible.
///
- public SleepRequestData(double? sleepMillis = null, double? sleepFrames = null)
+ public SleepRequestData(int? sleepMillis = null, int? sleepFrames = null)
{
this.SleepMillis = sleepMillis;
this.SleepFrames = sleepFrames;
diff --git a/ObsWebSocket.Core/Generated/Protocol/Responses/CreateInput.Response.g.cs b/ObsWebSocket.Core/Generated/Protocol/Responses/CreateInput.Response.g.cs
index 2f05650..c032cd3 100644
--- a/ObsWebSocket.Core/Generated/Protocol/Responses/CreateInput.Response.g.cs
+++ b/ObsWebSocket.Core/Generated/Protocol/Responses/CreateInput.Response.g.cs
@@ -36,7 +36,7 @@ public sealed partial record CreateInputResponseData
///
[JsonPropertyName("sceneItemId")]
[Key("sceneItemId")]
- public required double SceneItemId { get; init; }
+ public required int SceneItemId { get; init; }
/// Initializes a new instance for deserialization via .
[JsonConstructor]
@@ -47,7 +47,7 @@ public CreateInputResponseData() { }
/// Parameters are ordered with required properties first, then optional properties (with defaults). Follows protocol definition order where possible.
///
[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
- public CreateInputResponseData(double sceneItemId, string? inputUuid = null)
+ public CreateInputResponseData(int sceneItemId, string? inputUuid = null)
{
this.InputUuid = inputUuid;
this.SceneItemId = sceneItemId;
diff --git a/ObsWebSocket.Core/Generated/Protocol/Responses/CreateSceneItem.Response.g.cs b/ObsWebSocket.Core/Generated/Protocol/Responses/CreateSceneItem.Response.g.cs
index cfabee0..d81b54c 100644
--- a/ObsWebSocket.Core/Generated/Protocol/Responses/CreateSceneItem.Response.g.cs
+++ b/ObsWebSocket.Core/Generated/Protocol/Responses/CreateSceneItem.Response.g.cs
@@ -31,7 +31,7 @@ public sealed partial record CreateSceneItemResponseData
///
[JsonPropertyName("sceneItemId")]
[Key("sceneItemId")]
- public required double SceneItemId { get; init; }
+ public required int SceneItemId { get; init; }
/// Initializes a new instance for deserialization via .
[JsonConstructor]
@@ -42,7 +42,7 @@ public CreateSceneItemResponseData() { }
/// Parameters are ordered with required properties first, then optional properties (with defaults). Follows protocol definition order where possible.
///
[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
- public CreateSceneItemResponseData(double sceneItemId)
+ public CreateSceneItemResponseData(int sceneItemId)
{
this.SceneItemId = sceneItemId;
}
diff --git a/ObsWebSocket.Core/Generated/Protocol/Responses/DuplicateSceneItem.Response.g.cs b/ObsWebSocket.Core/Generated/Protocol/Responses/DuplicateSceneItem.Response.g.cs
index ecfcf15..cc4c27a 100644
--- a/ObsWebSocket.Core/Generated/Protocol/Responses/DuplicateSceneItem.Response.g.cs
+++ b/ObsWebSocket.Core/Generated/Protocol/Responses/DuplicateSceneItem.Response.g.cs
@@ -31,7 +31,7 @@ public sealed partial record DuplicateSceneItemResponseData
///
[JsonPropertyName("sceneItemId")]
[Key("sceneItemId")]
- public required double SceneItemId { get; init; }
+ public required int SceneItemId { get; init; }
/// Initializes a new instance for deserialization via .
[JsonConstructor]
@@ -42,7 +42,7 @@ public DuplicateSceneItemResponseData() { }
/// Parameters are ordered with required properties first, then optional properties (with defaults). Follows protocol definition order where possible.
///
[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
- public DuplicateSceneItemResponseData(double sceneItemId)
+ public DuplicateSceneItemResponseData(int sceneItemId)
{
this.SceneItemId = sceneItemId;
}
diff --git a/ObsWebSocket.Core/Generated/Protocol/Responses/GetCurrentSceneTransition.Response.g.cs b/ObsWebSocket.Core/Generated/Protocol/Responses/GetCurrentSceneTransition.Response.g.cs
index cc42520..54f270a 100644
--- a/ObsWebSocket.Core/Generated/Protocol/Responses/GetCurrentSceneTransition.Response.g.cs
+++ b/ObsWebSocket.Core/Generated/Protocol/Responses/GetCurrentSceneTransition.Response.g.cs
@@ -36,7 +36,7 @@ public sealed partial record GetCurrentSceneTransitionResponseData
///
[JsonPropertyName("transitionDuration")]
[Key("transitionDuration")]
- public double? TransitionDuration { get; init; }
+ public int? TransitionDuration { get; init; }
///
/// Whether the transition uses a fixed (unconfigurable) duration
@@ -82,7 +82,7 @@ public GetCurrentSceneTransitionResponseData() { }
/// Parameters are ordered with required properties first, then optional properties (with defaults). Follows protocol definition order where possible.
///
[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
- public GetCurrentSceneTransitionResponseData(bool transitionFixed, bool transitionConfigurable, string? transitionName = null, string? transitionUuid = null, string? transitionKind = null, double? transitionDuration = null, System.Text.Json.JsonElement? transitionSettings = null)
+ public GetCurrentSceneTransitionResponseData(bool transitionFixed, bool transitionConfigurable, string? transitionName = null, string? transitionUuid = null, string? transitionKind = null, int? transitionDuration = null, System.Text.Json.JsonElement? transitionSettings = null)
{
this.TransitionName = transitionName;
this.TransitionUuid = transitionUuid;
diff --git a/ObsWebSocket.Core/Generated/Protocol/Responses/GetInputAudioSyncOffset.Response.g.cs b/ObsWebSocket.Core/Generated/Protocol/Responses/GetInputAudioSyncOffset.Response.g.cs
index 2d2cb2d..01caf06 100644
--- a/ObsWebSocket.Core/Generated/Protocol/Responses/GetInputAudioSyncOffset.Response.g.cs
+++ b/ObsWebSocket.Core/Generated/Protocol/Responses/GetInputAudioSyncOffset.Response.g.cs
@@ -31,7 +31,7 @@ public sealed partial record GetInputAudioSyncOffsetResponseData
///
[JsonPropertyName("inputAudioSyncOffset")]
[Key("inputAudioSyncOffset")]
- public required double InputAudioSyncOffset { get; init; }
+ public required int InputAudioSyncOffset { get; init; }
/// Initializes a new instance for deserialization via .
[JsonConstructor]
@@ -42,7 +42,7 @@ public GetInputAudioSyncOffsetResponseData() { }
/// Parameters are ordered with required properties first, then optional properties (with defaults). Follows protocol definition order where possible.
///
[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
- public GetInputAudioSyncOffsetResponseData(double inputAudioSyncOffset)
+ public GetInputAudioSyncOffsetResponseData(int inputAudioSyncOffset)
{
this.InputAudioSyncOffset = inputAudioSyncOffset;
}
diff --git a/ObsWebSocket.Core/Generated/Protocol/Responses/GetMediaInputStatus.Response.g.cs b/ObsWebSocket.Core/Generated/Protocol/Responses/GetMediaInputStatus.Response.g.cs
index ff95718..54d974d 100644
--- a/ObsWebSocket.Core/Generated/Protocol/Responses/GetMediaInputStatus.Response.g.cs
+++ b/ObsWebSocket.Core/Generated/Protocol/Responses/GetMediaInputStatus.Response.g.cs
@@ -40,14 +40,14 @@ public sealed partial record GetMediaInputStatusResponseData
///
[JsonPropertyName("mediaCursor")]
[Key("mediaCursor")]
- public double? MediaCursor { get; init; }
+ public long? MediaCursor { get; init; }
///
/// Total duration of the playing media in milliseconds. `null` if not playing
///
[JsonPropertyName("mediaDuration")]
[Key("mediaDuration")]
- public double? MediaDuration { get; init; }
+ public long? MediaDuration { get; init; }
///
/// State of the media input
@@ -64,7 +64,7 @@ public GetMediaInputStatusResponseData() { }
/// Initializes a new instance with all properties specified.
/// Parameters are ordered with required properties first, then optional properties (with defaults). Follows protocol definition order where possible.
///
- public GetMediaInputStatusResponseData(string? mediaState = null, double? mediaDuration = null, double? mediaCursor = null)
+ public GetMediaInputStatusResponseData(string? mediaState = null, long? mediaDuration = null, long? mediaCursor = null)
{
this.MediaState = mediaState;
this.MediaDuration = mediaDuration;
diff --git a/ObsWebSocket.Core/Generated/Protocol/Responses/GetOutputStatus.Response.g.cs b/ObsWebSocket.Core/Generated/Protocol/Responses/GetOutputStatus.Response.g.cs
index edec618..9b0b776 100644
--- a/ObsWebSocket.Core/Generated/Protocol/Responses/GetOutputStatus.Response.g.cs
+++ b/ObsWebSocket.Core/Generated/Protocol/Responses/GetOutputStatus.Response.g.cs
@@ -36,7 +36,7 @@ public sealed partial record GetOutputStatusResponseData
///
[JsonPropertyName("outputBytes")]
[Key("outputBytes")]
- public required double OutputBytes { get; init; }
+ public required long OutputBytes { get; init; }
///
/// Congestion of the output
@@ -50,7 +50,7 @@ public sealed partial record GetOutputStatusResponseData
///
[JsonPropertyName("outputDuration")]
[Key("outputDuration")]
- public required double OutputDuration { get; init; }
+ public required long OutputDuration { get; init; }
///
/// Whether the output is reconnecting
@@ -64,7 +64,7 @@ public sealed partial record GetOutputStatusResponseData
///
[JsonPropertyName("outputSkippedFrames")]
[Key("outputSkippedFrames")]
- public required double OutputSkippedFrames { get; init; }
+ public required int OutputSkippedFrames { get; init; }
///
/// Current formatted timecode string for the output
@@ -78,7 +78,7 @@ public sealed partial record GetOutputStatusResponseData
///
[JsonPropertyName("outputTotalFrames")]
[Key("outputTotalFrames")]
- public required double OutputTotalFrames { get; init; }
+ public required int OutputTotalFrames { get; init; }
/// Initializes a new instance for deserialization via .
[JsonConstructor]
@@ -89,7 +89,7 @@ public GetOutputStatusResponseData() { }
/// Parameters are ordered with required properties first, then optional properties (with defaults). Follows protocol definition order where possible.
///
[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
- public GetOutputStatusResponseData(bool outputActive, bool outputReconnecting, double outputDuration, double outputCongestion, double outputBytes, double outputSkippedFrames, double outputTotalFrames, string? outputTimecode = null)
+ public GetOutputStatusResponseData(bool outputActive, bool outputReconnecting, long outputDuration, double outputCongestion, long outputBytes, int outputSkippedFrames, int outputTotalFrames, string? outputTimecode = null)
{
this.OutputActive = outputActive;
this.OutputReconnecting = outputReconnecting;
diff --git a/ObsWebSocket.Core/Generated/Protocol/Responses/GetRecordStatus.Response.g.cs b/ObsWebSocket.Core/Generated/Protocol/Responses/GetRecordStatus.Response.g.cs
index 0737846..5dbe7bc 100644
--- a/ObsWebSocket.Core/Generated/Protocol/Responses/GetRecordStatus.Response.g.cs
+++ b/ObsWebSocket.Core/Generated/Protocol/Responses/GetRecordStatus.Response.g.cs
@@ -36,14 +36,14 @@ public sealed partial record GetRecordStatusResponseData
///
[JsonPropertyName("outputBytes")]
[Key("outputBytes")]
- public required double OutputBytes { get; init; }
+ public required long OutputBytes { get; init; }
///
/// Current duration in milliseconds for the output
///
[JsonPropertyName("outputDuration")]
[Key("outputDuration")]
- public required double OutputDuration { get; init; }
+ public required long OutputDuration { get; init; }
///
/// Whether the output is paused
@@ -68,7 +68,7 @@ public GetRecordStatusResponseData() { }
/// Parameters are ordered with required properties first, then optional properties (with defaults). Follows protocol definition order where possible.
///
[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
- public GetRecordStatusResponseData(bool outputActive, bool outputPaused, double outputDuration, double outputBytes, string? outputTimecode = null)
+ public GetRecordStatusResponseData(bool outputActive, bool outputPaused, long outputDuration, long outputBytes, string? outputTimecode = null)
{
this.OutputActive = outputActive;
this.OutputPaused = outputPaused;
diff --git a/ObsWebSocket.Core/Generated/Protocol/Responses/GetSceneItemId.Response.g.cs b/ObsWebSocket.Core/Generated/Protocol/Responses/GetSceneItemId.Response.g.cs
index af48b22..4fbba5a 100644
--- a/ObsWebSocket.Core/Generated/Protocol/Responses/GetSceneItemId.Response.g.cs
+++ b/ObsWebSocket.Core/Generated/Protocol/Responses/GetSceneItemId.Response.g.cs
@@ -31,7 +31,7 @@ public sealed partial record GetSceneItemIdResponseData
///
[JsonPropertyName("sceneItemId")]
[Key("sceneItemId")]
- public required double SceneItemId { get; init; }
+ public required int SceneItemId { get; init; }
/// Initializes a new instance for deserialization via .
[JsonConstructor]
@@ -42,7 +42,7 @@ public GetSceneItemIdResponseData() { }
/// Parameters are ordered with required properties first, then optional properties (with defaults). Follows protocol definition order where possible.
///
[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
- public GetSceneItemIdResponseData(double sceneItemId)
+ public GetSceneItemIdResponseData(int sceneItemId)
{
this.SceneItemId = sceneItemId;
}
diff --git a/ObsWebSocket.Core/Generated/Protocol/Responses/GetSceneItemIndex.Response.g.cs b/ObsWebSocket.Core/Generated/Protocol/Responses/GetSceneItemIndex.Response.g.cs
index e6e0c80..a7d86c6 100644
--- a/ObsWebSocket.Core/Generated/Protocol/Responses/GetSceneItemIndex.Response.g.cs
+++ b/ObsWebSocket.Core/Generated/Protocol/Responses/GetSceneItemIndex.Response.g.cs
@@ -33,7 +33,7 @@ public sealed partial record GetSceneItemIndexResponseData
///
[JsonPropertyName("sceneItemIndex")]
[Key("sceneItemIndex")]
- public required double SceneItemIndex { get; init; }
+ public required int SceneItemIndex { get; init; }
/// Initializes a new instance for deserialization via .
[JsonConstructor]
@@ -44,7 +44,7 @@ public GetSceneItemIndexResponseData() { }
/// Parameters are ordered with required properties first, then optional properties (with defaults). Follows protocol definition order where possible.
///
[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
- public GetSceneItemIndexResponseData(double sceneItemIndex)
+ public GetSceneItemIndexResponseData(int sceneItemIndex)
{
this.SceneItemIndex = sceneItemIndex;
}
diff --git a/ObsWebSocket.Core/Generated/Protocol/Responses/GetSceneSceneTransitionOverride.Response.g.cs b/ObsWebSocket.Core/Generated/Protocol/Responses/GetSceneSceneTransitionOverride.Response.g.cs
index ca5f955..c1cece7 100644
--- a/ObsWebSocket.Core/Generated/Protocol/Responses/GetSceneSceneTransitionOverride.Response.g.cs
+++ b/ObsWebSocket.Core/Generated/Protocol/Responses/GetSceneSceneTransitionOverride.Response.g.cs
@@ -31,7 +31,7 @@ public sealed partial record GetSceneSceneTransitionOverrideResponseData
///
[JsonPropertyName("transitionDuration")]
[Key("transitionDuration")]
- public double? TransitionDuration { get; init; }
+ public int? TransitionDuration { get; init; }
///
/// Name of the overridden scene transition, else `null`
@@ -48,7 +48,7 @@ public GetSceneSceneTransitionOverrideResponseData() { }
/// Initializes a new instance with all properties specified.
/// Parameters are ordered with required properties first, then optional properties (with defaults). Follows protocol definition order where possible.
///
- public GetSceneSceneTransitionOverrideResponseData(string? transitionName = null, double? transitionDuration = null)
+ public GetSceneSceneTransitionOverrideResponseData(string? transitionName = null, int? transitionDuration = null)
{
this.TransitionName = transitionName;
this.TransitionDuration = transitionDuration;
diff --git a/ObsWebSocket.Core/Generated/Protocol/Responses/GetSourceFilter.Response.g.cs b/ObsWebSocket.Core/Generated/Protocol/Responses/GetSourceFilter.Response.g.cs
index 8cba357..ef6669c 100644
--- a/ObsWebSocket.Core/Generated/Protocol/Responses/GetSourceFilter.Response.g.cs
+++ b/ObsWebSocket.Core/Generated/Protocol/Responses/GetSourceFilter.Response.g.cs
@@ -36,7 +36,7 @@ public sealed partial record GetSourceFilterResponseData
///
[JsonPropertyName("filterIndex")]
[Key("filterIndex")]
- public required double FilterIndex { get; init; }
+ public required int FilterIndex { get; init; }
///
/// The kind of filter
@@ -61,7 +61,7 @@ public GetSourceFilterResponseData() { }
/// Parameters are ordered with required properties first, then optional properties (with defaults). Follows protocol definition order where possible.
///
[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
- public GetSourceFilterResponseData(bool filterEnabled, double filterIndex, string? filterKind = null, System.Text.Json.JsonElement? filterSettings = null)
+ public GetSourceFilterResponseData(bool filterEnabled, int filterIndex, string? filterKind = null, System.Text.Json.JsonElement? filterSettings = null)
{
this.FilterEnabled = filterEnabled;
this.FilterIndex = filterIndex;
diff --git a/ObsWebSocket.Core/Generated/Protocol/Responses/GetStats.Response.g.cs b/ObsWebSocket.Core/Generated/Protocol/Responses/GetStats.Response.g.cs
index 0942964..07d2863 100644
--- a/ObsWebSocket.Core/Generated/Protocol/Responses/GetStats.Response.g.cs
+++ b/ObsWebSocket.Core/Generated/Protocol/Responses/GetStats.Response.g.cs
@@ -64,42 +64,42 @@ public sealed partial record GetStatsResponseData
///
[JsonPropertyName("outputSkippedFrames")]
[Key("outputSkippedFrames")]
- public required double OutputSkippedFrames { get; init; }
+ public required int OutputSkippedFrames { get; init; }
///
/// Total number of frames outputted by the output thread
///
[JsonPropertyName("outputTotalFrames")]
[Key("outputTotalFrames")]
- public required double OutputTotalFrames { get; init; }
+ public required int OutputTotalFrames { get; init; }
///
/// Number of frames skipped by OBS in the render thread
///
[JsonPropertyName("renderSkippedFrames")]
[Key("renderSkippedFrames")]
- public required double RenderSkippedFrames { get; init; }
+ public required int RenderSkippedFrames { get; init; }
///
/// Total number of frames outputted by the render thread
///
[JsonPropertyName("renderTotalFrames")]
[Key("renderTotalFrames")]
- public required double RenderTotalFrames { get; init; }
+ public required int RenderTotalFrames { get; init; }
///
/// Total number of messages received by obs-websocket from the client
///
[JsonPropertyName("webSocketSessionIncomingMessages")]
[Key("webSocketSessionIncomingMessages")]
- public required double WebSocketSessionIncomingMessages { get; init; }
+ public required int WebSocketSessionIncomingMessages { get; init; }
///
/// Total number of messages sent by obs-websocket to the client
///
[JsonPropertyName("webSocketSessionOutgoingMessages")]
[Key("webSocketSessionOutgoingMessages")]
- public required double WebSocketSessionOutgoingMessages { get; init; }
+ public required int WebSocketSessionOutgoingMessages { get; init; }
/// Initializes a new instance for deserialization via .
[JsonConstructor]
@@ -110,7 +110,7 @@ public GetStatsResponseData() { }
/// Parameters are ordered with required properties first, then optional properties (with defaults). Follows protocol definition order where possible.
///
[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
- public GetStatsResponseData(double cpuUsage, double memoryUsage, double availableDiskSpace, double activeFps, double averageFrameRenderTime, double renderSkippedFrames, double renderTotalFrames, double outputSkippedFrames, double outputTotalFrames, double webSocketSessionIncomingMessages, double webSocketSessionOutgoingMessages)
+ public GetStatsResponseData(double cpuUsage, double memoryUsage, double availableDiskSpace, double activeFps, double averageFrameRenderTime, int renderSkippedFrames, int renderTotalFrames, int outputSkippedFrames, int outputTotalFrames, int webSocketSessionIncomingMessages, int webSocketSessionOutgoingMessages)
{
this.CpuUsage = cpuUsage;
this.MemoryUsage = memoryUsage;
diff --git a/ObsWebSocket.Core/Generated/Protocol/Responses/GetStreamStatus.Response.g.cs b/ObsWebSocket.Core/Generated/Protocol/Responses/GetStreamStatus.Response.g.cs
index 52d0d65..c8119b0 100644
--- a/ObsWebSocket.Core/Generated/Protocol/Responses/GetStreamStatus.Response.g.cs
+++ b/ObsWebSocket.Core/Generated/Protocol/Responses/GetStreamStatus.Response.g.cs
@@ -36,7 +36,7 @@ public sealed partial record GetStreamStatusResponseData
///
[JsonPropertyName("outputBytes")]
[Key("outputBytes")]
- public required double OutputBytes { get; init; }
+ public required long OutputBytes { get; init; }
///
/// Congestion of the output
@@ -50,7 +50,7 @@ public sealed partial record GetStreamStatusResponseData
///
[JsonPropertyName("outputDuration")]
[Key("outputDuration")]
- public required double OutputDuration { get; init; }
+ public required long OutputDuration { get; init; }
///
/// Whether the output is currently reconnecting
@@ -64,7 +64,7 @@ public sealed partial record GetStreamStatusResponseData
///
[JsonPropertyName("outputSkippedFrames")]
[Key("outputSkippedFrames")]
- public required double OutputSkippedFrames { get; init; }
+ public required int OutputSkippedFrames { get; init; }
///
/// Current formatted timecode string for the output
@@ -78,7 +78,7 @@ public sealed partial record GetStreamStatusResponseData
///
[JsonPropertyName("outputTotalFrames")]
[Key("outputTotalFrames")]
- public required double OutputTotalFrames { get; init; }
+ public required int OutputTotalFrames { get; init; }
/// Initializes a new instance for deserialization via .
[JsonConstructor]
@@ -89,7 +89,7 @@ public GetStreamStatusResponseData() { }
/// Parameters are ordered with required properties first, then optional properties (with defaults). Follows protocol definition order where possible.
///
[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
- public GetStreamStatusResponseData(bool outputActive, bool outputReconnecting, double outputDuration, double outputCongestion, double outputBytes, double outputSkippedFrames, double outputTotalFrames, string? outputTimecode = null)
+ public GetStreamStatusResponseData(bool outputActive, bool outputReconnecting, long outputDuration, double outputCongestion, long outputBytes, int outputSkippedFrames, int outputTotalFrames, string? outputTimecode = null)
{
this.OutputActive = outputActive;
this.OutputReconnecting = outputReconnecting;
diff --git a/ObsWebSocket.Core/Generated/Protocol/Responses/GetVersion.Response.g.cs b/ObsWebSocket.Core/Generated/Protocol/Responses/GetVersion.Response.g.cs
index c8b120f..56eb552 100644
--- a/ObsWebSocket.Core/Generated/Protocol/Responses/GetVersion.Response.g.cs
+++ b/ObsWebSocket.Core/Generated/Protocol/Responses/GetVersion.Response.g.cs
@@ -64,7 +64,7 @@ public sealed partial record GetVersionResponseData
///
[JsonPropertyName("rpcVersion")]
[Key("rpcVersion")]
- public required double RpcVersion { get; init; }
+ public required int RpcVersion { get; init; }
///
/// Image formats available in `GetSourceScreenshot` and `SaveSourceScreenshot` requests.
@@ -82,7 +82,7 @@ public GetVersionResponseData() { }
/// Parameters are ordered with required properties first, then optional properties (with defaults). Follows protocol definition order where possible.
///
[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
- public GetVersionResponseData(double rpcVersion, string? obsVersion = null, string? obsWebSocketVersion = null, System.Collections.Generic.List? availableRequests = null, System.Collections.Generic.List? supportedImageFormats = null, string? platform = null, string? platformDescription = null)
+ public GetVersionResponseData(int rpcVersion, string? obsVersion = null, string? obsWebSocketVersion = null, System.Collections.Generic.List? availableRequests = null, System.Collections.Generic.List? supportedImageFormats = null, string? platform = null, string? platformDescription = null)
{
this.ObsVersion = obsVersion;
this.ObsWebSocketVersion = obsWebSocketVersion;
diff --git a/ObsWebSocket.Core/Generated/Protocol/Responses/GetVideoSettings.Response.g.cs b/ObsWebSocket.Core/Generated/Protocol/Responses/GetVideoSettings.Response.g.cs
index 7fab887..4becccc 100644
--- a/ObsWebSocket.Core/Generated/Protocol/Responses/GetVideoSettings.Response.g.cs
+++ b/ObsWebSocket.Core/Generated/Protocol/Responses/GetVideoSettings.Response.g.cs
@@ -31,42 +31,42 @@ public sealed partial record GetVideoSettingsResponseData
///
[JsonPropertyName("baseHeight")]
[Key("baseHeight")]
- public required double BaseHeight { get; init; }
+ public required int BaseHeight { get; init; }
///
/// Width of the base (canvas) resolution in pixels
///
[JsonPropertyName("baseWidth")]
[Key("baseWidth")]
- public required double BaseWidth { get; init; }
+ public required int BaseWidth { get; init; }
///
/// Denominator of the fractional FPS value
///
[JsonPropertyName("fpsDenominator")]
[Key("fpsDenominator")]
- public required double FpsDenominator { get; init; }
+ public required int FpsDenominator { get; init; }
///
/// Numerator of the fractional FPS value
///
[JsonPropertyName("fpsNumerator")]
[Key("fpsNumerator")]
- public required double FpsNumerator { get; init; }
+ public required int FpsNumerator { get; init; }
///
/// Height of the output resolution in pixels
///
[JsonPropertyName("outputHeight")]
[Key("outputHeight")]
- public required double OutputHeight { get; init; }
+ public required int OutputHeight { get; init; }
///
/// Width of the output resolution in pixels
///
[JsonPropertyName("outputWidth")]
[Key("outputWidth")]
- public required double OutputWidth { get; init; }
+ public required int OutputWidth { get; init; }
/// Initializes a new instance for deserialization via .
[JsonConstructor]
@@ -77,7 +77,7 @@ public GetVideoSettingsResponseData() { }
/// Parameters are ordered with required properties first, then optional properties (with defaults). Follows protocol definition order where possible.
///
[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
- public GetVideoSettingsResponseData(double fpsNumerator, double fpsDenominator, double baseWidth, double baseHeight, double outputWidth, double outputHeight)
+ public GetVideoSettingsResponseData(int fpsNumerator, int fpsDenominator, int baseWidth, int baseHeight, int outputWidth, int outputHeight)
{
this.FpsNumerator = fpsNumerator;
this.FpsDenominator = fpsDenominator;
diff --git a/ObsWebSocket.Core/Groups/ConfigRequestGroup.cs b/ObsWebSocket.Core/Groups/ConfigGroup.cs
similarity index 82%
rename from ObsWebSocket.Core/Groups/ConfigRequestGroup.cs
rename to ObsWebSocket.Core/Groups/ConfigGroup.cs
index d210228..db8d7cf 100644
--- a/ObsWebSocket.Core/Groups/ConfigRequestGroup.cs
+++ b/ObsWebSocket.Core/Groups/ConfigGroup.cs
@@ -1,11 +1,11 @@
-using Microsoft.Extensions.Logging;
using System.Text.Json;
using System.Text.Json.Serialization.Metadata;
+using Microsoft.Extensions.Logging;
using ObsWebSocket.Core.Events;
using ObsWebSocket.Core.Events.Generated;
+using ObsWebSocket.Core.Networking;
using ObsWebSocket.Core.Protocol;
using ObsWebSocket.Core.Protocol.Common;
-using ObsWebSocket.Core.Networking;
using ObsWebSocket.Core.Protocol.Common.FilterSettings;
using ObsWebSocket.Core.Protocol.Common.InputSettings;
using ObsWebSocket.Core.Protocol.Generated;
@@ -17,7 +17,7 @@ namespace ObsWebSocket.Core;
///
/// Conveniences for the Config category, alongside its generated requests.
///
-public readonly partial struct ConfigRequestGroup
+public readonly partial struct ConfigGroup
{
///
/// Gets the current stream service settings as a strongly-typed object. The service type string is discarded.
@@ -28,7 +28,8 @@ public readonly partial struct ConfigRequestGroup
/// The deserialized stream service settings, or if no settings are present.
/// Thrown if OBS returns an error or serialization fails.
/// Thrown if the client is not connected.
- public async Task GetStreamServiceSettingsAsync(JsonTypeInfo typeInfo,
+ public async Task GetStreamServiceSettingsAsync(
+ JsonTypeInfo typeInfo,
CancellationToken cancellationToken = default
)
where T : class
@@ -40,7 +41,9 @@ public readonly partial struct ConfigRequestGroup
.Config.GetStreamServiceSettingsAsync(cancellationToken: cancellationToken)
.ConfigureAwait(false);
- return response?.StreamServiceSettings is not { } element ? null : JsonSerializer.Deserialize(element, typeInfo);
+ return response?.StreamServiceSettings is not { } element
+ ? null
+ : JsonSerializer.Deserialize(element, typeInfo);
}
///
@@ -51,8 +54,7 @@ public readonly partial struct ConfigRequestGroup
/// The deserialized stream service settings, or if no settings are present.
/// Thrown if the type is not registered, OBS returns an error, or serialization fails.
/// Thrown if the client is not connected.
- public Task GetStreamServiceSettingsAsync(CancellationToken cancellationToken = default
- )
+ public Task GetStreamServiceSettingsAsync(CancellationToken cancellationToken = default)
where T : class
{
JsonTypeInfo typeInfo = ObsWebSocketClientHelpers.GetRegisteredTypeInfo();
@@ -69,7 +71,8 @@ public readonly partial struct ConfigRequestGroup
/// A token to cancel the operation.
/// Thrown if OBS returns an error or serialization fails.
/// Thrown if the client is not connected.
- public async Task SetStreamServiceSettingsAsync(string streamServiceType,
+ public async Task SetStreamServiceSettingsAsync(
+ string streamServiceType,
T settings,
JsonTypeInfo typeInfo,
CancellationToken cancellationToken = default
@@ -83,7 +86,8 @@ public async Task SetStreamServiceSettingsAsync(string streamServiceType,
JsonElement settingsElement = JsonSerializer.SerializeToElement(settings, typeInfo);
await client
- .Config.SetStreamServiceSettingsAsync(new SetStreamServiceSettingsRequestData(
+ .Config.SetStreamServiceSettingsAsync(
+ new SetStreamServiceSettingsRequestData(
streamServiceType: streamServiceType,
streamServiceSettings: settingsElement
),
@@ -101,14 +105,20 @@ await client
/// A token to cancel the operation.
/// Thrown if the type is not registered, OBS returns an error, or serialization fails.
/// Thrown if the client is not connected.
- public Task SetStreamServiceSettingsAsync(string streamServiceType,
+ public Task SetStreamServiceSettingsAsync(
+ string streamServiceType,
T settings,
CancellationToken cancellationToken = default
)
where T : class
{
JsonTypeInfo typeInfo = ObsWebSocketClientHelpers.GetRegisteredTypeInfo();
- return client.Config.SetStreamServiceSettingsAsync(streamServiceType, settings, typeInfo, cancellationToken);
+ return client.Config.SetStreamServiceSettingsAsync(
+ streamServiceType,
+ settings,
+ typeInfo,
+ cancellationToken
+ );
}
///
@@ -119,7 +129,8 @@ public Task SetStreamServiceSettingsAsync(string streamServiceType,
/// True if the target scene collection is active after the call; false if the switch failed (e.g., not found).
/// Thrown for unexpected OBS errors during the process.
/// Thrown if the client is not connected.
- public async Task EnsureSceneCollectionActiveAsync(string targetSceneCollectionName,
+ public async Task EnsureSceneCollectionActiveAsync(
+ string targetSceneCollectionName,
CancellationToken cancellationToken = default
)
{
@@ -146,21 +157,19 @@ public async Task EnsureSceneCollectionActiveAsync(string targetSceneColle
{
await client
.Config.SetCurrentSceneCollectionAsync(
- new SetCurrentSceneCollectionRequestData(sceneCollectionName: targetSceneCollectionName),
+ new SetCurrentSceneCollectionRequestData(
+ sceneCollectionName: targetSceneCollectionName
+ ),
cancellationToken: cancellationToken
)
.ConfigureAwait(false);
return true; // Switch command sent successfully
}
- catch (ObsWebSocketException ex)
- when (ex.Message.Contains("NotFound", StringComparison.OrdinalIgnoreCase)
- || // General not found
- ex.Message.Contains(
- $"code {(int)Core.Protocol.Generated.RequestStatus.ResourceNotFound}:",
- StringComparison.Ordinal
- )
- || // Specific code
- ex.Message.Contains("InvalidParameter", StringComparison.OrdinalIgnoreCase) // Might be InvalidParameter if name doesn't exist
+ // OBS answers a name it does not know with either status, depending on the request.
+ catch (ObsWebSocketRequestException ex)
+ when (ex.StatusCode
+ is RequestStatusCode.ResourceNotFound
+ or RequestStatusCode.InvalidRequestField
)
{
client._logger.LogWarning(
@@ -180,7 +189,8 @@ await client
/// True if the target profile is active after the call; false if the switch failed (e.g., not found).
/// Thrown for unexpected OBS errors during the process.
/// Thrown if the client is not connected.
- public async Task EnsureProfileActiveAsync(string targetProfileName,
+ public async Task EnsureProfileActiveAsync(
+ string targetProfileName,
CancellationToken cancellationToken = default
)
{
@@ -213,15 +223,11 @@ await client
.ConfigureAwait(false);
return true; // Switch command sent successfully
}
- catch (ObsWebSocketException ex)
- when (ex.Message.Contains("NotFound", StringComparison.OrdinalIgnoreCase)
- || // General not found
- ex.Message.Contains(
- $"code {(int)Core.Protocol.Generated.RequestStatus.ResourceNotFound}:",
- StringComparison.Ordinal
- )
- || // Specific code
- ex.Message.Contains("InvalidParameter", StringComparison.OrdinalIgnoreCase) // Might be InvalidParameter if name doesn't exist
+ // OBS answers a name it does not know with either status, depending on the request.
+ catch (ObsWebSocketRequestException ex)
+ when (ex.StatusCode
+ is RequestStatusCode.ResourceNotFound
+ or RequestStatusCode.InvalidRequestField
)
{
client._logger.LogWarning(
diff --git a/ObsWebSocket.Core/Groups/FiltersRequestGroup.cs b/ObsWebSocket.Core/Groups/FiltersGroup.cs
similarity index 87%
rename from ObsWebSocket.Core/Groups/FiltersRequestGroup.cs
rename to ObsWebSocket.Core/Groups/FiltersGroup.cs
index 7ee21ad..f70830c 100644
--- a/ObsWebSocket.Core/Groups/FiltersRequestGroup.cs
+++ b/ObsWebSocket.Core/Groups/FiltersGroup.cs
@@ -1,11 +1,11 @@
-using Microsoft.Extensions.Logging;
using System.Text.Json;
using System.Text.Json.Serialization.Metadata;
+using Microsoft.Extensions.Logging;
using ObsWebSocket.Core.Events;
using ObsWebSocket.Core.Events.Generated;
+using ObsWebSocket.Core.Networking;
using ObsWebSocket.Core.Protocol;
using ObsWebSocket.Core.Protocol.Common;
-using ObsWebSocket.Core.Networking;
using ObsWebSocket.Core.Protocol.Common.FilterSettings;
using ObsWebSocket.Core.Protocol.Common.InputSettings;
using ObsWebSocket.Core.Protocol.Generated;
@@ -17,7 +17,7 @@ namespace ObsWebSocket.Core;
///
/// Conveniences for the Filters category, alongside its generated requests.
///
-public readonly partial struct FiltersRequestGroup
+public readonly partial struct FiltersGroup
{
///
/// Retrieves the settings for a specific filter on a source and deserializes them using an explicit .
@@ -31,7 +31,8 @@ public readonly partial struct FiltersRequestGroup
/// The deserialized settings, or null if the source/filter is not found or deserialization fails.
/// Thrown for OBS errors other than 'ResourceNotFound'.
/// Thrown if the client is not connected.
- public async Task GetSourceFilterSettingsAsync(string sourceName,
+ public async Task GetSourceFilterSettingsAsync(
+ string sourceName,
string filterName,
JsonTypeInfo typeInfo,
CancellationToken cancellationToken = default
@@ -53,13 +54,8 @@ public readonly partial struct FiltersRequestGroup
)
.ConfigureAwait(false);
}
- catch (ObsWebSocketException ex)
- when (ex.Message.Contains("NotFound", StringComparison.OrdinalIgnoreCase)
- || ex.Message.Contains(
- $"code {(int)Core.Protocol.Generated.RequestStatus.ResourceNotFound}:",
- StringComparison.Ordinal
- )
- )
+ catch (ObsWebSocketRequestException ex)
+ when (ex.StatusCode is RequestStatusCode.ResourceNotFound)
{
return null;
}
@@ -96,14 +92,20 @@ public readonly partial struct FiltersRequestGroup
/// The deserialized settings, or null if the source/filter is not found or deserialization fails.
/// Thrown for OBS errors other than 'ResourceNotFound'.
/// Thrown if the client is not connected.
- public Task GetSourceFilterSettingsAsync(string sourceName,
+ public Task GetSourceFilterSettingsAsync