Skip to content

Commit 8682354

Browse files
authored
Fix project (#34)
* Remove project files * Initial commit: Blazor WASM SoundTest app with PWA support Introduces the SoundTest Blazor WebAssembly app for generating and playing test tones with selectable type and frequency. Features MudBlazor UI, audio device selection, shareable sound links, and JS interop for audio and clipboard. Includes PWA setup, service workers, icons, and responsive layout. * Code style and formatting improvements across project Refactored code for consistency and readability in multiple files, including .editorconfig, Razor components, JS, CSS, and project configuration. Standardized attribute formatting, improved enum and dictionary usage, clarified naming rules, and enhanced maintainability without changing functionality. * Update app name in manifest to "Sound Test" Changed the "name" and "short_name" fields in manifest.webmanifest from "SoundTest" to "Sound Test" for improved readability and consistency.
1 parent d58df4d commit 8682354

25 files changed

Lines changed: 100 additions & 181 deletions

.editorconfig

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ csharp_style_conditional_delegate_call = true:suggestion
102102

103103
# Modifier preferences
104104
csharp_prefer_static_local_function = true:suggestion
105-
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async
105+
csharp_preferred_modifier_order = public, private, protected, internal, static, extern, new, virtual, abstract, sealed, override, readonly, unsafe, volatile, async
106106

107107
# Code-block preferences
108108
csharp_prefer_braces = true:suggestion
@@ -198,26 +198,26 @@ dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
198198

199199
dotnet_naming_symbols.interface.applicable_kinds = interface
200200
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
201-
dotnet_naming_symbols.interface.required_modifiers =
201+
dotnet_naming_symbols.interface.required_modifiers =
202202

203203
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
204204
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
205-
dotnet_naming_symbols.types.required_modifiers =
205+
dotnet_naming_symbols.types.required_modifiers =
206206

207207
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
208208
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
209-
dotnet_naming_symbols.non_field_members.required_modifiers =
209+
dotnet_naming_symbols.non_field_members.required_modifiers =
210210

211211
# Naming styles
212212

213-
dotnet_naming_style.pascal_case.required_prefix =
214-
dotnet_naming_style.pascal_case.required_suffix =
215-
dotnet_naming_style.pascal_case.word_separator =
213+
dotnet_naming_style.pascal_case.required_prefix =
214+
dotnet_naming_style.pascal_case.required_suffix =
215+
dotnet_naming_style.pascal_case.word_separator =
216216
dotnet_naming_style.pascal_case.capitalization = pascal_case
217217

218218
dotnet_naming_style.begins_with_i.required_prefix = I
219-
dotnet_naming_style.begins_with_i.required_suffix =
220-
dotnet_naming_style.begins_with_i.word_separator =
219+
dotnet_naming_style.begins_with_i.required_suffix =
220+
dotnet_naming_style.begins_with_i.word_separator =
221221
dotnet_naming_style.begins_with_i.capitalization = pascal_case
222222
csharp_style_prefer_method_group_conversion = true:suggestion
223223
csharp_style_prefer_parameter_null_checking = true:suggestion

.vscode/launch.json

Lines changed: 0 additions & 11 deletions
This file was deleted.

.vscode/tasks.json

Lines changed: 0 additions & 42 deletions
This file was deleted.

SoundTest.code-workspace

Lines changed: 0 additions & 8 deletions
This file was deleted.

SoundTest.sln

Lines changed: 0 additions & 31 deletions
This file was deleted.

SoundTest.slnx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<Solution>
2+
<Folder Name="/Solution Items/">
3+
<File Path=".editorconfig"/>
4+
<File Path="global.json"/>
5+
</Folder>
6+
<Project Path="SoundTest/SoundTest.csproj"/>
7+
</Solution>

SoundTest/App.razor

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Router AppAssembly="@typeof(App).Assembly"
2+
NotFoundPage="typeof(NotFound)">
3+
<Found Context="routeData">
4+
<RouteView RouteData="@routeData"
5+
DefaultLayout="@typeof(MainLayout)"/>
6+
<FocusOnNavigate RouteData="@routeData"
7+
Selector="h1"/>
8+
</Found>
9+
</Router>

SoundTest/Components/App.razor

Lines changed: 0 additions & 18 deletions
This file was deleted.

SoundTest/Components/SoundComponent.razor.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
namespace SoundTest.Components;
1+
namespace SoundTest.Components;
22

33
public partial class SoundComponent(IJSRuntime jsRuntime, ISnackbar snackbar, NavigationManager navigation)
44
{
5+
private bool isJsInitialized;
56
private bool isPlaying;
6-
private string? soundLink;
77

88
private IJSObjectReference? module;
9-
private bool isJsInitialized;
9+
private string? soundLink;
1010

1111
private List<AudioDevice>? AudioDevices { get; set; }
1212

@@ -33,7 +33,7 @@ public int Frequency
3333
{
3434
< MinFrequency => MinFrequency,
3535
> MaxFrequency => MaxFrequency,
36-
_ => value,
36+
_ => value
3737
};
3838
_ = SetParametersAndUpdate();
3939
}
@@ -47,7 +47,7 @@ private async Task SetParametersAndUpdate()
4747

4848
private void UpdateUri()
4949
{
50-
var uri = navigation.GetUriWithQueryParameters(new Dictionary<string, object?>() { [nameof(Type)] = (int)Type, [nameof(Frequency)] = Frequency, });
50+
var uri = navigation.GetUriWithQueryParameters(new Dictionary<string, object?> { [nameof(Type)] = (int)Type, [nameof(Frequency)] = Frequency });
5151
soundLink = uri;
5252
}
5353

SoundTest/Components/SoundComponent.razor.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
let context = null;
1+
let context = null;
22
let osc = null;
33
let oscType = null;
44
let oscFreq = null;
@@ -42,14 +42,14 @@ export async function GetAudioOutputDevices() {
4242
devices = (await navigator.mediaDevices.enumerateDevices()).filter(function (entry) {
4343
return entry.kind === 'audiooutput' && entry.deviceId !== null && entry.deviceId !== "";
4444
});
45-
;
45+
4646

4747
if (devices === null || devices.length === 0) {
4848
await navigator.mediaDevices.getUserMedia({audio: true});
4949
devices = (await navigator.mediaDevices.enumerateDevices()).filter(function (entry) {
5050
return entry.kind === 'audiooutput' && entry.deviceId !== null && entry.deviceId !== "";
5151
});
52-
;
52+
5353
}
5454

5555
return devices;

0 commit comments

Comments
 (0)