Merge branch 'develop' of github.com:Flamefire/Vocaluxe into develop

This commit is contained in:
Florian Küpper committed 2013-04-28 17:47:59 +02:00
commit ee91798639
45 files changed
+1053 -1194

No files matched your search

+14 -14
View File
@@ -80,23 +80,23 @@ namespace VocaluxeLib.Menu
if (round >= NumRounds)
return new SPlayer[1];
SPlayer[] player = new SPlayer[numPlayer];
SPlayer[] players = new SPlayer[numPlayer];
for (int p = 0; p < player.Length; p++)
for (int p = 0; p < players.Length; p++)
{
player[p].Points = _Rounds[round, p].Points;
player[p].PointsGoldenNotes = _Rounds[round, p].PointsGoldenNotes;
player[p].PointsLineBonus = _Rounds[round, p].PointsLineBonus;
player[p].SongID = _Rounds[round, p].SongID;
player[p].LineNr = _Rounds[round, p].LineNr;
player[p].Medley = _Rounds[round, p].Medley;
player[p].Duet = _Rounds[round, p].Duet;
player[p].ShortSong = _Rounds[round, p].ShortSong;
player[p].DateTicks = _Rounds[round, p].DateTicks;
player[p].SongFinished = _Rounds[round, p].SongFinished;
player[p].ProfileID = _Rounds[round, p].ProfileID;
players[p].Points = _Rounds[round, p].Points;
players[p].PointsGoldenNotes = _Rounds[round, p].PointsGoldenNotes;
players[p].PointsLineBonus = _Rounds[round, p].PointsLineBonus;
players[p].SongID = _Rounds[round, p].SongID;
players[p].LineNr = _Rounds[round, p].LineNr;
players[p].Medley = _Rounds[round, p].Medley;
players[p].Duet = _Rounds[round, p].Duet;
players[p].ShortSong = _Rounds[round, p].ShortSong;
players[p].DateTicks = _Rounds[round, p].DateTicks;
players[p].SongFinished = _Rounds[round, p].SongFinished;
players[p].ProfileID = _Rounds[round, p].ProfileID;
}
return player;
return players;
}
}
}
+5 -10
View File
@@ -221,27 +221,22 @@ namespace VocaluxeLib.Menu
return false;
}
public void Draw()
public void Draw(bool forceDraw = false)
{
Draw(1f, Rect.Z, Aspect, false);
Draw(1f, Rect.Z, Aspect, forceDraw);
}
public void Draw(EAspect aspect)
{
Draw(1f, Rect.Z, aspect, false);
Draw(1f, Rect.Z, aspect);
}
public void Draw(float scale, EAspect aspect)
{
Draw(scale, Rect.Z, aspect, false);
Draw(scale, Rect.Z, aspect);
}
public void ForceDraw()
{
Draw(1f, Rect.Z, Aspect, true);
}
public void Draw(float scale, float z, EAspect aspect, bool forceDraw)
public void Draw(float scale, float z, EAspect aspect, bool forceDraw = false)
{
STexture texture = _Texture.Index != -1 ? _Texture : CBase.Theme.GetSkinTexture(_Theme.TextureName, _PartyModeID);
-5
View File
@@ -601,11 +601,6 @@ namespace VocaluxeLib.Menu
return false;
}
public void ForceDraw()
{
Draw(true);
}
public void Draw(bool forceDraw = false)
{
if (!forceDraw && !Visible && CBase.Settings.GetGameState() != EGameState.EditTheme)
+4 -5
View File
@@ -19,6 +19,7 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Drawing;
using VocaluxeLib.Menu.SongMenu;
using VocaluxeLib.PartyModes;
@@ -240,7 +241,7 @@ namespace VocaluxeLib.Menu
public interface ISongs
{
int GetNumSongs();
int GetNumVisibleSongs();
int GetNumSongsVisible();
int GetNumCategories();
int NumSongsInCategory(int categoryIndex);
@@ -253,13 +254,11 @@ namespace VocaluxeLib.Menu
CSong GetVisibleSong(int visibleIndex);
CSong GetSongByID(int songID);
CSong[] GetSongs();
CSong[] GetSongsNotSung();
ReadOnlyCollection<CSong> GetVisibleSongs();
CCategory GetCategory(int index);
void AddPartySongSung(int songID);
void ResetPartySongSung();
void ResetPartySongSung(int catIndex);
void ResetSongSung(int catIndex = -1);
void SortSongs(ESongSorting sorting, EOffOn tabs, EOffOn ignoreArticles, String searchString, EDuetOptions duetOptions);
+1
View File
@@ -423,6 +423,7 @@ namespace VocaluxeLib.Menu.SingNotes
return _PerfectLine;
}
//Find last note with StartBeat<=Beat
public int FindPreviousNote(int beat)
{
//If no notes -> No previous note
+20 -82
View File
@@ -26,6 +26,19 @@ using VocaluxeLib.Menu.SingNotes;
namespace VocaluxeLib.Menu.SongMenu
{
public class CSongPointer
{
public readonly int SongID;
public string SortString;
public bool IsSung;
public CSongPointer(int id, string sortString)
{
SongID = id;
SortString = sortString;
}
}
[Flags]
enum EHeaderFlags
{
@@ -40,58 +53,11 @@ namespace VocaluxeLib.Menu.SongMenu
public enum EMedleySource
{
None,
None = 0,
Calculated,
Tag
}
public class CCategory
{
public readonly string Name;
private STexture _CoverTextureSmall = new STexture(-1);
private STexture _CoverTextureBig = new STexture(-1);
private bool _CoverBigLoaded;
public CCategory(string name)
{
Name = name;
}
public STexture CoverTextureSmall
{
get { return _CoverTextureSmall; }
set { _CoverTextureSmall = value; }
}
public STexture CoverTextureBig
{
get { return _CoverBigLoaded ? _CoverTextureBig : _CoverTextureSmall; }
set
{
if (value.Index != -1)
{
_CoverTextureBig = value;
_CoverBigLoaded = true;
}
}
}
public CCategory(string name, STexture coverSmall, STexture coverBig)
{
Name = name;
CoverTextureSmall = coverSmall;
CoverTextureBig = coverBig;
}
public CCategory(CCategory cat)
{
Name = cat.Name;
CoverTextureSmall = cat.CoverTextureSmall;
CoverTextureBig = cat.CoverTextureBig;
}
}
public struct SMedley
{
public EMedleySource Source;
@@ -99,28 +65,16 @@ namespace VocaluxeLib.Menu.SongMenu
public int EndBeat;
public float FadeInTime;
public float FadeOutTime;
// ReSharper disable UnusedParameter.Local
public SMedley(int dummy)
// ReSharper restore UnusedParameter.Local
{
Source = EMedleySource.None;
StartBeat = 0;
EndBeat = 0;
FadeInTime = 0f;
FadeOutTime = 0f;
}
}
public class CSong
{
private bool _CoverSmallLoaded;
private bool _CoverBigLoaded;
private bool _NotesLoaded;
private STexture _CoverTextureSmall = new STexture(-1);
private STexture _CoverTextureBig = new STexture(-1);
public SMedley Medley = new SMedley(0);
public SMedley Medley;
public bool CalculateMedley = true;
public float PreviewStart;
@@ -140,18 +94,7 @@ namespace VocaluxeLib.Menu.SongMenu
public EAspect VideoAspect = EAspect.Crop;
public bool CoverSmallLoaded
{
get { return _CoverSmallLoaded; }
}
public bool CoverBigLoaded
{
get { return _CoverBigLoaded; }
}
public bool NotesLoaded
{
get { return _NotesLoaded; }
}
public bool NotesLoaded { get; private set; }
public STexture CoverTextureSmall
{
@@ -171,12 +114,7 @@ namespace VocaluxeLib.Menu.SongMenu
public STexture CoverTextureBig
{
get
{
if (_CoverBigLoaded)
return _CoverTextureBig;
return _CoverTextureSmall;
}
get { return _CoverBigLoaded ? _CoverTextureBig : _CoverTextureSmall; }
set
{
_CoverTextureBig = value;
@@ -278,7 +216,7 @@ namespace VocaluxeLib.Menu.SongMenu
VideoAspect = song.VideoAspect;
_CoverSmallLoaded = song._CoverSmallLoaded;
_CoverBigLoaded = song._CoverBigLoaded;
_NotesLoaded = song._NotesLoaded;
NotesLoaded = song.NotesLoaded;
Artist = song.Artist;
Title = song.Title;
@@ -619,7 +557,7 @@ namespace VocaluxeLib.Menu.SongMenu
private bool _ReadNotes(string filePath, bool forceReload = false)
{
//Skip loading if already done and no reload is forced
if (_NotesLoaded && !forceReload)
if (NotesLoaded && !forceReload)
return true;
if (!File.Exists(filePath))
@@ -784,7 +722,7 @@ namespace VocaluxeLib.Menu.SongMenu
{
_FindRefrain();
_FindShortEnd();
_NotesLoaded = true;
NotesLoaded = true;
if (IsDuet)
_CheckDuet();
}
-6
View File
@@ -35,12 +35,6 @@ namespace VocaluxeLib.Menu.SongMenu
_CreateSongMenu();
}
public void UpdateSongMenuType()
{
if (_Type != CBase.Config.GetSongMenuType())
_CreateSongMenu();
}
public bool Selected
{
get { return _SongMenu.IsSelected(); }
@@ -252,8 +252,6 @@ namespace VocaluxeLib.Menu.SongMenu
StaticMedleyTagIcon = new CStatic(_PartyModeID)
}
};
_ThemeLoaded = false;
}
public string GetThemeName()
@@ -598,7 +596,7 @@ namespace VocaluxeLib.Menu.SongMenu
protected void _SelectSong(int nr)
{
if (CBase.Songs.GetCurrentCategoryIndex() >= 0 && (CBase.Songs.GetNumVisibleSongs() > 0) && (nr >= 0) && ((_Actsong != nr) || (_Streams.Count == 0)))
if (CBase.Songs.GetCurrentCategoryIndex() >= 0 && (CBase.Songs.GetNumSongsVisible() > 0) && (nr >= 0) && ((_Actsong != nr) || (_Streams.Count == 0)))
{
_Streams.ForEach(soundStream => CBase.Sound.FadeAndStop(soundStream, 0f, 1f));
_Streams.Clear();
@@ -609,7 +607,7 @@ namespace VocaluxeLib.Menu.SongMenu
CBase.Drawing.RemoveTexture(ref _Vidtex);
_Actsong = nr;
if (_Actsong >= CBase.Songs.GetNumVisibleSongs())
if (_Actsong >= CBase.Songs.GetNumSongsVisible())
_Actsong = 0;
@@ -138,7 +138,6 @@ namespace VocaluxeLib.Menu.SongMenu
//AfterCategoryChange();
SetSelectedSong(_ActSong);
_AfterCategoryChange();
CBase.Songs.UpdateRandomSongList();
int actcat = _PreviewSelected;
if ((CBase.Songs.GetNumCategories() > 0) && (actcat < 0))
@@ -155,7 +154,7 @@ namespace VocaluxeLib.Menu.SongMenu
_MedleyTagIcon.Visible = false;
}
if (CBase.Songs.GetNumVisibleSongs() == 0 && CBase.Songs.GetSearchFilter() != "")
if (CBase.Songs.GetNumSongsVisible() == 0 && CBase.Songs.GetSearchFilter() != "")
{
_CoverBig.Texture = _CoverBigTexture;
_Artist.Text = String.Empty;
@@ -253,7 +252,7 @@ namespace VocaluxeLib.Menu.SongMenu
}
else
{
if (CBase.Songs.GetCurrentCategoryIndex() != -1 && _Locked < CBase.Songs.GetNumVisibleSongs() - 1 && !songOptions.Selection.RandomOnly)
if (CBase.Songs.GetCurrentCategoryIndex() != -1 && _Locked < CBase.Songs.GetNumSongsVisible() - 1 && !songOptions.Selection.RandomOnly)
{
_Locked++;
_UpdateList();
@@ -291,7 +290,7 @@ namespace VocaluxeLib.Menu.SongMenu
_UpdateList();
}
}
else if (_Locked < CBase.Songs.GetNumVisibleSongs() - _NumW && !songOptions.Selection.RandomOnly)
else if (_Locked < CBase.Songs.GetNumSongsVisible() - _NumW && !songOptions.Selection.RandomOnly)
{
_Locked += _NumW;
_UpdateList();
@@ -403,7 +402,7 @@ namespace VocaluxeLib.Menu.SongMenu
if (CBase.Songs.GetCurrentCategoryIndex() >= 0)
{
int actsong = _PreviewSelected;
if ((CBase.Songs.GetNumVisibleSongs() > actsong) && (actsong >= 0))
if ((CBase.Songs.GetNumSongsVisible() > actsong) && (actsong >= 0))
{
CSong song = CBase.Songs.GetVisibleSong(actsong);
@@ -529,7 +528,7 @@ namespace VocaluxeLib.Menu.SongMenu
{
base.SetSelectedSong(visibleSongNr);
if (visibleSongNr >= 0 && visibleSongNr < CBase.Songs.GetNumVisibleSongs())
if (visibleSongNr >= 0 && visibleSongNr < CBase.Songs.GetNumSongsVisible())
_SetSelectedTile(visibleSongNr);
}
@@ -592,11 +591,11 @@ namespace VocaluxeLib.Menu.SongMenu
if (_ActualSelection >= 0 && _ActualSelection < _Tiles.Count)
_Tiles[_ActualSelection].Selected = true;
if ((_LastKnownNumSongs == CBase.Songs.GetNumVisibleSongs()) && (_LastKnownCategory == CBase.Songs.GetCurrentCategoryIndex()))
if ((_LastKnownNumSongs == CBase.Songs.GetNumSongsVisible()) && (_LastKnownCategory == CBase.Songs.GetCurrentCategoryIndex()))
return;
_LastKnownCategory = CBase.Songs.GetCurrentCategoryIndex();
_LastKnownNumSongs = CBase.Songs.GetNumVisibleSongs();
_LastKnownNumSongs = CBase.Songs.GetNumSongsVisible();
_UpdateList(0, true);
CBase.Songs.UpdateRandomSongList();
}
@@ -609,7 +608,7 @@ namespace VocaluxeLib.Menu.SongMenu
private void _UpdateList(int offset, bool force = false)
{
bool isInCategory = CBase.Songs.GetCurrentCategoryIndex() >= 0;
int itemCount = isInCategory ? CBase.Songs.GetNumVisibleSongs() : CBase.Songs.GetNumCategories();
int itemCount = isInCategory ? CBase.Songs.GetNumSongsVisible() : CBase.Songs.GetNumCategories();
if (offset >= (itemCount / _NumW) * _NumW - (_NumW * (_NumH - 1)))
offset = (itemCount / _NumW) * _NumW - (_NumW * (_NumH - 1));