Removing two "Code Smells"

This commit is contained in:
Stefan authored and GitHub committed 2020-01-19 09:29:54 +01:00
1 parent 3fcb22269a
commit 64c0b392a9
1 file changed
+10 -16
+10 -16
View File
@@ -291,13 +291,10 @@ namespace Vocaluxe.Screens
// Restart Round and reload song file header
case Keys.R:
if (keyEvent.Mod == EModifier.Ctrl)
if (keyEvent.Mod == EModifier.Ctrl && _Pause)
{
if (_Pause)
{
_SetPause(false);
_RestartRound();
}
_SetPause(false);
_RestartRound();
}
break;
@@ -312,18 +309,15 @@ namespace Vocaluxe.Screens
// Skip 30 seconds
case Keys.Right:
if (keyEvent.Mod == EModifier.Ctrl)
if (keyEvent.Mod == EModifier.Ctrl && !_Pause)
{
if (!_Pause)
{
if (_TimerSongText.IsRunning)
_TimerSongText.Stop();
if (_TimerSongText.IsRunning)
_TimerSongText.Stop();
float newTime = _CurrentTime + 30f;
if (CSound.GetLength(_CurrentStream) < (_CurrentTime + 30f))
newTime = CSound.GetLength(_CurrentStream) - 1f;
CSound.SetPosition(_CurrentStream, newTime);
}
float newTime = _CurrentTime + 30f;
if (CSound.GetLength(_CurrentStream) < (_CurrentTime + 30f))
newTime = CSound.GetLength(_CurrentStream) - 1f;
CSound.SetPosition(_CurrentStream, newTime);
}
break;
}