Skip to content

Commit

Permalink
Probably fixed a bug with the jukebox fades applying instantly the
Browse files Browse the repository at this point in the history
target volue (finished condition check was reversed), also removed
some old commented out code
  • Loading branch information
hhyyrylainen committed Dec 14, 2020
1 parent 5e138ec commit 2f71a15
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions src/general/Jukebox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,16 +126,6 @@ public override void _Process(float delta)
if (operations.Peek().Action(delta))
operations.Dequeue();
}

// // Check if a stream has ended
// foreach (var player in audioPlayers)
// {
// if (!player.Playing)
// {
// OnSomeTrackEnded();
// break;
// }
// }
}

private void UpdateStreamsPauseStatus()
Expand Down Expand Up @@ -264,7 +254,7 @@ private void AddFadeOut()

bool finished = data.TimeLeft <= 0;

if (finished)
if (!finished)
{
AdjustVolume(FADE_PER_TIME_UNIT * delta);
}
Expand All @@ -286,7 +276,7 @@ private void AddFadeIn()

bool finished = data.TimeLeft <= 0;

if (finished)
if (!finished)
{
AdjustVolume(-1 * FADE_PER_TIME_UNIT * delta);
}
Expand Down

0 comments on commit 2f71a15

Please sign in to comment.