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
18 changes: 9 additions & 9 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ csharp_style_conditional_delegate_call = true:suggestion

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

# Code-block preferences
csharp_prefer_braces = true:suggestion
Expand Down Expand Up @@ -198,26 +198,26 @@ dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case

dotnet_naming_symbols.interface.applicable_kinds = interface
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.interface.required_modifiers =
dotnet_naming_symbols.interface.required_modifiers =

dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.types.required_modifiers =
dotnet_naming_symbols.types.required_modifiers =

dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.non_field_members.required_modifiers =
dotnet_naming_symbols.non_field_members.required_modifiers =

# Naming styles

dotnet_naming_style.pascal_case.required_prefix =
dotnet_naming_style.pascal_case.required_suffix =
dotnet_naming_style.pascal_case.word_separator =
dotnet_naming_style.pascal_case.required_prefix =
dotnet_naming_style.pascal_case.required_suffix =
dotnet_naming_style.pascal_case.word_separator =
dotnet_naming_style.pascal_case.capitalization = pascal_case

dotnet_naming_style.begins_with_i.required_prefix = I
dotnet_naming_style.begins_with_i.required_suffix =
dotnet_naming_style.begins_with_i.word_separator =
dotnet_naming_style.begins_with_i.required_suffix =
dotnet_naming_style.begins_with_i.word_separator =
dotnet_naming_style.begins_with_i.capitalization = pascal_case
csharp_style_prefer_method_group_conversion = true:suggestion
csharp_style_prefer_parameter_null_checking = true:suggestion
Expand Down
11 changes: 0 additions & 11 deletions .vscode/launch.json

This file was deleted.

42 changes: 0 additions & 42 deletions .vscode/tasks.json

This file was deleted.

8 changes: 0 additions & 8 deletions SoundTest.code-workspace

This file was deleted.

31 changes: 0 additions & 31 deletions SoundTest.sln

This file was deleted.

7 changes: 7 additions & 0 deletions SoundTest.slnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Solution>
<Folder Name="/Solution Items/">
<File Path=".editorconfig"/>
<File Path="global.json"/>
</Folder>
<Project Path="SoundTest/SoundTest.csproj"/>
</Solution>
9 changes: 9 additions & 0 deletions SoundTest/App.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Router AppAssembly="@typeof(App).Assembly"
NotFoundPage="typeof(NotFound)">
<Found Context="routeData">
<RouteView RouteData="@routeData"
DefaultLayout="@typeof(MainLayout)"/>
<FocusOnNavigate RouteData="@routeData"
Selector="h1"/>
</Found>
</Router>
18 changes: 0 additions & 18 deletions SoundTest/Components/App.razor

This file was deleted.

10 changes: 5 additions & 5 deletions SoundTest/Components/SoundComponent.razor.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
namespace SoundTest.Components;
namespace SoundTest.Components;

public partial class SoundComponent(IJSRuntime jsRuntime, ISnackbar snackbar, NavigationManager navigation)
{
private bool isJsInitialized;
private bool isPlaying;
private string? soundLink;

private IJSObjectReference? module;
private bool isJsInitialized;
private string? soundLink;

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

Expand All @@ -33,7 +33,7 @@ public int Frequency
{
< MinFrequency => MinFrequency,
> MaxFrequency => MaxFrequency,
_ => value,
_ => value
};
_ = SetParametersAndUpdate();
}
Expand All @@ -47,7 +47,7 @@ private async Task SetParametersAndUpdate()

private void UpdateUri()
{
var uri = navigation.GetUriWithQueryParameters(new Dictionary<string, object?>() { [nameof(Type)] = (int)Type, [nameof(Frequency)] = Frequency, });
var uri = navigation.GetUriWithQueryParameters(new Dictionary<string, object?> { [nameof(Type)] = (int)Type, [nameof(Frequency)] = Frequency });
soundLink = uri;
}

