added duet filter
This commit is contained in:
1 parent
2d38c10905
commit
aabfc72af5
5 files changed
+25
-12
No files matched your search
@@ -149,6 +149,7 @@ namespace Vocaluxe.PartyModes
|
|||||||
|
|
||||||
_ScreenSongOptions.Sorting.SearchString = String.Empty;
|
_ScreenSongOptions.Sorting.SearchString = String.Empty;
|
||||||
_ScreenSongOptions.Sorting.SearchStringVisible = false;
|
_ScreenSongOptions.Sorting.SearchStringVisible = false;
|
||||||
|
_ScreenSongOptions.Sorting.ShowDuetSongs = false;
|
||||||
|
|
||||||
_Stage = EStage.NotStarted;
|
_Stage = EStage.NotStarted;
|
||||||
|
|
||||||
|
|||||||
+20
-10
@@ -51,6 +51,7 @@ namespace Vocaluxe.Base
|
|||||||
private static EOffOn _Tabs = CConfig.Tabs;
|
private static EOffOn _Tabs = CConfig.Tabs;
|
||||||
private static EOffOn _IgnoreArticles = CConfig.IgnoreArticles;
|
private static EOffOn _IgnoreArticles = CConfig.IgnoreArticles;
|
||||||
private static ESongSorting _SongSorting = CConfig.SongSorting;
|
private static ESongSorting _SongSorting = CConfig.SongSorting;
|
||||||
|
private static bool _ShowDuetSongs = true;
|
||||||
|
|
||||||
private static Thread _CoverLoaderThread = new Thread(new ThreadStart(_LoadCover));
|
private static Thread _CoverLoaderThread = new Thread(new ThreadStart(_LoadCover));
|
||||||
|
|
||||||
@@ -61,11 +62,11 @@ namespace Vocaluxe.Base
|
|||||||
{
|
{
|
||||||
if (value.Length > 0)
|
if (value.Length > 0)
|
||||||
{
|
{
|
||||||
_Sort(_SongSorting, EOffOn.TR_CONFIG_OFF, _IgnoreArticles, value, false);
|
_Sort(_SongSorting, EOffOn.TR_CONFIG_OFF, _IgnoreArticles, value, false, _ShowDuetSongs);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_Sort(_SongSorting, _Tabs, _IgnoreArticles, value, false);
|
_Sort(_SongSorting, _Tabs, _IgnoreArticles, value, false, _ShowDuetSongs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -324,15 +325,20 @@ namespace Vocaluxe.Base
|
|||||||
|
|
||||||
public static void Sort(ESongSorting Sorting, EOffOn Tabs, EOffOn IgnoreArticles, String SearchString)
|
public static void Sort(ESongSorting Sorting, EOffOn Tabs, EOffOn IgnoreArticles, String SearchString)
|
||||||
{
|
{
|
||||||
_Sort(Sorting, Tabs, IgnoreArticles, SearchString, false);
|
_Sort(Sorting, Tabs, IgnoreArticles, SearchString, false, _ShowDuetSongs);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void _Sort(ESongSorting Sorting, EOffOn Tabs, EOffOn IgnoreArticles, string SearchString, bool force)
|
public static void Sort(ESongSorting Sorting, EOffOn Tabs, EOffOn IgnoreArticles, String SearchString, bool ShowDuetSongs)
|
||||||
|
{
|
||||||
|
_Sort(Sorting, Tabs, IgnoreArticles, SearchString, false, ShowDuetSongs);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void _Sort(ESongSorting Sorting, EOffOn Tabs, EOffOn IgnoreArticles, string SearchString, bool force, bool ShowDuetSongs)
|
||||||
{
|
{
|
||||||
if (_Songs.Count == 0)
|
if (_Songs.Count == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!force && Sorting == _SongSorting && Tabs == _Tabs && IgnoreArticles == _IgnoreArticles && SearchString == _SearchFilter)
|
if (!force && Sorting == _SongSorting && Tabs == _Tabs && IgnoreArticles == _IgnoreArticles && SearchString == _SearchFilter && ShowDuetSongs == _ShowDuetSongs)
|
||||||
return; //nothing to do
|
return; //nothing to do
|
||||||
|
|
||||||
_Categories.Clear();
|
_Categories.Clear();
|
||||||
@@ -341,6 +347,7 @@ namespace Vocaluxe.Base
|
|||||||
_IgnoreArticles = IgnoreArticles;
|
_IgnoreArticles = IgnoreArticles;
|
||||||
_SongSorting = Sorting;
|
_SongSorting = Sorting;
|
||||||
_Tabs = Tabs;
|
_Tabs = Tabs;
|
||||||
|
_ShowDuetSongs = ShowDuetSongs;
|
||||||
|
|
||||||
_SearchFilter = SearchString;
|
_SearchFilter = SearchString;
|
||||||
|
|
||||||
@@ -349,12 +356,15 @@ namespace Vocaluxe.Base
|
|||||||
|
|
||||||
foreach (CSong song in _Songs)
|
foreach (CSong song in _Songs)
|
||||||
{
|
{
|
||||||
if (_SearchFilter == String.Empty)
|
if (!song.IsDuet || _ShowDuetSongs)
|
||||||
_SongList.Add(song);
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
if (song.Title.ToUpper().Contains(_SearchFilter.ToUpper()) || song.Artist.ToUpper().Contains(_SearchFilter.ToUpper()))
|
if (_SearchFilter == String.Empty)
|
||||||
_SongList.Add(song);
|
_SongList.Add(song);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (song.Title.ToUpper().Contains(_SearchFilter.ToUpper()) || song.Artist.ToUpper().Contains(_SearchFilter.ToUpper()))
|
||||||
|
_SongList.Add(song);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -955,7 +965,7 @@ namespace Vocaluxe.Base
|
|||||||
CLog.StopBenchmark(2, "Read TXTs");
|
CLog.StopBenchmark(2, "Read TXTs");
|
||||||
|
|
||||||
CLog.StartBenchmark(2, "Sort Songs");
|
CLog.StartBenchmark(2, "Sort Songs");
|
||||||
_Sort(CConfig.SongSorting, CConfig.Tabs, CConfig.IgnoreArticles, String.Empty, true);
|
_Sort(CConfig.SongSorting, CConfig.Tabs, CConfig.IgnoreArticles, String.Empty, true, true);
|
||||||
CLog.StopBenchmark(2, "Sort Songs");
|
CLog.StopBenchmark(2, "Sort Songs");
|
||||||
Category = -1;
|
Category = -1;
|
||||||
_SongsLoaded = true;
|
_SongsLoaded = true;
|
||||||
|
|||||||
@@ -615,7 +615,7 @@ namespace Vocaluxe.Screens
|
|||||||
base.OnShow();
|
base.OnShow();
|
||||||
|
|
||||||
_sso = CParty.GetSongSelectionOptions();
|
_sso = CParty.GetSongSelectionOptions();
|
||||||
CSongs.Sort(_sso.Sorting.SongSorting, _sso.Sorting.Tabs, _sso.Sorting.IgnoreArticles, _sso.Sorting.SearchString);
|
CSongs.Sort(_sso.Sorting.SongSorting, _sso.Sorting.Tabs, _sso.Sorting.IgnoreArticles, _sso.Sorting.SearchString, _sso.Sorting.ShowDuetSongs);
|
||||||
_SearchActive = _sso.Sorting.SearchStringVisible;
|
_SearchActive = _sso.Sorting.SearchStringVisible;
|
||||||
_SearchText = _sso.Sorting.SearchString;
|
_SearchText = _sso.Sorting.SearchString;
|
||||||
|
|
||||||
@@ -644,7 +644,7 @@ namespace Vocaluxe.Screens
|
|||||||
public override bool UpdateGame()
|
public override bool UpdateGame()
|
||||||
{
|
{
|
||||||
_sso = CParty.GetSongSelectionOptions();
|
_sso = CParty.GetSongSelectionOptions();
|
||||||
CSongs.Sort(_sso.Sorting.SongSorting, _sso.Sorting.Tabs, _sso.Sorting.IgnoreArticles, _sso.Sorting.SearchString);
|
CSongs.Sort(_sso.Sorting.SongSorting, _sso.Sorting.Tabs, _sso.Sorting.IgnoreArticles, _sso.Sorting.SearchString, _sso.Sorting.ShowDuetSongs);
|
||||||
_SearchActive = _sso.Sorting.SearchStringVisible;
|
_SearchActive = _sso.Sorting.SearchStringVisible;
|
||||||
_SearchText = _sso.Sorting.SearchString;
|
_SearchText = _sso.Sorting.SearchString;
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ namespace Vocaluxe.PartyModes
|
|||||||
|
|
||||||
_ScreenSongOptions.Sorting.SearchString = String.Empty;
|
_ScreenSongOptions.Sorting.SearchString = String.Empty;
|
||||||
_ScreenSongOptions.Sorting.SearchStringVisible = false;
|
_ScreenSongOptions.Sorting.SearchStringVisible = false;
|
||||||
|
_ScreenSongOptions.Sorting.ShowDuetSongs = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override ScreenSongOptions GetScreenSongOptions()
|
public override ScreenSongOptions GetScreenSongOptions()
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ namespace Vocaluxe.PartyModes
|
|||||||
public EOffOn IgnoreArticles;
|
public EOffOn IgnoreArticles;
|
||||||
public string SearchString;
|
public string SearchString;
|
||||||
public bool SearchStringVisible;
|
public bool SearchStringVisible;
|
||||||
|
public bool ShowDuetSongs;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in new issue
Block a user