On change of Tabs to on it will go out of any category
Auto reformat
This commit is contained in:
1 parent
cf0fd9dbed
commit
69c36362f5
15 files changed
+168
-39
No files matched your search
@@ -584,6 +584,11 @@ namespace Vocaluxe.Base
|
||||
return CSongs.NumSongsInCategory(categoryIndex);
|
||||
}
|
||||
|
||||
public bool IsInCategory()
|
||||
{
|
||||
return CSongs.IsInCategory;
|
||||
}
|
||||
|
||||
public int GetCurrentCategoryIndex()
|
||||
{
|
||||
return CSongs.Category;
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using Vocaluxe.Lib.Playlist;
|
||||
@@ -223,7 +224,7 @@ namespace Vocaluxe.Base
|
||||
private static CPlaylistFile _ConvertUSDXPlaylist(string file)
|
||||
{
|
||||
CPlaylistFile pl = new CPlaylistFile();
|
||||
var allSongs = CSongs.AllSongs;
|
||||
ReadOnlyCollection<CSong> allSongs = CSongs.AllSongs;
|
||||
|
||||
if (!File.Exists(file))
|
||||
return null;
|
||||
|
||||
@@ -52,6 +52,8 @@ namespace Vocaluxe.Base
|
||||
if (value == _Tabs)
|
||||
return;
|
||||
_Tabs = value;
|
||||
if (_Tabs == EOffOn.TR_CONFIG_ON)
|
||||
CSongs.Category = -1;
|
||||
_SetChanged();
|
||||
}
|
||||
}
|
||||
|
||||
+14
-10
@@ -76,20 +76,25 @@ namespace Vocaluxe.Base
|
||||
|
||||
public static int Category
|
||||
{
|
||||
get { return _CatIndex; }
|
||||
get
|
||||
{
|
||||
if (_CatIndex >= Categories.Count)
|
||||
_CatIndex = -1;
|
||||
return _CatIndex;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value == -1 || IsCatIndexValid(value))
|
||||
if (value == -1 || _IsCatIndexValid(value))
|
||||
_CatIndex = value;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsInCategory
|
||||
{
|
||||
get { return _CatIndex >= 0; }
|
||||
get { return _IsCatIndexValid(_CatIndex); }
|
||||
}
|
||||
|
||||
private static bool IsCatIndexValid(int catIndex)
|
||||
private static bool _IsCatIndexValid(int catIndex)
|
||||
{
|
||||
return catIndex >= 0 && catIndex < Categories.Count;
|
||||
}
|
||||
@@ -101,7 +106,7 @@ namespace Vocaluxe.Base
|
||||
/// <returns></returns>
|
||||
public static int NumSongsInCategory(int catIndex)
|
||||
{
|
||||
return IsCatIndexValid(catIndex) ? Categories[catIndex].Songs.Count(sp => !sp.IsSung) : 0;
|
||||
return _IsCatIndexValid(catIndex) ? Categories[catIndex].Songs.Count(sp => !sp.IsSung) : 0;
|
||||
}
|
||||
|
||||
public static void NextCategory()
|
||||
@@ -139,7 +144,7 @@ namespace Vocaluxe.Base
|
||||
|
||||
public static string GetCurrentCategoryName()
|
||||
{
|
||||
return IsCatIndexValid(_CatIndex) ? Categories[_CatIndex].Name : "";
|
||||
return _IsCatIndexValid(_CatIndex) ? Categories[_CatIndex].Name : "";
|
||||
}
|
||||
|
||||
public static CSong GetSong(int songID)
|
||||
@@ -170,7 +175,7 @@ namespace Vocaluxe.Base
|
||||
|
||||
public static void ResetPartySongSung(int catIndex)
|
||||
{
|
||||
if (IsCatIndexValid(catIndex))
|
||||
if (_IsCatIndexValid(catIndex))
|
||||
{
|
||||
foreach (CSongPointer song in Categories[catIndex].Songs)
|
||||
song.IsSung = false;
|
||||
@@ -247,7 +252,7 @@ namespace Vocaluxe.Base
|
||||
get
|
||||
{
|
||||
List<CSong> songs = new List<CSong>();
|
||||
if (IsCatIndexValid(_CatIndex))
|
||||
if (_IsCatIndexValid(_CatIndex))
|
||||
{
|
||||
foreach (CSongPointer sp in Categories[_CatIndex].Songs)
|
||||
{
|
||||
@@ -268,14 +273,13 @@ namespace Vocaluxe.Base
|
||||
{
|
||||
if (index < 0)
|
||||
return null;
|
||||
var visSongs = VisibleSongs;
|
||||
ReadOnlyCollection<CSong> visSongs = VisibleSongs;
|
||||
return (index < visSongs.Count) ? visSongs[index] : null;
|
||||
}
|
||||
|
||||
private static void _HandleCategoriesChanged(object sender, EventArgs args)
|
||||
{
|
||||
_CategoriesForRandom.Clear();
|
||||
Category = _CatIndex;
|
||||
}
|
||||
|
||||
public static void Sort(ESongSorting sorting, EOffOn tabs, EOffOn ignoreArticles, String searchString, EDuetOptions duetOptions)
|
||||
|
||||
@@ -1,3 +1,22 @@
|
||||
#region license
|
||||
// /*
|
||||
// This file is part of Vocaluxe.
|
||||
//
|
||||
// Vocaluxe is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Vocaluxe is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
|
||||
// */
|
||||
#endregion
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
|
||||
@@ -1,3 +1,22 @@
|
||||
#region license
|
||||
// /*
|
||||
// This file is part of Vocaluxe.
|
||||
//
|
||||
// Vocaluxe is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Vocaluxe is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
|
||||
// */
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
|
||||
@@ -1,3 +1,22 @@
|
||||
#region license
|
||||
// /*
|
||||
// This file is part of Vocaluxe.
|
||||
//
|
||||
// Vocaluxe is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Vocaluxe is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
|
||||
// */
|
||||
#endregion
|
||||
|
||||
using Vocaluxe.Base;
|
||||
using VocaluxeLib.Menu.SongMenu;
|
||||
|
||||
|
||||
@@ -1,4 +1,23 @@
|
||||
using System;
|
||||
#region license
|
||||
// /*
|
||||
// This file is part of Vocaluxe.
|
||||
//
|
||||
// Vocaluxe is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Vocaluxe is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
|
||||
// */
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
@@ -1,4 +1,23 @@
|
||||
using VocaluxeLib.Menu.SongMenu;
|
||||
#region license
|
||||
// /*
|
||||
// This file is part of Vocaluxe.
|
||||
//
|
||||
// Vocaluxe is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Vocaluxe is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
|
||||
// */
|
||||
#endregion
|
||||
|
||||
using VocaluxeLib.Menu.SongMenu;
|
||||
|
||||
namespace Vocaluxe.GameModes
|
||||
{
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Windows.Forms;
|
||||
using Vocaluxe.Base;
|
||||
using VocaluxeLib.Menu;
|
||||
@@ -1007,7 +1008,7 @@ namespace Vocaluxe.Screens
|
||||
if (CSongs.IsInCategory)
|
||||
{
|
||||
//TODO: Check and use sorting method
|
||||
var songs = CSongs.VisibleSongs;
|
||||
ReadOnlyCollection<CSong> songs = CSongs.VisibleSongs;
|
||||
int ct = songs.Count;
|
||||
if (curSelected >= 0 && curSelected < ct - 1 && songs[curSelected].Artist.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase))
|
||||
start = curSelected + 1;
|
||||
@@ -1017,7 +1018,7 @@ namespace Vocaluxe.Screens
|
||||
}
|
||||
else
|
||||
{
|
||||
var categories = CSongs.Categories;
|
||||
ReadOnlyCollection<CCategory> categories = CSongs.Categories;
|
||||
int ct = categories.Count;
|
||||
if (curSelected >= 0 && curSelected < ct - 1 && categories[curSelected].Name.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase))
|
||||
start = curSelected + 1;
|
||||
|
||||
Reference in new issue
Block a user