Skip to content

Commit

Permalink
imp - Navigation sounds should not play twice
Browse files Browse the repository at this point in the history
---

When the terminal reader is busy with TermReader.IsReaderBusy being true,
we shouldn't attempt to play the audio cue from ReadKey().

---

Type: imp
Breaking: False
Doc Required: False
Backport Required: False
Part: 1/1
  • Loading branch information
AptiviCEO committed Feb 16, 2025
1 parent 55a7732 commit 7a9c86d
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion private/Nitrocid.Tests/Nitrocid.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@

<ItemGroup>
<PackageReference Include="Shouldly" Version="4.3.0" />
<PackageReference Include="Terminaux" Version="6.1.5" />
<PackageReference Include="Terminaux" Version="6.1.6" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<!-- Extras.Images.Icons addon Platform Information End -->

<ItemGroup>
<PackageReference Include="Terminaux.Images.Icons" Version="6.1.5" />
<PackageReference Include="Terminaux.Images.Icons" Version="6.1.6" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="[4.8.0]" />
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="[4.8.0]" />
<PackageReference Include="Terminaux" Version="6.1.5" />
<PackageReference Include="Terminaux" Version="6.1.6" />
</ItemGroup>

<Import Project="..\Nitrocid.Analyzers.Common\Nitrocid.Analyzers.Common.projitems" Label="Shared" />
Expand Down
2 changes: 1 addition & 1 deletion public/Nitrocid.Locales/Nitrocid.Locales.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="[4.8.0]" />
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="[4.8.0]" />
<PackageReference Include="Terminaux" Version="6.1.5" />
<PackageReference Include="Terminaux" Version="6.1.6" />
</ItemGroup>

<ItemGroup>
Expand Down
3 changes: 2 additions & 1 deletion public/Nitrocid/Drivers/Console/BaseConsoleDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
using Nitrocid.ConsoleBase.Colors;
using Nitrocid.Kernel.Configuration;
using Nitrocid.Misc.Audio;
using Terminaux.Reader;

namespace Nitrocid.Drivers.Console
{
Expand Down Expand Up @@ -293,7 +294,7 @@ public virtual ConsoleKeyInfo ReadKey(bool intercept = false)
{
var keyInfo = SystemConsole.ReadKey(intercept);
_moved = true;
if (Config.MainConfig.EnableNavigationSounds)
if (Config.MainConfig.EnableNavigationSounds && !TermReader.IsReaderBusy)
AudioCuesTools.PlayAudioCue(AudioCueType.KeyboardCueType);
return keyInfo;
}
Expand Down
4 changes: 2 additions & 2 deletions public/Nitrocid/Nitrocid.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@

<!-- KS Non-private Dependencies Information -->
<ItemGroup>
<PackageReference Include="Terminaux" Version="6.1.5" PrivateAssets="contentfiles;analyzers;build;runtime;native" />
<PackageReference Include="Terminaux.Images" Version="6.1.5" PrivateAssets="contentfiles;analyzers;build;runtime;native" />
<PackageReference Include="Terminaux" Version="6.1.6" PrivateAssets="contentfiles;analyzers;build;runtime;native" />
<PackageReference Include="Terminaux.Images" Version="6.1.6" PrivateAssets="contentfiles;analyzers;build;runtime;native" />
<PackageReference Include="Textify.Offline" Version="2.9.0" PrivateAssets="contentfiles;analyzers;build;runtime">
<Aliases>global,TextifyDep</Aliases>
</PackageReference>
Expand Down

0 comments on commit 7a9c86d

Please sign in to comment.