Made the code checker a bit happier

This commit is contained in:
Flamefire committed 2013-02-26 16:25:29 +01:00
1 parent d5cb43a09f
commit 3ebd34fcc3
48 files changed
+1880 -1834

No files matched your search

+5 -5
View File
@@ -104,7 +104,7 @@ namespace Vocaluxe.Menu
writer.WriteComment("<Color>: Background color for type \"Color\" from ColorScheme (high priority)");
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
if (_Theme.ColorName != String.Empty)
if (_Theme.ColorName.Length > 0)
{
writer.WriteElementString("Color", _Theme.ColorName);
}
@@ -127,13 +127,13 @@ namespace Vocaluxe.Menu
public void Resume()
{
if (_Theme.Type == EBackgroundTypes.Video && _Theme.VideoName != String.Empty && CBase.Config.GetVideoBackgrounds() == EOffOn.TR_CONFIG_ON)
if (_Theme.Type == EBackgroundTypes.Video && _Theme.VideoName.Length > 0 && CBase.Config.GetVideoBackgrounds() == EOffOn.TR_CONFIG_ON)
CBase.Theme.SkinVideoResume(_Theme.VideoName, _PartyModeID);
}
public void Pause()
{
if (_Theme.VideoName != String.Empty)
if (_Theme.VideoName.Length > 0)
CBase.Theme.SkinVideoPause(_Theme.VideoName, _PartyModeID);
}
@@ -153,7 +153,7 @@ namespace Vocaluxe.Menu
ok = DrawVideo();
}
if (_Theme.TextureName != String.Empty &&
if (_Theme.TextureName.Length > 0 &&
(_Theme.Type == EBackgroundTypes.Texture ||
(_Theme.Type == EBackgroundTypes.Video && (CBase.Config.GetVideoBackgrounds() == EOffOn.TR_CONFIG_OFF || !ok))))
ok = DrawTexture();
@@ -171,7 +171,7 @@ namespace Vocaluxe.Menu
public void LoadTextures()
{
if (_Theme.ColorName != String.Empty)
if (_Theme.ColorName.Length > 0)
Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID);
}
+4 -4
View File
@@ -227,7 +227,7 @@ namespace Vocaluxe.Menu
writer.WriteComment("<Color>: Button color from ColorScheme (high priority)");
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
if (_Theme.ColorName != String.Empty)
if (_Theme.ColorName.Length > 0)
{
writer.WriteElementString("Color", _Theme.ColorName);
}
@@ -241,7 +241,7 @@ namespace Vocaluxe.Menu
writer.WriteComment("<SColor>: Selected button color from ColorScheme (high priority)");
writer.WriteComment("or <SR>, <SG>, <SB>, <SA> (lower priority)");
if (_Theme.SColorName != String.Empty)
if (_Theme.SColorName.Length > 0)
{
writer.WriteElementString("SColor", _Theme.SColorName);
}
@@ -370,10 +370,10 @@ namespace Vocaluxe.Menu
{
Text.LoadTextures();
if (_Theme.ColorName != String.Empty)
if (_Theme.ColorName.Length > 0)
Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID);
if (_Theme.SColorName != String.Empty)
if (_Theme.SColorName.Length > 0)
SColor = CBase.Theme.GetColor(_Theme.SColorName, _PartyModeID);
}
+4 -4
View File
@@ -165,7 +165,7 @@ namespace Vocaluxe.Menu
writer.WriteComment("<Color>: Equalizer color from ColorScheme (high priority)");
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
if (_Theme.ColorName != String.Empty)
if (_Theme.ColorName.Length > 0)
{
writer.WriteElementString("Color", _Theme.ColorName);
}
@@ -178,7 +178,7 @@ namespace Vocaluxe.Menu
}
writer.WriteComment("<MaxColor>: Equalizer color for maximal volume from ColorScheme (high priority)");
writer.WriteComment("or <MaxR>, <MaxG>, <MaxB>, <MaxA> (lower priority)");
if (_Theme.ColorName != String.Empty)
if (_Theme.ColorName.Length > 0)
{
writer.WriteElementString("MaxColor", _Theme.ColorName);
}
@@ -273,10 +273,10 @@ namespace Vocaluxe.Menu
public void LoadTextures()
{
if (_Theme.ColorName != String.Empty)
if (_Theme.ColorName.Length > 0)
Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID);
if (_Theme.MaxColorName != String.Empty)
if (_Theme.MaxColorName.Length > 0)
MaxColor = CBase.Theme.GetColor(_Theme.MaxColorName, _PartyModeID);
}
+3 -2
View File
@@ -73,8 +73,9 @@ namespace Vocaluxe.Menu
return 0;
}
int result = 0;
int.TryParse(value, out result);
return result;
if(int.TryParse(value, out result))
return result;
return 0;
}
public static void SetRect(RectangleF Bounds, ref RectangleF Rect, float RectAspect, EAspect Aspect)
+4 -4
View File
@@ -164,7 +164,7 @@ namespace Vocaluxe.Menu
writer.WriteComment("<Color>: Lyric text color from ColorScheme (high priority)");
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
if (_Theme.ColorName != String.Empty)
if (_Theme.ColorName.Length > 0)
{
writer.WriteElementString("Color", _Theme.ColorName);
}
@@ -178,7 +178,7 @@ namespace Vocaluxe.Menu
writer.WriteComment("<SColor>: Highlighted lyric color from ColorScheme (high priority)");
writer.WriteComment("or <SR>, <SG>, <SB>, <SA> (lower priority)");
if (_Theme.SColorName != String.Empty)
if (_Theme.SColorName.Length > 0)
{
writer.WriteElementString("SColor", _Theme.SColorName);
}
@@ -547,10 +547,10 @@ namespace Vocaluxe.Menu
public void LoadTextures()
{
if (_Theme.ColorName != String.Empty)
if (_Theme.ColorName.Length > 0)
Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID);
if (_Theme.SColorName != String.Empty)
if (_Theme.SColorName.Length > 0)
ColorProcessed = CBase.Theme.GetColor(_Theme.SColorName, _PartyModeID);
}
+93 -92
View File
@@ -409,7 +409,7 @@ namespace Vocaluxe.Menu
public virtual void SaveTheme()
{
if (_ThemePath == String.Empty)
if (_ThemePath.Length == 0)
return;
XmlWriterSettings settings = new XmlWriterSettings();
@@ -418,98 +418,99 @@ namespace Vocaluxe.Menu
settings.ConformanceLevel = ConformanceLevel.Document;
string file = Path.Combine(_ThemePath, _ThemeName + ".xml");
XmlWriter writer = XmlWriter.Create(file, settings);
writer.WriteStartDocument();
writer.WriteStartElement("root");
writer.WriteStartElement(_ThemeName);
// Screen Version
writer.WriteElementString("ScreenVersion", _ScreenVersion.ToString());
// Backgrounds
for (int i = 0; i < _Backgrounds.Count; i++)
_Backgrounds[i].SaveTheme(writer);
// Statics
for (int i = 0; i < _Statics.Count; i++)
_Statics[i].SaveTheme(writer);
// Texts
for (int i = 0; i < _Texts.Count; i++)
using (XmlWriter writer = XmlWriter.Create(file, settings))
{
_Texts[i].SaveTheme(writer);
writer.WriteStartDocument();
writer.WriteStartElement("root");
writer.WriteStartElement(_ThemeName);
// Screen Version
writer.WriteElementString("ScreenVersion", _ScreenVersion.ToString());
// Backgrounds
for (int i = 0; i < _Backgrounds.Count; i++)
_Backgrounds[i].SaveTheme(writer);
// Statics
for (int i = 0; i < _Statics.Count; i++)
_Statics[i].SaveTheme(writer);
// Texts
for (int i = 0; i < _Texts.Count; i++)
{
_Texts[i].SaveTheme(writer);
}
// Buttons
for (int i = 0; i < _Buttons.Count; i++)
{
_Buttons[i].SaveTheme(writer);
}
// SelectSlides
for (int i = 0; i < _SelectSlides.Count; i++)
{
_SelectSlides[i].SaveTheme(writer);
}
// SongMenus
for (int i = 0; i < _SongMenus.Count; i++)
{
_SongMenus[i].SaveTheme(writer);
}
// Lyrics
for (int i = 0; i < _Lyrics.Count; i++)
{
_Lyrics[i].SaveTheme(writer);
}
// SingBars
for (int i = 0; i < _SingNotes.Count; i++)
{
_SingNotes[i].SaveTheme(writer);
}
// NameSelections
for (int i = 0; i < _NameSelections.Count; i++)
{
_NameSelections[i].SaveTheme(writer);
}
//Equalizers
for (int i = 0; i < _Equalizers.Count; i++)
{
_Equalizers[i].SaveTheme(writer);
}
//Playlists
for (int i = 0; i < _Playlists.Count; i++)
{
_Playlists[i].SaveTheme(writer);
}
//ParticleEffects
for (int i = 0; i < _ParticleEffects.Count; i++)
{
_ParticleEffects[i].SaveTheme(writer);
}
//ScreenSettings
for (int i = 0; i < _ScreenSettings.Count; i++)
{
_ScreenSettings[i].SaveTheme(writer);
}
writer.WriteEndElement();
// End of File
writer.WriteEndElement(); //end of root
writer.WriteEndDocument();
writer.Flush();
}
// Buttons
for (int i = 0; i < _Buttons.Count; i++)
{
_Buttons[i].SaveTheme(writer);
}
// SelectSlides
for (int i = 0; i < _SelectSlides.Count; i++)
{
_SelectSlides[i].SaveTheme(writer);
}
// SongMenus
for (int i = 0; i < _SongMenus.Count; i++)
{
_SongMenus[i].SaveTheme(writer);
}
// Lyrics
for (int i = 0; i < _Lyrics.Count; i++)
{
_Lyrics[i].SaveTheme(writer);
}
// SingBars
for (int i = 0; i < _SingNotes.Count; i++)
{
_SingNotes[i].SaveTheme(writer);
}
// NameSelections
for (int i = 0; i < _NameSelections.Count; i++)
{
_NameSelections[i].SaveTheme(writer);
}
//Equalizers
for (int i = 0; i < _Equalizers.Count; i++)
{
_Equalizers[i].SaveTheme(writer);
}
//Playlists
for (int i = 0; i < _Playlists.Count; i++)
{
_Playlists[i].SaveTheme(writer);
}
//ParticleEffects
for (int i = 0; i < _ParticleEffects.Count; i++)
{
_ParticleEffects[i].SaveTheme(writer);
}
//ScreenSettings
for (int i = 0; i < _ScreenSettings.Count; i++)
{
_ScreenSettings[i].SaveTheme(writer);
}
writer.WriteEndElement();
// End of File
writer.WriteEndElement(); //end of root
writer.WriteEndDocument();
writer.Flush();
writer.Close();
}
public virtual void ReloadTextures()
@@ -649,7 +650,7 @@ namespace Vocaluxe.Menu
public virtual void ReloadTheme(string XmlPath)
{
if (_ThemePath == String.Empty)
if (_ThemePath.Length == 0)
return;
UnloadTextures();
+4 -4
View File
@@ -182,7 +182,7 @@ namespace Vocaluxe.Menu
writer.WriteComment("<ColorEmptyTile>: Static color from ColorScheme (high priority)");
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
if (_Theme.ColorEmptyTileName != String.Empty)
if (_Theme.ColorEmptyTileName.Length > 0)
{
writer.WriteElementString("ColorEmptyTile", _Theme.ColorEmptyTileName);
}
@@ -215,7 +215,7 @@ namespace Vocaluxe.Menu
writer.WriteComment("<Font>: Text font name");
writer.WriteElementString("Font", _Theme.NameFont);
writer.WriteComment("<Color>: Text color from ColorScheme (high priority)");
if (_Theme.NameColorName != String.Empty)
if (_Theme.NameColorName.Length > 0)
{
writer.WriteElementString("Color", _Theme.NameColorName);
}
@@ -474,10 +474,10 @@ namespace Vocaluxe.Menu
_TextureEmptyTile = CBase.Theme.GetSkinTexture(_Theme.TextureEmptyTileName, _PartyModeID);
_TextureTileSelected = CBase.Theme.GetSkinTexture(_Theme.TextureTileSelectedName, _PartyModeID);
if (_Theme.ColorEmptyTileName != String.Empty)
if (_Theme.ColorEmptyTileName.Length > 0)
ColorEmptyTile = CBase.Theme.GetColor(_Theme.ColorEmptyTileName, _PartyModeID);
if (_Theme.NameColorName != String.Empty)
if (_Theme.NameColorName.Length > 0)
_Theme.NameColor = CBase.Theme.GetColor(_Theme.NameColorName, _PartyModeID);
}
+1 -1
View File
@@ -42,7 +42,7 @@ namespace Vocaluxe.Menu
Init();
}
protected virtual void Init()
protected void Init()
{
_Interactions = new List<CInteraction>();
_Selection = 0;
+5 -5
View File
@@ -287,7 +287,7 @@ namespace Vocaluxe.Menu
public void Draw()
{
if (_TextureName != String.Empty)
if (_TextureName.Length > 0)
CBase.Drawing.DrawTexture(CBase.Theme.GetSkinTexture(_TextureName, _PartyModeID), _Rect, new SColorF(_Color.R, _Color.G, _Color.B, _Color.A * Alpha2 * _Alpha));
else
CBase.Drawing.DrawTexture(_Texture, _Rect, new SColorF(_Color.R, _Color.G, _Color.B, _Color.A * Alpha2 * _Alpha));
@@ -428,7 +428,7 @@ namespace Vocaluxe.Menu
writer.WriteComment("<Color>: ParticleEffect color from ColorScheme (high priority)");
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
if (_Theme.ColorName != String.Empty)
if (_Theme.ColorName.Length > 0)
{
writer.WriteElementString("Color", _Theme.ColorName);
}
@@ -544,7 +544,7 @@ namespace Vocaluxe.Menu
h = 0;
CParticle star;
if (_Theme.TextureName != String.Empty)
if (_Theme.TextureName.Length > 0)
{
star = new CParticle(_PartyModeID, _Theme.TextureName, Color,
CBase.Game.GetRandom(w) + Rect.X - size / 4f,
@@ -611,9 +611,9 @@ namespace Vocaluxe.Menu
public void LoadTextures()
{
if (_Theme.ColorName != String.Empty)
if (_Theme.ColorName.Length > 0)
Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID);
if(_Theme.TextureName != String.Empty)
if(_Theme.TextureName.Length > 0)
Texture = CBase.Theme.GetSkinTexture(_Theme.TextureName, _PartyModeID);
}
+4 -4
View File
@@ -360,7 +360,7 @@ namespace Vocaluxe.Menu
writer.WriteComment("<ColorBackground>: Button color from ColorScheme (high priority)");
writer.WriteComment("or <BackgroundR>, <BackgroundG>, <BackgroundB>, <BackgroundA> (lower priority)");
if (_Theme.ColorBackgroundName != String.Empty)
if (_Theme.ColorBackgroundName.Length > 0)
{
writer.WriteElementString("ColorBackground", _Theme.ColorBackgroundName);
}
@@ -374,7 +374,7 @@ namespace Vocaluxe.Menu
writer.WriteComment("<SColorBackground>: Selected paylist-entry color from ColorScheme (high priority)");
writer.WriteComment("or <SBackgroundR>, <SBackgroundG>, <SBackgroundB>, <SBackgroundA> (lower priority)");
if (_Theme.SColorBackgroundName != String.Empty)
if (_Theme.SColorBackgroundName.Length > 0)
{
writer.WriteElementString("SColorBackground", _Theme.SColorBackgroundName);
}
@@ -467,10 +467,10 @@ namespace Vocaluxe.Menu
public void LoadTextures()
{
if (_Theme.ColorBackgroundName != String.Empty)
if (_Theme.ColorBackgroundName.Length > 0)
BackgroundColor = CBase.Theme.GetColor(_Theme.ColorBackgroundName, _PartyModeID);
if (_Theme.SColorBackgroundName != String.Empty)
if (_Theme.SColorBackgroundName.Length > 0)
BackgroundSColor = CBase.Theme.GetColor(_Theme.SColorBackgroundName, _PartyModeID);
_Theme.Text1.LoadTextures();
+14 -14
View File
@@ -413,7 +413,7 @@ namespace Vocaluxe.Menu
writer.WriteComment("<Color>: SelectSlide color from ColorScheme (high priority)");
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
if (_Theme.ColorName != String.Empty)
if (_Theme.ColorName.Length > 0)
{
writer.WriteElementString("Color", _Theme.ColorName);
}
@@ -427,7 +427,7 @@ namespace Vocaluxe.Menu
writer.WriteComment("<SColor>: Selected SelectSlide color from ColorScheme (high priority)");
writer.WriteComment("or <SR>, <SG>, <SB>, <SA> (lower priority)");
if (_Theme.SColorName != String.Empty)
if (_Theme.SColorName.Length > 0)
{
writer.WriteElementString("SColor", _Theme.SColorName);
}
@@ -441,7 +441,7 @@ namespace Vocaluxe.Menu
writer.WriteComment("<HColor>: Highlighted SelectSlide color from ColorScheme (high priority)");
writer.WriteComment("or <HR>, <HG>, <HB>, <HA> (lower priority)");
if (_Theme.HColorName != String.Empty)
if (_Theme.HColorName.Length > 0)
{
writer.WriteElementString("HColor", _Theme.HColorName);
}
@@ -455,7 +455,7 @@ namespace Vocaluxe.Menu
writer.WriteComment("<ArrowColor>: Arrow color from ColorScheme (high priority)");
writer.WriteComment("or <ArrowR>, <ArrowG>, <ArrowB>, <ArrowA> (lower priority)");
if (_Theme.ArrowColorName != String.Empty)
if (_Theme.ArrowColorName.Length > 0)
{
writer.WriteElementString("ArrowColor", _Theme.ArrowColorName);
}
@@ -469,7 +469,7 @@ namespace Vocaluxe.Menu
writer.WriteComment("<ArrowSColor>: Selected arrow color from ColorScheme (high priority)");
writer.WriteComment("or <ArrowSR>, <ArrowSG>, <ArrowSB>, <ArrowSA> (lower priority)");
if (_Theme.SArrowColorName != String.Empty)
if (_Theme.SArrowColorName.Length > 0)
{
writer.WriteElementString("ArrowSColor", _Theme.SArrowColorName);
}
@@ -483,7 +483,7 @@ namespace Vocaluxe.Menu
writer.WriteComment("<TextColor>: Text color from ColorScheme (high priority)");
writer.WriteComment("or <TextR>, <TextG>, <TextB>, <TextA> (lower priority)");
if (_Theme.TextColorName != String.Empty)
if (_Theme.TextColorName.Length > 0)
{
writer.WriteElementString("TextColor", _Theme.TextColorName);
}
@@ -497,7 +497,7 @@ namespace Vocaluxe.Menu
writer.WriteComment("<TextSColor>: Selected text color from ColorScheme (high priority)");
writer.WriteComment("or <TextSR>, <TextSG>, <TextSB>, <TextSA> (lower priority)");
if (_Theme.STextColorName != String.Empty)
if (_Theme.STextColorName.Length > 0)
{
writer.WriteElementString("TextSColor", _Theme.STextColorName);
}
@@ -817,25 +817,25 @@ namespace Vocaluxe.Menu
public void LoadTextures()
{
if (_Theme.ColorName != String.Empty)
if (_Theme.ColorName.Length > 0)
Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID);
if (_Theme.SColorName != String.Empty)
if (_Theme.SColorName.Length > 0)
SColor = CBase.Theme.GetColor(_Theme.SColorName, _PartyModeID);
if (_Theme.HColorName != String.Empty)
if (_Theme.HColorName.Length > 0)
HColor = CBase.Theme.GetColor(_Theme.HColorName, _PartyModeID);
if (_Theme.ArrowColorName != String.Empty)
if (_Theme.ArrowColorName.Length > 0)
ColorArrow = CBase.Theme.GetColor(_Theme.ArrowColorName, _PartyModeID);
if (_Theme.SArrowColorName != String.Empty)
if (_Theme.SArrowColorName.Length > 0)
SColorArrow = CBase.Theme.GetColor(_Theme.SArrowColorName, _PartyModeID);
if (_Theme.TextColorName != String.Empty)
if (_Theme.TextColorName.Length > 0)
TextColor = CBase.Theme.GetColor(_Theme.TextColorName, _PartyModeID);
if (_Theme.SColorName != String.Empty)
if (_Theme.SColorName.Length > 0)
STextColor = CBase.Theme.GetColor(_Theme.STextColorName, _PartyModeID);
}
+2 -2
View File
@@ -186,7 +186,7 @@ namespace Vocaluxe.Menu
writer.WriteComment("<Color>: Static color from ColorScheme (high priority)");
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
if (_Theme.ColorName != String.Empty)
if (_Theme.ColorName.Length > 0)
{
writer.WriteElementString("Color", _Theme.ColorName);
}
@@ -286,7 +286,7 @@ namespace Vocaluxe.Menu
public void LoadTextures()
{
if (_Theme.ColorName != String.Empty)
if (_Theme.ColorName.Length > 0)
Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID);
}
+5 -5
View File
@@ -576,7 +576,7 @@ namespace Vocaluxe.Menu
writer.WriteComment("<Color>: Text color from ColorScheme (high priority)");
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
if (_Theme.ColorName != String.Empty)
if (_Theme.ColorName.Length > 0)
{
writer.WriteElementString("Color", _Theme.ColorName);
}
@@ -590,7 +590,7 @@ namespace Vocaluxe.Menu
writer.WriteComment("<SColor>: Selected Text color from ColorScheme (high priority)");
writer.WriteComment("or <SR>, <SG>, <SB>, <SA> (lower priority)");
if (_Theme.SColorName != String.Empty)
if (_Theme.SColorName.Length > 0)
{
writer.WriteElementString("SColor", _Theme.SColorName);
}
@@ -849,10 +849,10 @@ namespace Vocaluxe.Menu
public void LoadTextures()
{
if (_Theme.ColorName != String.Empty)
if (_Theme.ColorName.Length > 0)
Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID);
if (_Theme.SColorName != String.Empty)
if (_Theme.SColorName.Length > 0)
SColor = CBase.Theme.GetColor(_Theme.SColorName, _PartyModeID);
}
@@ -879,7 +879,7 @@ namespace Vocaluxe.Menu
private void UpdateTextPosition()
{
if (_Text == String.Empty)
if (_Text.Length == 0)
return;
CBase.Fonts.SetFont(Fon);
+27 -20
View File
@@ -330,7 +330,7 @@ namespace Vocaluxe.Menu.SongMenu
this.FileName = Path.GetFileName(FilePath);
EHeaderFlags HeaderFlags = new EHeaderFlags();
StreamReader sr;
StreamReader sr = null;
try
{
@@ -362,6 +362,8 @@ namespace Vocaluxe.Menu.SongMenu
{
case "ENCODING":
this.Encoding = CEncoding.GetEncoding(Value);
sr.Dispose();
sr = null;
sr = new StreamReader(FilePath, this.Encoding);
Identifier = String.Empty;
@@ -369,9 +371,9 @@ namespace Vocaluxe.Menu.SongMenu
while (!sr.EndOfStream)
{
line = sr.ReadLine();
if (line.Length == 0)
if (line.Length == 0)
continue;
if(!line[0].ToString().Equals("#")) break;
if (!line[0].ToString().Equals("#")) break;
pos = line.IndexOf(":");
@@ -384,39 +386,39 @@ namespace Vocaluxe.Menu.SongMenu
}
break;
case "TITLE":
if (Value != String.Empty)
if (Value.Length > 0)
{
this.Title = Value;
HeaderFlags |= EHeaderFlags.Title;
}
break;
case "ARTIST":
if (Value != String.Empty)
if (Value.Length > 0)
{
this.Artist = Value;
HeaderFlags |= EHeaderFlags.Artist;
}
break;
case "TITLE-ON-SORTING":
if (Value != String.Empty)
if (Value.Length > 0)
{
this.TitleSorting = Value;
}
break;
case "ARTIST-ON-SORTING":
if (Value != String.Empty)
if (Value.Length > 0)
{
this.ArtistSorting = Value;
}
break;
case "P1":
if (Value != String.Empty)
if (Value.Length > 0)
{
this.DuetPart1 = Value;
}
break;
case "P2":
if (Value != String.Empty)
if (Value.Length > 0)
{
this.DuetPart2 = Value;
}
@@ -586,19 +588,21 @@ namespace Vocaluxe.Menu.SongMenu
}
catch (Exception e)
{
if (sr != null)
sr.Dispose();
CBase.Log.LogError("Error reading txt header in file \"" + FilePath + "\": " + e.Message);
return false;
}
sr.Dispose();
CheckFiles();
//Before saving this tags to .txt: Check, if ArtistSorting and Artist are equal, then don't save this tag.
if (this.ArtistSorting == String.Empty)
if (this.ArtistSorting.Length == 0)
{
this.ArtistSorting = this.Artist;
}
if (this.TitleSorting == String.Empty)
if (this.TitleSorting.Length == 0)
{
this.TitleSorting = this.Title;
}
@@ -634,7 +638,7 @@ namespace Vocaluxe.Menu.SongMenu
int Player = 0;
int FileLineNo = 0;
StreamReader sr;
StreamReader sr = null;
try
{
@@ -776,8 +780,11 @@ namespace Vocaluxe.Menu.SongMenu
catch (Exception e)
{
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();
_NotesLoaded = true;
@@ -805,7 +812,7 @@ namespace Vocaluxe.Menu.SongMenu
{
if (_CoverSmallLoaded)
return;
if (this.CoverFileName != String.Empty)
if (this.CoverFileName.Length > 0)
{
if (!CBase.DataBase.GetCover(Path.Combine(this.Folder, this.CoverFileName), ref _CoverTextureSmall, CBase.Config.GetCoverSize()))
_CoverTextureSmall = CBase.Cover.GetNoCover();
@@ -818,7 +825,7 @@ namespace Vocaluxe.Menu.SongMenu
private void CheckFiles()
{
if(this.CoverFileName == String.Empty){
if(this.CoverFileName.Length == 0){
List<string> files = CHelper.ListFiles(this.Folder, "*.jpg", false);
files.AddRange(CHelper.ListFiles(this.Folder, "*.png", false));
foreach(String file in files)
@@ -830,7 +837,7 @@ namespace Vocaluxe.Menu.SongMenu
}
}
if (this.BackgroundFileName == String.Empty)
if (this.BackgroundFileName.Length == 0)
{
List<string> files = CHelper.ListFiles(this.Folder, "*.jpg", false);
files.AddRange(CHelper.ListFiles(this.Folder, "*.png", false));
@@ -847,12 +854,12 @@ namespace Vocaluxe.Menu.SongMenu
private void CheckDuet()
{
if (DuetPart1 == String.Empty)
if (DuetPart1.Length == 0)
{
DuetPart1 = "Part 1";
CBase.Log.LogError("Warning: Can't find #P1-tag for duets in \"" + this.Artist + " - " + this.Title + "\".");
}
if (DuetPart2 == String.Empty)
if (DuetPart2.Length == 0)
{
DuetPart2 = "Part 2";
CBase.Log.LogError("Warning: Can't find #P2-tag for duets in \"" + this.Artist + " - " + this.Title + "\".");
@@ -889,7 +896,7 @@ namespace Vocaluxe.Menu.SongMenu
{
for (int j = i + 1; j < lines.LineCount; j++)
{
if (sentences[i] == sentences[j] && sentences[i] != String.Empty)
if (sentences[i] == sentences[j] && sentences[i].Length > 0)
{
Series tempSeries = new Series();
tempSeries.start = i;
@@ -903,7 +910,7 @@ namespace Vocaluxe.Menu.SongMenu
for (int k = 1; k <= max; k++)
{
if (sentences[i + k] == sentences[j + k] && sentences[i + k] != String.Empty)
if (sentences[i + k] == sentences[j + k] && sentences[i + k].Length > 0)
tempSeries.end = i + k;
else
break;
@@ -350,7 +350,7 @@ namespace Vocaluxe.Menu.SongMenu
writer.WriteComment("<Color>: Tile color from ColorScheme (high priority)");
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
if (_Theme.ColorName != String.Empty)
if (_Theme.ColorName.Length > 0)
{
writer.WriteElementString("Color", _Theme.ColorName);
}
@@ -578,7 +578,7 @@ namespace Vocaluxe.Menu.SongMenu
{
Init();
if (_Theme.ColorName != String.Empty)
if (_Theme.ColorName.Length > 0)
_Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID);
}
@@ -652,7 +652,7 @@ namespace Vocaluxe.Menu.SongMenu
_streams.Add(_stream);
_actsongstream = _stream;
if (CBase.Songs.GetVisibleSong(_actsong).VideoFileName != String.Empty && 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));
if (_video == -1)
@@ -144,7 +144,7 @@ namespace Vocaluxe.Menu.SongMenu
_MedleyTagIcon.Visible = false;
}
if (CBase.Songs.GetNumVisibleSongs() == 0 && CBase.Songs.GetSearchFilter() != String.Empty)
if (CBase.Songs.GetNumVisibleSongs() == 0 && CBase.Songs.GetSearchFilter().Length > 0)
{
_CoverBig.Texture = _CoverBigTexture;
_Artist.Text = String.Empty;