Expand Down
6 changes: 3 additions & 3 deletions SoundTest/Components/SoundComponent.razor.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
let context = null;
let context = null;
let osc = null;
let oscType = null;
let oscFreq = null;
Expand Down Expand Up @@ -42,14 +42,14 @@ export async function GetAudioOutputDevices() {
devices = (await navigator.mediaDevices.enumerateDevices()).filter(function (entry) {
return entry.kind === 'audiooutput' && entry.deviceId !== null && entry.deviceId !== "";
});
;


if (devices === null || devices.length === 0) {
await navigator.mediaDevices.getUserMedia({audio: true});
devices = (await navigator.mediaDevices.enumerateDevices()).filter(function (entry) {
return entry.kind === 'audiooutput' && entry.deviceId !== null && entry.deviceId !== "";
});
;

}

return devices;
Expand Down
16 changes: 8 additions & 8 deletions SoundTest/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

public static class Constants
{
public enum Types
{
Sine,
Square,
Triangle,
Sawtooth
}

public const int MinFrequency = 1;

public const int MaxFrequency = 1500; // 20154;
Expand All @@ -11,12 +19,4 @@ public static class Constants
public const int NeuroFrequency = 852;

public const decimal PerfectCFrequency = 261.63M; // C4

public enum Types
{
Sine,
Square,
Triangle,
Sawtooth,
}
}
4 changes: 3 additions & 1 deletion SoundTest/GlobalUsings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
global using Microsoft.JSInterop;
global using MudBlazor;
global using MudBlazor.Services;
global using SoundTest.Components;
global using SoundTest.Layout;
global using SoundTest.Pages;
global using System.Diagnostics;
global using System.Runtime.InteropServices.JavaScript;
global using static SoundTest.Constants;
global using SoundTest;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace SoundTest.Components.Layout;
namespace SoundTest.Layout;

public partial class MainLayout
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
</PageTitle>

<SoundComponent Type="@((Types)Type)"
Frequency="@Frequency" />
Frequency="@Frequency"/>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace SoundTest.Components.Pages;
namespace SoundTest.Pages;

public partial class Home
{
Expand Down
5 changes: 5 additions & 0 deletions SoundTest/Pages/NotFound.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@page "/not-found"
@layout MainLayout

<h3>Not Found</h3>
<p>Sorry, the content you are looking for does not exist.</p>
22 changes: 3 additions & 19 deletions SoundTest/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
{
"$schema": "http://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:38548",
"sslPort": 44368
}
},
"$schema": "https://json.schemastore.org/launchsettings.json",
"profiles": {
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
"applicationUrl": "http://localhost:5046",
"applicationUrl": "http://localhost:5129",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
Expand All @@ -24,15 +16,7 @@
"dotnetRunMessages": true,
"launchBrowser": true,
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
"applicationUrl": "https://localhost:7095;http://localhost:5046",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
"applicationUrl": "https://localhost:7079;http://localhost:5129",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
Expand Down
3 changes: 2 additions & 1 deletion SoundTest/SoundTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<OverrideHtmlAssetPlaceholders>true</OverrideHtmlAssetPlaceholders>
<BlazorEnableTimeZoneSupport>false</BlazorEnableTimeZoneSupport>
<BlazorWebAssemblyPreserveCollationData>false</BlazorWebAssemblyPreserveCollationData>
<InvariantGlobalization>true</InvariantGlobalization>
Expand All @@ -18,7 +19,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="10.0.0"/>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="10.0.0" PrivateAssets="all"/>
<PackageReference Include="MudBlazor" Version="8.14.0"/>
<PackageReference Include="MudBlazor" Version="8.15.0"/>
</ItemGroup>

<ItemGroup>
Expand Down
8 changes: 5 additions & 3 deletions SoundTest/_Imports.razor
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
@using Microsoft.AspNetCore.Components.Web.Virtualization
@using Microsoft.AspNetCore.Components.WebAssembly.Http
@using Microsoft.JSInterop
@using MudBlazor
@using SoundTest
@using SoundTest.Components
@using SoundTest.Components.Layout
@using static SoundTest.Constants
@using SoundTest.Layout
@using SoundTest.Pages
@using MudBlazor

@using static Constants
5 changes: 3 additions & 2 deletions SoundTest/wwwroot/css/app.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
.loading-progress {
position: relative;
position: absolute;
display: block;
width: 8rem;
height: 8rem;
margin: 20vh auto 1rem auto;
inset: 20vh 0 auto 0;
margin: 0 auto 0 auto;
}

.loading-progress circle {
Expand Down
Loading