changed base handling in VocaluxeLib

This commit is contained in:
Alexander Eckart committed 2013-02-22 17:57:47 +01:00
1 parent 08658e20e3
commit b4f77d50b2
42 files changed
+801 -924

No files matched your search

+32 -35
View File
@@ -69,7 +69,6 @@ namespace Vocaluxe.Menu.SongMenu
public class CSong
{
private Basic _Base;
private bool _CoverLoaded = false;
private bool _NotesLoaded = false;
private STexture _CoverTextureSmall = new STexture(-1);
@@ -117,11 +116,11 @@ namespace Vocaluxe.Menu.SongMenu
if (this.CoverFileName != String.Empty)
{
if (!_Base.DataBase.GetCover(Path.Combine(this.Folder, this.CoverFileName), ref _CoverTextureSmall, _Base.Config.GetCoverSize()))
_CoverTextureSmall = _Base.Cover.GetNoCover();
if (!CBase.Base.DataBase.GetCover(Path.Combine(this.Folder, this.CoverFileName), ref _CoverTextureSmall, CBase.Base.Config.GetCoverSize()))
_CoverTextureSmall = CBase.Base.Cover.GetNoCover();
}
else
_CoverTextureSmall = _Base.Cover.GetNoCover();
_CoverTextureSmall = CBase.Base.Cover.GetNoCover();
_CoverLoaded = true;
}
@@ -194,14 +193,12 @@ namespace Vocaluxe.Menu.SongMenu
}
}
public CSong(Basic Base)
public CSong()
{
_Base = Base;
}
public CSong(CSong song)
{
this._Base = song._Base;
this._CoverTextureSmall = song._CoverTextureSmall;
this._CoverTextureBig = song._CoverTextureBig;
@@ -307,7 +304,7 @@ namespace Vocaluxe.Menu.SongMenu
this.Folder = Path.GetDirectoryName(FilePath);
foreach (string folder in _Base.Config.GetSongFolder())
foreach (string folder in CBase.Base.Config.GetSongFolder())
{
if (this.Folder.Contains(folder))
{
@@ -434,7 +431,7 @@ namespace Vocaluxe.Menu.SongMenu
}
else
{
_Base.Log.LogError("Can't find audio file: " + Path.Combine(this.Folder, Value));
CBase.Base.Log.LogError("Can't find audio file: " + Path.Combine(this.Folder, Value));
return false;
}
break;
@@ -484,7 +481,7 @@ namespace Vocaluxe.Menu.SongMenu
if (File.Exists(Path.Combine(this.Folder, Value)))
this.VideoFileName = Value;
else
_Base.Log.LogError("Can't find video file: " + Path.Combine(this.Folder, Value));
CBase.Base.Log.LogError("Can't find video file: " + Path.Combine(this.Folder, Value));
break;
case "VIDEOGAP":
@@ -540,25 +537,25 @@ namespace Vocaluxe.Menu.SongMenu
if ((HeaderFlags & EHeaderFlags.Title) == 0)
{
_Base.Log.LogError("Title tag missing: " + FilePath);
CBase.Base.Log.LogError("Title tag missing: " + FilePath);
return false;
}
if ((HeaderFlags & EHeaderFlags.Artist) == 0)
{
_Base.Log.LogError("Artist tag missing: " + FilePath);
CBase.Base.Log.LogError("Artist tag missing: " + FilePath);
return false;
}
if ((HeaderFlags & EHeaderFlags.MP3) == 0)
{
_Base.Log.LogError("MP3 tag missing: " + FilePath);
CBase.Base.Log.LogError("MP3 tag missing: " + FilePath);
return false;
}
if ((HeaderFlags & EHeaderFlags.BPM) == 0)
{
_Base.Log.LogError("BPM tag missing: " + FilePath);
CBase.Base.Log.LogError("BPM tag missing: " + FilePath);
return false;
}
@@ -567,7 +564,7 @@ namespace Vocaluxe.Menu.SongMenu
{
if (this.Medley.StartBeat > this.Medley.EndBeat)
{
_Base.Log.LogError("MedleyStartBeat is bigger than MedleyEndBeat in file: " + FilePath);
CBase.Base.Log.LogError("MedleyStartBeat is bigger than MedleyEndBeat in file: " + FilePath);
HeaderFlags = HeaderFlags - EHeaderFlags.MedleyStartBeat - EHeaderFlags.MedleyEndBeat;
}
}
@@ -577,7 +574,7 @@ namespace Vocaluxe.Menu.SongMenu
//PreviewStart is not set or <=0
if ((HeaderFlags & EHeaderFlags.MedleyStartBeat) != 0)
//fallback to MedleyStart
this.PreviewStart = _Base.Game.GetTimeFromBeats(this.Medley.StartBeat, this.BPM);
this.PreviewStart = CBase.Base.Game.GetTimeFromBeats(this.Medley.StartBeat, this.BPM);
else
//else set to 0, it will be set in FindRefrainStart
this.PreviewStart = 0f;
@@ -586,8 +583,8 @@ namespace Vocaluxe.Menu.SongMenu
if ((HeaderFlags & EHeaderFlags.MedleyStartBeat) != 0 && (HeaderFlags & EHeaderFlags.MedleyEndBeat) != 0)
{
this.Medley.Source = EMedleySource.Tag;
this.Medley.FadeInTime = _Base.Settings.GetDefaultMedleyFadeInTime();
this.Medley.FadeOutTime = _Base.Settings.GetDefaultMedleyFadeOutTime();
this.Medley.FadeInTime = CBase.Base.Settings.GetDefaultMedleyFadeInTime();
this.Medley.FadeOutTime = CBase.Base.Settings.GetDefaultMedleyFadeOutTime();
}
#endregion check medley tags
@@ -595,7 +592,7 @@ namespace Vocaluxe.Menu.SongMenu
}
catch (Exception e)
{
_Base.Log.LogError("Error reading txt header in file \"" + FilePath + "\": " + e.Message);
CBase.Base.Log.LogError("Error reading txt header in file \"" + FilePath + "\": " + e.Message);
return false;
}
@@ -623,7 +620,7 @@ namespace Vocaluxe.Menu.SongMenu
{
if (!File.Exists(FilePath))
{
_Base.Log.LogError("Error loading song. The file does not exist: " + FilePath);
CBase.Base.Log.LogError("Error loading song. The file does not exist: " + FilePath);
return false;
}
@@ -655,7 +652,7 @@ namespace Vocaluxe.Menu.SongMenu
if (sr.EndOfStream || (line.Length == 0))
{
_Base.Log.LogError("Error loading song. Line No.: " + FileLineNo.ToString() + ". The file is empty or it starts with an empty line: " + FilePath);
CBase.Base.Log.LogError("Error loading song. Line No.: " + FileLineNo.ToString() + ". The file is empty or it starts with an empty line: " + FilePath);
return false;
}
@@ -679,7 +676,7 @@ namespace Vocaluxe.Menu.SongMenu
Player = 2;
else
{
_Base.Log.LogError("Error loading song. Line No.: " + FileLineNo.ToString() + ". Wrong or missing number after \"P\": " + FilePath);
CBase.Base.Log.LogError("Error loading song. Line No.: " + FileLineNo.ToString() + ". Wrong or missing number after \"P\": " + FilePath);
return false;
}
}
@@ -726,7 +723,7 @@ namespace Vocaluxe.Menu.SongMenu
{
if (isNewSentence)
{
_Base.Log.LogError("Error loading song. Line No.: " + FileLineNo.ToString() + ". Double sentence break: " + FilePath);
CBase.Base.Log.LogError("Error loading song. Line No.: " + FileLineNo.ToString() + ". Double sentence break: " + FilePath);
return false;
}
@@ -768,7 +765,7 @@ namespace Vocaluxe.Menu.SongMenu
}
catch (Exception e)
{
_Base.Log.LogError("Error loading song. Line No.: " + FileLineNo.ToString() + ". An unhandled exception occured (" + e.Message + "): " + FilePath);
CBase.Base.Log.LogError("Error loading song. Line No.: " + FileLineNo.ToString() + ". An unhandled exception occured (" + e.Message + "): " + FilePath);
return false;
}
FindRefrain();
@@ -781,7 +778,7 @@ namespace Vocaluxe.Menu.SongMenu
private void ParseNote(int Player, ENoteType NoteType, int Start, int Length, int Tone, string Text)
{
CNote note = new CNote(_Base, Start, Length, Tone, Text, NoteType);
CNote note = new CNote(Start, Length, Tone, Text, NoteType);
CLines lines = this.Notes.GetLines(Player);
if (lines.LineCount == 0)
@@ -847,12 +844,12 @@ namespace Vocaluxe.Menu.SongMenu
if (DuetPart1 == String.Empty)
{
DuetPart1 = "Part 1";
_Base.Log.LogError("Warning: Can't find #P1-tag for duets in \"" + this.Artist + " - " + this.Title + "\".");
CBase.Base.Log.LogError("Warning: Can't find #P1-tag for duets in \"" + this.Artist + " - " + this.Title + "\".");
}
if (DuetPart2 == String.Empty)
{
DuetPart2 = "Part 2";
_Base.Log.LogError("Warning: Can't find #P2-tag for duets in \"" + this.Artist + " - " + this.Title + "\".");
CBase.Base.Log.LogError("Warning: Can't find #P2-tag for duets in \"" + this.Artist + " - " + this.Title + "\".");
}
}
@@ -933,7 +930,7 @@ namespace Vocaluxe.Menu.SongMenu
}
// set medley vars
if (series.Count > 0 && series[longest].length > _Base.Settings.GetMedleyMinSeriesLength())
if (series.Count > 0 && series[longest].length > CBase.Base.Settings.GetMedleyMinSeriesLength())
{
this.Medley.StartBeat = lines.Line[series[longest].start].FirstNoteBeat;
this.Medley.EndBeat = lines.Line[series[longest].end].LastNoteBeat;
@@ -941,16 +938,16 @@ namespace Vocaluxe.Menu.SongMenu
bool foundEnd = false;
// set end if duration > MedleyMinDuration
if (_Base.Game.GetTimeFromBeats(this.Medley.StartBeat, this.BPM) + _Base.Settings.GetMedleyMinDuration() >
_Base.Game.GetTimeFromBeats(this.Medley.EndBeat, this.BPM))
if (CBase.Base.Game.GetTimeFromBeats(this.Medley.StartBeat, this.BPM) + CBase.Base.Settings.GetMedleyMinDuration() >
CBase.Base.Game.GetTimeFromBeats(this.Medley.EndBeat, this.BPM))
foundEnd = true;
if (!foundEnd)
{
for (int i = series[longest].start + 1; i < lines.LineCount - 1; i++)
{
if (_Base.Game.GetTimeFromBeats(this.Medley.StartBeat, this.BPM) + _Base.Settings.GetMedleyMinDuration() >
_Base.Game.GetTimeFromBeats(lines.Line[i].LastNoteBeat, this.BPM))
if (CBase.Base.Game.GetTimeFromBeats(this.Medley.StartBeat, this.BPM) + CBase.Base.Settings.GetMedleyMinDuration() >
CBase.Base.Game.GetTimeFromBeats(lines.Line[i].LastNoteBeat, this.BPM))
{
foundEnd = true;
this.Medley.EndBeat = lines.Line[i].LastNoteBeat;
@@ -961,15 +958,15 @@ namespace Vocaluxe.Menu.SongMenu
if (foundEnd)
{
this.Medley.Source = EMedleySource.Calculated;
this.Medley.FadeInTime = _Base.Settings.GetDefaultMedleyFadeInTime();
this.Medley.FadeOutTime = _Base.Settings.GetDefaultMedleyFadeOutTime();
this.Medley.FadeInTime = CBase.Base.Settings.GetDefaultMedleyFadeInTime();
this.Medley.FadeOutTime = CBase.Base.Settings.GetDefaultMedleyFadeOutTime();
}
}
if (this.PreviewStart == 0f)
{
if (this.Medley.Source == EMedleySource.Calculated)
this.PreviewStart = _Base.Game.GetTimeFromBeats(this.Medley.StartBeat, this.BPM);
this.PreviewStart = CBase.Base.Game.GetTimeFromBeats(this.Medley.StartBeat, this.BPM);
}
}
+5 -7
View File
@@ -11,21 +11,19 @@ namespace Vocaluxe.Menu.SongMenu
public class CSongMenu : ISongMenu
{
private int _PartyModeID;
private Basic _Base;
private ISongMenu _SongMenu;
private ESongMenu _Type;
public CSongMenu(Basic Base, int PartyModeID)
public CSongMenu(int PartyModeID)
{
_PartyModeID = PartyModeID;
_Base = Base;
CreateSongMenu();
}
public void UpdateSongMenuType()
{
if (_Type != _Base.Config.GetSongMenuType())
if (_Type != CBase.Base.Config.GetSongMenuType())
CreateSongMenu();
}
@@ -208,7 +206,7 @@ namespace Vocaluxe.Menu.SongMenu
_SongMenu.OnHide();
}
switch (_Base.Config.GetSongMenuType())
switch (CBase.Base.Config.GetSongMenuType())
{
//case ESongMenu.TR_CONFIG_LIST:
// _SongMenu = new CSongMenuList();
@@ -219,7 +217,7 @@ namespace Vocaluxe.Menu.SongMenu
// break;
case ESongMenu.TR_CONFIG_TILE_BOARD:
_SongMenu = new CSongMenuTileBoard(_Base, _PartyModeID);
_SongMenu = new CSongMenuTileBoard(_PartyModeID);
break;
//case ESongMenu.TR_CONFIG_BOOK:
@@ -227,7 +225,7 @@ namespace Vocaluxe.Menu.SongMenu
// break;
}
_Type = _Base.Config.GetSongMenuType();
_Type = CBase.Base.Config.GetSongMenuType();
}
}
}
+2 -5
View File
@@ -6,12 +6,9 @@ namespace Vocaluxe.Menu.SongMenu
{
class CSongMenuBook : CSongMenuFramework
{
new private Basic _Base;
public CSongMenuBook(Basic Base, int PartyModeID)
: base(Base, PartyModeID)
public CSongMenuBook(int PartyModeID)
: base(PartyModeID)
{
_Base = Base;
}
}
}
@@ -8,7 +8,6 @@ namespace Vocaluxe.Menu.SongMenu
{
class CSongMenuDreidel : CSongMenuFramework
{
new private Basic _Base;
/*
private SRectF _ScrollRect;
private CStatic _CoverBig;
@@ -29,10 +28,9 @@ namespace Vocaluxe.Menu.SongMenu
}
*/
public CSongMenuDreidel(Basic Base, int PartyModeID)
: base(Base, PartyModeID)
public CSongMenuDreidel(int PartyModeID)
: base(PartyModeID)
{
_Base = Base;
}
public override void Init()
+46 -48
View File
@@ -91,7 +91,6 @@ namespace Vocaluxe.Menu.SongMenu
abstract class CSongMenuFramework : ISongMenu
{
protected int _PartyModeID;
protected Basic _Base;
protected SThemeSongMenu _Theme;
private bool _ThemeLoaded;
@@ -233,22 +232,21 @@ namespace Vocaluxe.Menu.SongMenu
_Visible = Visible;
}
public CSongMenuFramework(Basic Base, int PartyModeID)
public CSongMenuFramework(int PartyModeID)
{
_PartyModeID = PartyModeID;
_Base = Base;
_Theme = new SThemeSongMenu();
_Theme.songMenuTileBoard.TextArtist = new CText(_Base, _PartyModeID);
_Theme.songMenuTileBoard.TextTitle = new CText(_Base, _PartyModeID);
_Theme.songMenuTileBoard.TextSongLength = new CText(_Base, _PartyModeID);
_Theme.songMenuTileBoard.TextArtist = new CText(_PartyModeID);
_Theme.songMenuTileBoard.TextTitle = new CText(_PartyModeID);
_Theme.songMenuTileBoard.TextSongLength = new CText(_PartyModeID);
_Theme.songMenuTileBoard.StaticCoverBig = new CStatic(_Base, _PartyModeID);
_Theme.songMenuTileBoard.StaticTextBG = new CStatic(_Base, _PartyModeID);
_Theme.songMenuTileBoard.StaticDuetIcon = new CStatic(_Base, _PartyModeID);
_Theme.songMenuTileBoard.StaticVideoIcon = new CStatic(_Base, _PartyModeID);
_Theme.songMenuTileBoard.StaticMedleyCalcIcon = new CStatic(_Base, _PartyModeID);
_Theme.songMenuTileBoard.StaticMedleyTagIcon = new CStatic(_Base, _PartyModeID);
_Theme.songMenuTileBoard.StaticCoverBig = new CStatic(_PartyModeID);
_Theme.songMenuTileBoard.StaticTextBG = new CStatic(_PartyModeID);
_Theme.songMenuTileBoard.StaticDuetIcon = new CStatic(_PartyModeID);
_Theme.songMenuTileBoard.StaticVideoIcon = new CStatic(_PartyModeID);
_Theme.songMenuTileBoard.StaticMedleyCalcIcon = new CStatic(_PartyModeID);
_Theme.songMenuTileBoard.StaticMedleyTagIcon = new CStatic(_PartyModeID);
_ThemeLoaded = false;
}
@@ -272,7 +270,7 @@ namespace Vocaluxe.Menu.SongMenu
if (xmlReader.GetValue(item + "/Color", ref _Theme.ColorName, String.Empty))
{
_ThemeLoaded &= _Base.Theme.GetColor(_Theme.ColorName, SkinIndex, ref _Color);
_ThemeLoaded &= CBase.Base.Theme.GetColor(_Theme.ColorName, SkinIndex, ref _Color);
}
else
{
@@ -443,17 +441,17 @@ namespace Vocaluxe.Menu.SongMenu
if (_streams.Count > 0 && _video != -1)
{
if (_Base.Video.IsFinished(_video) || _Base.Sound.IsFinished(_actsongstream))
if (CBase.Base.Video.IsFinished(_video) || CBase.Base.Sound.IsFinished(_actsongstream))
{
_Base.Video.Close(_video);
CBase.Base.Video.Close(_video);
_video = -1;
return;
}
float time = _Base.Sound.GetPosition(_actsongstream);
float time = CBase.Base.Sound.GetPosition(_actsongstream);
float vtime = 0f;
_Base.Video.GetFrame(_video, ref _vidtex, time, ref vtime);
CBase.Base.Video.GetFrame(_video, ref _vidtex, time, ref vtime);
if (_VideoFadeTimer.ElapsedMilliseconds <= 3000L)
{
_vidtex.color.A = (_VideoFadeTimer.ElapsedMilliseconds / 3000f);
@@ -476,14 +474,14 @@ namespace Vocaluxe.Menu.SongMenu
{
foreach (int stream in _streams)
{
_Base.Sound.FadeAndStop(stream, 0f, 0.75f);
CBase.Base.Sound.FadeAndStop(stream, 0f, 0.75f);
}
_streams.Clear();
_Base.Video.Close(_video);
CBase.Base.Video.Close(_video);
_video = -1;
_Base.Drawing.RemoveTexture(ref _vidtex);
CBase.Base.Drawing.RemoveTexture(ref _vidtex);
_timer.Stop();
_timer.Reset();
@@ -509,7 +507,7 @@ namespace Vocaluxe.Menu.SongMenu
if (_video != -1)
{
_Base.Drawing.DrawTexture(_vidtex, new SRectF(0, 0, 1280, 720, 0));
CBase.Base.Drawing.DrawTexture(_vidtex, new SRectF(0, 0, 1280, 720, 0));
}
}
@@ -520,7 +518,7 @@ namespace Vocaluxe.Menu.SongMenu
foreach (int stream in _streams)
{
_Base.Sound.SetStreamVolumeMax(stream, _MaxVolume);
CBase.Base.Sound.SetStreamVolumeMax(stream, _MaxVolume);
}
}
@@ -541,7 +539,7 @@ namespace Vocaluxe.Menu.SongMenu
public virtual CStatic GetSelectedSongCover()
{
return new CStatic(_Base, _PartyModeID);
return new CStatic(_PartyModeID);
}
public virtual int GetSelectedCategory()
@@ -581,7 +579,7 @@ namespace Vocaluxe.Menu.SongMenu
Init();
if (_Theme.ColorName != String.Empty)
_Color = _Base.Theme.GetColor(_Theme.ColorName, _PartyModeID);
_Color = CBase.Base.Theme.GetColor(_Theme.ColorName, _PartyModeID);
}
public void ReloadTextures()
@@ -595,11 +593,11 @@ namespace Vocaluxe.Menu.SongMenu
if (!_Initialized)
return;
if (Category >= _Base.Songs.GetNumCategories())
if (Category >= CBase.Base.Songs.GetNumCategories())
return;
Reset();
_Base.Songs.SetCategory(Category);
CBase.Base.Songs.SetCategory(Category);
}
protected virtual void ShowCategories()
@@ -607,59 +605,59 @@ namespace Vocaluxe.Menu.SongMenu
if (!_Initialized)
return;
if (_Base.Songs.GetCurrentCategoryIndex() != -1)
if (CBase.Base.Songs.GetCurrentCategoryIndex() != -1)
Reset();
Reset();
_Base.Songs.SetCategory(-1);
CBase.Base.Songs.SetCategory(-1);
}
public void ApplyVolume()
{
_Base.Sound.SetStreamVolume(_actsongstream, _Base.Config.GetPreviewMusicVolume());
CBase.Base.Sound.SetStreamVolume(_actsongstream, CBase.Base.Config.GetPreviewMusicVolume());
}
protected void SelectSong(int nr)
{
if (_Base.Songs.GetCurrentCategoryIndex() >= 0 && (_Base.Songs.GetNumVisibleSongs() > 0) && (nr >= 0) && ((_actsong != nr) || (_streams.Count == 0)))
if (CBase.Base.Songs.GetCurrentCategoryIndex() >= 0 && (CBase.Base.Songs.GetNumVisibleSongs() > 0) && (nr >= 0) && ((_actsong != nr) || (_streams.Count == 0)))
{
foreach (int stream in _streams)
{
_Base.Sound.FadeAndStop(stream, 0f, 1f);
CBase.Base.Sound.FadeAndStop(stream, 0f, 1f);
}
_streams.Clear();
_Base.Video.Close(_video);
CBase.Base.Video.Close(_video);
_video = -1;
_Base.Drawing.RemoveTexture(ref _vidtex);
CBase.Base.Drawing.RemoveTexture(ref _vidtex);
_actsong = nr;
if (_actsong >= _Base.Songs.GetNumVisibleSongs())
if (_actsong >= CBase.Base.Songs.GetNumVisibleSongs())
_actsong = 0;
int _stream = _Base.Sound.Load(Path.Combine(_Base.Songs.GetVisibleSong(_actsong).Folder, _Base.Songs.GetVisibleSong(_actsong).MP3FileName), true);
_Base.Sound.SetStreamVolumeMax(_stream, _MaxVolume);
_Base.Sound.SetStreamVolume(_stream, 0f);
int _stream = CBase.Base.Sound.Load(Path.Combine(CBase.Base.Songs.GetVisibleSong(_actsong).Folder, CBase.Base.Songs.GetVisibleSong(_actsong).MP3FileName), true);
CBase.Base.Sound.SetStreamVolumeMax(_stream, _MaxVolume);
CBase.Base.Sound.SetStreamVolume(_stream, 0f);
float startposition = _Base.Songs.GetVisibleSong(_actsong).PreviewStart;
float startposition = CBase.Base.Songs.GetVisibleSong(_actsong).PreviewStart;
if (startposition == 0f)
startposition = _Base.Sound.GetLength(_stream) / 4f;
startposition = CBase.Base.Sound.GetLength(_stream) / 4f;
_Base.Sound.SetPosition(_stream, startposition);
_Base.Sound.Play(_stream);
_Base.Sound.Fade(_stream, 100f, 3f);
CBase.Base.Sound.SetPosition(_stream, startposition);
CBase.Base.Sound.Play(_stream);
CBase.Base.Sound.Fade(_stream, 100f, 3f);
_streams.Add(_stream);
_actsongstream = _stream;
if (_Base.Songs.GetVisibleSong(_actsong).VideoFileName != String.Empty && _Base.Config.GetVideoPreview() == EOffOn.TR_CONFIG_ON)
if (CBase.Base.Songs.GetVisibleSong(_actsong).VideoFileName != String.Empty && CBase.Base.Config.GetVideoPreview() == EOffOn.TR_CONFIG_ON)
{
_video = _Base.Video.Load(Path.Combine(_Base.Songs.GetVisibleSong(_actsong).Folder, _Base.Songs.GetVisibleSong(_actsong).VideoFileName));
_video = CBase.Base.Video.Load(Path.Combine(CBase.Base.Songs.GetVisibleSong(_actsong).Folder, CBase.Base.Songs.GetVisibleSong(_actsong).VideoFileName));
if (_video == -1)
return;
_Base.Video.Skip(_video, startposition, _Base.Songs.GetVisibleSong(_actsong).VideoGap);
CBase.Base.Video.Skip(_video, startposition, CBase.Base.Songs.GetVisibleSong(_actsong).VideoGap);
_VideoFadeTimer.Stop();
_VideoFadeTimer.Reset();
_VideoFadeTimer.Start();
@@ -671,14 +669,14 @@ namespace Vocaluxe.Menu.SongMenu
{
foreach (int stream in _streams)
{
_Base.Sound.FadeAndStop(stream, 0f, 0.75f);
CBase.Base.Sound.FadeAndStop(stream, 0f, 0.75f);
}
_streams.Clear();
_Base.Video.Close(_video);
CBase.Base.Video.Close(_video);
_video = -1;
_Base.Drawing.RemoveTexture(ref _vidtex);
CBase.Base.Drawing.RemoveTexture(ref _vidtex);
_timer.Stop();
_timer.Reset();
+2 -5
View File
@@ -6,12 +6,9 @@ namespace Vocaluxe.Menu.SongMenu
{
class CSongMenuList : CSongMenuFramework
{
new private Basic _Base;
public CSongMenuList(Basic Base, int PartyModeID)
: base(Base, PartyModeID)
public CSongMenuList(int PartyModeID)
: base(PartyModeID)
{
_Base = Base;
}
}
}
+89 -91
View File
@@ -11,7 +11,6 @@ namespace Vocaluxe.Menu.SongMenu
{
class CSongMenuTileBoard : CSongMenuFramework
{
new private Basic _Base;
private SRectF _ScrollRect;
private List<CStatic> _Tiles;
private CStatic _CoverBig;
@@ -42,10 +41,9 @@ namespace Vocaluxe.Menu.SongMenu
private bool _SmallView = false;
public CSongMenuTileBoard(Basic Base, int PartyModeID)
: base(Base, PartyModeID)
public CSongMenuTileBoard(int PartyModeID)
: base(PartyModeID)
{
_Base = Base;
}
public override int GetActualSelection()
@@ -69,8 +67,8 @@ namespace Vocaluxe.Menu.SongMenu
_TileW = (int)((_Theme.songMenuTileBoard.TileRect.W - _SpaceW * (_NumW - 1)) / _NumW);
_TileH = (int)((_Theme.songMenuTileBoard.TileRect.H - _SpaceH * (_NumH - 1)) / _NumH);
_CoverTexture = _Base.Theme.GetSkinTexture(_Theme.CoverBackgroundName, _PartyModeID);
_CoverBigTexture = _Base.Theme.GetSkinTexture(_Theme.CoverBigBackgroundName, _PartyModeID);
_CoverTexture = CBase.Base.Theme.GetSkinTexture(_Theme.CoverBackgroundName, _PartyModeID);
_CoverBigTexture = CBase.Base.Theme.GetSkinTexture(_Theme.CoverBigBackgroundName, _PartyModeID);
_Tiles = new List<CStatic>();
for (int i = 0; i < _NumH; i++)
@@ -79,12 +77,12 @@ namespace Vocaluxe.Menu.SongMenu
{
SRectF rect = new SRectF(_Theme.songMenuTileBoard.TileRect.X + j * (_TileW + _SpaceW),
_Theme.songMenuTileBoard.TileRect.Y + i * (_TileH + _SpaceH), _TileW, _TileH, _Rect.Z);
CStatic tile = new CStatic(_Base, _PartyModeID, _CoverTexture, Color, rect);
CStatic tile = new CStatic(_PartyModeID, _CoverTexture, Color, rect);
_Tiles.Add(tile);
}
}
_ScrollRect = new SRectF(0, 0, _Base.Settings.GetRenderW(), _Base.Settings.GetRenderH(), _Theme.songMenuTileBoard.TileRect.Z);
_ScrollRect = new SRectF(0, 0, CBase.Base.Settings.GetRenderW(), CBase.Base.Settings.GetRenderH(), _Theme.songMenuTileBoard.TileRect.Z);
_PreviewSelected = -1;
_Offset = 0;
@@ -118,7 +116,7 @@ namespace Vocaluxe.Menu.SongMenu
public override void OnShow()
{
if (_Base.Songs.GetTabs() == EOffOn.TR_CONFIG_OFF && _Base.Songs.GetNumCategories() > 0 && _Base.Songs.GetCurrentCategoryIndex() == -1)
if (CBase.Base.Songs.GetTabs() == EOffOn.TR_CONFIG_OFF && CBase.Base.Songs.GetNumCategories() > 0 && CBase.Base.Songs.GetCurrentCategoryIndex() == -1)
{
EnterCategory(0);
}
@@ -129,13 +127,13 @@ namespace Vocaluxe.Menu.SongMenu
//AfterCategoryChange();
SetSelectedSong(_ActSong);
AfterCategoryChange();
_Base.Songs.UpdateRandomSongList();
CBase.Base.Songs.UpdateRandomSongList();
int actcat = _PreviewSelected;
if ((_Base.Songs.GetNumCategories() > 0) && (actcat < 0))
if ((CBase.Base.Songs.GetNumCategories() > 0) && (actcat < 0))
{
_CoverBig.Texture = _Base.Songs.GetCategory(0).CoverTextureSmall;
_Artist.Text = _Base.Songs.GetCategory(0).Name;
_CoverBig.Texture = CBase.Base.Songs.GetCategory(0).CoverTextureSmall;
_Artist.Text = CBase.Base.Songs.GetCategory(0).Name;
_Title.Text = String.Empty;
_SongLength.Text = String.Empty;
_PreviewSelected = 0;
@@ -146,7 +144,7 @@ namespace Vocaluxe.Menu.SongMenu
_MedleyTagIcon.Visible = false;
}
if (_Base.Songs.GetNumVisibleSongs() == 0 && _Base.Songs.GetSearchFilter() != String.Empty)
if (CBase.Base.Songs.GetNumVisibleSongs() == 0 && CBase.Base.Songs.GetSearchFilter() != String.Empty)
{
_CoverBig.Texture = _CoverBigTexture;
_Artist.Text = String.Empty;
@@ -207,7 +205,7 @@ namespace Vocaluxe.Menu.SongMenu
switch (KeyEvent.Key)
{
case Keys.Enter:
if (_Base.Songs.GetCurrentCategoryIndex() < 0)
if (CBase.Base.Songs.GetCurrentCategoryIndex() < 0)
{
EnterCategory(_PreviewSelected);
KeyEvent.Handled = true;
@@ -220,71 +218,71 @@ namespace Vocaluxe.Menu.SongMenu
case Keys.Escape:
case Keys.Back:
if (_Base.Songs.GetCurrentCategoryIndex() > -1 && _Base.Songs.GetTabs() == EOffOn.TR_CONFIG_ON && SongOptions.Selection.CategoryChangeAllowed)
if (CBase.Base.Songs.GetCurrentCategoryIndex() > -1 && CBase.Base.Songs.GetTabs() == EOffOn.TR_CONFIG_ON && SongOptions.Selection.CategoryChangeAllowed)
{
ShowCategories();
KeyEvent.Handled = true;
}
//else if (_Base.Songs.GetTabs() == EOffOn.TR_CONFIG_OFF)
//else if (CBase.Base.Songs.GetTabs() == EOffOn.TR_CONFIG_OFF)
//{
// CGraphics.FadeTo(EScreens.ScreenMain);
//}
break;
case Keys.PageUp:
if (_Base.Songs.GetTabs() == EOffOn.TR_CONFIG_ON && SongOptions.Selection.CategoryChangeAllowed)
if (CBase.Base.Songs.GetTabs() == EOffOn.TR_CONFIG_ON && SongOptions.Selection.CategoryChangeAllowed)
{
PrevCategory();
}
break;
case Keys.PageDown:
if (_Base.Songs.GetTabs() == EOffOn.TR_CONFIG_ON && SongOptions.Selection.CategoryChangeAllowed)
if (CBase.Base.Songs.GetTabs() == EOffOn.TR_CONFIG_ON && SongOptions.Selection.CategoryChangeAllowed)
{
NextCategory();
}
break;
case Keys.Left:
if (_Locked > 0 && (!SongOptions.Selection.RandomOnly || SongOptions.Selection.CategoryChangeAllowed && _Base.Songs.GetCurrentCategoryIndex() < 0))
if (_Locked > 0 && (!SongOptions.Selection.RandomOnly || SongOptions.Selection.CategoryChangeAllowed && CBase.Base.Songs.GetCurrentCategoryIndex() < 0))
{
_Locked--;
if (_Base.Songs.GetCurrentCategoryIndex() < 0 && _Locked < _Base.Songs.GetNumCategories() - _NumW ||
_Base.Songs.GetCurrentCategoryIndex() >= 0 && _Locked < _Base.Songs.GetNumVisibleSongs() - _NumW)
if (CBase.Base.Songs.GetCurrentCategoryIndex() < 0 && _Locked < CBase.Base.Songs.GetNumCategories() - _NumW ||
CBase.Base.Songs.GetCurrentCategoryIndex() >= 0 && _Locked < CBase.Base.Songs.GetNumVisibleSongs() - _NumW)
UpdateList((_Locked / _NumW) * _NumW - (_NumW * (_NumH - 2)));
}
break;
case Keys.Right:
if (_Base.Songs.GetCurrentCategoryIndex() < 0 && SongOptions.Selection.CategoryChangeAllowed)
if (CBase.Base.Songs.GetCurrentCategoryIndex() < 0 && SongOptions.Selection.CategoryChangeAllowed)
{
if (_Locked < _Base.Songs.GetNumCategories() - 1)
if (_Locked < CBase.Base.Songs.GetNumCategories() - 1)
{
_Locked++;
if (_Locked < _Base.Songs.GetNumCategories() - _NumW)
if (_Locked < CBase.Base.Songs.GetNumCategories() - _NumW)
UpdateList((_Locked / _NumW) * _NumW - (_NumW * (_NumH - 2)));
}
}
else
{
if (_Base.Songs.GetCurrentCategoryIndex() != -1 && _Locked < _Base.Songs.GetNumVisibleSongs() - 1 && !SongOptions.Selection.RandomOnly)
if (CBase.Base.Songs.GetCurrentCategoryIndex() != -1 && _Locked < CBase.Base.Songs.GetNumVisibleSongs() - 1 && !SongOptions.Selection.RandomOnly)
{
_Locked++;
if (_Locked < _Base.Songs.GetNumVisibleSongs() - _NumW)
if (_Locked < CBase.Base.Songs.GetNumVisibleSongs() - _NumW)
UpdateList((_Locked / _NumW) * _NumW - (_NumW * (_NumH - 2)));
}
}
break;
case Keys.Up:
if (KeyEvent.ModSHIFT && _Base.Songs.GetTabs() == EOffOn.TR_CONFIG_ON && SongOptions.Selection.CategoryChangeAllowed)
if (KeyEvent.ModSHIFT && CBase.Base.Songs.GetTabs() == EOffOn.TR_CONFIG_ON && SongOptions.Selection.CategoryChangeAllowed)
{
PrevCategory();
break;
}
if (_Locked > _NumW - 1 && (!SongOptions.Selection.RandomOnly || SongOptions.Selection.CategoryChangeAllowed && _Base.Songs.GetCurrentCategoryIndex() < 0))
if (_Locked > _NumW - 1 && (!SongOptions.Selection.RandomOnly || SongOptions.Selection.CategoryChangeAllowed && CBase.Base.Songs.GetCurrentCategoryIndex() < 0))
{
_Locked -= _NumW;
UpdateList((_Locked / _NumW) * _NumW - (_NumW * (_NumH - 2)));
@@ -292,28 +290,28 @@ namespace Vocaluxe.Menu.SongMenu
break;
case Keys.Down:
if (KeyEvent.ModSHIFT && _Base.Songs.GetTabs() == EOffOn.TR_CONFIG_ON && SongOptions.Selection.CategoryChangeAllowed)
if (KeyEvent.ModSHIFT && CBase.Base.Songs.GetTabs() == EOffOn.TR_CONFIG_ON && SongOptions.Selection.CategoryChangeAllowed)
{
NextCategory();
break;
}
if (_Base.Songs.GetCurrentCategoryIndex() < 0 && SongOptions.Selection.CategoryChangeAllowed)
if (CBase.Base.Songs.GetCurrentCategoryIndex() < 0 && SongOptions.Selection.CategoryChangeAllowed)
{
if (_Locked < _Base.Songs.GetNumCategories() - _NumW)
if (_Locked < CBase.Base.Songs.GetNumCategories() - _NumW)
{
_Locked += _NumW;
if (_Locked < _Base.Songs.GetNumCategories() - _NumW)
if (_Locked < CBase.Base.Songs.GetNumCategories() - _NumW)
UpdateList((_Locked / _NumW) * _NumW - (_NumW * (_NumH - 2)));
}
}
else
{
if (_Locked < _Base.Songs.GetNumVisibleSongs() - _NumW && !SongOptions.Selection.RandomOnly)
if (_Locked < CBase.Base.Songs.GetNumVisibleSongs() - _NumW && !SongOptions.Selection.RandomOnly)
{
_Locked += _NumW;
if (_Locked < _Base.Songs.GetNumVisibleSongs() - _NumW)
if (_Locked < CBase.Base.Songs.GetNumVisibleSongs() - _NumW)
UpdateList((_Locked / _NumW) * _NumW - (_NumW * (_NumH - 2)));
}
}
@@ -343,13 +341,13 @@ namespace Vocaluxe.Menu.SongMenu
bool sel = false;
int lastselection = _actualSelection;
if (!SongOptions.Selection.RandomOnly || _Base.Songs.GetCurrentCategoryIndex() < 0 && SongOptions.Selection.CategoryChangeAllowed)
if (!SongOptions.Selection.RandomOnly || CBase.Base.Songs.GetCurrentCategoryIndex() < 0 && SongOptions.Selection.CategoryChangeAllowed)
{
foreach (CStatic tile in _Tiles)
{
if ((tile.Texture.index != _CoverTexture.index) && CHelper.IsInBounds(tile.Rect, MouseEvent) && !sel)
{
if (MouseEvent.LB || _Base.Songs.GetCurrentCategoryIndex() == -1)
if (MouseEvent.LB || CBase.Base.Songs.GetCurrentCategoryIndex() == -1)
{
if (_PreviewSelected == i + _Offset)
_Locked = _PreviewSelected;
@@ -374,29 +372,29 @@ namespace Vocaluxe.Menu.SongMenu
sel = true;
if (MouseEvent.Sender == ESender.WiiMote && _actualSelection != lastselection && _actualSelection != -1)
_Base.Input.SetRumble(0.050f);
CBase.Base.Input.SetRumble(0.050f);
if (!sel)
_actualSelection = -1;
if ((MouseEvent.RB) && (_Base.Songs.GetNumCategories() > 0) && _Base.Songs.GetCurrentCategoryIndex() >= 0 && _Base.Songs.GetTabs() == EOffOn.TR_CONFIG_ON && SongOptions.Selection.CategoryChangeAllowed)
if ((MouseEvent.RB) && (CBase.Base.Songs.GetNumCategories() > 0) && CBase.Base.Songs.GetCurrentCategoryIndex() >= 0 && CBase.Base.Songs.GetTabs() == EOffOn.TR_CONFIG_ON && SongOptions.Selection.CategoryChangeAllowed)
{
ShowCategories();
MouseEvent.Handled = true;
return;
}
else if (MouseEvent.RB && _Base.Songs.GetTabs() == EOffOn.TR_CONFIG_OFF && !SongOptions.Selection.PartyMode)
else if (MouseEvent.RB && CBase.Base.Songs.GetTabs() == EOffOn.TR_CONFIG_OFF && !SongOptions.Selection.PartyMode)
{
_Base.Graphics.FadeTo(EScreens.ScreenMain);
CBase.Base.Graphics.FadeTo(EScreens.ScreenMain);
}
else if (_PreviewSelected != -1 && MouseEvent.LB && _Base.Songs.GetCurrentCategoryIndex() != -1 && !SongOptions.Selection.PartyMode)
else if (_PreviewSelected != -1 && MouseEvent.LB && CBase.Base.Songs.GetCurrentCategoryIndex() != -1 && !SongOptions.Selection.PartyMode)
{
if (CHelper.IsInBounds(_CoverBig.Rect, MouseEvent) || CHelper.IsInBounds(_TextBG.Rect, MouseEvent))
{
_Locked = _PreviewSelected;
}
}
else if ((MouseEvent.LB) && (_Base.Songs.GetCurrentCategoryIndex() == -1))
else if ((MouseEvent.LB) && (CBase.Base.Songs.GetCurrentCategoryIndex() == -1))
{
foreach (CStatic tile in _Tiles)
{
@@ -411,10 +409,10 @@ namespace Vocaluxe.Menu.SongMenu
if (MouseEvent.Wheel > 0)
{
if (CHelper.IsInBounds(_ScrollRect, MouseEvent) && (!SongOptions.Selection.RandomOnly || _Base.Songs.GetCurrentCategoryIndex() < 0 && SongOptions.Selection.CategoryChangeAllowed))
if (CHelper.IsInBounds(_ScrollRect, MouseEvent) && (!SongOptions.Selection.RandomOnly || CBase.Base.Songs.GetCurrentCategoryIndex() < 0 && SongOptions.Selection.CategoryChangeAllowed))
{
if (_Base.Songs.GetCurrentCategoryIndex() >= 0 && _Base.Songs.GetNumVisibleSongs() > _Offset + _NumW * MouseEvent.Wheel + _NumW * (_NumH - 1) ||
_Base.Songs.GetCurrentCategoryIndex() < 0 && _Base.Songs.GetNumCategories() > _Offset + _NumW * MouseEvent.Wheel + _NumW * (_NumH - 1))
if (CBase.Base.Songs.GetCurrentCategoryIndex() >= 0 && CBase.Base.Songs.GetNumVisibleSongs() > _Offset + _NumW * MouseEvent.Wheel + _NumW * (_NumH - 1) ||
CBase.Base.Songs.GetCurrentCategoryIndex() < 0 && CBase.Base.Songs.GetNumCategories() > _Offset + _NumW * MouseEvent.Wheel + _NumW * (_NumH - 1))
{
_Offset += _NumW * MouseEvent.Wheel;
UpdateList(_Offset);
@@ -424,7 +422,7 @@ namespace Vocaluxe.Menu.SongMenu
if (MouseEvent.Wheel < 0)
{
if (CHelper.IsInBounds(_ScrollRect, MouseEvent) && (!SongOptions.Selection.RandomOnly || _Base.Songs.GetCurrentCategoryIndex() < 0 && SongOptions.Selection.CategoryChangeAllowed))
if (CHelper.IsInBounds(_ScrollRect, MouseEvent) && (!SongOptions.Selection.RandomOnly || CBase.Base.Songs.GetCurrentCategoryIndex() < 0 && SongOptions.Selection.CategoryChangeAllowed))
{
_Offset += _NumW * MouseEvent.Wheel;
if (_Offset < 0)
@@ -451,12 +449,12 @@ namespace Vocaluxe.Menu.SongMenu
}
}
if (_Base.Songs.GetCurrentCategoryIndex() >= 0)
if (CBase.Base.Songs.GetCurrentCategoryIndex() >= 0)
{
int actsong = _PreviewSelected;
if ((_Base.Songs.GetNumVisibleSongs() > actsong) && (actsong >= 0))
if ((CBase.Base.Songs.GetNumVisibleSongs() > actsong) && (actsong >= 0))
{
CSong song = _Base.Songs.GetVisibleSong(actsong);
CSong song = CBase.Base.Songs.GetVisibleSong(actsong);
_CoverBig.Texture = song.CoverTextureSmall;
_Artist.Text = song.Artist;
@@ -466,7 +464,7 @@ namespace Vocaluxe.Menu.SongMenu
_MedleyCalcIcon.Visible = song.Medley.Source == EMedleySource.Calculated;
_MedleyTagIcon.Visible = song.Medley.Source == EMedleySource.Tag;
float Time = _Base.Sound.GetLength(_SongStream);
float Time = CBase.Base.Sound.GetLength(_SongStream);
if (song.Finish != 0)
Time = song.Finish;
@@ -479,16 +477,16 @@ namespace Vocaluxe.Menu.SongMenu
else
{
int actcat = _PreviewSelected;
if ((_Base.Songs.GetNumCategories() > actcat) && (actcat >= 0))
if ((CBase.Base.Songs.GetNumCategories() > actcat) && (actcat >= 0))
{
_CoverBig.Texture = _Base.Songs.GetCategory(actcat).CoverTextureSmall;
_Artist.Text = _Base.Songs.GetCategory(actcat).Name;
_CoverBig.Texture = CBase.Base.Songs.GetCategory(actcat).CoverTextureSmall;
_Artist.Text = CBase.Base.Songs.GetCategory(actcat).Name;
int num = _Base.Songs.NumSongsInCategory(actcat);
int num = CBase.Base.Songs.NumSongsInCategory(actcat);
if (num != 1)
_Title.Text = _Base.Language.Translate("TR_SCREENSONG_NUMSONGS").Replace("%v", num.ToString());
_Title.Text = CBase.Base.Language.Translate("TR_SCREENSONG_NUMSONGS").Replace("%v", num.ToString());
else
_Title.Text = _Base.Language.Translate("TR_SCREENSONG_NUMSONG").Replace("%v", num.ToString());
_Title.Text = CBase.Base.Language.Translate("TR_SCREENSONG_NUMSONG").Replace("%v", num.ToString());
_SongLength.Text = String.Empty;
_DuetIcon.Visible = false;
@@ -510,9 +508,9 @@ namespace Vocaluxe.Menu.SongMenu
RectangleF rect = new RectangleF(0f, 0f, _vidtex.width, _vidtex.height);
CHelper.SetRect(bounds, ref rect, rect.Width / rect.Height, EAspect.Crop);
_Base.Drawing.DrawTexture(_vidtex, new SRectF(rect.X, rect.Y, rect.Width, rect.Height, _CoverBig.Rect.Z),
CBase.Base.Drawing.DrawTexture(_vidtex, new SRectF(rect.X, rect.Y, rect.Width, rect.Height, _CoverBig.Rect.Z),
_vidtex.color, new SRectF(bounds.X, bounds.Y, bounds.Width, bounds.Height, 0f), false);
_Base.Drawing.DrawTextureReflection(_vidtex, new SRectF(rect.X, rect.Y, rect.Width, rect.Height, _CoverBig.Rect.Z),
CBase.Base.Drawing.DrawTextureReflection(_vidtex, new SRectF(rect.X, rect.Y, rect.Width, rect.Height, _CoverBig.Rect.Z),
_vidtex.color, new SRectF(bounds.X, bounds.Y, bounds.Width, bounds.Height, 0f), _CoverBig.ReflectionSpace, _CoverBig.ReflectionHeight);
}
@@ -540,7 +538,7 @@ namespace Vocaluxe.Menu.SongMenu
if (tile.Selected)
return new CStatic(tile);
}
return new CStatic(_Base, _PartyModeID);
return new CStatic(_PartyModeID);
}
public override void SetSelectedSong(int VisibleSongNr)
@@ -550,7 +548,7 @@ namespace Vocaluxe.Menu.SongMenu
if (VisibleSongNr < 0)
return;
if (_Base.Songs.GetNumVisibleSongs() > VisibleSongNr)
if (CBase.Base.Songs.GetNumVisibleSongs() > VisibleSongNr)
{
bool sel = false;
foreach (CStatic tile in _Tiles)
@@ -607,7 +605,7 @@ namespace Vocaluxe.Menu.SongMenu
if (CategoryNr < 0)
return;
if (_Base.Songs.GetNumCategories() > CategoryNr)
if (CBase.Base.Songs.GetNumCategories() > CategoryNr)
{
bool sel = false;
foreach (CStatic tile in _Tiles)
@@ -680,19 +678,19 @@ namespace Vocaluxe.Menu.SongMenu
private void NextCategory()
{
if (_Base.Songs.GetCurrentCategoryIndex() > -1)
if (CBase.Base.Songs.GetCurrentCategoryIndex() > -1)
{
_Base.Songs.NextCategory();
EnterCategory(_Base.Songs.GetCurrentCategoryIndex());
CBase.Base.Songs.NextCategory();
EnterCategory(CBase.Base.Songs.GetCurrentCategoryIndex());
}
}
private void PrevCategory()
{
if (_Base.Songs.GetCurrentCategoryIndex() > -1)
if (CBase.Base.Songs.GetCurrentCategoryIndex() > -1)
{
_Base.Songs.PrevCategory();
EnterCategory(_Base.Songs.GetCurrentCategoryIndex());
CBase.Base.Songs.PrevCategory();
EnterCategory(CBase.Base.Songs.GetCurrentCategoryIndex());
}
}
@@ -709,26 +707,26 @@ namespace Vocaluxe.Menu.SongMenu
if (_actualSelection >= 0 && _actualSelection < _Tiles.Count)
_Tiles[_actualSelection].Selected = true;
if ((_LastKnownNumSongs == _Base.Songs.GetNumVisibleSongs()) && (_LastKnownCategory == _Base.Songs.GetCurrentCategoryIndex()))
if ((_LastKnownNumSongs == CBase.Base.Songs.GetNumVisibleSongs()) && (_LastKnownCategory == CBase.Base.Songs.GetCurrentCategoryIndex()))
return;
_LastKnownCategory = _Base.Songs.GetCurrentCategoryIndex();
_LastKnownNumSongs = _Base.Songs.GetNumVisibleSongs();
_LastKnownCategory = CBase.Base.Songs.GetCurrentCategoryIndex();
_LastKnownNumSongs = CBase.Base.Songs.GetNumVisibleSongs();
UpdateList(0);
_Base.Songs.UpdateRandomSongList();
CBase.Base.Songs.UpdateRandomSongList();
}
private void UpdateList(int offset)
{
if (_Base.Songs.GetCurrentCategoryIndex() > -1)
if (CBase.Base.Songs.GetCurrentCategoryIndex() > -1)
{
if (offset >= (_Base.Songs.GetNumVisibleSongs() / _NumW) * _NumW - (_NumW * (_NumH - 1)))
offset = (_Base.Songs.GetNumVisibleSongs() / _NumW) * _NumW - (_NumW * (_NumH - 1));
if (offset >= (CBase.Base.Songs.GetNumVisibleSongs() / _NumW) * _NumW - (_NumW * (_NumH - 1)))
offset = (CBase.Base.Songs.GetNumVisibleSongs() / _NumW) * _NumW - (_NumW * (_NumH - 1));
}
else
{
if (offset >= (_Base.Songs.GetNumCategories() / _NumW) * _NumW - (_NumW * (_NumH - 1)))
offset = (_Base.Songs.GetNumCategories() / _NumW) * _NumW - (_NumW * (_NumH - 1));
if (offset >= (CBase.Base.Songs.GetNumCategories() / _NumW) * _NumW - (_NumW * (_NumH - 1)))
offset = (CBase.Base.Songs.GetNumCategories() / _NumW) * _NumW - (_NumW * (_NumH - 1));
}
if (offset < 0)
@@ -736,11 +734,11 @@ namespace Vocaluxe.Menu.SongMenu
for (int i = 0; i < _Tiles.Count; i++)
{
if (_Base.Songs.GetCurrentCategoryIndex() >= 0)
if (CBase.Base.Songs.GetCurrentCategoryIndex() >= 0)
{
if (_Base.Songs.GetNumVisibleSongs() > i + offset)
if (CBase.Base.Songs.GetNumVisibleSongs() > i + offset)
{
_Tiles[i].Texture = _Base.Songs.GetVisibleSong(i + offset).CoverTextureSmall;
_Tiles[i].Texture = CBase.Base.Songs.GetVisibleSong(i + offset).CoverTextureSmall;
_Tiles[i].Color = new SColorF(1f, 1f, 1f, 1f);
}
else
@@ -750,11 +748,11 @@ namespace Vocaluxe.Menu.SongMenu
}
}
if (_Base.Songs.GetCurrentCategoryIndex() == -1)
if (CBase.Base.Songs.GetCurrentCategoryIndex() == -1)
{
if (_Base.Songs.GetNumCategories() > i + offset)
if (CBase.Base.Songs.GetNumCategories() > i + offset)
{
_Tiles[i].Texture = _Base.Songs.GetCategory(i + offset).CoverTextureSmall;
_Tiles[i].Texture = CBase.Base.Songs.GetCategory(i + offset).CoverTextureSmall;
_Tiles[i].Color = new SColorF(1f, 1f, 1f, 1f);
}
else
@@ -781,8 +779,8 @@ namespace Vocaluxe.Menu.SongMenu
_TileW = (int)((_Theme.songMenuTileBoard.TileRectSmall.W - _SpaceW * (_NumW - 1)) / _NumW);
_TileH = (int)((_Theme.songMenuTileBoard.TileRectSmall.H - _SpaceH * (_NumH - 1)) / _NumH);
_CoverTexture = _Base.Theme.GetSkinTexture(_Theme.CoverBackgroundName, _PartyModeID);
_CoverBigTexture = _Base.Theme.GetSkinTexture(_Theme.CoverBigBackgroundName, _PartyModeID);
_CoverTexture = CBase.Base.Theme.GetSkinTexture(_Theme.CoverBackgroundName, _PartyModeID);
_CoverBigTexture = CBase.Base.Theme.GetSkinTexture(_Theme.CoverBigBackgroundName, _PartyModeID);
_Tiles = new List<CStatic>();
for (int i = 0; i < _NumH; i++)
@@ -791,13 +789,13 @@ namespace Vocaluxe.Menu.SongMenu
{
SRectF rect = new SRectF(_Theme.songMenuTileBoard.TileRectSmall.X + j * (_TileW + _SpaceW),
_Theme.songMenuTileBoard.TileRectSmall.Y + i * (_TileH + _SpaceH), _TileW, _TileH, _Rect.Z);
CStatic tile = new CStatic(_Base, _PartyModeID, _CoverTexture, Color, rect);
CStatic tile = new CStatic(_PartyModeID, _CoverTexture, Color, rect);
_Tiles.Add(tile);
}
}
_Rect = _Theme.songMenuTileBoard.TileRectSmall;
_ScrollRect = new SRectF(0, 0, _Base.Settings.GetRenderW(), _Base.Settings.GetRenderH(), _Theme.songMenuTileBoard.TileRectSmall.Z);
_ScrollRect = new SRectF(0, 0, CBase.Base.Settings.GetRenderW(), CBase.Base.Settings.GetRenderH(), _Theme.songMenuTileBoard.TileRectSmall.Z);
}
else
{
@@ -807,8 +805,8 @@ namespace Vocaluxe.Menu.SongMenu
_TileW = (int)((_Theme.songMenuTileBoard.TileRect.W - _SpaceW * (_NumW - 1)) / _NumW);
_TileH = (int)((_Theme.songMenuTileBoard.TileRect.H - _SpaceH * (_NumH - 1)) / _NumH);
_CoverTexture = _Base.Theme.GetSkinTexture(_Theme.CoverBackgroundName, _PartyModeID);
_CoverBigTexture = _Base.Theme.GetSkinTexture(_Theme.CoverBigBackgroundName, _PartyModeID);
_CoverTexture = CBase.Base.Theme.GetSkinTexture(_Theme.CoverBackgroundName, _PartyModeID);
_CoverBigTexture = CBase.Base.Theme.GetSkinTexture(_Theme.CoverBigBackgroundName, _PartyModeID);
_Tiles = new List<CStatic>();
for (int i = 0; i < _NumH; i++)
@@ -817,13 +815,13 @@ namespace Vocaluxe.Menu.SongMenu
{
SRectF rect = new SRectF(_Theme.songMenuTileBoard.TileRect.X + j * (_TileW + _SpaceW),
_Theme.songMenuTileBoard.TileRect.Y + i * (_TileH + _SpaceH), _TileW, _TileH, _Rect.Z);
CStatic tile = new CStatic(_Base, _PartyModeID, _CoverTexture, Color, rect);
CStatic tile = new CStatic(_PartyModeID, _CoverTexture, Color, rect);
_Tiles.Add(tile);
}
}
_Rect = _Theme.songMenuTileBoard.TileRect;
_ScrollRect = new SRectF(0, 0, _Base.Settings.GetRenderW(), _Base.Settings.GetRenderH(), _Theme.songMenuTileBoard.TileRect.Z);
_ScrollRect = new SRectF(0, 0, CBase.Base.Settings.GetRenderW(), CBase.Base.Settings.GetRenderH(), _Theme.songMenuTileBoard.TileRect.Z);
}
UpdateList((_Locked / _NumW) * _NumW - (_NumW * (_NumH - 2)));