Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"version": 1,
"isRoot": true,
"tools": {
"csharpier": {
"version": "1.3.0",
"commands": [
"csharpier"
],
"rollForward": false
}
}
}
45 changes: 45 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
root = true


[*.cs]
# Formatting follows CSharpier; `dotnet csharpier check` enforces it in CI. These keys keep the IDE
# formatter consistent with it, and IDE0055 is off because some layouts, such as a multi-line
# constructor initializer before an empty body, cannot be expressed to it.
dotnet_diagnostic.IDE0055.severity = none
csharp_new_line_before_open_brace = all
csharp_new_line_before_else = true
csharp_new_line_before_catch = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_members_in_anonymous_types = true
csharp_new_line_between_query_expression_clauses = true
csharp_indent_block_contents = true
csharp_indent_braces = false
csharp_indent_case_contents = true
csharp_indent_case_contents_when_block = false
csharp_indent_switch_labels = true
csharp_indent_labels = one_less_than_current
csharp_preserve_single_line_blocks = true
csharp_preserve_single_line_statements = false
csharp_space_after_cast = false
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_after_comma = true
csharp_space_after_dot = false
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_after_semicolon_in_for_statement = true
csharp_space_around_binary_operators = before_and_after
csharp_space_around_declaration_statements = do_not_ignore
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_before_comma = false
csharp_space_before_dot = false
csharp_space_before_open_square_brackets = false
csharp_space_before_semicolon_in_for_statement = false
csharp_space_between_empty_square_brackets = false
csharp_space_between_method_call_empty_parameter_list_parentheses = false
csharp_space_between_method_call_name_and_opening_parenthesis = false
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
csharp_space_between_method_declaration_name_and_open_parenthesis = false
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_parentheses = false
csharp_space_between_square_brackets = false
9 changes: 7 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,16 @@ jobs:
dotnet-version: |
9.0.x
10.0.x
11.0.100-preview.7.26381.103
11.0.100-rc.1.26425.128

- name: Restore dependencies
run: dotnet restore WaveLink.Client.slnx

- name: Check formatting
run: |
dotnet tool restore
dotnet csharpier check .

- name: Clean solution
run: dotnet clean WaveLink.Client.slnx --configuration Release

Expand All @@ -57,7 +62,7 @@ jobs:

- name: Run tests
run: >
dotnet test WaveLink.Client.slnx
dotnet test --solution WaveLink.Client.slnx
--configuration Release
--no-build
-- --coverage --coverage-settings coverage.settings.xml --coverage-output-format cobertura --coverage-output coverage.cobertura.xml
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "11.0.100-preview.7.26381.103",
"version": "11.0.100-rc.1.26425.128",
"allowPrerelease": true,
"rollForward": "latestPreview"
},
Expand Down
25 changes: 17 additions & 8 deletions samples/WaveLink.Console/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
WaveLinkClient client = new();

client.Disconnected += (_, _) => Console.WriteLine("Disconnected.");
client.FocusedAppChanged += (_, e) => Console.WriteLine($"Focused app: {e.Name} ({e.Id}) -> channel {e.Channel?.Id}");
client.LevelMeterChanged += (_, e) => Console.WriteLine($"Level meters update: channels={e.Channels?.Count ?? 0}");
client.FocusedAppChanged += (_, e) =>
Console.WriteLine($"Focused app: {e.Name} ({e.Id}) -> channel {e.Channel?.Id}");
client.LevelMeterChanged += (_, e) =>
Console.WriteLine($"Level meters update: channels={e.Channels?.Count ?? 0}");

await client.ConnectAsync();

Expand All @@ -17,13 +19,20 @@
await client.GetMixesAsync();

// Subscribe to focused app changes and all channel meters
await client.SetSubscriptionAsync(new SetSubscriptionParams
{
FocusedAppChanged = new SubscriptionToggle { IsEnabled = true },
LevelMeterChanged = new LevelMeterSubscription { IsEnabled = true, Type = "channel", Id = "all" }
});
await client.SetSubscriptionAsync(
new SetSubscriptionParams
{
FocusedAppChanged = new SubscriptionToggle { IsEnabled = true },
LevelMeterChanged = new LevelMeterSubscription
{
IsEnabled = true,
Type = "channel",
Id = "all",
},
}
);

Console.WriteLine("Press Enter to exit.");
Console.ReadLine();

await client.DisposeAsync();
await client.DisposeAsync();
10 changes: 4 additions & 6 deletions samples/WaveLink.Console/WaveLink.Console.csproj
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<!-- The runtime pack is what a self-contained/AOT publish resolves, and the graph flags any
10.0.10 or older. Pin the serviced patch so the sample does not carry a known advisory. -->
<RuntimeFrameworkVersion Condition="'$(TargetFramework)' == 'net10.0'">10.0.11</RuntimeFrameworkVersion>
<TargetFramework>net11.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<LangVersion>preview</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<PublishAot>true</PublishAot>
<IsPackable>false</IsPackable>
<PublishAot>true</PublishAot>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/WaveLink.Client/JsonRpcModels.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,4 @@ public sealed record JsonRpcNotification
/// <summary>The parameters for the method call, or null for no parameters.</summary>
[JsonPropertyName("params")]
public JsonElement? Params { get; init; }
}
}
Loading
Loading