Skip to content

Commit

Permalink
ref - No need to have the repopulate variable
Browse files Browse the repository at this point in the history
---

Type: ref
Breaking: False
Doc Required: False
Part: 1/1
  • Loading branch information
AptiviCEO committed Oct 16, 2023
1 parent f01ded2 commit 6193bc9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
12 changes: 3 additions & 9 deletions BassBoom.Cli/CliBase/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ internal static class Player
internal static int position = 0;
internal static bool advance = false;
internal static bool populate = true;
internal static bool regen = true;
internal static bool paused = false;
internal static string cachedLyric = "";
internal static readonly List<string> musicFiles = new();
Expand Down Expand Up @@ -114,13 +113,6 @@ public static void PlayerLoop()
TextWriterWhereColor.WriteWhere(ConsoleExtensions.GetClearLineToRightSequence(), 0, ConsoleWrappers.ActionWindowHeight() - 10);
cachedLyric = "";

// Regenerate as necessary
if (regen)
{
regen = false;
playerThread = new(HandlePlay);
}

// Wait for any keystroke
if (ConsoleWrappers.ActionKeyAvailable())
{
Expand Down Expand Up @@ -172,16 +164,19 @@ private static void HandleKeypressIdleMode(ConsoleKeyInfo keystroke)
PlayerControls.LowerVolume();
break;
case ConsoleKey.Spacebar:
playerThread = new(HandlePlay);
PlayerControls.Play();
break;
case ConsoleKey.B:
PlayerControls.SeekBeginning();
PlayerControls.PreviousSong();
playerThread = new(HandlePlay);
PlayerControls.Play();
break;
case ConsoleKey.N:
PlayerControls.SeekBeginning();
PlayerControls.NextSong();
playerThread = new(HandlePlay);
PlayerControls.Play();
break;
case ConsoleKey.H:
Expand Down Expand Up @@ -276,7 +271,6 @@ private static void HandlePlay()
lyricInstance = null;
rerender = true;
}
regen = true;
}

private static void HandleDraw()
Expand Down
2 changes: 0 additions & 2 deletions BassBoom.Cli/CliBase/PlayerControls.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,13 @@ internal static void Play()
internal static void Pause()
{
Player.advance = false;
Player.regen = true;
Player.paused = true;
PlaybackTools.Pause();
}

internal static void Stop(bool resetCurrentSong = true)
{
Player.advance = false;
Player.regen = true;
Player.paused = false;
if (resetCurrentSong)
Player.currentSong = 1;
Expand Down

0 comments on commit 6193bc9

Please sign in to comment.