Fix forgetting last song after singing.
This commit is contained in:
1 parent
388a5b4078
commit
5277504e34
2 files changed
+13
-5
No files matched your search
@@ -116,7 +116,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
|||||||
//the real selected song for singing
|
//the real selected song for singing
|
||||||
protected int _Locked { get; set; }
|
protected int _Locked { get; set; }
|
||||||
|
|
||||||
private int _PreviewIdInternal = -1;
|
protected int _PreviewIdInternal = -1;
|
||||||
protected virtual int _PreviewId
|
protected virtual int _PreviewId
|
||||||
{
|
{
|
||||||
get { return _PreviewIdInternal; }
|
get { return _PreviewIdInternal; }
|
||||||
@@ -523,7 +523,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
|||||||
CBase.Songs.SetCategory(-1);
|
CBase.Songs.SetCategory(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void _PlaySong(int nr)
|
protected void _PlaySong(int nr)
|
||||||
{
|
{
|
||||||
if (CBase.Songs.IsInCategory() && (_PreviewId != nr || _Streams.Count == 0))
|
if (CBase.Songs.IsInCategory() && (_PreviewId != nr || _Streams.Count == 0))
|
||||||
{
|
{
|
||||||
@@ -555,6 +555,8 @@ namespace VocaluxeLib.Menu.SongMenu
|
|||||||
_Streams.Add(stream);
|
_Streams.Add(stream);
|
||||||
_PreviewSongStream = stream;
|
_PreviewSongStream = stream;
|
||||||
|
|
||||||
|
_PreviewIdInternal = nr;
|
||||||
|
|
||||||
if (song.VideoFileName != "" && CBase.Config.GetVideoPreview() == EOffOn.TR_CONFIG_ON)
|
if (song.VideoFileName != "" && CBase.Config.GetVideoPreview() == EOffOn.TR_CONFIG_ON)
|
||||||
{
|
{
|
||||||
_PreviewVideoStream = CBase.Video.Load(Path.Combine(song.Folder, song.VideoFileName));
|
_PreviewVideoStream = CBase.Video.Load(Path.Combine(song.Folder, song.VideoFileName));
|
||||||
|
|||||||
@@ -67,9 +67,14 @@ namespace VocaluxeLib.Menu.SongMenu
|
|||||||
{
|
{
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
base._PreviewId = value;
|
base._PlaySong(value);
|
||||||
|
base._PreviewIdInternal = value;
|
||||||
_UpdatePreview();
|
_UpdatePreview();
|
||||||
}
|
}
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return base._PreviewIdInternal;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override int GetActualSelection()
|
public override int GetActualSelection()
|
||||||
@@ -222,7 +227,6 @@ namespace VocaluxeLib.Menu.SongMenu
|
|||||||
_EnterCategory(0);
|
_EnterCategory(0);
|
||||||
_ActualSelection = -1;
|
_ActualSelection = -1;
|
||||||
_Locked = -1;
|
_Locked = -1;
|
||||||
_PreviewId = -1;
|
|
||||||
_UpdateList(0, true);
|
_UpdateList(0, true);
|
||||||
//AfterCategoryChange();
|
//AfterCategoryChange();
|
||||||
SetSelectedSong(_PreviewId);
|
SetSelectedSong(_PreviewId);
|
||||||
@@ -372,8 +376,9 @@ namespace VocaluxeLib.Menu.SongMenu
|
|||||||
|
|
||||||
if (!keyEvent.Handled)
|
if (!keyEvent.Handled)
|
||||||
{
|
{
|
||||||
_PreviewId = _Locked;
|
|
||||||
_ActualSelection = _Locked;
|
_ActualSelection = _Locked;
|
||||||
|
if (_PreviewId != _Locked)
|
||||||
|
_PreviewId = _Locked;
|
||||||
|
|
||||||
for (int i = 0; i < _Tiles.Count; i++)
|
for (int i = 0; i < _Tiles.Count; i++)
|
||||||
_Tiles[i].Selected = _Locked == i + _Offset;
|
_Tiles[i].Selected = _Locked == i + _Offset;
|
||||||
@@ -554,6 +559,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
|||||||
|
|
||||||
public override void SetSelectedSong(int visibleSongNr)
|
public override void SetSelectedSong(int visibleSongNr)
|
||||||
{
|
{
|
||||||
|
base._PlaySong(visibleSongNr);
|
||||||
base.SetSelectedSong(visibleSongNr);
|
base.SetSelectedSong(visibleSongNr);
|
||||||
|
|
||||||
if (visibleSongNr >= 0 && visibleSongNr < CBase.Songs.GetNumSongsVisible())
|
if (visibleSongNr >= 0 && visibleSongNr < CBase.Songs.GetNumSongsVisible())
|
||||||
|
|||||||
Reference in new issue
Block a user