Merge branch 'develop' of github.com:Vocaluxe/Vocaluxe into player-guid
This commit is contained in:
commit
d140c2311a
15 files changed
+267
-49
No files matched your search
@@ -56,6 +56,8 @@ namespace VocaluxeLib
|
||||
IEnumerable<string> GetSongFolders();
|
||||
ESongSorting GetSongSorting();
|
||||
EOffOn GetTabs();
|
||||
EOffOn GetAutoplayPreviews();
|
||||
int GetAutoplayPreviewDelay();
|
||||
EOffOn GetIgnoreArticles();
|
||||
|
||||
bool IsMicConfigured(int playerNr);
|
||||
|
||||
@@ -158,6 +158,9 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
}
|
||||
}
|
||||
|
||||
protected int _AutoplayDelayinMs = CBase.Config.GetAutoplayPreviewDelay();
|
||||
protected System.Timers.Timer _AutoplayTimer = new System.Timers.Timer();
|
||||
|
||||
private SColorF _ColorInternal;
|
||||
protected SColorF _Color
|
||||
{
|
||||
@@ -204,6 +207,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
public virtual void Init()
|
||||
{
|
||||
_ResetPreview(false);
|
||||
_InitializeAutoplayTimer();
|
||||
_Initialized = true;
|
||||
}
|
||||
|
||||
@@ -358,6 +362,42 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
_PreviewNrInternal = -1;
|
||||
}
|
||||
|
||||
protected void _PreviewSelectedSong()
|
||||
{
|
||||
_PreviewNr = _SelectionNr;
|
||||
}
|
||||
|
||||
protected void _InitializeAutoplayTimer()
|
||||
{
|
||||
_AutoplayTimer.Interval = _AutoplayDelayinMs;
|
||||
_AutoplayTimer.AutoReset = false;
|
||||
_AutoplayTimer.Elapsed += (object sender, System.Timers.ElapsedEventArgs e) =>
|
||||
{
|
||||
_PreviewSelectedSong();
|
||||
};
|
||||
}
|
||||
|
||||
protected void _AutoplayPreviewIfEnabled()
|
||||
{
|
||||
if (CBase.Config.GetAutoplayPreviews() == EOffOn.TR_CONFIG_ON)
|
||||
{
|
||||
_PlayPreviewAfterDelay();
|
||||
}
|
||||
}
|
||||
|
||||
protected void _PlayPreviewAfterDelay()
|
||||
{
|
||||
if (!_AutoplayTimer.Enabled)
|
||||
{
|
||||
_AutoplayTimer.Start();
|
||||
}
|
||||
else
|
||||
{
|
||||
_AutoplayTimer.Stop();
|
||||
_AutoplayTimer.Start();
|
||||
}
|
||||
}
|
||||
|
||||
#region ThemeEdit
|
||||
public void MoveElement(int stepX, int stepY)
|
||||
{
|
||||
|
||||
@@ -204,7 +204,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
public override void Update(SScreenSongOptions songOptions)
|
||||
{
|
||||
if (songOptions.Selection.RandomOnly)
|
||||
_PreviewNr = _SelectionNr;
|
||||
_PreviewSelectedSong();
|
||||
|
||||
if (_Length < 0 && CBase.Songs.IsInCategory() && CBase.BackgroundMusic.GetLength() > 0)
|
||||
_UpdateLength(CBase.Songs.GetVisibleSong(_PreviewNr));
|
||||
@@ -300,7 +300,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
SetSelectedSong(_SelectionNr < 0 ? 0 : _SelectionNr);
|
||||
else
|
||||
SetSelectedCategory(_SelectionNr < 0 ? 0 : _SelectionNr);
|
||||
_PreviewNr = _SelectionNr;
|
||||
_PreviewSelectedSong();
|
||||
_UpdateListIfRequired();
|
||||
}
|
||||
|
||||
@@ -323,7 +323,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
{
|
||||
if (_SelectionNr >= 0 && _PreviewNr != _SelectionNr)
|
||||
{
|
||||
_PreviewNr = _SelectionNr;
|
||||
_PreviewSelectedSong();
|
||||
keyEvent.Handled = true;
|
||||
}
|
||||
}
|
||||
@@ -364,6 +364,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
if (_SelectionNr > 0 && moveAllowed)
|
||||
{
|
||||
_SelectionNr--;
|
||||
_AutoplayPreviewIfEnabled();
|
||||
keyEvent.Handled = true;
|
||||
}
|
||||
break;
|
||||
@@ -372,6 +373,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
if (moveAllowed)
|
||||
{
|
||||
_SelectionNr++;
|
||||
_AutoplayPreviewIfEnabled();
|
||||
keyEvent.Handled = true;
|
||||
}
|
||||
break;
|
||||
@@ -388,6 +390,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
else if (_SelectionNr >= 1 && moveAllowed)
|
||||
{
|
||||
_SelectionNr -= 1;
|
||||
_AutoplayPreviewIfEnabled();
|
||||
keyEvent.Handled = true;
|
||||
}
|
||||
break;
|
||||
@@ -404,12 +407,13 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
else if (moveAllowed)
|
||||
{
|
||||
_SelectionNr += 1;
|
||||
_AutoplayPreviewIfEnabled();
|
||||
keyEvent.Handled = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (!CBase.Songs.IsInCategory())
|
||||
_PreviewNr = _SelectionNr;
|
||||
_PreviewSelectedSong();
|
||||
return keyEvent.Handled;
|
||||
}
|
||||
|
||||
@@ -469,7 +473,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
{
|
||||
if (_PreviewNr == _SelectionNr)
|
||||
return false;
|
||||
_PreviewNr = _SelectionNr;
|
||||
_PreviewSelectedSong();
|
||||
}
|
||||
else
|
||||
EnterSelectedCategory();
|
||||
|
||||
@@ -195,7 +195,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
public override void Update(SScreenSongOptions songOptions)
|
||||
{
|
||||
if (songOptions.Selection.RandomOnly)
|
||||
_PreviewNr = _SelectionNr;
|
||||
_PreviewSelectedSong();
|
||||
|
||||
if (_Length < 0 && CBase.Songs.IsInCategory() && CBase.BackgroundMusic.GetLength() > 0)
|
||||
_UpdateLength(CBase.Songs.GetVisibleSong(_PreviewNr));
|
||||
@@ -291,7 +291,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
SetSelectedSong(_SelectionNr < 0 ? 0 : _SelectionNr);
|
||||
else
|
||||
SetSelectedCategory(_SelectionNr < 0 ? 0 : _SelectionNr);
|
||||
_PreviewNr = _SelectionNr;
|
||||
_PreviewSelectedSong();
|
||||
_UpdateListIfRequired();
|
||||
}
|
||||
|
||||
@@ -314,7 +314,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
{
|
||||
if (_SelectionNr >= 0 && _PreviewNr != _SelectionNr)
|
||||
{
|
||||
_PreviewNr = _SelectionNr;
|
||||
_PreviewSelectedSong();
|
||||
keyEvent.Handled = true;
|
||||
}
|
||||
}
|
||||
@@ -355,6 +355,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
if (_SelectionNr > 0 && moveAllowed)
|
||||
{
|
||||
_SelectionNr--;
|
||||
_AutoplayPreviewIfEnabled();
|
||||
keyEvent.Handled = true;
|
||||
}
|
||||
break;
|
||||
@@ -363,6 +364,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
if (moveAllowed)
|
||||
{
|
||||
_SelectionNr++;
|
||||
_AutoplayPreviewIfEnabled();
|
||||
keyEvent.Handled = true;
|
||||
}
|
||||
break;
|
||||
@@ -379,6 +381,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
else if (_SelectionNr >= _NumW && moveAllowed)
|
||||
{
|
||||
_SelectionNr -= _NumW;
|
||||
_AutoplayPreviewIfEnabled();
|
||||
keyEvent.Handled = true;
|
||||
}
|
||||
break;
|
||||
@@ -395,12 +398,13 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
else if (moveAllowed)
|
||||
{
|
||||
_SelectionNr += _NumW;
|
||||
_AutoplayPreviewIfEnabled();
|
||||
keyEvent.Handled = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (!CBase.Songs.IsInCategory())
|
||||
_PreviewNr = _SelectionNr;
|
||||
_PreviewSelectedSong();
|
||||
return keyEvent.Handled;
|
||||
}
|
||||
|
||||
@@ -456,7 +460,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
{
|
||||
if (_PreviewNr == _SelectionNr)
|
||||
return false;
|
||||
_PreviewNr = _SelectionNr;
|
||||
_PreviewSelectedSong();
|
||||
}
|
||||
else
|
||||
EnterSelectedCategory();
|
||||
|
||||
Reference in new issue
Block a user