Clean up code a bit

This commit is contained in:
Jiiniasu committed 2017-11-06 20:03:27 +01:00
1 parent ec64a797f5
commit 8d50d9f8d1
2 files changed
+24 -32

No files matched your search

+12 -16
View File
@@ -364,10 +364,7 @@ namespace VocaluxeLib.Menu.SongMenu
if (_SelectionNr > 0 && moveAllowed)
{
_SelectionNr--;
if (CBase.Config.GetAutoplayPreviews() == EOffOn.TR_CONFIG_ON)
{
_PreviewNr = _SelectionNr;
}
_AutoplayPreviewIfEnabled();
keyEvent.Handled = true;
}
break;
@@ -376,10 +373,7 @@ namespace VocaluxeLib.Menu.SongMenu
if (moveAllowed)
{
_SelectionNr++;
if (CBase.Config.GetAutoplayPreviews() == EOffOn.TR_CONFIG_ON)
{
_PreviewNr = _SelectionNr;
}
_AutoplayPreviewIfEnabled();
keyEvent.Handled = true;
}
break;
@@ -396,10 +390,7 @@ namespace VocaluxeLib.Menu.SongMenu
else if (_SelectionNr >= 1 && moveAllowed)
{
_SelectionNr -= 1;
if (CBase.Config.GetAutoplayPreviews() == EOffOn.TR_CONFIG_ON)
{
_PreviewNr = _SelectionNr;
}
_AutoplayPreviewIfEnabled();
keyEvent.Handled = true;
}
break;
@@ -416,10 +407,7 @@ namespace VocaluxeLib.Menu.SongMenu
else if (moveAllowed)
{
_SelectionNr += 1;
if(CBase.Config.GetAutoplayPreviews() == EOffOn.TR_CONFIG_ON)
{
_PreviewNr = _SelectionNr;
}
_AutoplayPreviewIfEnabled();
keyEvent.Handled = true;
}
break;
@@ -572,6 +560,14 @@ namespace VocaluxeLib.Menu.SongMenu
_UpdateListIfRequired();
}
private void _AutoplayPreviewIfEnabled()
{
if(CBase.Config.GetAutoplayPreviews() == EOffOn.TR_CONFIG_ON)
{
_PreviewNr = _SelectionNr;
}
}
private void _NextCategory()
{
if (CBase.Songs.IsInCategory())
+12 -16
View File
@@ -355,10 +355,7 @@ namespace VocaluxeLib.Menu.SongMenu
if (_SelectionNr > 0 && moveAllowed)
{
_SelectionNr--;
if (CBase.Config.GetAutoplayPreviews() == EOffOn.TR_CONFIG_ON)
{
_PreviewNr = _SelectionNr;
}
_AutoplayPreviewIfEnabled();
keyEvent.Handled = true;
}
break;
@@ -367,10 +364,7 @@ namespace VocaluxeLib.Menu.SongMenu
if (moveAllowed)
{
_SelectionNr++;
if (CBase.Config.GetAutoplayPreviews() == EOffOn.TR_CONFIG_ON)
{
_PreviewNr = _SelectionNr;
}
_AutoplayPreviewIfEnabled();
keyEvent.Handled = true;
}
break;
@@ -387,10 +381,7 @@ namespace VocaluxeLib.Menu.SongMenu
else if (_SelectionNr >= _NumW && moveAllowed)
{
_SelectionNr -= _NumW;
if (CBase.Config.GetAutoplayPreviews() == EOffOn.TR_CONFIG_ON)
{
_PreviewNr = _SelectionNr;
}
_AutoplayPreviewIfEnabled();
keyEvent.Handled = true;
}
break;
@@ -407,10 +398,7 @@ namespace VocaluxeLib.Menu.SongMenu
else if (moveAllowed)
{
_SelectionNr += _NumW;
if (CBase.Config.GetAutoplayPreviews() == EOffOn.TR_CONFIG_ON)
{
_PreviewNr = _SelectionNr;
}
_AutoplayPreviewIfEnabled();
keyEvent.Handled = true;
}
break;
@@ -535,6 +523,14 @@ namespace VocaluxeLib.Menu.SongMenu
_UpdateListIfRequired();
}
private void _AutoplayPreviewIfEnabled()
{
if (CBase.Config.GetAutoplayPreviews() == EOffOn.TR_CONFIG_ON)
{
_PreviewNr = _SelectionNr;
}
}
private void _NextCategory()
{
if (CBase.Songs.IsInCategory())