Renaming for namesheme

This commit is contained in:
Flamefire committed 2013-04-15 19:10:38 +02:00
1 parent 1336a6fa36
commit 67da90427b
131 files changed
+11905 -11812

No files matched your search

+177 -177
View File
@@ -56,7 +56,7 @@ namespace VocaluxeLib.Menu.SongMenu
}
set
{
if (value.index != -1)
if (value.Index != -1)
{
_CoverTextureBig = value;
_CoverBigLoaded = true;
@@ -64,11 +64,11 @@ namespace VocaluxeLib.Menu.SongMenu
}
}
public CCategory(string name, STexture CoverSmall, STexture CoverBig)
public CCategory(string name, STexture coverSmall, STexture coverBig)
{
Name = name;
CoverTextureSmall = CoverSmall;
CoverTextureBig = CoverBig;
CoverTextureSmall = coverSmall;
CoverTextureBig = coverBig;
}
public CCategory(CCategory cat)
@@ -227,11 +227,11 @@ namespace VocaluxeLib.Menu.SongMenu
//No point creating a song without a text file --> Use factory method LoadSong
private CSong() {}
public static CSong LoadSong(string FilePath)
public static CSong LoadSong(string filePath)
{
CSong Song = new CSong();
if (Song.ReadHeader(FilePath))
return Song;
CSong song = new CSong();
if (song.ReadHeader(filePath))
return song;
return null;
}
@@ -316,12 +316,12 @@ namespace VocaluxeLib.Menu.SongMenu
return Path.Combine(Folder, VideoFileName);
}
public bool ReadHeader(string FilePath)
public bool ReadHeader(string filePath)
{
if (!File.Exists(FilePath))
if (!File.Exists(filePath))
return false;
Folder = Path.GetDirectoryName(FilePath);
Folder = Path.GetDirectoryName(filePath);
foreach (string folder in CBase.Config.GetSongFolder())
{
@@ -341,19 +341,19 @@ namespace VocaluxeLib.Menu.SongMenu
}
}
FileName = Path.GetFileName(FilePath);
FileName = Path.GetFileName(filePath);
EHeaderFlags HeaderFlags = new EHeaderFlags();
EHeaderFlags headerFlags = new EHeaderFlags();
StreamReader sr = null;
try
{
sr = new StreamReader(FilePath, Encoding.Default, true);
sr = new StreamReader(filePath, Encoding.Default, true);
string line;
int pos = -1;
string Identifier = String.Empty;
string Value = String.Empty;
string identifier = String.Empty;
string value = String.Empty;
while (!sr.EndOfStream)
{
@@ -367,19 +367,19 @@ namespace VocaluxeLib.Menu.SongMenu
if (pos > 0)
{
Identifier = line.Substring(1, pos - 1).Trim().ToUpper();
Value = line.Substring(pos + 1, line.Length - pos - 1).Trim();
identifier = line.Substring(1, pos - 1).Trim().ToUpper();
value = line.Substring(pos + 1, line.Length - pos - 1).Trim();
if (Value.Length > 0)
if (value.Length > 0)
{
switch (Identifier)
switch (identifier)
{
case "ENCODING":
Encoding = CEncoding.GetEncoding(Value);
Encoding = CEncoding.GetEncoding(value);
sr.Dispose();
sr = null;
sr = new StreamReader(FilePath, Encoding);
Identifier = String.Empty;
sr = new StreamReader(filePath, Encoding);
identifier = String.Empty;
//Scip everything till encoding
while (!sr.EndOfStream)
@@ -394,136 +394,136 @@ namespace VocaluxeLib.Menu.SongMenu
if (pos > 0)
{
Identifier = line.Substring(1, pos - 1).Trim().ToUpper();
if (Identifier == "ENCODING")
identifier = line.Substring(1, pos - 1).Trim().ToUpper();
if (identifier == "ENCODING")
break;
}
}
break;
case "TITLE":
if (Value.Length > 0)
if (value.Length > 0)
{
Title = Value;
HeaderFlags |= EHeaderFlags.Title;
Title = value;
headerFlags |= EHeaderFlags.Title;
}
break;
case "ARTIST":
if (Value.Length > 0)
if (value.Length > 0)
{
Artist = Value;
HeaderFlags |= EHeaderFlags.Artist;
Artist = value;
headerFlags |= EHeaderFlags.Artist;
}
break;
case "TITLE-ON-SORTING":
if (Value.Length > 0)
TitleSorting = Value;
if (value.Length > 0)
TitleSorting = value;
break;
case "ARTIST-ON-SORTING":
if (Value.Length > 0)
ArtistSorting = Value;
if (value.Length > 0)
ArtistSorting = value;
break;
case "P1":
if (Value.Length > 0)
DuetPart1 = Value;
if (value.Length > 0)
DuetPart1 = value;
break;
case "P2":
if (Value.Length > 0)
DuetPart2 = Value;
if (value.Length > 0)
DuetPart2 = value;
break;
case "MP3":
if (File.Exists(Path.Combine(Folder, Value)))
if (File.Exists(Path.Combine(Folder, value)))
{
MP3FileName = Value;
HeaderFlags |= EHeaderFlags.MP3;
MP3FileName = value;
headerFlags |= EHeaderFlags.MP3;
}
else
{
CBase.Log.LogError("Can't find audio file: " + Path.Combine(Folder, Value));
CBase.Log.LogError("Can't find audio file: " + Path.Combine(Folder, value));
return false;
}
break;
case "BPM":
if (CHelper.TryParse(Value, out BPM))
if (CHelper.TryParse(value, out BPM))
{
BPM *= 4;
HeaderFlags |= EHeaderFlags.BPM;
headerFlags |= EHeaderFlags.BPM;
}
break;
case "EDITION":
if (Value.Length > 1)
Edition.Add(Value);
if (value.Length > 1)
Edition.Add(value);
break;
case "GENRE":
if (Value.Length > 1)
Genre.Add(Value);
if (value.Length > 1)
Genre.Add(value);
break;
case "YEAR":
int num = 0;
if (Value.Length == 4 && int.TryParse(Value, out num) && num != 0)
Year = Value;
if (value.Length == 4 && int.TryParse(value, out num) && num != 0)
Year = value;
break;
case "LANGUAGE":
if (Value.Length > 1)
Language.Add(Value);
if (value.Length > 1)
Language.Add(value);
break;
case "COMMENT":
if (Value.Length > 1)
Comment.Add(Value);
if (value.Length > 1)
Comment.Add(value);
break;
case "GAP":
if (CHelper.TryParse(Value, out Gap))
if (CHelper.TryParse(value, out Gap))
Gap /= 1000f;
break;
case "COVER":
if (File.Exists(Path.Combine(Folder, Value)))
CoverFileName = Value;
if (File.Exists(Path.Combine(Folder, value)))
CoverFileName = value;
break;
case "BACKGROUND":
if (File.Exists(Path.Combine(Folder, Value)))
BackgroundFileName = Value;
if (File.Exists(Path.Combine(Folder, value)))
BackgroundFileName = value;
break;
case "VIDEO":
if (File.Exists(Path.Combine(Folder, Value)))
VideoFileName = Value;
if (File.Exists(Path.Combine(Folder, value)))
VideoFileName = value;
else
CBase.Log.LogError("Can't find video file: " + Path.Combine(Folder, Value));
CBase.Log.LogError("Can't find video file: " + Path.Combine(Folder, value));
break;
case "VIDEOGAP":
CHelper.TryParse(Value, out VideoGap);
CHelper.TryParse(value, out VideoGap);
break;
case "VIDEOASPECT":
CHelper.TryParse(Value, out VideoAspect, true);
CHelper.TryParse(value, out VideoAspect, true);
break;
case "START":
CHelper.TryParse(Value, out Start);
CHelper.TryParse(value, out Start);
break;
case "END":
if (CHelper.TryParse(Value, out Finish))
if (CHelper.TryParse(value, out Finish))
Finish /= 1000f;
break;
case "PREVIEWSTART":
if (CHelper.TryParse(Value, out PreviewStart))
if (CHelper.TryParse(value, out PreviewStart))
{
if (PreviewStart < 0f)
PreviewStart = 0f;
else
HeaderFlags |= EHeaderFlags.PreviewStart;
headerFlags |= EHeaderFlags.PreviewStart;
}
break;
case "MEDLEYSTARTBEAT":
if (int.TryParse(Value, out Medley.StartBeat))
HeaderFlags |= EHeaderFlags.MedleyStartBeat;
if (int.TryParse(value, out Medley.StartBeat))
headerFlags |= EHeaderFlags.MedleyStartBeat;
break;
case "MEDLEYENDBEAT":
if (int.TryParse(Value, out Medley.EndBeat))
HeaderFlags |= EHeaderFlags.MedleyEndBeat;
if (int.TryParse(value, out Medley.EndBeat))
headerFlags |= EHeaderFlags.MedleyEndBeat;
break;
case "CALCMEDLEY":
if (Value.ToUpper() == "OFF")
if (value.ToUpper() == "OFF")
CalculateMedley = false;
break;
case "RELATIVE":
if (Value.ToUpper() == "YES" && Value.ToUpper() != "NO")
if (value.ToUpper() == "YES" && value.ToUpper() != "NO")
Relative = EOffOn.TR_CONFIG_ON;
break;
}
@@ -534,48 +534,48 @@ namespace VocaluxeLib.Menu.SongMenu
if (sr.EndOfStream)
{
//No other data then header
CBase.Log.LogError("Lyrics/Notes missing: " + FilePath);
CBase.Log.LogError("Lyrics/Notes missing: " + filePath);
return false;
}
if ((HeaderFlags & EHeaderFlags.Title) == 0)
if ((headerFlags & EHeaderFlags.Title) == 0)
{
CBase.Log.LogError("Title tag missing: " + FilePath);
CBase.Log.LogError("Title tag missing: " + filePath);
return false;
}
if ((HeaderFlags & EHeaderFlags.Artist) == 0)
if ((headerFlags & EHeaderFlags.Artist) == 0)
{
CBase.Log.LogError("Artist tag missing: " + FilePath);
CBase.Log.LogError("Artist tag missing: " + filePath);
return false;
}
if ((HeaderFlags & EHeaderFlags.MP3) == 0)
if ((headerFlags & EHeaderFlags.MP3) == 0)
{
CBase.Log.LogError("MP3 tag missing: " + FilePath);
CBase.Log.LogError("MP3 tag missing: " + filePath);
return false;
}
if ((HeaderFlags & EHeaderFlags.BPM) == 0)
if ((headerFlags & EHeaderFlags.BPM) == 0)
{
CBase.Log.LogError("BPM tag missing: " + FilePath);
CBase.Log.LogError("BPM tag missing: " + filePath);
return false;
}
#region check medley tags
if ((HeaderFlags & EHeaderFlags.MedleyStartBeat) != 0 && (HeaderFlags & EHeaderFlags.MedleyEndBeat) != 0)
if ((headerFlags & EHeaderFlags.MedleyStartBeat) != 0 && (headerFlags & EHeaderFlags.MedleyEndBeat) != 0)
{
if (Medley.StartBeat > Medley.EndBeat)
{
CBase.Log.LogError("MedleyStartBeat is bigger than MedleyEndBeat in file: " + FilePath);
HeaderFlags = HeaderFlags - EHeaderFlags.MedleyStartBeat - EHeaderFlags.MedleyEndBeat;
CBase.Log.LogError("MedleyStartBeat is bigger than MedleyEndBeat in file: " + filePath);
headerFlags = headerFlags - EHeaderFlags.MedleyStartBeat - EHeaderFlags.MedleyEndBeat;
}
}
if ((HeaderFlags & EHeaderFlags.PreviewStart) == 0 || PreviewStart == 0f)
if ((headerFlags & EHeaderFlags.PreviewStart) == 0 || PreviewStart == 0f)
{
//PreviewStart is not set or <=0
if ((HeaderFlags & EHeaderFlags.MedleyStartBeat) != 0)
if ((headerFlags & EHeaderFlags.MedleyStartBeat) != 0)
//fallback to MedleyStart
PreviewStart = CBase.Game.GetTimeFromBeats(Medley.StartBeat, BPM);
else
@@ -583,7 +583,7 @@ namespace VocaluxeLib.Menu.SongMenu
PreviewStart = 0f;
}
if ((HeaderFlags & EHeaderFlags.MedleyStartBeat) != 0 && (HeaderFlags & EHeaderFlags.MedleyEndBeat) != 0)
if ((headerFlags & EHeaderFlags.MedleyStartBeat) != 0 && (headerFlags & EHeaderFlags.MedleyEndBeat) != 0)
{
Medley.Source = EMedleySource.Tag;
Medley.FadeInTime = CBase.Settings.GetDefaultMedleyFadeInTime();
@@ -597,11 +597,11 @@ namespace VocaluxeLib.Menu.SongMenu
{
if (sr != null)
sr.Dispose();
CBase.Log.LogError("Error reading txt header in file \"" + FilePath + "\": " + e.Message);
CBase.Log.LogError("Error reading txt header in file \"" + filePath + "\": " + e.Message);
return false;
}
sr.Dispose();
CheckFiles();
_CheckFiles();
//Before saving this tags to .txt: Check, if ArtistSorting and Artist are equal, then don't save this tag.
if (ArtistSorting.Length == 0)
@@ -618,34 +618,34 @@ namespace VocaluxeLib.Menu.SongMenu
return ReadNotes(Path.Combine(Folder, FileName));
}
public bool ReadNotes(string FilePath, bool forceReload = false)
public bool ReadNotes(string filePath, bool forceReload = false)
{
//Skip loading if already done and no reload is forced
if (_NotesLoaded && !forceReload)
return true;
if (!File.Exists(FilePath))
if (!File.Exists(filePath))
{
CBase.Log.LogError("Error loading song. The file does not exist: " + FilePath);
CBase.Log.LogError("Error loading song. The file does not exist: " + filePath);
return false;
}
char TempC = char.MinValue;
int Param1 = 0;
int Param2 = 0;
int Param3 = 0;
char tempC = char.MinValue;
int param1 = 0;
int param2 = 0;
int param3 = 0;
int currentPos = 0;
string ParamS = String.Empty;
string paramS = String.Empty;
bool isNewSentence = false;
string line = String.Empty;
int Player = 0;
int FileLineNo = 0;
int player = 0;
int fileLineNo = 0;
StreamReader sr = null;
try
{
sr = new StreamReader(FilePath, Encoding, true);
sr = new StreamReader(filePath, Encoding, true);
Notes.Reset();
@@ -653,42 +653,42 @@ namespace VocaluxeLib.Menu.SongMenu
while (!sr.EndOfStream)
{
line = sr.ReadLine();
FileLineNo++;
fileLineNo++;
TempC = (char)sr.Peek();
if ((TempC == '#') || (TempC == '\r') || (TempC == '\n'))
tempC = (char)sr.Peek();
if ((tempC == '#') || (tempC == '\r') || (tempC == '\n'))
continue;
if ((TempC == ':') || (TempC == 'F') || (TempC == '*') || (TempC == 'P'))
if ((tempC == ':') || (tempC == 'F') || (tempC == '*') || (tempC == 'P'))
{
TempC = (char)sr.Read();
tempC = (char)sr.Read();
break;
}
}
if (sr.EndOfStream)
{
CBase.Log.LogError("Error loading song. Line No.: " + FileLineNo.ToString() + ". No lyrics/notes found: " + FilePath);
CBase.Log.LogError("Error loading song. Line No.: " + fileLineNo.ToString() + ". No lyrics/notes found: " + filePath);
return false;
}
do
{
char chr;
switch (TempC)
switch (tempC)
{
case 'P':
while ((chr = (char)sr.Read()) == ' ') {}
int.TryParse(chr.ToString(), out Param1);
if (Param1 == 1)
Player = 0;
else if (Param1 == 2)
Player = 1;
else if (Param1 == 3)
Player = 2;
int.TryParse(chr.ToString(), out param1);
if (param1 == 1)
player = 0;
else if (param1 == 2)
player = 1;
else if (param1 == 3)
player = 2;
else
{
CBase.Log.LogError("Error loading song. Line No.: " + FileLineNo.ToString() + ". Wrong or missing number after \"P\": " + FilePath);
CBase.Log.LogError("Error loading song. Line No.: " + fileLineNo.ToString() + ". Wrong or missing number after \"P\": " + filePath);
return false;
}
sr.ReadLine();
@@ -697,72 +697,72 @@ namespace VocaluxeLib.Menu.SongMenu
case '*':
case 'F':
sr.Read();
Param1 = CHelper.TryReadInt(sr);
param1 = CHelper.TryReadInt(sr);
sr.Read();
Param2 = CHelper.TryReadInt(sr);
param2 = CHelper.TryReadInt(sr);
sr.Read();
Param3 = CHelper.TryReadInt(sr);
param3 = CHelper.TryReadInt(sr);
sr.Read();
ParamS = sr.ReadLine();
paramS = sr.ReadLine();
ENoteType NoteType;
ENoteType noteType;
if (TempC.CompareTo('*') == 0)
NoteType = ENoteType.Golden;
else if (TempC.CompareTo('F') == 0)
NoteType = ENoteType.Freestyle;
if (tempC.CompareTo('*') == 0)
noteType = ENoteType.Golden;
else if (tempC.CompareTo('F') == 0)
noteType = ENoteType.Freestyle;
else
NoteType = ENoteType.Normal;
noteType = ENoteType.Normal;
if (Relative == EOffOn.TR_CONFIG_ON)
Param1 += currentPos;
param1 += currentPos;
if (Player != 2)
if (player != 2)
// one singer
ParseNote(Player, NoteType, Param1, Param2, Param3, ParamS);
_ParseNote(player, noteType, param1, param2, param3, paramS);
else
{
// both singer
ParseNote(0, NoteType, Param1, Param2, Param3, ParamS);
ParseNote(1, NoteType, Param1, Param2, Param3, ParamS);
_ParseNote(0, noteType, param1, param2, param3, paramS);
_ParseNote(1, noteType, param1, param2, param3, paramS);
}
isNewSentence = false;
break;
case '-':
if (isNewSentence)
{
CBase.Log.LogError("Error loading song. Line No.: " + FileLineNo.ToString() + ". Double sentence break: " + FilePath);
CBase.Log.LogError("Error loading song. Line No.: " + fileLineNo.ToString() + ". Double sentence break: " + filePath);
return false;
}
sr.Read();
Param1 = CHelper.TryReadInt(sr);
param1 = CHelper.TryReadInt(sr);
if (Relative == EOffOn.TR_CONFIG_ON)
{
Param1 += currentPos;
param1 += currentPos;
sr.Read();
Param2 = CHelper.TryReadInt(sr);
currentPos += Param2;
param2 = CHelper.TryReadInt(sr);
currentPos += param2;
}
if (Player != 2)
if (player != 2)
// one singer
NewSentence(Player, Param1);
_NewSentence(player, param1);
else
{
// both singer
NewSentence(0, Param1);
NewSentence(1, Param1);
_NewSentence(0, param1);
_NewSentence(1, param1);
}
isNewSentence = true;
sr.ReadLine();
break;
default:
CBase.Log.LogError("Error loading song. Line No.: " + FileLineNo.ToString() + ". Unexpected or missing character (" + TempC + "): " + FilePath);
CBase.Log.LogError("Error loading song. Line No.: " + fileLineNo.ToString() + ". Unexpected or missing character (" + tempC + "): " + filePath);
return false;
}
int c = 0;
@@ -770,41 +770,41 @@ namespace VocaluxeLib.Menu.SongMenu
{
c = sr.Read();
} while (!sr.EndOfStream && (c == 19 || c == 16 || c == 13 || c == 10));
TempC = (char)c;
FileLineNo++;
} while (!sr.EndOfStream && (TempC != 'E'));
tempC = (char)c;
fileLineNo++;
} while (!sr.EndOfStream && (tempC != 'E'));
foreach (CLines lines in Notes.Lines)
lines.UpdateTimings();
}
catch (Exception e)
{
CBase.Log.LogError("Error loading song. Line No.: " + FileLineNo.ToString() + ". An unhandled exception occured (" + e.Message + "): " + FilePath);
CBase.Log.LogError("Error loading song. Line No.: " + fileLineNo.ToString() + ". An unhandled exception occured (" + e.Message + "): " + filePath);
if (sr != null)
sr.Dispose();
return false;
}
sr.Dispose();
FindRefrain();
FindShortEnd();
_FindRefrain();
_FindShortEnd();
_NotesLoaded = true;
if (IsDuet)
CheckDuet();
_CheckDuet();
return true;
}
private bool ParseNote(int Player, ENoteType NoteType, int Start, int Length, int Tone, string Text)
private bool _ParseNote(int player, ENoteType noteType, int start, int length, int tone, string text)
{
CNote note = new CNote(Start, Length, Tone, Text, NoteType);
CLines lines = Notes.GetLines(Player);
CNote note = new CNote(start, length, tone, text, noteType);
CLines lines = Notes.GetLines(player);
return lines.AddNote(note);
}
private void NewSentence(int Player, int Start)
private void _NewSentence(int player, int start)
{
CLines lines = Notes.GetLines(Player);
CLines lines = Notes.GetLines(player);
CLine line = new CLine();
line.StartBeat = Start;
line.StartBeat = start;
lines.AddLine(line);
}
@@ -823,7 +823,7 @@ namespace VocaluxeLib.Menu.SongMenu
_CoverSmallLoaded = true;
}
private void CheckFiles()
private void _CheckFiles()
{
if (CoverFileName.Length == 0)
{
@@ -850,7 +850,7 @@ namespace VocaluxeLib.Menu.SongMenu
}
}
private void CheckDuet()
private void _CheckDuet()
{
if (DuetPart1.Length == 0)
{
@@ -864,14 +864,14 @@ namespace VocaluxeLib.Menu.SongMenu
}
}
private struct Series
private struct SSeries
{
public int Start;
public int end;
public int length;
public int End;
public int Length;
}
private List<Series> GetSeries()
private List<SSeries> _GetSeries()
{
CLines lines = Notes.GetLines(0);
@@ -889,16 +889,16 @@ namespace VocaluxeLib.Menu.SongMenu
}
// find equal sentences series
List<Series> series = new List<Series>();
List<SSeries> series = new List<SSeries>();
for (int i = 0; i < lines.LineCount - 1; i++)
{
for (int j = i + 1; j < lines.LineCount; j++)
{
if (sentences[i] == sentences[j] && sentences[i].Length > 0)
{
Series tempSeries = new Series();
SSeries tempSeries = new SSeries();
tempSeries.Start = i;
tempSeries.end = i;
tempSeries.End = i;
int max = 0;
if (j + j - i - 1 > lines.LineCount - 1)
@@ -909,12 +909,12 @@ namespace VocaluxeLib.Menu.SongMenu
for (int k = 1; k <= max; k++)
{
if (sentences[i + k] == sentences[j + k] && sentences[i + k].Length > 0)
tempSeries.end = i + k;
tempSeries.End = i + k;
else
break;
}
tempSeries.length = tempSeries.end - tempSeries.Start + 1;
tempSeries.Length = tempSeries.End - tempSeries.Start + 1;
series.Add(tempSeries);
}
}
@@ -922,7 +922,7 @@ namespace VocaluxeLib.Menu.SongMenu
return series;
}
private void FindRefrain()
private void _FindRefrain()
{
if (IsDuet)
{
@@ -936,7 +936,7 @@ namespace VocaluxeLib.Menu.SongMenu
if (!CalculateMedley)
return;
List<Series> series = GetSeries();
List<SSeries> series = _GetSeries();
if (series == null)
return;
@@ -944,17 +944,17 @@ namespace VocaluxeLib.Menu.SongMenu
int longest = 0;
for (int i = 0; i < series.Count; i++)
{
if (series[i].length > series[longest].length)
if (series[i].Length > series[longest].Length)
longest = i;
}
CLines lines = Notes.GetLines(0);
// set medley vars
if (series.Count > 0 && series[longest].length > CBase.Settings.GetMedleyMinSeriesLength())
if (series.Count > 0 && series[longest].Length > CBase.Settings.GetMedleyMinSeriesLength())
{
Medley.StartBeat = lines.Line[series[longest].Start].FirstNoteBeat;
Medley.EndBeat = lines.Line[series[longest].end].LastNoteBeat;
Medley.EndBeat = lines.Line[series[longest].End].LastNoteBeat;
bool foundEnd = false;
@@ -991,9 +991,9 @@ namespace VocaluxeLib.Menu.SongMenu
}
}
private void FindShortEnd()
private void _FindShortEnd()
{
List<Series> series = GetSeries();
List<SSeries> series = _GetSeries();
if (series == null)
return;
@@ -1005,16 +1005,16 @@ namespace VocaluxeLib.Menu.SongMenu
//Check if stop is in series
for (int i = 0; i < series.Count; i++)
{
if (lines.Line[series[i].Start].FirstNoteBeat < stop && lines.Line[series[i].end].LastNoteBeat > stop)
if (lines.Line[series[i].Start].FirstNoteBeat < stop && lines.Line[series[i].End].LastNoteBeat > stop)
{
if (stop < (lines.Line[series[i].Start].FirstNoteBeat + ((lines.Line[series[i].end].LastNoteBeat - lines.Line[series[i].Start].FirstNoteBeat) / 2)))
if (stop < (lines.Line[series[i].Start].FirstNoteBeat + ((lines.Line[series[i].End].LastNoteBeat - lines.Line[series[i].Start].FirstNoteBeat) / 2)))
{
ShortEnd = lines.Line[series[i].Start - 1].LastNote.EndBeat;
return;
}
else
{
ShortEnd = lines.Line[series[i].end].LastNote.EndBeat;
ShortEnd = lines.Line[series[i].End].LastNote.EndBeat;
return;
}
}
+27 -27
View File
@@ -10,16 +10,16 @@ namespace VocaluxeLib.Menu.SongMenu
private ISongMenu _SongMenu;
private ESongMenu _Type;
public CSongMenu(int PartyModeID)
public CSongMenu(int partyModeID)
{
_PartyModeID = PartyModeID;
CreateSongMenu();
_PartyModeID = partyModeID;
_CreateSongMenu();
}
public void UpdateSongMenuType()
{
if (_Type != CBase.Config.GetSongMenuType())
CreateSongMenu();
_CreateSongMenu();
}
public bool Selected
@@ -40,9 +40,9 @@ namespace VocaluxeLib.Menu.SongMenu
}
#region ISongMenu
public void Update(ScreenSongOptions SongOptions)
public void Update(SScreenSongOptions songOptions)
{
_SongMenu.Update(SongOptions);
_SongMenu.Update(songOptions);
}
public void OnShow()
@@ -55,14 +55,14 @@ namespace VocaluxeLib.Menu.SongMenu
_SongMenu.OnHide();
}
public void HandleInput(ref KeyEvent KeyEvent, ScreenSongOptions SongOptions)
public void HandleInput(ref SKeyEvent keyEvent, SScreenSongOptions songOptions)
{
_SongMenu.HandleInput(ref KeyEvent, SongOptions);
_SongMenu.HandleInput(ref keyEvent, songOptions);
}
public void HandleMouse(ref MouseEvent MouseEvent, ScreenSongOptions SongOptions)
public void HandleMouse(ref SMouseEvent mouseEvent, SScreenSongOptions songOptions)
{
_SongMenu.HandleMouse(ref MouseEvent, SongOptions);
_SongMenu.HandleMouse(ref mouseEvent, songOptions);
}
public void Draw()
@@ -70,9 +70,9 @@ namespace VocaluxeLib.Menu.SongMenu
_SongMenu.Draw();
}
public void ApplyVolume(float VolumeMax)
public void ApplyVolume(float volumeMax)
{
_SongMenu.ApplyVolume(VolumeMax);
_SongMenu.ApplyVolume(volumeMax);
}
public bool IsActive()
@@ -80,9 +80,9 @@ namespace VocaluxeLib.Menu.SongMenu
return _SongMenu.IsActive();
}
public void SetActive(bool Active)
public void SetActive(bool active)
{
_SongMenu.SetActive(Active);
_SongMenu.SetActive(active);
}
public int GetSelectedSong()
@@ -95,9 +95,9 @@ namespace VocaluxeLib.Menu.SongMenu
return _SongMenu.GetSelectedSongCover();
}
public void SetSelectedSong(int VisibleSongNr)
public void SetSelectedSong(int visibleSongNr)
{
_SongMenu.SetSelectedSong(VisibleSongNr);
_SongMenu.SetSelectedSong(visibleSongNr);
}
public int GetSelectedCategory()
@@ -105,9 +105,9 @@ namespace VocaluxeLib.Menu.SongMenu
return _SongMenu.GetSelectedCategory();
}
public void SetSelectedCategory(int CategoryNr)
public void SetSelectedCategory(int categoryNr)
{
_SongMenu.SetSelectedCategory(CategoryNr);
_SongMenu.SetSelectedCategory(categoryNr);
}
public bool EnterCurrentCategory()
@@ -125,9 +125,9 @@ namespace VocaluxeLib.Menu.SongMenu
return _SongMenu.IsSelected();
}
public void SetSelected(bool Selected)
public void SetSelected(bool selected)
{
_SongMenu.SetSelected(Selected);
_SongMenu.SetSelected(selected);
}
public bool IsVisible()
@@ -135,9 +135,9 @@ namespace VocaluxeLib.Menu.SongMenu
return _SongMenu.IsVisible();
}
public void SetVisible(bool Visible)
public void SetVisible(bool visible)
{
_SongMenu.SetVisible(Visible);
_SongMenu.SetVisible(visible);
}
public SRectF GetRect()
@@ -150,9 +150,9 @@ namespace VocaluxeLib.Menu.SongMenu
return _SongMenu.IsSmallView();
}
public void SetSmallView(bool SmallView)
public void SetSmallView(bool smallView)
{
_SongMenu.SetSmallView(SmallView);
_SongMenu.SetSmallView(smallView);
}
#endregion ISongMenu
@@ -162,9 +162,9 @@ namespace VocaluxeLib.Menu.SongMenu
return _SongMenu.GetThemeName();
}
public bool LoadTheme(string XmlPath, string ElementName, CXMLReader xmlReader, int SkinIndex)
public bool LoadTheme(string xmlPath, string elementName, CXMLReader xmlReader, int skinIndex)
{
return _SongMenu.LoadTheme(XmlPath, ElementName, xmlReader, SkinIndex);
return _SongMenu.LoadTheme(xmlPath, elementName, xmlReader, skinIndex);
}
public bool SaveTheme(XmlWriter writer)
@@ -198,7 +198,7 @@ namespace VocaluxeLib.Menu.SongMenu
}
#endregion IMenuElement
private void CreateSongMenu()
private void _CreateSongMenu()
{
if (_SongMenu != null)
_SongMenu.OnHide();
+2 -2
View File
@@ -2,7 +2,7 @@
{
class CSongMenuBook : CSongMenuFramework
{
public CSongMenuBook(int PartyModeID)
: base(PartyModeID) {}
public CSongMenuBook(int partyModeID)
: base(partyModeID) {}
}
}
@@ -21,8 +21,8 @@
return _actualSelection;
}
*/
public CSongMenuDreidel(int PartyModeID)
: base(PartyModeID) {}
public CSongMenuDreidel(int partyModeID)
: base(partyModeID) {}
public override void Init()
{
+155 -155
View File
@@ -24,7 +24,7 @@ namespace VocaluxeLib.Menu.SongMenu
//public SThemeSongMenuBook songMenuBook;
//public SThemeSongMenuDreidel songMenuDreidel;
//public SThemeSongMenuList songMenuList;
public SThemeSongMenuTileBoard songMenuTileBoard;
public SThemeSongMenuTileBoard SongMenuTileBoard;
}
struct SThemeSongMenuBook {}
@@ -38,32 +38,32 @@ namespace VocaluxeLib.Menu.SongMenu
/// <summary>
/// Number of tiles horizontal
/// </summary>
public int numW;
public int NumW;
/// <summary>
/// Number of tiles vertical
/// </summary>
public int numH;
public int NumH;
/// <summary>
/// Number of tiles horizontal in small-modus
/// </summary>
public int numWsmall;
public int NumWsmall;
/// <summary>
/// Number of tiles vertical in small-modus
/// </summary>
public int numHsmall;
public int NumHsmall;
/// <summary>
/// Space between tiles horizontal
/// </summary>
public float spaceW;
public float SpaceW;
/// <summary>
/// Space between tiles vertical
/// </summary>
public float spaceH;
public float SpaceH;
public SRectF TileRect;
public SRectF TileRectSmall;
@@ -86,12 +86,12 @@ namespace VocaluxeLib.Menu.SongMenu
protected SThemeSongMenu _Theme;
private bool _ThemeLoaded;
private readonly Stopwatch _timer = new Stopwatch();
private readonly Stopwatch _Timer = new Stopwatch();
private readonly Stopwatch _VideoFadeTimer = new Stopwatch();
private readonly List<int> _streams = new List<int>();
private int _actsong = -1;
private int _actsongstream = -1;
protected STexture _vidtex = new STexture(-1);
private readonly List<int> _Streams = new List<int>();
private int _Actsong = -1;
private int _Actsongstream = -1;
protected STexture _Vidtex = new STexture(-1);
protected bool _Initialized = false;
protected int _LastKnownNumSongs = 0;
@@ -114,10 +114,10 @@ namespace VocaluxeLib.Menu.SongMenu
//for preview only
get
{
if ((_SelectedInternal != _SelectedPending) && (_timer.ElapsedMilliseconds >= _PendingTime))
if ((_SelectedInternal != _SelectedPending) && (_Timer.ElapsedMilliseconds >= _PendingTime))
{
_timer.Stop();
_timer.Reset();
_Timer.Stop();
_Timer.Reset();
_SelectedInternal = _SelectedPending;
}
return _SelectedInternal;
@@ -126,8 +126,8 @@ namespace VocaluxeLib.Menu.SongMenu
{
if (value == -1)
{
_timer.Stop();
_timer.Reset();
_Timer.Stop();
_Timer.Reset();
_SelectedInternal = -1;
_SelectedPending = -1;
@@ -136,25 +136,25 @@ namespace VocaluxeLib.Menu.SongMenu
if ((value != _SelectedInternal) && (value != _SelectedPending))
{
_timer.Reset();
_timer.Start();
_Timer.Reset();
_Timer.Start();
_SelectedPending = value;
}
if ((value == _SelectedPending) && ((_timer.ElapsedMilliseconds >= _PendingTime) || (_SelectedInternal == -1)))
if ((value == _SelectedPending) && ((_Timer.ElapsedMilliseconds >= _PendingTime) || (_SelectedInternal == -1)))
{
_timer.Stop();
_timer.Reset();
_Timer.Stop();
_Timer.Reset();
_SelectedInternal = _SelectedPending;
}
}
}
protected virtual void SetSelectedNow()
protected virtual void _SetSelectedNow()
{
_timer.Stop();
_timer.Reset();
_Timer.Stop();
_Timer.Reset();
_SelectedInternal = _SelectedPending;
}
@@ -167,14 +167,14 @@ namespace VocaluxeLib.Menu.SongMenu
protected int _SongStream
{
get { return _actsongstream; }
get { return _Actsongstream; }
}
protected int _Video { get; private set; }
protected int _ActSong
{
get { return _actsong; }
get { return _Actsong; }
}
public SRectF Rect
@@ -194,7 +194,7 @@ namespace VocaluxeLib.Menu.SongMenu
public virtual int GetActualSelection()
{
return _actsong;
return _Actsong;
}
private bool _Selected;
@@ -205,10 +205,10 @@ namespace VocaluxeLib.Menu.SongMenu
return _Selected;
}
public void SetSelected(bool Selected)
public void SetSelected(bool selected)
{
_Selected = Selected;
SetActive(Selected);
_Selected = selected;
SetActive(selected);
}
public bool IsVisible()
@@ -216,26 +216,26 @@ namespace VocaluxeLib.Menu.SongMenu
return _Visible;
}
public void SetVisible(bool Visible)
public void SetVisible(bool visible)
{
_Visible = Visible;
_Visible = visible;
}
public CSongMenuFramework(int PartyModeID)
public CSongMenuFramework(int partyModeID)
{
_PartyModeID = PartyModeID;
_PartyModeID = partyModeID;
_Theme = new SThemeSongMenu();
_Theme.songMenuTileBoard.TextArtist = new CText(_PartyModeID);
_Theme.songMenuTileBoard.TextTitle = new CText(_PartyModeID);
_Theme.songMenuTileBoard.TextSongLength = new CText(_PartyModeID);
_Theme.SongMenuTileBoard.TextArtist = new CText(_PartyModeID);
_Theme.SongMenuTileBoard.TextTitle = new CText(_PartyModeID);
_Theme.SongMenuTileBoard.TextSongLength = new CText(_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);
_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;
}
@@ -245,9 +245,9 @@ namespace VocaluxeLib.Menu.SongMenu
return _Theme.Name;
}
public bool LoadTheme(string XmlPath, string ElementName, CXMLReader xmlReader, int SkinIndex)
public bool LoadTheme(string xmlPath, string elementName, CXMLReader xmlReader, int skinIndex)
{
string item = XmlPath + "/" + ElementName;
string item = xmlPath + "/" + elementName;
_ThemeLoaded = true;
_ThemeLoaded &= xmlReader.GetValue(item + "/CoverBackground", ref _Theme.CoverBackgroundName, String.Empty);
@@ -258,7 +258,7 @@ namespace VocaluxeLib.Menu.SongMenu
_ThemeLoaded &= xmlReader.GetValue(item + "/MedleyTagIcon", ref _Theme.MedleyTagIcon, String.Empty);
if (xmlReader.GetValue(item + "/Color", ref _Theme.ColorName, String.Empty))
_ThemeLoaded &= CBase.Theme.GetColor(_Theme.ColorName, SkinIndex, out _Color);
_ThemeLoaded &= CBase.Theme.GetColor(_Theme.ColorName, skinIndex, out _Color);
else
{
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/R", ref _Color.R);
@@ -268,41 +268,41 @@ namespace VocaluxeLib.Menu.SongMenu
}
#region SongMenuTileBoard
_ThemeLoaded &= xmlReader.TryGetIntValue(item + "/SongMenuTileBoard/NumW", ref _Theme.songMenuTileBoard.numW);
_ThemeLoaded &= xmlReader.TryGetIntValue(item + "/SongMenuTileBoard/NumH", ref _Theme.songMenuTileBoard.numH);
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SongMenuTileBoard/SpaceW", ref _Theme.songMenuTileBoard.spaceW);
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SongMenuTileBoard/SpaceH", ref _Theme.songMenuTileBoard.spaceH);
_ThemeLoaded &= xmlReader.TryGetIntValue(item + "/SongMenuTileBoard/NumW", ref _Theme.SongMenuTileBoard.NumW);
_ThemeLoaded &= xmlReader.TryGetIntValue(item + "/SongMenuTileBoard/NumH", ref _Theme.SongMenuTileBoard.NumH);
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SongMenuTileBoard/SpaceW", ref _Theme.SongMenuTileBoard.SpaceW);
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SongMenuTileBoard/SpaceH", ref _Theme.SongMenuTileBoard.SpaceH);
_ThemeLoaded &= xmlReader.TryGetIntValue(item + "/SongMenuTileBoard/NumWsmall", ref _Theme.songMenuTileBoard.numWsmall);
_ThemeLoaded &= xmlReader.TryGetIntValue(item + "/SongMenuTileBoard/NumHsmall", ref _Theme.songMenuTileBoard.numHsmall);
_ThemeLoaded &= xmlReader.TryGetIntValue(item + "/SongMenuTileBoard/NumWsmall", ref _Theme.SongMenuTileBoard.NumWsmall);
_ThemeLoaded &= xmlReader.TryGetIntValue(item + "/SongMenuTileBoard/NumHsmall", ref _Theme.SongMenuTileBoard.NumHsmall);
_ThemeLoaded &= _Theme.songMenuTileBoard.TextArtist.LoadTheme(item + "/SongMenuTileBoard", "TextArtist", xmlReader, SkinIndex);
_ThemeLoaded &= _Theme.songMenuTileBoard.TextTitle.LoadTheme(item + "/SongMenuTileBoard", "TextTitle", xmlReader, SkinIndex);
_ThemeLoaded &= _Theme.songMenuTileBoard.TextSongLength.LoadTheme(item + "/SongMenuTileBoard", "TextSongLength", xmlReader, SkinIndex);
_ThemeLoaded &= _Theme.SongMenuTileBoard.TextArtist.LoadTheme(item + "/SongMenuTileBoard", "TextArtist", xmlReader, skinIndex);
_ThemeLoaded &= _Theme.SongMenuTileBoard.TextTitle.LoadTheme(item + "/SongMenuTileBoard", "TextTitle", xmlReader, skinIndex);
_ThemeLoaded &= _Theme.SongMenuTileBoard.TextSongLength.LoadTheme(item + "/SongMenuTileBoard", "TextSongLength", xmlReader, skinIndex);
_ThemeLoaded &= _Theme.songMenuTileBoard.StaticCoverBig.LoadTheme(item + "/SongMenuTileBoard", "StaticCoverBig", xmlReader, SkinIndex);
_ThemeLoaded &= _Theme.songMenuTileBoard.StaticTextBG.LoadTheme(item + "/SongMenuTileBoard", "StaticTextBG", xmlReader, SkinIndex);
_ThemeLoaded &= _Theme.songMenuTileBoard.StaticDuetIcon.LoadTheme(item + "/SongMenuTileBoard", "StaticDuetIcon", xmlReader, SkinIndex);
_ThemeLoaded &= _Theme.songMenuTileBoard.StaticVideoIcon.LoadTheme(item + "/SongMenuTileBoard", "StaticVideoIcon", xmlReader, SkinIndex);
_ThemeLoaded &= _Theme.songMenuTileBoard.StaticMedleyCalcIcon.LoadTheme(item + "/SongMenuTileBoard", "StaticMedleyCalcIcon", xmlReader, SkinIndex);
_ThemeLoaded &= _Theme.songMenuTileBoard.StaticMedleyTagIcon.LoadTheme(item + "/SongMenuTileBoard", "StaticMedleyTagIcon", xmlReader, SkinIndex);
_ThemeLoaded &= _Theme.SongMenuTileBoard.StaticCoverBig.LoadTheme(item + "/SongMenuTileBoard", "StaticCoverBig", xmlReader, skinIndex);
_ThemeLoaded &= _Theme.SongMenuTileBoard.StaticTextBG.LoadTheme(item + "/SongMenuTileBoard", "StaticTextBG", xmlReader, skinIndex);
_ThemeLoaded &= _Theme.SongMenuTileBoard.StaticDuetIcon.LoadTheme(item + "/SongMenuTileBoard", "StaticDuetIcon", xmlReader, skinIndex);
_ThemeLoaded &= _Theme.SongMenuTileBoard.StaticVideoIcon.LoadTheme(item + "/SongMenuTileBoard", "StaticVideoIcon", xmlReader, skinIndex);
_ThemeLoaded &= _Theme.SongMenuTileBoard.StaticMedleyCalcIcon.LoadTheme(item + "/SongMenuTileBoard", "StaticMedleyCalcIcon", xmlReader, skinIndex);
_ThemeLoaded &= _Theme.SongMenuTileBoard.StaticMedleyTagIcon.LoadTheme(item + "/SongMenuTileBoard", "StaticMedleyTagIcon", xmlReader, skinIndex);
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SongMenuTileBoard/TileRectX", ref _Theme.songMenuTileBoard.TileRect.X);
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SongMenuTileBoard/TileRectY", ref _Theme.songMenuTileBoard.TileRect.Y);
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SongMenuTileBoard/TileRectZ", ref _Theme.songMenuTileBoard.TileRect.Z);
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SongMenuTileBoard/TileRectW", ref _Theme.songMenuTileBoard.TileRect.W);
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SongMenuTileBoard/TileRectH", ref _Theme.songMenuTileBoard.TileRect.H);
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SongMenuTileBoard/TileRectX", ref _Theme.SongMenuTileBoard.TileRect.X);
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SongMenuTileBoard/TileRectY", ref _Theme.SongMenuTileBoard.TileRect.Y);
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SongMenuTileBoard/TileRectZ", ref _Theme.SongMenuTileBoard.TileRect.Z);
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SongMenuTileBoard/TileRectW", ref _Theme.SongMenuTileBoard.TileRect.W);
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SongMenuTileBoard/TileRectH", ref _Theme.SongMenuTileBoard.TileRect.H);
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SongMenuTileBoard/TileRectSmallX", ref _Theme.songMenuTileBoard.TileRectSmall.X);
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SongMenuTileBoard/TileRectSmallY", ref _Theme.songMenuTileBoard.TileRectSmall.Y);
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SongMenuTileBoard/TileRectSmallZ", ref _Theme.songMenuTileBoard.TileRectSmall.Z);
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SongMenuTileBoard/TileRectSmallW", ref _Theme.songMenuTileBoard.TileRectSmall.W);
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SongMenuTileBoard/TileRectSmallH", ref _Theme.songMenuTileBoard.TileRectSmall.H);
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SongMenuTileBoard/TileRectSmallX", ref _Theme.SongMenuTileBoard.TileRectSmall.X);
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SongMenuTileBoard/TileRectSmallY", ref _Theme.SongMenuTileBoard.TileRectSmall.Y);
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SongMenuTileBoard/TileRectSmallZ", ref _Theme.SongMenuTileBoard.TileRectSmall.Z);
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SongMenuTileBoard/TileRectSmallW", ref _Theme.SongMenuTileBoard.TileRectSmall.W);
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SongMenuTileBoard/TileRectSmallH", ref _Theme.SongMenuTileBoard.TileRectSmall.H);
#endregion SongMenuTileBoard
if (_ThemeLoaded)
{
_Theme.Name = ElementName;
_Theme.Name = elementName;
LoadTextures();
Init();
}
@@ -351,47 +351,47 @@ namespace VocaluxeLib.Menu.SongMenu
writer.WriteStartElement("SongMenuTileBoard");
writer.WriteComment("<NumW>: Number of tiles horizontal");
writer.WriteElementString("NumW", _Theme.songMenuTileBoard.numW.ToString());
writer.WriteElementString("NumW", _Theme.SongMenuTileBoard.NumW.ToString());
writer.WriteComment("<NumH>: Number of tiles vertical");
writer.WriteElementString("NumH", _Theme.songMenuTileBoard.numH.ToString());
writer.WriteElementString("NumH", _Theme.SongMenuTileBoard.NumH.ToString());
writer.WriteComment("<SpaceW>: Space between tiles horizontal");
writer.WriteElementString("SpaceW", _Theme.songMenuTileBoard.spaceW.ToString("#0.00"));
writer.WriteElementString("SpaceW", _Theme.SongMenuTileBoard.SpaceW.ToString("#0.00"));
writer.WriteComment("<SpaceH>: Space between tiles vertical");
writer.WriteElementString("SpaceH", _Theme.songMenuTileBoard.spaceH.ToString("#0.00"));
writer.WriteElementString("SpaceH", _Theme.SongMenuTileBoard.SpaceH.ToString("#0.00"));
writer.WriteComment("<NumWsmall>: Number of tiles horizontal in small-mode");
writer.WriteElementString("NumWsmall", _Theme.songMenuTileBoard.numWsmall.ToString());
writer.WriteElementString("NumWsmall", _Theme.SongMenuTileBoard.NumWsmall.ToString());
writer.WriteComment("<NumHsmall>: Number of tiles vertical in small-mode");
writer.WriteElementString("NumHsmall", _Theme.songMenuTileBoard.numHsmall.ToString());
writer.WriteElementString("NumHsmall", _Theme.SongMenuTileBoard.NumHsmall.ToString());
writer.WriteComment("<TileRectX>, <TileRectY>, <TileRectZ>, <TileRectW>, <TileRectH>: SongMenu position, width and height");
writer.WriteElementString("TileRectX", _Theme.songMenuTileBoard.TileRect.X.ToString("#0"));
writer.WriteElementString("TileRectY", _Theme.songMenuTileBoard.TileRect.Y.ToString("#0"));
writer.WriteElementString("TileRectZ", _Theme.songMenuTileBoard.TileRect.Z.ToString("#0.00"));
writer.WriteElementString("TileRectW", _Theme.songMenuTileBoard.TileRect.W.ToString("#0"));
writer.WriteElementString("TileRectH", _Theme.songMenuTileBoard.TileRect.H.ToString("#0"));
writer.WriteElementString("TileRectX", _Theme.SongMenuTileBoard.TileRect.X.ToString("#0"));
writer.WriteElementString("TileRectY", _Theme.SongMenuTileBoard.TileRect.Y.ToString("#0"));
writer.WriteElementString("TileRectZ", _Theme.SongMenuTileBoard.TileRect.Z.ToString("#0.00"));
writer.WriteElementString("TileRectW", _Theme.SongMenuTileBoard.TileRect.W.ToString("#0"));
writer.WriteElementString("TileRectH", _Theme.SongMenuTileBoard.TileRect.H.ToString("#0"));
writer.WriteComment("<TileRectSmallX>, <TileRectSmallY>, <TileRectSmallZ>, <TileRectSmallW>, <TileRectSmallH>: SongMenu position, width and height in small-mode");
writer.WriteElementString("TileRectSmallX", _Theme.songMenuTileBoard.TileRectSmall.X.ToString("#0"));
writer.WriteElementString("TileRectSmallY", _Theme.songMenuTileBoard.TileRectSmall.Y.ToString("#0"));
writer.WriteElementString("TileRectSmallZ", _Theme.songMenuTileBoard.TileRectSmall.Z.ToString("#0.00"));
writer.WriteElementString("TileRectSmallW", _Theme.songMenuTileBoard.TileRectSmall.W.ToString("#0"));
writer.WriteElementString("TileRectSmallH", _Theme.songMenuTileBoard.TileRectSmall.H.ToString("#0"));
writer.WriteElementString("TileRectSmallX", _Theme.SongMenuTileBoard.TileRectSmall.X.ToString("#0"));
writer.WriteElementString("TileRectSmallY", _Theme.SongMenuTileBoard.TileRectSmall.Y.ToString("#0"));
writer.WriteElementString("TileRectSmallZ", _Theme.SongMenuTileBoard.TileRectSmall.Z.ToString("#0.00"));
writer.WriteElementString("TileRectSmallW", _Theme.SongMenuTileBoard.TileRectSmall.W.ToString("#0"));
writer.WriteElementString("TileRectSmallH", _Theme.SongMenuTileBoard.TileRectSmall.H.ToString("#0"));
_Theme.songMenuTileBoard.TextArtist.SaveTheme(writer);
_Theme.songMenuTileBoard.TextTitle.SaveTheme(writer);
_Theme.songMenuTileBoard.TextSongLength.SaveTheme(writer);
_Theme.SongMenuTileBoard.TextArtist.SaveTheme(writer);
_Theme.SongMenuTileBoard.TextTitle.SaveTheme(writer);
_Theme.SongMenuTileBoard.TextSongLength.SaveTheme(writer);
_Theme.songMenuTileBoard.StaticCoverBig.SaveTheme(writer);
_Theme.songMenuTileBoard.StaticTextBG.SaveTheme(writer);
_Theme.songMenuTileBoard.StaticDuetIcon.SaveTheme(writer);
_Theme.songMenuTileBoard.StaticVideoIcon.SaveTheme(writer);
_Theme.songMenuTileBoard.StaticMedleyCalcIcon.SaveTheme(writer);
_Theme.songMenuTileBoard.StaticMedleyTagIcon.SaveTheme(writer);
_Theme.SongMenuTileBoard.StaticCoverBig.SaveTheme(writer);
_Theme.SongMenuTileBoard.StaticTextBG.SaveTheme(writer);
_Theme.SongMenuTileBoard.StaticDuetIcon.SaveTheme(writer);
_Theme.SongMenuTileBoard.StaticVideoIcon.SaveTheme(writer);
_Theme.SongMenuTileBoard.StaticMedleyCalcIcon.SaveTheme(writer);
_Theme.SongMenuTileBoard.StaticMedleyTagIcon.SaveTheme(writer);
writer.WriteEndElement();
#endregion SongMenuTileBoard
@@ -405,7 +405,7 @@ namespace VocaluxeLib.Menu.SongMenu
public virtual void Init()
{
Reset();
_Reset();
_Initialized = true;
}
@@ -415,32 +415,32 @@ namespace VocaluxeLib.Menu.SongMenu
Init();
}
public virtual void Update(ScreenSongOptions SongOptions)
public virtual void Update(SScreenSongOptions songOptions)
{
if (!_Initialized)
return;
if (_actsong != _PreviewSelected)
SelectSong(_PreviewSelected);
if (_Actsong != _PreviewSelected)
_SelectSong(_PreviewSelected);
if (_streams.Count > 0 && _Video != -1)
if (_Streams.Count > 0 && _Video != -1)
{
if (CBase.Video.IsFinished(_Video) || CBase.Sound.IsFinished(_actsongstream))
if (CBase.Video.IsFinished(_Video) || CBase.Sound.IsFinished(_Actsongstream))
{
CBase.Video.Close(_Video);
_Video = -1;
return;
}
float time = CBase.Sound.GetPosition(_actsongstream);
float time = CBase.Sound.GetPosition(_Actsongstream);
float vtime = 0f;
CBase.Video.GetFrame(_Video, ref _vidtex, time, ref vtime);
CBase.Video.GetFrame(_Video, ref _Vidtex, time, ref vtime);
if (_VideoFadeTimer.ElapsedMilliseconds <= 3000L)
_vidtex.color.A = _VideoFadeTimer.ElapsedMilliseconds / 3000f;
_Vidtex.Color.A = _VideoFadeTimer.ElapsedMilliseconds / 3000f;
else
{
_vidtex.color.A = 1f;
_Vidtex.Color.A = 1f;
_VideoFadeTimer.Stop();
}
}
@@ -448,33 +448,33 @@ namespace VocaluxeLib.Menu.SongMenu
public virtual void OnShow()
{
_actsongstream = -1;
_vidtex = new STexture(-1);
_Actsongstream = -1;
_Vidtex = new STexture(-1);
}
public virtual void OnHide()
{
foreach (int stream in _streams)
foreach (int stream in _Streams)
CBase.Sound.FadeAndStop(stream, 0f, 0.75f);
_streams.Clear();
_Streams.Clear();
CBase.Video.Close(_Video);
_Video = -1;
CBase.Drawing.RemoveTexture(ref _vidtex);
CBase.Drawing.RemoveTexture(ref _Vidtex);
_timer.Stop();
_timer.Reset();
_Timer.Stop();
_Timer.Reset();
_SelectedInternal = _SelectedPending;
}
public virtual void HandleInput(ref KeyEvent KeyEvent, ScreenSongOptions SongOptions)
public virtual void HandleInput(ref SKeyEvent keyEvent, SScreenSongOptions songOptions)
{
if (!_Initialized)
return;
}
public virtual void HandleMouse(ref MouseEvent MouseEvent, ScreenSongOptions SongOptions)
public virtual void HandleMouse(ref SMouseEvent mouseEvent, SScreenSongOptions songOptions)
{
if (!_Initialized)
return;
@@ -486,14 +486,14 @@ namespace VocaluxeLib.Menu.SongMenu
return;
if (_Video != -1)
CBase.Drawing.DrawTexture(_vidtex, new SRectF(0, 0, 1280, 720, 0));
CBase.Drawing.DrawTexture(_Vidtex, new SRectF(0, 0, 1280, 720, 0));
}
public virtual void ApplyVolume(float VolumeMax)
public virtual void ApplyVolume(float volumeMax)
{
_MaxVolume = VolumeMax;
_MaxVolume = volumeMax;
foreach (int stream in _streams)
foreach (int stream in _Streams)
CBase.Sound.SetStreamVolumeMax(stream, _MaxVolume);
}
@@ -502,9 +502,9 @@ namespace VocaluxeLib.Menu.SongMenu
return _Active;
}
public virtual void SetActive(bool Active)
public virtual void SetActive(bool active)
{
_Active = Active;
_Active = active;
}
public virtual int GetSelectedSong()
@@ -522,19 +522,19 @@ namespace VocaluxeLib.Menu.SongMenu
return -1;
}
public virtual void SetSelectedSong(int VisibleSongNr)
public virtual void SetSelectedSong(int visibleSongNr)
{
if (!_Initialized)
return;
}
public virtual void SetSelectedCategory(int CategoryNr)
public virtual void SetSelectedCategory(int categoryNr)
{
if (!_Initialized)
return;
}
public virtual void SetSmallView(bool SmallView)
public virtual void SetSmallView(bool smallView)
{
if (!_Initialized)
return;
@@ -567,23 +567,23 @@ namespace VocaluxeLib.Menu.SongMenu
return false;
if (CBase.Songs.GetCurrentCategoryIndex() >= 0 || _PreviewSelected < 0 || _PreviewSelected >= CBase.Songs.GetNumCategories())
return false;
EnterCategory(_PreviewSelected);
_EnterCategory(_PreviewSelected);
return true;
}
protected virtual void EnterCategory(int Category)
protected virtual void _EnterCategory(int category)
{
if (!_Initialized)
return;
if (Category >= CBase.Songs.GetNumCategories())
if (category >= CBase.Songs.GetNumCategories())
return;
Reset();
CBase.Songs.SetCategory(Category);
_Reset();
CBase.Songs.SetCategory(category);
}
protected virtual void ShowCategories()
protected virtual void _ShowCategories()
{
if (!_Initialized)
return;
@@ -591,37 +591,37 @@ namespace VocaluxeLib.Menu.SongMenu
if (CBase.Songs.GetCurrentCategoryIndex() == -1)
return;
Reset();
_Reset();
CBase.Songs.SetCategory(-1);
}
public void ApplyVolume()
{
CBase.Sound.SetStreamVolume(_actsongstream, CBase.Config.GetPreviewMusicVolume());
CBase.Sound.SetStreamVolume(_Actsongstream, CBase.Config.GetPreviewMusicVolume());
}
protected void SelectSong(int nr)
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.GetNumVisibleSongs() > 0) && (nr >= 0) && ((_Actsong != nr) || (_Streams.Count == 0)))
{
_streams.ForEach(soundStream => CBase.Sound.FadeAndStop(soundStream, 0f, 1f));
_streams.Clear();
_Streams.ForEach(soundStream => CBase.Sound.FadeAndStop(soundStream, 0f, 1f));
_Streams.Clear();
CBase.Video.Close(_Video);
_Video = -1;
CBase.Drawing.RemoveTexture(ref _vidtex);
CBase.Drawing.RemoveTexture(ref _Vidtex);
_actsong = nr;
if (_actsong >= CBase.Songs.GetNumVisibleSongs())
_actsong = 0;
_Actsong = nr;
if (_Actsong >= CBase.Songs.GetNumVisibleSongs())
_Actsong = 0;
int stream = CBase.Sound.Load(Path.Combine(CBase.Songs.GetVisibleSong(_actsong).Folder, CBase.Songs.GetVisibleSong(_actsong).MP3FileName), true);
int stream = CBase.Sound.Load(Path.Combine(CBase.Songs.GetVisibleSong(_Actsong).Folder, CBase.Songs.GetVisibleSong(_Actsong).MP3FileName), true);
CBase.Sound.SetStreamVolumeMax(stream, _MaxVolume);
CBase.Sound.SetStreamVolume(stream, 0f);
float startposition = CBase.Songs.GetVisibleSong(_actsong).PreviewStart;
float startposition = CBase.Songs.GetVisibleSong(_Actsong).PreviewStart;
if (startposition == 0f)
startposition = CBase.Sound.GetLength(stream) / 4f;
@@ -629,15 +629,15 @@ namespace VocaluxeLib.Menu.SongMenu
CBase.Sound.SetPosition(stream, startposition);
CBase.Sound.Play(stream);
CBase.Sound.Fade(stream, 100f, 3f);
_streams.Add(stream);
_actsongstream = stream;
_Streams.Add(stream);
_Actsongstream = stream;
if (CBase.Songs.GetVisibleSong(_actsong).VideoFileName.Length > 0 && CBase.Config.GetVideoPreview() == EOffOn.TR_CONFIG_ON)
if (CBase.Songs.GetVisibleSong(_Actsong).VideoFileName.Length > 0 && CBase.Config.GetVideoPreview() == EOffOn.TR_CONFIG_ON)
{
_Video = CBase.Video.Load(Path.Combine(CBase.Songs.GetVisibleSong(_actsong).Folder, CBase.Songs.GetVisibleSong(_actsong).VideoFileName));
_Video = CBase.Video.Load(Path.Combine(CBase.Songs.GetVisibleSong(_Actsong).Folder, CBase.Songs.GetVisibleSong(_Actsong).VideoFileName));
if (_Video == -1)
return;
CBase.Video.Skip(_Video, startposition, CBase.Songs.GetVisibleSong(_actsong).VideoGap);
CBase.Video.Skip(_Video, startposition, CBase.Songs.GetVisibleSong(_Actsong).VideoGap);
_VideoFadeTimer.Stop();
_VideoFadeTimer.Reset();
_VideoFadeTimer.Start();
@@ -645,19 +645,19 @@ namespace VocaluxeLib.Menu.SongMenu
}
}
protected void Reset()
protected void _Reset()
{
foreach (int stream in _streams)
foreach (int stream in _Streams)
CBase.Sound.FadeAndStop(stream, 0f, 0.75f);
_streams.Clear();
_Streams.Clear();
CBase.Video.Close(_Video);
_Video = -1;
CBase.Drawing.RemoveTexture(ref _vidtex);
CBase.Drawing.RemoveTexture(ref _Vidtex);
_timer.Stop();
_timer.Reset();
_Timer.Stop();
_Timer.Reset();
_SelectedInternal = _SelectedPending;
}
+2 -2
View File
@@ -2,7 +2,7 @@
{
class CSongMenuList : CSongMenuFramework
{
public CSongMenuList(int PartyModeID)
: base(PartyModeID) {}
public CSongMenuList(int partyModeID)
: base(partyModeID) {}
}
}
+160 -160
View File
@@ -34,33 +34,33 @@ namespace VocaluxeLib.Menu.SongMenu
private int _TileH;
private int _Offset = -1;
private int _actualSelection = -1;
private int _ActualSelection = -1;
private bool _SmallView;
public CSongMenuTileBoard(int PartyModeID)
: base(PartyModeID) {}
public CSongMenuTileBoard(int partyModeID)
: base(partyModeID) {}
public override int GetActualSelection()
{
return _actualSelection;
return _ActualSelection;
}
public override void Init()
{
base.Init();
_Rect = _Theme.songMenuTileBoard.TileRect;
_Rect = _Theme.SongMenuTileBoard.TileRect;
_NumW = _Theme.songMenuTileBoard.numW;
_NumH = _Theme.songMenuTileBoard.numH;
_SpaceW = _Theme.songMenuTileBoard.spaceW;
_SpaceH = _Theme.songMenuTileBoard.spaceH;
_NumW = _Theme.SongMenuTileBoard.NumW;
_NumH = _Theme.SongMenuTileBoard.NumH;
_SpaceW = _Theme.SongMenuTileBoard.SpaceW;
_SpaceH = _Theme.SongMenuTileBoard.SpaceH;
_PendingTime = 100L;
_TileW = (int)((_Theme.songMenuTileBoard.TileRect.W - _SpaceW * (_NumW - 1)) / _NumW);
_TileH = (int)((_Theme.songMenuTileBoard.TileRect.H - _SpaceH * (_NumH - 1)) / _NumH);
_TileW = (int)((_Theme.SongMenuTileBoard.TileRect.W - _SpaceW * (_NumW - 1)) / _NumW);
_TileH = (int)((_Theme.SongMenuTileBoard.TileRect.H - _SpaceH * (_NumH - 1)) / _NumH);
_CoverTexture = CBase.Theme.GetSkinTexture(_Theme.CoverBackgroundName, _PartyModeID);
_CoverBigTexture = CBase.Theme.GetSkinTexture(_Theme.CoverBigBackgroundName, _PartyModeID);
@@ -70,38 +70,38 @@ namespace VocaluxeLib.Menu.SongMenu
{
for (int j = 0; j < _NumW; j++)
{
SRectF rect = new SRectF(_Theme.songMenuTileBoard.TileRect.X + j * (_TileW + _SpaceW),
_Theme.songMenuTileBoard.TileRect.Y + i * (_TileH + _SpaceH), _TileW, _TileH, _Rect.Z);
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(_PartyModeID, _CoverTexture, Color, rect);
_Tiles.Add(tile);
}
}
_ScrollRect = new SRectF(0, 0, CBase.Settings.GetRenderW(), CBase.Settings.GetRenderH(), _Theme.songMenuTileBoard.TileRect.Z);
_ScrollRect = new SRectF(0, 0, CBase.Settings.GetRenderW(), CBase.Settings.GetRenderH(), _Theme.SongMenuTileBoard.TileRect.Z);
_PreviewSelected = -1;
_Offset = 0;
_CoverBig = _Theme.songMenuTileBoard.StaticCoverBig;
_TextBG = _Theme.songMenuTileBoard.StaticTextBG;
_DuetIcon = _Theme.songMenuTileBoard.StaticDuetIcon;
_VideoIcon = _Theme.songMenuTileBoard.StaticVideoIcon;
_MedleyCalcIcon = _Theme.songMenuTileBoard.StaticMedleyCalcIcon;
_MedleyTagIcon = _Theme.songMenuTileBoard.StaticMedleyTagIcon;
_CoverBig = _Theme.SongMenuTileBoard.StaticCoverBig;
_TextBG = _Theme.SongMenuTileBoard.StaticTextBG;
_DuetIcon = _Theme.SongMenuTileBoard.StaticDuetIcon;
_VideoIcon = _Theme.SongMenuTileBoard.StaticVideoIcon;
_MedleyCalcIcon = _Theme.SongMenuTileBoard.StaticMedleyCalcIcon;
_MedleyTagIcon = _Theme.SongMenuTileBoard.StaticMedleyTagIcon;
_Artist = _Theme.songMenuTileBoard.TextArtist;
_Title = _Theme.songMenuTileBoard.TextTitle;
_SongLength = _Theme.songMenuTileBoard.TextSongLength;
_Artist = _Theme.SongMenuTileBoard.TextArtist;
_Title = _Theme.SongMenuTileBoard.TextTitle;
_SongLength = _Theme.SongMenuTileBoard.TextSongLength;
}
public override void Update(ScreenSongOptions SongOptions)
public override void Update(SScreenSongOptions songOptions)
{
base.Update(SongOptions);
base.Update(songOptions);
if (SongOptions.Selection.RandomOnly)
if (songOptions.Selection.RandomOnly)
{
_Locked = _PreviewSelected;
_actualSelection = _PreviewSelected;
_ActualSelection = _PreviewSelected;
for (int i = 0; i < _Tiles.Count; i++)
_Tiles[i].Selected = _Locked == i + _Offset;
}
@@ -110,14 +110,14 @@ namespace VocaluxeLib.Menu.SongMenu
public override void OnShow()
{
if (CBase.Songs.GetTabs() == EOffOn.TR_CONFIG_OFF && CBase.Songs.GetNumCategories() > 0 && CBase.Songs.GetCurrentCategoryIndex() == -1)
EnterCategory(0);
_actualSelection = -1;
_EnterCategory(0);
_ActualSelection = -1;
_Locked = -1;
_PreviewSelected = -1;
UpdateList(0, true);
_UpdateList(0, true);
//AfterCategoryChange();
SetSelectedSong(_ActSong);
AfterCategoryChange();
_AfterCategoryChange();
CBase.Songs.UpdateRandomSongList();
int actcat = _PreviewSelected;
@@ -150,15 +150,15 @@ namespace VocaluxeLib.Menu.SongMenu
}
}
public override void HandleInput(ref KeyEvent KeyEvent, ScreenSongOptions SongOptions)
public override void HandleInput(ref SKeyEvent keyEvent, SScreenSongOptions songOptions)
{
base.HandleInput(ref KeyEvent, SongOptions);
base.HandleInput(ref keyEvent, songOptions);
if (!KeyEvent.KeyPressed)
if (!keyEvent.KeyPressed)
{
if (!(KeyEvent.Key == Keys.Left || KeyEvent.Key == Keys.Right || KeyEvent.Key == Keys.Up || KeyEvent.Key == Keys.Down ||
KeyEvent.Key == Keys.Escape || KeyEvent.Key == Keys.Back || KeyEvent.Key == Keys.Enter ||
KeyEvent.Key == Keys.PageDown || KeyEvent.Key == Keys.PageUp))
if (!(keyEvent.Key == Keys.Left || keyEvent.Key == Keys.Right || keyEvent.Key == Keys.Up || keyEvent.Key == Keys.Down ||
keyEvent.Key == Keys.Escape || keyEvent.Key == Keys.Back || keyEvent.Key == Keys.Enter ||
keyEvent.Key == Keys.PageDown || keyEvent.Key == Keys.PageUp))
return;
bool sel = false;
@@ -172,39 +172,39 @@ namespace VocaluxeLib.Menu.SongMenu
}
if ((_Locked == -1 || !sel) &&
(KeyEvent.Key != Keys.Escape && KeyEvent.Key != Keys.Back && KeyEvent.Key != Keys.PageUp && KeyEvent.Key != Keys.PageDown))
(keyEvent.Key != Keys.Escape && keyEvent.Key != Keys.Back && keyEvent.Key != Keys.PageUp && keyEvent.Key != Keys.PageDown))
{
if (_PreviewSelected > -1)
_Locked = _PreviewSelected;
else
{
_Locked = 0;
_actualSelection = 0;
_ActualSelection = 0;
_PreviewSelected = 0;
SetSelectedNow();
UpdateList(0, true);
_SetSelectedNow();
_UpdateList(0, true);
}
}
else
{
switch (KeyEvent.Key)
switch (keyEvent.Key)
{
case Keys.Enter:
if (CBase.Songs.GetCurrentCategoryIndex() < 0)
{
EnterCategory(_PreviewSelected);
KeyEvent.Handled = true;
_EnterCategory(_PreviewSelected);
keyEvent.Handled = true;
}
else if (_actualSelection > -1 && _PreviewSelected >= 0)
_Locked = _actualSelection;
else if (_ActualSelection > -1 && _PreviewSelected >= 0)
_Locked = _ActualSelection;
break;
case Keys.Escape:
case Keys.Back:
if (CBase.Songs.GetCurrentCategoryIndex() > -1 && CBase.Songs.GetTabs() == EOffOn.TR_CONFIG_ON && SongOptions.Selection.CategoryChangeAllowed)
if (CBase.Songs.GetCurrentCategoryIndex() > -1 && CBase.Songs.GetTabs() == EOffOn.TR_CONFIG_ON && songOptions.Selection.CategoryChangeAllowed)
{
ShowCategories();
KeyEvent.Handled = true;
_ShowCategories();
keyEvent.Handled = true;
}
//else if (CBase.Songs.GetTabs() == EOffOn.TR_CONFIG_OFF)
//{
@@ -213,85 +213,85 @@ namespace VocaluxeLib.Menu.SongMenu
break;
case Keys.PageUp:
if (CBase.Songs.GetTabs() == EOffOn.TR_CONFIG_ON && SongOptions.Selection.CategoryChangeAllowed)
PrevCategory();
if (CBase.Songs.GetTabs() == EOffOn.TR_CONFIG_ON && songOptions.Selection.CategoryChangeAllowed)
_PrevCategory();
break;
case Keys.PageDown:
if (CBase.Songs.GetTabs() == EOffOn.TR_CONFIG_ON && SongOptions.Selection.CategoryChangeAllowed)
NextCategory();
if (CBase.Songs.GetTabs() == EOffOn.TR_CONFIG_ON && songOptions.Selection.CategoryChangeAllowed)
_NextCategory();
break;
case Keys.Left:
if (_Locked > 0 && (!SongOptions.Selection.RandomOnly || SongOptions.Selection.CategoryChangeAllowed && CBase.Songs.GetCurrentCategoryIndex() < 0))
if (_Locked > 0 && (!songOptions.Selection.RandomOnly || songOptions.Selection.CategoryChangeAllowed && CBase.Songs.GetCurrentCategoryIndex() < 0))
{
_Locked--;
UpdateList();
_UpdateList();
}
break;
case Keys.Right:
if (CBase.Songs.GetCurrentCategoryIndex() < 0 && SongOptions.Selection.CategoryChangeAllowed)
if (CBase.Songs.GetCurrentCategoryIndex() < 0 && songOptions.Selection.CategoryChangeAllowed)
{
if (_Locked < CBase.Songs.GetNumCategories() - 1)
{
_Locked++;
UpdateList();
_UpdateList();
}
}
else
{
if (CBase.Songs.GetCurrentCategoryIndex() != -1 && _Locked < CBase.Songs.GetNumVisibleSongs() - 1 && !SongOptions.Selection.RandomOnly)
if (CBase.Songs.GetCurrentCategoryIndex() != -1 && _Locked < CBase.Songs.GetNumVisibleSongs() - 1 && !songOptions.Selection.RandomOnly)
{
_Locked++;
UpdateList();
_UpdateList();
}
}
break;
case Keys.Up:
if (KeyEvent.ModSHIFT && CBase.Songs.GetTabs() == EOffOn.TR_CONFIG_ON && SongOptions.Selection.CategoryChangeAllowed)
if (keyEvent.ModShift && CBase.Songs.GetTabs() == EOffOn.TR_CONFIG_ON && songOptions.Selection.CategoryChangeAllowed)
{
PrevCategory();
_PrevCategory();
break;
}
if (_Locked > _NumW - 1 &&
(!SongOptions.Selection.RandomOnly || SongOptions.Selection.CategoryChangeAllowed && CBase.Songs.GetCurrentCategoryIndex() < 0))
(!songOptions.Selection.RandomOnly || songOptions.Selection.CategoryChangeAllowed && CBase.Songs.GetCurrentCategoryIndex() < 0))
{
_Locked -= _NumW;
UpdateList();
_UpdateList();
}
break;
case Keys.Down:
if (KeyEvent.ModSHIFT && CBase.Songs.GetTabs() == EOffOn.TR_CONFIG_ON && SongOptions.Selection.CategoryChangeAllowed)
if (keyEvent.ModShift && CBase.Songs.GetTabs() == EOffOn.TR_CONFIG_ON && songOptions.Selection.CategoryChangeAllowed)
{
NextCategory();
_NextCategory();
break;
}
if (CBase.Songs.GetCurrentCategoryIndex() < 0 && SongOptions.Selection.CategoryChangeAllowed)
if (CBase.Songs.GetCurrentCategoryIndex() < 0 && songOptions.Selection.CategoryChangeAllowed)
{
if (_Locked < CBase.Songs.GetNumCategories() - _NumW)
{
_Locked += _NumW;
UpdateList();
_UpdateList();
}
}
else if (_Locked < CBase.Songs.GetNumVisibleSongs() - _NumW && !SongOptions.Selection.RandomOnly)
else if (_Locked < CBase.Songs.GetNumVisibleSongs() - _NumW && !songOptions.Selection.RandomOnly)
{
_Locked += _NumW;
UpdateList();
_UpdateList();
}
break;
}
}
if (!KeyEvent.Handled)
if (!keyEvent.Handled)
{
_PreviewSelected = _Locked;
_actualSelection = _Locked;
_ActualSelection = _Locked;
for (int i = 0; i < _Tiles.Count; i++)
_Tiles[i].Selected = _Locked == i + _Offset;
@@ -299,21 +299,21 @@ namespace VocaluxeLib.Menu.SongMenu
}
}
public override void HandleMouse(ref MouseEvent MouseEvent, ScreenSongOptions SongOptions)
public override void HandleMouse(ref SMouseEvent mouseEvent, SScreenSongOptions songOptions)
{
base.HandleMouse(ref MouseEvent, SongOptions);
base.HandleMouse(ref mouseEvent, songOptions);
int i = 0;
bool sel = false;
int lastselection = _actualSelection;
int lastselection = _ActualSelection;
if (!SongOptions.Selection.RandomOnly || CBase.Songs.GetCurrentCategoryIndex() < 0 && SongOptions.Selection.CategoryChangeAllowed)
if (!songOptions.Selection.RandomOnly || CBase.Songs.GetCurrentCategoryIndex() < 0 && songOptions.Selection.CategoryChangeAllowed)
{
foreach (CStatic tile in _Tiles)
{
if ((tile.Texture.index != _CoverTexture.index) && CHelper.IsInBounds(tile.Rect, MouseEvent) && !sel)
if ((tile.Texture.Index != _CoverTexture.Index) && CHelper.IsInBounds(tile.Rect, mouseEvent) && !sel)
{
if (MouseEvent.LB || CBase.Songs.GetCurrentCategoryIndex() == -1)
if (mouseEvent.LB || CBase.Songs.GetCurrentCategoryIndex() == -1)
{
if (_PreviewSelected == i + _Offset)
_Locked = _PreviewSelected;
@@ -324,7 +324,7 @@ namespace VocaluxeLib.Menu.SongMenu
}
}
tile.Selected = true;
_actualSelection = i + _Offset;
_ActualSelection = i + _Offset;
sel = true;
}
else
@@ -335,42 +335,42 @@ namespace VocaluxeLib.Menu.SongMenu
else
sel = true;
if (MouseEvent.Sender == ESender.WiiMote && _actualSelection != lastselection && _actualSelection != -1)
if (mouseEvent.Sender == ESender.WiiMote && _ActualSelection != lastselection && _ActualSelection != -1)
CBase.Input.SetRumble(0.050f);
if (!sel)
_actualSelection = -1;
_ActualSelection = -1;
if (MouseEvent.RB && (CBase.Songs.GetNumCategories() > 0) && CBase.Songs.GetCurrentCategoryIndex() >= 0 && CBase.Songs.GetTabs() == EOffOn.TR_CONFIG_ON &&
SongOptions.Selection.CategoryChangeAllowed)
if (mouseEvent.RB && (CBase.Songs.GetNumCategories() > 0) && CBase.Songs.GetCurrentCategoryIndex() >= 0 && CBase.Songs.GetTabs() == EOffOn.TR_CONFIG_ON &&
songOptions.Selection.CategoryChangeAllowed)
{
ShowCategories();
MouseEvent.Handled = true;
_ShowCategories();
mouseEvent.Handled = true;
return;
}
else if (MouseEvent.RB && CBase.Songs.GetTabs() == EOffOn.TR_CONFIG_OFF && !SongOptions.Selection.PartyMode)
else if (mouseEvent.RB && CBase.Songs.GetTabs() == EOffOn.TR_CONFIG_OFF && !songOptions.Selection.PartyMode)
CBase.Graphics.FadeTo(EScreens.ScreenMain);
else if (_PreviewSelected != -1 && MouseEvent.LB && CBase.Songs.GetCurrentCategoryIndex() != -1 && !SongOptions.Selection.PartyMode)
else if (_PreviewSelected != -1 && mouseEvent.LB && CBase.Songs.GetCurrentCategoryIndex() != -1 && !songOptions.Selection.PartyMode)
{
if (CHelper.IsInBounds(_CoverBig.Rect, MouseEvent) || CHelper.IsInBounds(_TextBG.Rect, MouseEvent))
if (CHelper.IsInBounds(_CoverBig.Rect, mouseEvent) || CHelper.IsInBounds(_TextBG.Rect, mouseEvent))
_Locked = _PreviewSelected;
}
else if (MouseEvent.LB && (CBase.Songs.GetCurrentCategoryIndex() == -1))
else if (mouseEvent.LB && (CBase.Songs.GetCurrentCategoryIndex() == -1))
{
foreach (CStatic tile in _Tiles)
{
if ((tile.Texture.index != _CoverTexture.index) && CHelper.IsInBounds(tile.Rect, MouseEvent))
if ((tile.Texture.Index != _CoverTexture.Index) && CHelper.IsInBounds(tile.Rect, mouseEvent))
{
EnterCategory(_PreviewSelected);
MouseEvent.Handled = true;
_EnterCategory(_PreviewSelected);
mouseEvent.Handled = true;
return;
}
}
}
if (MouseEvent.Wheel != 0 && CHelper.IsInBounds(_ScrollRect, MouseEvent) &&
(!SongOptions.Selection.RandomOnly || CBase.Songs.GetCurrentCategoryIndex() < 0 && SongOptions.Selection.CategoryChangeAllowed))
UpdateList(_Offset + _NumW * MouseEvent.Wheel);
if (mouseEvent.Wheel != 0 && CHelper.IsInBounds(_ScrollRect, mouseEvent) &&
(!songOptions.Selection.RandomOnly || CBase.Songs.GetCurrentCategoryIndex() < 0 && songOptions.Selection.CategoryChangeAllowed))
_UpdateList(_Offset + _NumW * mouseEvent.Wheel);
}
public override void Draw()
@@ -381,7 +381,7 @@ namespace VocaluxeLib.Menu.SongMenu
tile.Draw(1.2f, tile.Rect.Z - 0.1f, EAspect.Crop, false);
else
{
if (tile.Texture.index != _CoverTexture.index)
if (tile.Texture.Index != _CoverTexture.Index)
tile.Draw(1f, tile.Rect.Z, EAspect.Crop, false);
else
tile.Draw(1f, tile.Rect.Z, EAspect.Stretch, false);
@@ -403,13 +403,13 @@ namespace VocaluxeLib.Menu.SongMenu
_MedleyCalcIcon.Visible = song.Medley.Source == EMedleySource.Calculated;
_MedleyTagIcon.Visible = song.Medley.Source == EMedleySource.Tag;
float Time = CBase.Sound.GetLength(_SongStream);
float time = CBase.Sound.GetLength(_SongStream);
if (song.Finish != 0)
Time = song.Finish;
time = song.Finish;
Time -= song.Start;
int min = (int)Math.Floor(Time / 60f);
int sec = (int)(Time - min * 60f);
time -= song.Start;
int min = (int)Math.Floor(time / 60f);
int sec = (int)(time - min * 60f);
_SongLength.Text = min.ToString("00") + ":" + sec.ToString("00");
}
}
@@ -438,18 +438,18 @@ namespace VocaluxeLib.Menu.SongMenu
_TextBG.Draw();
if (_vidtex.index != -1 && _Video != -1)
if (_Vidtex.Index != -1 && _Video != -1)
{
if (_vidtex.color.A < 1)
if (_Vidtex.Color.A < 1)
_CoverBig.Draw(1f, EAspect.Crop);
RectangleF bounds = new RectangleF(_CoverBig.Rect.X, _CoverBig.Rect.Y, _CoverBig.Rect.W, _CoverBig.Rect.H);
RectangleF rect = new RectangleF(0f, 0f, _vidtex.width, _vidtex.height);
RectangleF rect = new RectangleF(0f, 0f, _Vidtex.Width, _Vidtex.Height);
CHelper.SetRect(bounds, ref rect, rect.Width / rect.Height, EAspect.Crop);
SRectF vidRect = new SRectF(rect.X, rect.Y, rect.Width, rect.Height, _CoverBig.Rect.Z);
SRectF vidRectBounds = new SRectF(bounds.X, bounds.Y, bounds.Width, bounds.Height, 0f);
CBase.Drawing.DrawTexture(_vidtex, vidRect, _vidtex.color, vidRectBounds, false);
CBase.Drawing.DrawTextureReflection(_vidtex, vidRect, _vidtex.color, vidRectBounds, _CoverBig.ReflectionSpace, _CoverBig.ReflectionHeight);
CBase.Drawing.DrawTexture(_Vidtex, vidRect, _Vidtex.Color, vidRectBounds, false);
CBase.Drawing.DrawTextureReflection(_Vidtex, vidRect, _Vidtex.Color, vidRectBounds, _CoverBig.ReflectionSpace, _CoverBig.ReflectionHeight);
}
else
_CoverBig.Draw(1f, EAspect.Crop);
@@ -479,7 +479,7 @@ namespace VocaluxeLib.Menu.SongMenu
return new CStatic(_PartyModeID);
}
protected void SetSelectedTile(int itemNr)
protected void _SetSelectedTile(int itemNr)
{
bool sel = false;
foreach (CStatic tile in _Tiles)
@@ -498,10 +498,10 @@ namespace VocaluxeLib.Menu.SongMenu
else
{
_Locked = 0;
_actualSelection = 0;
_ActualSelection = 0;
_PreviewSelected = 0;
SetSelectedNow();
UpdateList(0, true);
_SetSelectedNow();
_UpdateList(0, true);
}
}
@@ -509,100 +509,100 @@ namespace VocaluxeLib.Menu.SongMenu
tile.Selected = false;
_PreviewSelected = itemNr;
SetSelectedNow();
_SetSelectedNow();
_Locked = itemNr;
UpdateList(true);
_UpdateList(true);
_PreviewSelected = _Locked;
_actualSelection = _Locked;
_ActualSelection = _Locked;
if (_Locked - _Offset >= 0)
_Tiles[_Locked - _Offset].Selected = true;
}
public override void SetSelectedSong(int VisibleSongNr)
public override void SetSelectedSong(int visibleSongNr)
{
base.SetSelectedSong(VisibleSongNr);
base.SetSelectedSong(visibleSongNr);
if (VisibleSongNr >= 0 && VisibleSongNr < CBase.Songs.GetNumVisibleSongs())
SetSelectedTile(VisibleSongNr);
if (visibleSongNr >= 0 && visibleSongNr < CBase.Songs.GetNumVisibleSongs())
_SetSelectedTile(visibleSongNr);
}
public override void SetSelectedCategory(int CategoryNr)
public override void SetSelectedCategory(int categoryNr)
{
base.SetSelectedCategory(CategoryNr);
base.SetSelectedCategory(categoryNr);
if (CategoryNr >= 0 && CategoryNr < CBase.Songs.GetNumCategories())
SetSelectedTile(CategoryNr);
if (categoryNr >= 0 && categoryNr < CBase.Songs.GetNumCategories())
_SetSelectedTile(categoryNr);
}
protected override void EnterCategory(int cat)
protected override void _EnterCategory(int cat)
{
base.EnterCategory(cat);
base._EnterCategory(cat);
_PreviewSelected = 0;
_Locked = -1;
_actualSelection = 0;
AfterCategoryChange();
_ActualSelection = 0;
_AfterCategoryChange();
_Locked = 0;
}
protected override void ShowCategories()
protected override void _ShowCategories()
{
base.ShowCategories();
base._ShowCategories();
_PreviewSelected = 0;
_Locked = -1;
_actualSelection = 0;
AfterCategoryChange();
_ActualSelection = 0;
_AfterCategoryChange();
_Locked = 0;
}
private void NextCategory()
private void _NextCategory()
{
if (CBase.Songs.GetCurrentCategoryIndex() > -1)
{
CBase.Songs.NextCategory();
EnterCategory(CBase.Songs.GetCurrentCategoryIndex());
_EnterCategory(CBase.Songs.GetCurrentCategoryIndex());
}
}
private void PrevCategory()
private void _PrevCategory()
{
if (CBase.Songs.GetCurrentCategoryIndex() > -1)
{
CBase.Songs.PrevCategory();
EnterCategory(CBase.Songs.GetCurrentCategoryIndex());
_EnterCategory(CBase.Songs.GetCurrentCategoryIndex());
}
}
private void AfterCategoryChange()
private void _AfterCategoryChange()
{
SetSelectedNow();
SelectSong(_PreviewSelected);
_SetSelectedNow();
_SelectSong(_PreviewSelected);
foreach (CStatic tile in _Tiles)
tile.Selected = false;
if (_actualSelection >= 0 && _actualSelection < _Tiles.Count)
_Tiles[_actualSelection].Selected = true;
if (_ActualSelection >= 0 && _ActualSelection < _Tiles.Count)
_Tiles[_ActualSelection].Selected = true;
if ((_LastKnownNumSongs == CBase.Songs.GetNumVisibleSongs()) && (_LastKnownCategory == CBase.Songs.GetCurrentCategoryIndex()))
return;
_LastKnownCategory = CBase.Songs.GetCurrentCategoryIndex();
_LastKnownNumSongs = CBase.Songs.GetNumVisibleSongs();
UpdateList(0, true);
_UpdateList(0, true);
CBase.Songs.UpdateRandomSongList();
}
private void UpdateList(bool force = false)
private void _UpdateList(bool force = false)
{
UpdateList((_Locked / _NumW) * _NumW - (_NumW * (_NumH - 2)), force);
_UpdateList((_Locked / _NumW) * _NumW - (_NumW * (_NumH - 2)), force);
}
private void UpdateList(int offset, bool force = false)
private void _UpdateList(int offset, bool force = false)
{
bool isInCategory = CBase.Songs.GetCurrentCategoryIndex() >= 0;
int itemCount = isInCategory ? CBase.Songs.GetNumVisibleSongs() : CBase.Songs.GetNumCategories();
@@ -635,23 +635,23 @@ namespace VocaluxeLib.Menu.SongMenu
_Offset = offset;
}
public override void SetSmallView(bool SmallView)
public override void SetSmallView(bool smallView)
{
base.SetSmallView(SmallView);
base.SetSmallView(smallView);
_SmallView = SmallView;
_SmallView = smallView;
if (_SmallView)
{
_NumH = _Theme.songMenuTileBoard.numHsmall;
_NumW = _Theme.songMenuTileBoard.numWsmall;
_Rect = _Theme.songMenuTileBoard.TileRectSmall;
_NumH = _Theme.SongMenuTileBoard.NumHsmall;
_NumW = _Theme.SongMenuTileBoard.NumWsmall;
_Rect = _Theme.SongMenuTileBoard.TileRectSmall;
}
else
{
_NumH = _Theme.songMenuTileBoard.numH;
_NumW = _Theme.songMenuTileBoard.numW;
_Rect = _Theme.songMenuTileBoard.TileRect;
_NumH = _Theme.SongMenuTileBoard.NumH;
_NumW = _Theme.SongMenuTileBoard.NumW;
_Rect = _Theme.SongMenuTileBoard.TileRect;
}
_TileW = (int)((_Rect.W - _SpaceW * (_NumW - 1)) / _NumW);
@@ -672,7 +672,7 @@ namespace VocaluxeLib.Menu.SongMenu
}
_ScrollRect = new SRectF(0, 0, CBase.Settings.GetRenderW(), CBase.Settings.GetRenderH(), _Rect.Z);
UpdateList(true);
_UpdateList(true);
}
public override bool IsSmallView()
@@ -684,16 +684,16 @@ namespace VocaluxeLib.Menu.SongMenu
{
base.LoadTextures();
_Theme.songMenuTileBoard.StaticCoverBig.ReloadTextures();
_Theme.songMenuTileBoard.StaticTextBG.ReloadTextures();
_Theme.songMenuTileBoard.StaticDuetIcon.ReloadTextures();
_Theme.songMenuTileBoard.StaticVideoIcon.ReloadTextures();
_Theme.songMenuTileBoard.StaticMedleyCalcIcon.ReloadTextures();
_Theme.songMenuTileBoard.StaticMedleyTagIcon.ReloadTextures();
_Theme.SongMenuTileBoard.StaticCoverBig.ReloadTextures();
_Theme.SongMenuTileBoard.StaticTextBG.ReloadTextures();
_Theme.SongMenuTileBoard.StaticDuetIcon.ReloadTextures();
_Theme.SongMenuTileBoard.StaticVideoIcon.ReloadTextures();
_Theme.SongMenuTileBoard.StaticMedleyCalcIcon.ReloadTextures();
_Theme.SongMenuTileBoard.StaticMedleyTagIcon.ReloadTextures();
_Theme.songMenuTileBoard.TextArtist.ReloadTextures();
_Theme.songMenuTileBoard.TextTitle.ReloadTextures();
_Theme.songMenuTileBoard.TextSongLength.ReloadTextures();
_Theme.SongMenuTileBoard.TextArtist.ReloadTextures();
_Theme.SongMenuTileBoard.TextTitle.ReloadTextures();
_Theme.SongMenuTileBoard.TextSongLength.ReloadTextures();
}
}
}
+10 -10
View File
@@ -4,37 +4,37 @@ namespace VocaluxeLib.Menu.SongMenu
{
interface ISongMenu : IMenuElement
{
void Update(ScreenSongOptions SongOptions);
void Update(SScreenSongOptions songOptions);
void OnShow();
void OnHide();
void HandleInput(ref KeyEvent KeyEvent, ScreenSongOptions SongOptions);
void HandleMouse(ref MouseEvent MouseEvent, ScreenSongOptions SongOptions);
void HandleInput(ref SKeyEvent keyEvent, SScreenSongOptions songOptions);
void HandleMouse(ref SMouseEvent mouseEvent, SScreenSongOptions songOptions);
void Draw();
void ApplyVolume(float VolumeMax);
void ApplyVolume(float volumeMax);
int GetSelectedSong();
CStatic GetSelectedSongCover();
void SetSelectedSong(int VisibleSongNr);
void SetSelectedSong(int visibleSongNr);
bool IsActive();
void SetActive(bool Active);
void SetActive(bool active);
int GetSelectedCategory();
void SetSelectedCategory(int CategoryNr);
void SetSelectedCategory(int categoryNr);
int GetActualSelection();
bool EnterCurrentCategory();
bool IsSelected();
void SetSelected(bool Selected);
void SetSelected(bool selected);
bool IsVisible();
void SetVisible(bool Visible);
void SetVisible(bool visible);
bool IsSmallView();
void SetSmallView(bool SmallView);
void SetSmallView(bool smallView);
SRectF GetRect();
}