Merge remote-tracking branch 'remotes/flokuep/release-0.3' into release-0.3
This commit is contained in:
commit
248f036e72
11 files changed
+110
-28
No files matched your search
@@ -410,7 +410,7 @@
|
||||
<Text>
|
||||
<!--<X>, <Y>: Text position-->
|
||||
<X>75</X>
|
||||
<Y>16</Y>
|
||||
<Y>12</Y>
|
||||
<!--<H>: Text height-->
|
||||
<H>27</H>
|
||||
<!--<MaxW>: Maximum text width (if exists)-->
|
||||
@@ -467,7 +467,7 @@
|
||||
<Text>
|
||||
<!--<X>, <Y>: Text position-->
|
||||
<X>75</X>
|
||||
<Y>16</Y>
|
||||
<Y>12</Y>
|
||||
<!--<H>: Text height-->
|
||||
<H>27</H>
|
||||
<!--<MaxW>: Maximum text width (if exists)-->
|
||||
@@ -835,4 +835,4 @@
|
||||
</Reflection>
|
||||
</EqualizerChannel2>
|
||||
</ScreenOptionsRecord>
|
||||
</root>
|
||||
</root>
|
||||
@@ -79,9 +79,9 @@
|
||||
</Static4>
|
||||
<StaticWebcamOutput>
|
||||
<!--<Skin>: Texture name-->
|
||||
<Skin>CoverBackground</Skin>
|
||||
<Skin>Invisible</Skin>
|
||||
<!--<X>, <Y>, <Z>, <W>, <H>: Static position, width and height-->
|
||||
<X>75</X>
|
||||
<X>500</X>
|
||||
<Y>460</Y>
|
||||
<Z>0,00</Z>
|
||||
<W>320</W>
|
||||
@@ -756,4 +756,4 @@
|
||||
<NumVisible>3</NumVisible>
|
||||
</SelectSlideWebcamCapabilities>
|
||||
</ScreenOptionsVideo>
|
||||
</root>
|
||||
</root>
|
||||
@@ -568,7 +568,7 @@
|
||||
<!--<Font>: Text font name-->
|
||||
<Font>Outline</Font>
|
||||
<!--<Text>: Nothing or translation tag-->
|
||||
<Text>TR_BUTTON_EXIT</Text>
|
||||
<Text>TR_BUTTON_BACK</Text>
|
||||
</Text>
|
||||
<!--<Reflection> If exists:-->
|
||||
<!-- <Space>: Reflection Space-->
|
||||
@@ -653,4 +653,4 @@
|
||||
<NumVisible>1</NumVisible>
|
||||
</SelectSlideModes>
|
||||
</ScreenParty>
|
||||
</root>
|
||||
</root>
|
||||
@@ -72,9 +72,9 @@ namespace Vocaluxe.Base
|
||||
Char firstLetter = Char.ToUpper(songPointer.SortString.Normalize(NormalizationForm.FormD)[0]);
|
||||
if (Char.IsLetter(firstLetter))
|
||||
{
|
||||
if (lastCategory == null || songPointer.SortString != lastCategory.Name)
|
||||
if (lastCategory == null || firstLetter.ToString() != lastCategory.Name)
|
||||
{
|
||||
lastCategory = new CCategory(songPointer.SortString);
|
||||
lastCategory = new CCategory(firstLetter.ToString());
|
||||
_Categories.Add(lastCategory);
|
||||
}
|
||||
lastCategory.Songs.Add(songPointer);
|
||||
|
||||
@@ -86,28 +86,28 @@ namespace Vocaluxe.Base
|
||||
|
||||
private int _SortByFieldArtistTitle(CSongPointer s1, CSongPointer s2)
|
||||
{
|
||||
int res = String.Compare(s1.SortString, s2.SortString, StringComparison.OrdinalIgnoreCase);
|
||||
int res = String.Compare(s1.SortString, s2.SortString, StringComparison.CurrentCultureIgnoreCase);
|
||||
if (res == 0)
|
||||
{
|
||||
if (_IgnoreArticles == EOffOn.TR_CONFIG_ON)
|
||||
{
|
||||
res = String.Compare(CSongs.Songs[s1.SongID].ArtistSorting, CSongs.Songs[s2.SongID].ArtistSorting, StringComparison.OrdinalIgnoreCase);
|
||||
return res != 0 ? res : String.Compare(CSongs.Songs[s1.SongID].TitleSorting, CSongs.Songs[s2.SongID].TitleSorting, StringComparison.OrdinalIgnoreCase);
|
||||
res = String.Compare(CSongs.Songs[s1.SongID].ArtistSorting, CSongs.Songs[s2.SongID].ArtistSorting, StringComparison.CurrentCultureIgnoreCase);
|
||||
return res != 0 ? res : String.Compare(CSongs.Songs[s1.SongID].TitleSorting, CSongs.Songs[s2.SongID].TitleSorting, StringComparison.CurrentCultureIgnoreCase);
|
||||
}
|
||||
res = String.Compare(CSongs.Songs[s1.SongID].Artist, CSongs.Songs[s2.SongID].Artist, StringComparison.OrdinalIgnoreCase);
|
||||
return res != 0 ? res : String.Compare(CSongs.Songs[s1.SongID].Title, CSongs.Songs[s2.SongID].Title, StringComparison.OrdinalIgnoreCase);
|
||||
res = String.Compare(CSongs.Songs[s1.SongID].Artist, CSongs.Songs[s2.SongID].Artist, StringComparison.CurrentCultureIgnoreCase);
|
||||
return res != 0 ? res : String.Compare(CSongs.Songs[s1.SongID].Title, CSongs.Songs[s2.SongID].Title, StringComparison.CurrentCultureIgnoreCase);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
private int _SortByFieldTitle(CSongPointer s1, CSongPointer s2)
|
||||
{
|
||||
int res = String.Compare(s1.SortString, s2.SortString, StringComparison.OrdinalIgnoreCase);
|
||||
int res = String.Compare(s1.SortString, s2.SortString, StringComparison.CurrentCultureIgnoreCase);
|
||||
if (res == 0)
|
||||
{
|
||||
return _IgnoreArticles == EOffOn.TR_CONFIG_ON
|
||||
? String.Compare(CSongs.Songs[s1.SongID].TitleSorting, CSongs.Songs[s2.SongID].TitleSorting, StringComparison.OrdinalIgnoreCase) :
|
||||
String.Compare(CSongs.Songs[s1.SongID].Title, CSongs.Songs[s2.SongID].Title, StringComparison.OrdinalIgnoreCase);
|
||||
? String.Compare(CSongs.Songs[s1.SongID].TitleSorting, CSongs.Songs[s2.SongID].TitleSorting, StringComparison.CurrentCultureIgnoreCase) :
|
||||
String.Compare(CSongs.Songs[s1.SongID].Title, CSongs.Songs[s2.SongID].Title, StringComparison.CurrentCultureIgnoreCase);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -172,7 +172,7 @@ namespace Vocaluxe.Screens
|
||||
{
|
||||
if (_SearchActive)
|
||||
_ApplyNewSearchFilter(_SearchText + keyEvent.Unicode);
|
||||
else
|
||||
else if(!_Sso.Selection.PartyMode)
|
||||
{
|
||||
_JumpTo(keyEvent.Unicode);
|
||||
return true;
|
||||
@@ -284,26 +284,32 @@ namespace Vocaluxe.Screens
|
||||
break;
|
||||
|
||||
case Keys.D1:
|
||||
case Keys.NumPad1:
|
||||
_SelectNextRandom(0);
|
||||
break;
|
||||
|
||||
case Keys.D2:
|
||||
case Keys.NumPad2:
|
||||
_SelectNextRandom(1);
|
||||
break;
|
||||
|
||||
case Keys.D3:
|
||||
case Keys.NumPad3:
|
||||
_SelectNextRandom(2);
|
||||
break;
|
||||
|
||||
case Keys.D4:
|
||||
case Keys.NumPad4:
|
||||
_SelectNextRandom(3);
|
||||
break;
|
||||
|
||||
case Keys.D5:
|
||||
case Keys.NumPad5:
|
||||
_SelectNextRandom(4);
|
||||
break;
|
||||
|
||||
case Keys.D6:
|
||||
case Keys.NumPad6:
|
||||
_SelectNextRandom(5);
|
||||
break;
|
||||
}
|
||||
@@ -443,9 +449,7 @@ namespace Vocaluxe.Screens
|
||||
|
||||
if (mouseEvent.LD && !_Sso.Selection.PartyMode)
|
||||
{
|
||||
//TODO: Causes Bug if you select a song (e.g. with Select random song) and double click a normal button.
|
||||
//E.g. clicking to fast on Select random song starts the next random song. is this OK?
|
||||
if (CSongs.NumSongsVisible > 0 && _SongMenus[_SongMenu].GetActualSelection() != -1)
|
||||
if (CSongs.NumSongsVisible > 0 && _SongMenus[_SongMenu].GetActualSelection() != -1 && _SongMenus[_SongMenu].IsMouseOverActualSelection(mouseEvent))
|
||||
{
|
||||
_ToggleSongOptions(ESongOptionsView.None);
|
||||
_StartVisibleSong(_SongMenus[_SongMenu].GetActualSelection());
|
||||
@@ -1003,18 +1007,76 @@ namespace Vocaluxe.Screens
|
||||
{
|
||||
int start = 0;
|
||||
int curSelected = _SongMenus[_SongMenu].GetActualSelection();
|
||||
if (CSongs.IsInCategory)
|
||||
bool firstLevel = CConfig.Tabs == EOffOn.TR_CONFIG_OFF && CSongs.IsInCategory;
|
||||
bool secondSort = CConfig.Tabs == EOffOn.TR_CONFIG_ON &&
|
||||
(CConfig.SongSorting == ESongSorting.TR_CONFIG_ARTIST ||
|
||||
CConfig.SongSorting == ESongSorting.TR_CONFIG_ARTIST_LETTER ||
|
||||
CConfig.SongSorting == ESongSorting.TR_CONFIG_FOLDER ||
|
||||
CConfig.SongSorting == ESongSorting.TR_CONFIG_TITLE_LETTER);
|
||||
if (firstLevel && !secondSort)
|
||||
{
|
||||
//TODO: Check and use sorting method
|
||||
//TODO: What's to do with multiple tags?
|
||||
//How can we get current letter? I think we have to save it - Or is there a better method?
|
||||
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;
|
||||
int visibleID = _FindIndex(songs, start, element => element.Artist.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase));
|
||||
int visibleID = -1;
|
||||
switch (CConfig.SongSorting)
|
||||
{
|
||||
case ESongSorting.TR_CONFIG_ARTIST:
|
||||
case ESongSorting.TR_CONFIG_ARTIST_LETTER:
|
||||
if (curSelected >= 0 && curSelected < ct - 1 && songs[curSelected].Artist.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase))
|
||||
start = curSelected + 1;
|
||||
visibleID = _FindIndex(songs, start, element => element.Artist.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase));
|
||||
break;
|
||||
|
||||
//TODO: Does this make sense? Maybe we should deactivate this for years? You could only jump between 1 and 2
|
||||
case ESongSorting.TR_CONFIG_YEAR:
|
||||
case ESongSorting.TR_CONFIG_DECADE:
|
||||
if (curSelected >= 0 && curSelected < ct - 1 && songs[curSelected].Year.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase))
|
||||
start = curSelected + 1;
|
||||
visibleID = _FindIndex(songs, start, element => element.Year.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase));
|
||||
break;
|
||||
|
||||
case ESongSorting.TR_CONFIG_TITLE_LETTER:
|
||||
if (curSelected >= 0 && curSelected < ct - 1 && songs[curSelected].Title.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase))
|
||||
start = curSelected + 1;
|
||||
visibleID = _FindIndex(songs, start, element => element.Title.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase));
|
||||
break;
|
||||
|
||||
case ESongSorting.TR_CONFIG_FOLDER:
|
||||
if (curSelected >= 0 && curSelected < ct - 1 && songs[curSelected].Folder.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase))
|
||||
start = curSelected + 1;
|
||||
visibleID = _FindIndex(songs, start, element => element.Folder.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase));
|
||||
break;
|
||||
}
|
||||
if (visibleID > -1)
|
||||
_SongMenus[_SongMenu].SetSelectedSong(visibleID);
|
||||
}
|
||||
else
|
||||
else if (secondSort && CSongs.IsInCategory)
|
||||
{
|
||||
ReadOnlyCollection<CSong> songs = CSongs.VisibleSongs;
|
||||
int ct = songs.Count;
|
||||
int visibleID = -1;
|
||||
switch (CConfig.SongSorting)
|
||||
{
|
||||
case ESongSorting.TR_CONFIG_FOLDER:
|
||||
case ESongSorting.TR_CONFIG_TITLE_LETTER:
|
||||
if (curSelected >= 0 && curSelected < ct - 1 && songs[curSelected].Artist.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase))
|
||||
start = curSelected + 1;
|
||||
visibleID = _FindIndex(songs, start, element => element.Artist.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase));
|
||||
break;
|
||||
|
||||
case ESongSorting.TR_CONFIG_ARTIST:
|
||||
case ESongSorting.TR_CONFIG_ARTIST_LETTER:
|
||||
if (curSelected >= 0 && curSelected < ct - 1 && songs[curSelected].Title.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase))
|
||||
start = curSelected + 1;
|
||||
visibleID = _FindIndex(songs, start, element => element.Title.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase));
|
||||
break;
|
||||
}
|
||||
if (visibleID > -1)
|
||||
_SongMenus[_SongMenu].SetSelectedSong(visibleID);
|
||||
}
|
||||
else if(!CSongs.IsInCategory)
|
||||
{
|
||||
ReadOnlyCollection<CCategory> categories = CSongs.Categories;
|
||||
int ct = categories.Count;
|
||||
|
||||
@@ -199,6 +199,8 @@ namespace VocaluxeLib.Menu
|
||||
{
|
||||
_Theme.Text = value;
|
||||
_Text = translation;
|
||||
if (_EditMode)
|
||||
_Text += "|";
|
||||
_PositionNeedsUpdate = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,6 +98,11 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
_SongMenu.SetActive(active);
|
||||
}
|
||||
|
||||
public bool IsMouseOverActualSelection(SMouseEvent mEvent)
|
||||
{
|
||||
return _SongMenu.IsMouseOverActualSelection(mEvent);
|
||||
}
|
||||
|
||||
public int GetSelectedSong()
|
||||
{
|
||||
return _SongMenu.GetSelectedSong();
|
||||
|
||||
@@ -518,6 +518,8 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
_Active = active;
|
||||
}
|
||||
|
||||
public virtual bool IsMouseOverActualSelection(SMouseEvent mEvent) { return false; }
|
||||
|
||||
public virtual int GetSelectedSong()
|
||||
{
|
||||
return -1;
|
||||
|
||||
@@ -485,6 +485,15 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
return _Locked;
|
||||
}
|
||||
|
||||
public override bool IsMouseOverActualSelection(SMouseEvent mEvent)
|
||||
{
|
||||
CStatic selCov = GetSelectedSongCover();
|
||||
if (selCov.Texture == null)
|
||||
return false;
|
||||
SRectF rect = new SRectF(selCov.Rect.X - selCov.Rect.W*0.2f, selCov.Rect.Y - selCov.Rect.H*0.2f, selCov.Rect.W*1.2f, selCov.Rect.H*1.2f, selCov.Rect.Z);
|
||||
return CHelper.IsInBounds(rect, mEvent);
|
||||
}
|
||||
|
||||
public override CStatic GetSelectedSongCover()
|
||||
{
|
||||
foreach (CStatic tile in _Tiles)
|
||||
|
||||
@@ -40,6 +40,8 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
bool IsActive();
|
||||
void SetActive(bool active);
|
||||
|
||||
bool IsMouseOverActualSelection(SMouseEvent mEvent);
|
||||
|
||||
int GetSelectedCategory();
|
||||
void SetSelectedCategory(int categoryNr);
|
||||
int GetActualSelection();
|
||||
|
||||
Reference in new issue
Block a user