Skip to content

Commit

Permalink
Updated to correctly bind booleans to checkboxes.
Browse files Browse the repository at this point in the history
  • Loading branch information
KristofferStrube committed Oct 1, 2024
1 parent d2f41c6 commit 3769faa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@
}
<br />
<label for="noise-suppression">Noise Suppression</label>
<input type="checkbox" id="noise-suppression" @bind-value=SVGElement.NoiseSuppresion @bind-value:after="SetMediaStreamAudioSourceNode" />
<input type="checkbox" id="noise-suppression" @bind=SVGElement.NoiseSuppresion @bind:after="SetMediaStreamAudioSourceNode" />
<br />
<label for="echo-cancellation">EchoCancellation</label>
<input type="checkbox" id="echo-cancellation" @bind-value=SVGElement.EchoCancellation @bind-value:after="SetMediaStreamAudioSourceNode" />
<label for="echo-cancellation">Echo Cancellation</label>
<input type="checkbox" id="echo-cancellation" @bind=SVGElement.EchoCancellation @bind:after="SetMediaStreamAudioSourceNode" />
</foreignObject>
<ContextMenuTrigger MenuId="SVGMenu" WrapperTag="g" Data=@(new Port(SVGElement, false)) MouseButtonTrigger="SVGElement.ShouldTriggerContextMenu ? MouseButtonTrigger.Right : (MouseButtonTrigger)4">
<circle cx=@((SVGElement.X+SVGElement.Width).AsString()) cy="@((SVGElement.Y+20).AsString())" r="10" fill="grey">
Expand All @@ -60,7 +60,7 @@
if (mediaStreamAudioSourceNode is null && AudioContext is not null)
{
mediaStreamAudioSourceNode = (MediaStreamAudioSourceNode)await SVGElement.AudioNode(AudioContext);
StateHasChanged();
await InvokeAsync(StateHasChanged);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ public MediaStreamAudioSource(IElement element, SVGEditor.SVGEditor svg) : base(

public async Task SetMediaStreamAudioSourceNode(AudioContext context)
{

MediaDevicesService mediaDevicesService = new(context.JSRuntime);
MediaDevices mediaDevices = await mediaDevicesService.GetMediaDevicesAsync();

Expand Down Expand Up @@ -101,6 +100,8 @@ public bool EchoCancellation
StrokeWidth = "2",
Height = 100,
Width = 250,
NoiseSuppresion = true,
EchoCancellation = true,
};

(node.X, node.Y) = SVG.LocalDetransform(SVG.LastRightClick);
Expand Down

0 comments on commit 3769faa

Please sign in to comment.