Changed string comparisons to easier != "" syntax

This commit is contained in:
Flamefire committed 2013-04-23 14:52:51 +02:00
1 parent 1540be9120
commit cf39a4b107
71 files changed
+268 -288

No files matched your search

@@ -157,21 +157,15 @@ namespace VocaluxeLib.PartyModes.Challenge
//filter against PlayerNrDemand //filter against PlayerNrDemand
List<CCombination> combsFiltered = new List<CCombination>(); List<CCombination> combsFiltered = new List<CCombination>();
if (playerNrDemand != null) if (playerNrDemand != null)
{
combsFiltered.AddRange(_Combs.Where(t => t.IsAvailableAll(playerNrDemand))); combsFiltered.AddRange(_Combs.Where(t => t.IsAvailableAll(playerNrDemand)));
}
//1st fallback //1st fallback
if (playerNrDemand != null && combsFiltered.Count == 0) if (playerNrDemand != null && combsFiltered.Count == 0)
{
combsFiltered.AddRange(_Combs.Where(t => t.IsAvailableSomeone(playerNrDemand))); combsFiltered.AddRange(_Combs.Where(t => t.IsAvailableSomeone(playerNrDemand)));
}
//2nd fallback //2nd fallback
if (combsFiltered.Count == 0) if (combsFiltered.Count == 0)
{
combsFiltered.AddRange(_Combs); combsFiltered.AddRange(_Combs);
}
int num = combsFiltered.Count; int num = combsFiltered.Count;
int rand = _Rand.Next(num); int rand = _Rand.Next(num);
@@ -368,9 +368,9 @@ namespace VocaluxeLib.PartyModes.Challenge
return _ScreenSongOptions; return _ScreenSongOptions;
} }
// ReSharper disable RedundantAssignment // ReSharper disable RedundantAssignment
public override void OnSongChange(int songIndex, ref SScreenSongOptions screenSongOptions) public override void OnSongChange(int songIndex, ref SScreenSongOptions screenSongOptions)
// ReSharper restore RedundantAssignment // ReSharper restore RedundantAssignment
{ {
_ScreenSongOptions.Selection.SongIndex = -1; _ScreenSongOptions.Selection.SongIndex = -1;
@@ -389,9 +389,9 @@ namespace VocaluxeLib.PartyModes.Challenge
screenSongOptions = _ScreenSongOptions; screenSongOptions = _ScreenSongOptions;
} }
// ReSharper disable RedundantAssignment // ReSharper disable RedundantAssignment
public override void OnCategoryChange(int categoryIndex, ref SScreenSongOptions screenSongOptions) public override void OnCategoryChange(int categoryIndex, ref SScreenSongOptions screenSongOptions)
// ReSharper restore RedundantAssignment // ReSharper restore RedundantAssignment
{ {
if (_GameData.CatSongIndices != null && categoryIndex != -1) if (_GameData.CatSongIndices != null && categoryIndex != -1)
{ {
@@ -23,9 +23,9 @@ using VocaluxeLib.Menu;
namespace VocaluxeLib.PartyModes.Challenge namespace VocaluxeLib.PartyModes.Challenge
{ {
// ReSharper disable UnusedMember.Global // ReSharper disable UnusedMember.Global
public class CPartyScreenChallengeConfig : CMenuParty public class CPartyScreenChallengeConfig : CMenuParty
// ReSharper restore UnusedMember.Global // ReSharper restore UnusedMember.Global
{ {
// Version number for theme files. Increment it, if you've changed something on the theme files! // Version number for theme files. Increment it, if you've changed something on the theme files!
protected override int _ScreenVersion protected override int _ScreenVersion
@@ -41,9 +41,9 @@ namespace VocaluxeLib.PartyModes.Challenge
public List<CText> TextScores; public List<CText> TextScores;
} }
// ReSharper disable UnusedMember.Global // ReSharper disable UnusedMember.Global
public class CPartyScreenChallengeMain : CMenuParty public class CPartyScreenChallengeMain : CMenuParty
// ReSharper restore UnusedMember.Global // ReSharper restore UnusedMember.Global
{ {
// Version number for theme files. Increment it, if you've changed something on the theme files! // Version number for theme files. Increment it, if you've changed something on the theme files!
protected override int _ScreenVersion protected override int _ScreenVersion
@@ -352,7 +352,7 @@ namespace VocaluxeLib.PartyModes.Challenge
private void _UpdateNextPlayerPositions() private void _UpdateNextPlayerPositions()
{ {
float x = (float) CBase.Settings.GetRenderW() / 2 - ((_GameState.NumPlayerAtOnce * _Statics[_StaticNextPlayer].Rect.W) + ((_GameState.NumPlayerAtOnce - 1) * 15)) / 2; float x = (float)CBase.Settings.GetRenderW() / 2 - ((_GameState.NumPlayerAtOnce * _Statics[_StaticNextPlayer].Rect.W) + ((_GameState.NumPlayerAtOnce - 1) * 15)) / 2;
const float staticY = 590; const float staticY = 590;
const float textY = 550; const float textY = 550;
for (int i = 0; i < _GameState.NumPlayerAtOnce; i++) for (int i = 0; i < _GameState.NumPlayerAtOnce; i++)
@@ -25,9 +25,9 @@ using VocaluxeLib.Menu;
namespace VocaluxeLib.PartyModes.Challenge namespace VocaluxeLib.PartyModes.Challenge
{ {
// ReSharper disable UnusedMember.Global // ReSharper disable UnusedMember.Global
public class CPartyScreenChallengeNames : CMenuParty public class CPartyScreenChallengeNames : CMenuParty
// ReSharper restore UnusedMember.Global // ReSharper restore UnusedMember.Global
{ {
// Version number for theme files. Increment it, if you've changed something on the theme files! // Version number for theme files. Increment it, if you've changed something on the theme files!
protected override int _ScreenVersion protected override int _ScreenVersion
@@ -382,9 +382,7 @@ namespace VocaluxeLib.PartyModes.Challenge
bool visible = false; bool visible = false;
//Show profile only if active //Show profile only if active
if (CBase.Profiles.GetProfiles()[i].Active == EOffOn.TR_CONFIG_ON) if (CBase.Profiles.GetProfiles()[i].Active == EOffOn.TR_CONFIG_ON)
{
visible = _Data.ScreenNames.ProfileIDs.All(profileID => profileID != i); visible = _Data.ScreenNames.ProfileIDs.All(profileID => profileID != i);
}
if (visible) if (visible)
_PlayerChooseButtonsVisibleProfiles.Add(i); _PlayerChooseButtonsVisibleProfiles.Add(i);
} }
@@ -375,9 +375,9 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
return _ScreenSongOptions; return _ScreenSongOptions;
} }
// ReSharper disable RedundantAssignment // ReSharper disable RedundantAssignment
public override void OnSongChange(int songIndex, ref SScreenSongOptions screenSongOptions) public override void OnSongChange(int songIndex, ref SScreenSongOptions screenSongOptions)
// ReSharper restore RedundantAssignment // ReSharper restore RedundantAssignment
{ {
_ScreenSongOptions.Selection.SongIndex = -1; _ScreenSongOptions.Selection.SongIndex = -1;
@@ -396,9 +396,9 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
screenSongOptions = _ScreenSongOptions; screenSongOptions = _ScreenSongOptions;
} }
// ReSharper disable RedundantAssignment // ReSharper disable RedundantAssignment
public override void OnCategoryChange(int categoryIndex, ref SScreenSongOptions screenSongOptions) public override void OnCategoryChange(int categoryIndex, ref SScreenSongOptions screenSongOptions)
// ReSharper restore RedundantAssignment // ReSharper restore RedundantAssignment
{ {
if (_GameData.CatSongIndices != null && categoryIndex != -1) if (_GameData.CatSongIndices != null && categoryIndex != -1)
{ {
@@ -23,9 +23,9 @@ using VocaluxeLib.Menu;
namespace VocaluxeLib.PartyModes.ChallengeMedley namespace VocaluxeLib.PartyModes.ChallengeMedley
{ {
// ReSharper disable UnusedMember.Global // ReSharper disable UnusedMember.Global
public class CPartyScreenChallengeMedleyConfig : CMenuParty public class CPartyScreenChallengeMedleyConfig : CMenuParty
// ReSharper restore UnusedMember.Global // ReSharper restore UnusedMember.Global
{ {
// Version number for theme files. Increment it, if you've changed something on the theme files! // Version number for theme files. Increment it, if you've changed something on the theme files!
protected override int _ScreenVersion protected override int _ScreenVersion
@@ -41,9 +41,9 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
public List<CText> TextScores; public List<CText> TextScores;
} }
// ReSharper disable UnusedMember.Global // ReSharper disable UnusedMember.Global
public class CPartyScreenChallengeMedleyMain : CMenuParty public class CPartyScreenChallengeMedleyMain : CMenuParty
// ReSharper restore UnusedMember.Global // ReSharper restore UnusedMember.Global
{ {
// Version number for theme files. Increment it, if you've changed something on the theme files! // Version number for theme files. Increment it, if you've changed something on the theme files!
protected override int _ScreenVersion protected override int _ScreenVersion
@@ -352,7 +352,7 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
private void _UpdateNextPlayerPositions() private void _UpdateNextPlayerPositions()
{ {
float x = (float) CBase.Settings.GetRenderW() / 2 - ((_GameState.NumPlayerAtOnce * _Statics[_StaticNextPlayer].Rect.W) + ((_GameState.NumPlayerAtOnce - 1) * 15)) / 2; float x = (float)CBase.Settings.GetRenderW() / 2 - ((_GameState.NumPlayerAtOnce * _Statics[_StaticNextPlayer].Rect.W) + ((_GameState.NumPlayerAtOnce - 1) * 15)) / 2;
const float staticY = 590; const float staticY = 590;
const float textY = 550; const float textY = 550;
for (int i = 0; i < _GameState.NumPlayerAtOnce; i++) for (int i = 0; i < _GameState.NumPlayerAtOnce; i++)
@@ -24,9 +24,9 @@ using VocaluxeLib.Menu;
namespace VocaluxeLib.PartyModes.ChallengeMedley namespace VocaluxeLib.PartyModes.ChallengeMedley
{ {
// ReSharper disable UnusedMember.Global // ReSharper disable UnusedMember.Global
public class CPartyScreenChallengeMedleyNames : CMenuParty public class CPartyScreenChallengeMedleyNames : CMenuParty
// ReSharper restore UnusedMember.Global // ReSharper restore UnusedMember.Global
{ {
// Version number for theme files. Increment it, if you've changed something on the theme files! // Version number for theme files. Increment it, if you've changed something on the theme files!
protected override int _ScreenVersion protected override int _ScreenVersion
@@ -456,16 +456,16 @@ namespace VocaluxeLib.PartyModes.TicTacToe
return _ScreenSongOptions; return _ScreenSongOptions;
} }
// ReSharper disable RedundantAssignment // ReSharper disable RedundantAssignment
public override void OnSongChange(int songIndex, ref SScreenSongOptions screenSongOptions) public override void OnSongChange(int songIndex, ref SScreenSongOptions screenSongOptions)
// ReSharper restore RedundantAssignment // ReSharper restore RedundantAssignment
{ {
screenSongOptions = _ScreenSongOptions; screenSongOptions = _ScreenSongOptions;
} }
// ReSharper disable RedundantAssignment // ReSharper disable RedundantAssignment
public override void OnCategoryChange(int categoryIndex, ref SScreenSongOptions screenSongOptions) public override void OnCategoryChange(int categoryIndex, ref SScreenSongOptions screenSongOptions)
// ReSharper restore RedundantAssignment // ReSharper restore RedundantAssignment
{ {
screenSongOptions = _ScreenSongOptions; screenSongOptions = _ScreenSongOptions;
} }
@@ -24,9 +24,9 @@ using VocaluxeLib.Menu;
namespace VocaluxeLib.PartyModes.TicTacToe namespace VocaluxeLib.PartyModes.TicTacToe
{ {
// ReSharper disable UnusedMember.Global // ReSharper disable UnusedMember.Global
public class CPartyScreenTicTacToeConfig : CMenuParty public class CPartyScreenTicTacToeConfig : CMenuParty
// ReSharper restore UnusedMember.Global // ReSharper restore UnusedMember.Global
{ {
// Version number for theme files. Increment it, if you've changed something on the theme files! // Version number for theme files. Increment it, if you've changed something on the theme files!
protected override int _ScreenVersion protected override int _ScreenVersion
@@ -289,7 +289,7 @@ namespace VocaluxeLib.PartyModes.TicTacToe
_ConfigOk = false; _ConfigOk = false;
for (int i = 0; i < CBase.Songs.NumSongsInCategory(_Data.ScreenConfig.CategoryID); i++) for (int i = 0; i < CBase.Songs.NumSongsInCategory(_Data.ScreenConfig.CategoryID); i++)
{ {
_ConfigOk=CBase.Songs.GetVisibleSong(i).AvailableGameModes.Any(mode => mode == gm); _ConfigOk = CBase.Songs.GetVisibleSong(i).AvailableGameModes.Any(mode => mode == gm);
if (_ConfigOk) if (_ConfigOk)
break; break;
} }
@@ -24,9 +24,9 @@ using VocaluxeLib.Menu;
namespace VocaluxeLib.PartyModes.TicTacToe namespace VocaluxeLib.PartyModes.TicTacToe
{ {
// ReSharper disable UnusedMember.Global // ReSharper disable UnusedMember.Global
public class CPartyScreenTicTacToeNames : CMenuParty public class CPartyScreenTicTacToeNames : CMenuParty
// ReSharper restore UnusedMember.Global // ReSharper restore UnusedMember.Global
{ {
// Version number for theme files. Increment it, if you've changed something on the theme files! // Version number for theme files. Increment it, if you've changed something on the theme files!
protected override int _ScreenVersion protected override int _ScreenVersion
+1 -1
View File
@@ -116,7 +116,7 @@ namespace Vocaluxe.Base
{ {
get get
{ {
if (_CurrentPlaylistElement.Artist.Length > 0 && _CurrentPlaylistElement.Title.Length > 0) if (_CurrentPlaylistElement.Artist != "" && _CurrentPlaylistElement.Title != "")
return _CurrentPlaylistElement.Artist + " - " + _CurrentPlaylistElement.Title; return _CurrentPlaylistElement.Artist + " - " + _CurrentPlaylistElement.Title;
else else
return Path.GetFileNameWithoutExtension(_CurrentPlaylistElement.MusicFilePath); return Path.GetFileNameWithoutExtension(_CurrentPlaylistElement.MusicFilePath);
+4 -4
View File
@@ -505,7 +505,7 @@ namespace Vocaluxe.Base
for (int p = 1; p <= CSettings.MaxNumPlayer; p++) for (int p = 1; p <= CSettings.MaxNumPlayer; p++)
{ {
if (MicConfig[p - 1].DeviceName.Length > 0 && MicConfig[p - 1].InputName.Length > 0 && MicConfig[p - 1].Channel > 0) if (MicConfig[p - 1].DeviceName != "" && MicConfig[p - 1].InputName != "" && MicConfig[p - 1].Channel > 0)
{ {
writer.WriteStartElement("MicConfig" + p); writer.WriteStartElement("MicConfig" + p);
@@ -689,7 +689,7 @@ namespace Vocaluxe.Base
{ {
//Only found a parameter //Only found a parameter
case 1: case 1:
if (!Regex.IsMatch(parts[0], @"ReplacedStr:::3:::") && parts[0].Length > 0) if (!Regex.IsMatch(parts[0], @"ReplacedStr:::3:::") && parts[0] != "")
{ {
//Add parameter //Add parameter
_Params.Add(parts[0]); _Params.Add(parts[0]);
@@ -702,7 +702,7 @@ namespace Vocaluxe.Base
//Found parameter and value //Found parameter and value
case 2: case 2:
if (!Regex.IsMatch(parts[0], @"ReplacedStr:::5:::") && parts[0].Length > 0) if (!Regex.IsMatch(parts[0], @"ReplacedStr:::5:::") && parts[0] != "")
{ {
//Add parameter //Add parameter
_Params.Add(parts[0]); _Params.Add(parts[0]);
@@ -810,7 +810,7 @@ namespace Vocaluxe.Base
{ {
for (int j = 0; j < CSettings.MaxNumPlayer; j++) for (int j = 0; j < CSettings.MaxNumPlayer; j++)
{ {
if (Players[j].Length > 0) if (Players[j] != "")
{ {
if (Path.GetFileName(CProfiles.Profiles[i].ProfileFile) == Players[j] && CProfiles.Profiles[i].Active == EOffOn.TR_CONFIG_ON) if (Path.GetFileName(CProfiles.Profiles[i].ProfileFile) == Players[j] && CProfiles.Profiles[i].Active == EOffOn.TR_CONFIG_ON)
{ {
+3 -3
View File
@@ -177,7 +177,7 @@ namespace Vocaluxe.Base
xmlReader.GetValue("//root/Info/Name", out coverTheme.Name, String.Empty); xmlReader.GetValue("//root/Info/Name", out coverTheme.Name, String.Empty);
xmlReader.GetValue("//root/Info/Folder", out coverTheme.Folder, String.Empty); xmlReader.GetValue("//root/Info/Folder", out coverTheme.Folder, String.Empty);
if (coverTheme.Folder.Length > 0 && coverTheme.Name.Length > 0) if (coverTheme.Folder != "" && coverTheme.Name != "")
{ {
coverTheme.File = file; coverTheme.File = file;
@@ -239,9 +239,9 @@ namespace Vocaluxe.Base
if (_CoverExists(name)) if (_CoverExists(name))
continue; continue;
// ReSharper disable AssignNullToNotNullAttribute // ReSharper disable AssignNullToNotNullAttribute
SCover sk = new SCover {Name = name, Value = Path.Combine(coverTheme.Folder, Path.GetFileName(file))}; SCover sk = new SCover {Name = name, Value = Path.Combine(coverTheme.Folder, Path.GetFileName(file))};
// ReSharper restore AssignNullToNotNullAttribute // ReSharper restore AssignNullToNotNullAttribute
sk.Texture = CDraw.AddTexture(Path.Combine(CSettings.FolderCover, sk.Value)); sk.Texture = CDraw.AddTexture(Path.Combine(CSettings.FolderCover, sk.Value));
-2
View File
@@ -174,9 +174,7 @@ namespace Vocaluxe.Base
} }
if (reader != null) if (reader != null)
{
reader.Dispose(); reader.Dispose();
}
command.CommandText = "INSERT INTO Scores (SongID, PlayerName, Score, LineNr, Date, Medley, Duet, ShortSong, Difficulty) " + command.CommandText = "INSERT INTO Scores (SongID, PlayerName, Score, LineNr, Date, Medley, Duet, ShortSong, Difficulty) " +
"VALUES (@SongID, @PlayerName, @Score, @LineNr, @Date, @Medley, @Duet, @ShortSong, @Difficulty)"; "VALUES (@SongID, @PlayerName, @Score, @LineNr, @Date, @Medley, @Duet, @ShortSong, @Difficulty)";
+8 -10
View File
@@ -341,9 +341,7 @@ namespace Vocaluxe.Base
public static float Height public static float Height
{ {
get { return _Height; } get { return _Height; }
set { set { _Height = value < 0f ? 0f : value; }
_Height = value < 0f ? 0f : value;
}
} }
public static float Outline public static float Outline
@@ -413,7 +411,7 @@ namespace Vocaluxe.Base
if (h <= 0f) if (h <= 0f)
return; return;
if (text.Length == 0) if (text == "")
return; return;
Height = h; Height = h;
@@ -432,7 +430,7 @@ namespace Vocaluxe.Base
if (h <= 0f) if (h <= 0f)
return; return;
if (text.Length == 0) if (text == "")
return; return;
Height = h; Height = h;
@@ -451,7 +449,7 @@ namespace Vocaluxe.Base
if (h <= 0f) if (h <= 0f)
return; return;
if (text.Length == 0) if (text == "")
return; return;
Height = h; Height = h;
@@ -581,7 +579,7 @@ namespace Vocaluxe.Base
{ {
SFont sf = new SFont(); SFont sf = new SFont();
sf.Folder = value; sf.Folder = value;
sf.IsThemeFont = themeName.Length > 0; sf.IsThemeFont = themeName != "";
sf.ThemeName = themeName; sf.ThemeName = themeName;
sf.PartyModeID = partyModeId; sf.PartyModeID = partyModeId;
@@ -631,7 +629,7 @@ namespace Vocaluxe.Base
string fontTypes; string fontTypes;
if (partyModeId >= 0) if (partyModeId >= 0)
fontTypes = "theme fonts for party mode"; fontTypes = "theme fonts for party mode";
else if (themeName.Length > 0) else if (themeName != "")
fontTypes = "theme fonts for theme \"" + themeName + "\""; fontTypes = "theme fonts for theme \"" + themeName + "\"";
else else
fontTypes = "basic fonts"; fontTypes = "basic fonts";
@@ -747,7 +745,7 @@ namespace Vocaluxe.Base
private static int _GetFontIndex(string themeName, string fontName) private static int _GetFontIndex(string themeName, string fontName)
{ {
if (themeName.Length == 0 || fontName.Length == 0) if (themeName == "" || fontName == "")
return -1; return -1;
for (int i = 0; i < _Fonts.Count; i++) for (int i = 0; i < _Fonts.Count; i++)
@@ -761,7 +759,7 @@ namespace Vocaluxe.Base
private static int _GetFontIndexParty(int partyModeID, string fontName) private static int _GetFontIndexParty(int partyModeID, string fontName)
{ {
if (partyModeID == -1 || fontName.Length == 0) if (partyModeID == -1 || fontName == "")
return -1; return -1;
for (int i = 0; i < _Fonts.Count; i++) for (int i = 0; i < _Fonts.Count; i++)
+2 -4
View File
@@ -772,18 +772,16 @@ namespace Vocaluxe.Base
debugOutput.Add(CSongs.NumSongsWithCoverLoaded.ToString(CLanguage.Translate("TR_DEBUG_SONGS") + ": 00000")); debugOutput.Add(CSongs.NumSongsWithCoverLoaded.ToString(CLanguage.Translate("TR_DEBUG_SONGS") + ": 00000"));
if (CConfig.DebugLevel >= EDebugLevel.TR_CONFIG_LEVEL_MAX) if (CConfig.DebugLevel >= EDebugLevel.TR_CONFIG_LEVEL_MAX)
{
debugOutput.Add(_Cursor.X.ToString(CLanguage.Translate("TR_DEBUG_MOUSE") + " : (0000/") + _Cursor.Y.ToString("0000)")); debugOutput.Add(_Cursor.X.ToString(CLanguage.Translate("TR_DEBUG_MOUSE") + " : (0000/") + _Cursor.Y.ToString("0000)"));
} }
} }
} }
}
CFonts.Style = EStyle.Normal; CFonts.Style = EStyle.Normal;
CFonts.SetFont("Normal"); CFonts.SetFont("Normal");
CFonts.Height = 30; CFonts.Height = 30;
SColorF gray = new SColorF(1f, 1f, 1f, 0.5f); SColorF gray = new SColorF(1f, 1f, 1f, 0.5f);
float y = 0; float y = 0;
foreach (var txt in debugOutput) foreach (string txt in debugOutput)
{ {
RectangleF rect = new RectangleF(CSettings.RenderW - CFonts.GetTextWidth(txt), y, CFonts.GetTextWidth(txt), CFonts.GetTextHeight(txt)); RectangleF rect = new RectangleF(CSettings.RenderW - CFonts.GetTextWidth(txt), y, CFonts.GetTextWidth(txt), CFonts.GetTextHeight(txt));
CDraw.DrawColor(gray, new SRectF(rect.X, rect.Top, rect.Width, rect.Height, CSettings.ZNear)); CDraw.DrawColor(gray, new SRectF(rect.X, rect.Top, rect.Width, rect.Height, CSettings.ZNear));
@@ -796,7 +794,7 @@ namespace Vocaluxe.Base
{ {
_Cursor.UnloadTextures(); _Cursor.UnloadTextures();
if (CTheme.Cursor.Color.Length > 0) if (CTheme.Cursor.Color != "")
{ {
SColorF color; SColorF color;
color = CTheme.GetColor(CTheme.Cursor.Color, -1); color = CTheme.GetColor(CTheme.Cursor.Color, -1);
+2 -2
View File
@@ -62,9 +62,9 @@ namespace Vocaluxe.Base
if (_LogFile == null) if (_LogFile == null)
_Open(); _Open();
// ReSharper disable PossibleNullReferenceException // ReSharper disable PossibleNullReferenceException
_LogFile.WriteLine(text); _LogFile.WriteLine(text);
// ReSharper restore PossibleNullReferenceException // ReSharper restore PossibleNullReferenceException
_LogFile.Flush(); _LogFile.Flush();
} }
+1 -4
View File
@@ -343,10 +343,7 @@ namespace Vocaluxe.Base
private static Assembly _CompileFiles(string[] files) private static Assembly _CompileFiles(string[] files)
{ {
if (files == null) if (files == null || files.Length == 0)
return null;
if (files.Length == 0)
return null; return null;
CompilerParameters compilerParams = new CompilerParameters(); CompilerParameters compilerParams = new CompilerParameters();
+1 -1
View File
@@ -116,7 +116,7 @@ namespace Vocaluxe.Base
{ {
if (playlistID < 0 || playlistID >= _Playlists.Count) if (playlistID < 0 || playlistID >= _Playlists.Count)
return; return;
if (_Playlists[playlistID].PlaylistFile.Length > 0) if (_Playlists[playlistID].PlaylistFile != "")
{ {
try try
{ {
+5 -5
View File
@@ -77,7 +77,7 @@ namespace Vocaluxe.Base
profile.GuestProfile = EOffOn.TR_CONFIG_OFF; profile.GuestProfile = EOffOn.TR_CONFIG_OFF;
profile.Active = EOffOn.TR_CONFIG_ON; profile.Active = EOffOn.TR_CONFIG_ON;
if (fileName.Length > 0) if (fileName != "")
profile.ProfileFile = Path.Combine(CSettings.FolderProfiles, fileName); profile.ProfileFile = Path.Combine(CSettings.FolderProfiles, fileName);
else else
profile.ProfileFile = String.Empty; profile.ProfileFile = String.Empty;
@@ -163,7 +163,7 @@ namespace Vocaluxe.Base
return String.Empty; return String.Empty;
SProfile profile = _Profiles[profileNr]; SProfile profile = _Profiles[profileNr];
if (profile.PlayerName.Length > 0) if (profile.PlayerName != "")
profile.PlayerName = profile.PlayerName.Remove(profile.PlayerName.Length - 1); profile.PlayerName = profile.PlayerName.Remove(profile.PlayerName.Length - 1);
_Profiles[profileNr] = profile; _Profiles[profileNr] = profile;
@@ -266,7 +266,7 @@ namespace Vocaluxe.Base
{ {
if (profileID < 0 || profileID >= _Profiles.Count) if (profileID < 0 || profileID >= _Profiles.Count)
return; return;
if (_Profiles[profileID].ProfileFile.Length > 0) if (_Profiles[profileID].ProfileFile != "")
{ {
try try
{ {
@@ -306,7 +306,7 @@ namespace Vocaluxe.Base
if (profileID < 0 || profileID >= _Profiles.Count) if (profileID < 0 || profileID >= _Profiles.Count)
return; return;
if (_Profiles[profileID].ProfileFile.Length == 0) if (_Profiles[profileID].ProfileFile == "")
{ {
string filename = string.Empty; string filename = string.Empty;
foreach (char chr in _Profiles[profileID].PlayerName) foreach (char chr in _Profiles[profileID].PlayerName)
@@ -315,7 +315,7 @@ namespace Vocaluxe.Base
filename += chr.ToString(); filename += chr.ToString();
} }
if (filename.Length == 0) if (filename == "")
filename = "1"; filename = "1";
int i = 0; int i = 0;
+5 -5
View File
@@ -148,9 +148,9 @@ namespace Vocaluxe.Base
VersionMinor + "." + VersionMinor + "." +
VersionSub + " (" + Arch + ")"; VersionSub + " (" + Arch + ")";
// ReSharper disable ConditionIsAlwaysTrueOrFalse // ReSharper disable ConditionIsAlwaysTrueOrFalse
if (VersionRevision != ERevision.Release) if (VersionRevision != ERevision.Release)
// ReSharper restore ConditionIsAlwaysTrueOrFalse // ReSharper restore ConditionIsAlwaysTrueOrFalse
version += " " + _GetVersionStatus() + String.Format(" ({0:0000)}", Build); version += " " + _GetVersionStatus() + String.Format(" ({0:0000)}", Build);
return version; return version;
@@ -160,7 +160,7 @@ namespace Vocaluxe.Base
{ {
string version = ProgramName; string version = ProgramName;
if (ProgramCodeName.Length > 0) if (ProgramCodeName != "")
version += " \"" + ProgramCodeName + "\""; version += " \"" + ProgramCodeName + "\"";
return version + " " + GetVersionText(); return version + " " + GetVersionText();
@@ -170,9 +170,9 @@ namespace Vocaluxe.Base
{ {
string result; string result;
// ReSharper disable ConditionIsAlwaysTrueOrFalse // ReSharper disable ConditionIsAlwaysTrueOrFalse
if (VersionRevision != ERevision.Release) if (VersionRevision != ERevision.Release)
// ReSharper restore ConditionIsAlwaysTrueOrFalse // ReSharper restore ConditionIsAlwaysTrueOrFalse
result = Enum.GetName(typeof(ERevision), VersionRevision); result = Enum.GetName(typeof(ERevision), VersionRevision);
return result; return result;
+2 -2
View File
@@ -98,7 +98,7 @@ namespace Vocaluxe.Base
int noCategoryIndex = -1; int noCategoryIndex = -1;
for (int i = 0; i < CSongs.Sorter.SortedSongs.Length; i++) for (int i = 0; i < CSongs.Sorter.SortedSongs.Length; i++)
{ {
if (CSongs.Sorter.SortedSongs[i].SortString.Length > 0) if (CSongs.Sorter.SortedSongs[i].SortString != "")
{ {
if (CSongs.Sorter.SortedSongs[i].SortString != category) if (CSongs.Sorter.SortedSongs[i].SortString != category)
{ {
@@ -154,7 +154,7 @@ namespace Vocaluxe.Base
for (int i = 0; i < CSongs.Sorter.SortedSongs.Length; i++) for (int i = 0; i < CSongs.Sorter.SortedSongs.Length; i++)
{ {
string year = CSongs.Sorter.SortedSongs[i].SortString; string year = CSongs.Sorter.SortedSongs[i].SortString;
if (year.Length > 0) if (year != "")
{ {
year = year.Substring(0, 3); year = year.Substring(0, 3);
CSongs.Sorter.SortedSongs[i].SortString = year + "0 - " + year + "9"; CSongs.Sorter.SortedSongs[i].SortString = year + "0 - " + year + "9";
+1 -1
View File
@@ -84,7 +84,7 @@ namespace Vocaluxe.Base
_FilteredSongs.Clear(); _FilteredSongs.Clear();
string[] searchStrings = null; string[] searchStrings = null;
if (_SearchString.Length > 0) if (_SearchString != "")
searchStrings = _SearchString.ToUpper().Split(new char[] {' '}); searchStrings = _SearchString.ToUpper().Split(new char[] {' '});
foreach (CSong song in CSongs.Songs) foreach (CSong song in CSongs.Songs)
+2 -2
View File
@@ -125,14 +125,14 @@ namespace Vocaluxe.Base
private List<SSongPointer> _CreateSortList(string fieldName) private List<SSongPointer> _CreateSortList(string fieldName)
{ {
List<SSongPointer> sortList = new List<SSongPointer>(); List<SSongPointer> sortList = new List<SSongPointer>();
if (fieldName.Length == 0) if (fieldName == "")
CSongs.Filter.FilteredSongs.ForEach(song => sortList.Add(new SSongPointer(song.ID, ""))); CSongs.Filter.FilteredSongs.ForEach(song => sortList.Add(new SSongPointer(song.ID, "")));
else else
{ {
FieldInfo field = typeof(CSong).GetField(fieldName, BindingFlags.Instance | BindingFlags.DeclaredOnly | BindingFlags.Public); FieldInfo field = typeof(CSong).GetField(fieldName, BindingFlags.Instance | BindingFlags.DeclaredOnly | BindingFlags.Public);
if (field == null) if (field == null)
{ {
CLog.LogError("Unknow sorting field: "+fieldName); CLog.LogError("Unknow sorting field: " + fieldName);
return _CreateSortList(""); return _CreateSortList("");
} }
bool isString = field.FieldType == typeof(string); bool isString = field.FieldType == typeof(string);
+1 -1
View File
@@ -183,7 +183,7 @@ namespace Vocaluxe.Base
break; break;
} }
if (file.Length == 0) if (file == "")
return -1; return -1;
int stream = Load(file); int stream = Load(file);
+3 -3
View File
@@ -426,7 +426,7 @@ namespace Vocaluxe.Base
if (version == _ThemeSystemVersion) if (version == _ThemeSystemVersion)
{ {
xmlReader.GetValue("//root/Info/Name", out theme.Name, String.Empty); xmlReader.GetValue("//root/Info/Name", out theme.Name, String.Empty);
if (theme.Name.Length > 0) if (theme.Name != "")
{ {
xmlReader.GetValue("//root/Info/Author", out theme.Author, String.Empty); xmlReader.GetValue("//root/Info/Author", out theme.Author, String.Empty);
xmlReader.GetValue("//root/Info/SkinFolder", out theme.SkinFolder, String.Empty); xmlReader.GetValue("//root/Info/SkinFolder", out theme.SkinFolder, String.Empty);
@@ -493,7 +493,7 @@ namespace Vocaluxe.Base
if (version == _SkinSystemVersion) if (version == _SkinSystemVersion)
{ {
xmlReader.GetValue("//root/Info/Name", out skin.Name, String.Empty); xmlReader.GetValue("//root/Info/Name", out skin.Name, String.Empty);
if (skin.Name.Length > 0) if (skin.Name != "")
{ {
xmlReader.GetValue("//root/Info/Author", out skin.Author, String.Empty); xmlReader.GetValue("//root/Info/Author", out skin.Author, String.Empty);
xmlReader.TryGetIntValue("//root/Info/SkinVersionMajor", ref skin.SkinVersionMajor); xmlReader.TryGetIntValue("//root/Info/SkinVersionMajor", ref skin.SkinVersionMajor);
@@ -835,7 +835,7 @@ namespace Vocaluxe.Base
writer.WriteElementString("W", Cursor.W.ToString("#0.000")); writer.WriteElementString("W", Cursor.W.ToString("#0.000"));
writer.WriteElementString("H", Cursor.H.ToString("#0.000")); writer.WriteElementString("H", Cursor.H.ToString("#0.000"));
if (Cursor.Color.Length > 0) if (Cursor.Color != "")
writer.WriteElementString("Color", Cursor.Color); writer.WriteElementString("Color", Cursor.Color);
else else
{ {
+5
View File
@@ -86,5 +86,10 @@ namespace Vocaluxe.Base
{ {
return _Webcam.GetDevices(); return _Webcam.GetDevices();
} }
public static bool IsDeviceAvailable()
{
return _Webcam.IsDeviceAvailable();
}
} }
} }
+1 -2
View File
@@ -20,6 +20,5 @@
namespace Vocaluxe.GameModes namespace Vocaluxe.GameModes
{ {
// Nomal singing // Nomal singing
class CGameModeNormal : CGameMode class CGameModeNormal : CGameMode {}
{}
} }
+1 -1
View File
@@ -346,7 +346,7 @@ namespace Vocaluxe.Lib.Draw
} }
// Draw Basic Text // Draw Basic Text
public void DrawText(string text, int x, int y, int h, int z=0) public void DrawText(string text, int x, int y, int h, int z = 0)
{ {
CFonts.DrawText(text, h, x, y, z, new SColorF(1, 1, 1, 1)); CFonts.DrawText(text, h, x, y, z, new SColorF(1, 1, 1, 1));
} }
+6 -4
View File
@@ -142,7 +142,7 @@ namespace Vocaluxe.Lib.Draw
if (setValue > 32) if (setValue > 32)
setValue = 32; setValue = 32;
while (samples<=setValue) while (samples <= setValue)
{ {
GraphicsMode mode; GraphicsMode mode;
try try
@@ -563,7 +563,7 @@ namespace Vocaluxe.Lib.Draw
public void DrawLine(int a, int r, int g, int b, int w, int x1, int y1, int x2, int y2) {} public void DrawLine(int a, int r, int g, int b, int w, int x1, int y1, int x2, int y2) {}
// Draw Basic Text (must be deleted later) // Draw Basic Text (must be deleted later)
public void DrawText(string text, int x, int y, int h, int z=0) public void DrawText(string text, int x, int y, int h, int z = 0)
{ {
CFonts.DrawText(text, h, x, y, z, new SColorF(1, 1, 1, 1)); CFonts.DrawText(text, h, x, y, z, new SColorF(1, 1, 1, 1));
} }
@@ -1094,7 +1094,8 @@ namespace Vocaluxe.Lib.Draw
public void DrawTexture(STexture texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored) public void DrawTexture(STexture texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored)
{ {
if (Math.Abs(rect.W) < float.Epsilon || Math.Abs(rect.H) < float.Epsilon || Math.Abs(bounds.H) < float.Epsilon || Math.Abs(bounds.W) < float.Epsilon || Math.Abs(color.A) < float.Epsilon) if (Math.Abs(rect.W) < float.Epsilon || Math.Abs(rect.H) < float.Epsilon || Math.Abs(bounds.H) < float.Epsilon || Math.Abs(bounds.W) < float.Epsilon ||
Math.Abs(color.A) < float.Epsilon)
return; return;
if (bounds.X > rect.X + rect.W || bounds.X + bounds.W < rect.X) if (bounds.X > rect.X + rect.W || bounds.X + bounds.W < rect.X)
@@ -1233,7 +1234,8 @@ namespace Vocaluxe.Lib.Draw
public void DrawTextureReflection(STexture texture, SRectF rect, SColorF color, SRectF bounds, float space, float height) public void DrawTextureReflection(STexture texture, SRectF rect, SColorF color, SRectF bounds, float space, float height)
{ {
if (Math.Abs(rect.W) < float.Epsilon || Math.Abs(rect.H) < float.Epsilon || Math.Abs(bounds.H) < float.Epsilon || Math.Abs(bounds.W) < float.Epsilon || Math.Abs(color.A) < float.Epsilon || height <= float.Epsilon) if (Math.Abs(rect.W) < float.Epsilon || Math.Abs(rect.H) < float.Epsilon || Math.Abs(bounds.H) < float.Epsilon || Math.Abs(bounds.W) < float.Epsilon ||
Math.Abs(color.A) < float.Epsilon || height <= float.Epsilon)
return; return;
if (bounds.X > rect.X + rect.W || bounds.X + bounds.W < rect.X) if (bounds.X > rect.X + rect.W || bounds.X + bounds.W < rect.X)
+1 -1
View File
@@ -46,7 +46,7 @@ namespace Vocaluxe.Lib.Draw
void MakeScreenShot(); void MakeScreenShot();
// Draw Basic Text (must be deleted later) // Draw Basic Text (must be deleted later)
void DrawText(string text, int x, int y, int h, int z=0); void DrawText(string text, int x, int y, int h, int z = 0);
STexture AddTexture(string texturePath); STexture AddTexture(string texturePath);
STexture AddTexture(Bitmap bitmap); STexture AddTexture(Bitmap bitmap);
+6 -4
View File
@@ -59,7 +59,7 @@ namespace Vocaluxe.Lib.Playlist
public void SavePlaylist() public void SavePlaylist()
{ {
if (PlaylistFile.Length == 0) if (PlaylistFile == "")
{ {
string filename = string.Empty; string filename = string.Empty;
foreach (char chr in PlaylistName) foreach (char chr in PlaylistName)
@@ -68,7 +68,7 @@ namespace Vocaluxe.Lib.Playlist
filename += chr.ToString(); filename += chr.ToString();
} }
if (filename.Length == 0) if (filename == "")
filename = "1"; filename = "1";
int i = 0; int i = 0;
@@ -146,7 +146,8 @@ namespace Vocaluxe.Lib.Playlist
List<string> songs = xmlReader.GetValues("Songs"); List<string> songs = xmlReader.GetValues("Songs");
EGameMode gm = EGameMode.TR_GAMEMODE_NORMAL; EGameMode gm = EGameMode.TR_GAMEMODE_NORMAL;
foreach (string song in songs) { foreach (string song in songs)
{
string artist; string artist;
string title; string title;
xmlReader.GetValue("//root/Songs/" + song + "/Artist", out artist, String.Empty); xmlReader.GetValue("//root/Songs/" + song + "/Artist", out artist, String.Empty);
@@ -157,7 +158,8 @@ namespace Vocaluxe.Lib.Playlist
playlistSong.SongID = -1; playlistSong.SongID = -1;
CSong[] allSongs = CSongs.AllSongs; CSong[] allSongs = CSongs.AllSongs;
foreach (CSong curSong in allSongs) { foreach (CSong curSong in allSongs)
{
if (curSong.Artist != artist || curSong.Title != title) if (curSong.Artist != artist || curSong.Title != title)
continue; continue;
playlistSong.SongID = curSong.ID; playlistSong.SongID = curSong.ID;
+1 -1
View File
@@ -844,7 +844,7 @@ namespace Vocaluxe.Lib.Sound
if (buffer != 0) if (buffer != 0)
{ {
ALFormat alFormat = (_Format.ChannelCount == 2)?ALFormat.Stereo16:ALFormat.Mono16; ALFormat alFormat = (_Format.ChannelCount == 2) ? ALFormat.Stereo16 : ALFormat.Mono16;
AL.BufferData(buffer, alFormat, buf, buf.Length, _Format.SamplesPerSecond); AL.BufferData(buffer, alFormat, buf, buf.Length, _Format.SamplesPerSecond);
Console.WriteLine("Write to Buffer: " + buffer); Console.WriteLine("Write to Buffer: " + buffer);
AL.SourceQueueBuffer(_Source, buffer); AL.SourceQueueBuffer(_Source, buffer);
+5 -8
View File
@@ -120,19 +120,16 @@ namespace Vocaluxe.Lib.Sound
if (deviceConfig == null) if (deviceConfig == null)
return false; return false;
if (_RecHandle == null) if (_RecHandle == null || _RecHandle.Length == 0)
return false; return false;
if (_RecHandle.Length == 0) foreach (CBuffer buffer in _Buffer)
return false; buffer.Reset();
for (int i = 0; i < _Buffer.Length; i++) foreach (IntPtr handle in _RecHandle)
_Buffer[i].Reset();
for (int i = 0; i < _RecHandle.Length; i++)
{ {
int waitcount = 0; int waitcount = 0;
while (waitcount < 5 && CPortAudio.Pa_IsStreamStopped(_RecHandle[i]) == CPortAudio.EPaError.PaStreamIsNotStopped) while (waitcount < 5 && CPortAudio.Pa_IsStreamStopped(handle) == CPortAudio.EPaError.PaStreamIsNotStopped)
{ {
Thread.Sleep(1); Thread.Sleep(1);
waitcount++; waitcount++;
@@ -36,9 +36,7 @@ namespace Vocaluxe.Lib.Sound.Decoder
private string _FileName; private string _FileName;
private bool _FileOpened; private bool _FileOpened;
public void Init() public void Init() {}
{
}
public void Open(string fileName, bool loop) public void Open(string fileName, bool loop)
{ {
+1 -1
View File
@@ -31,7 +31,7 @@ namespace Vocaluxe.Lib.Sound.Decoder
void Init(); void Init();
void Close(); void Close();
void Open(string fileName, bool loop=false); void Open(string fileName, bool loop = false);
SFormatInfo GetFormatInfo(); SFormatInfo GetFormatInfo();
float GetLength(); float GetLength();
+1 -1
View File
@@ -28,7 +28,7 @@ namespace Vocaluxe.Lib.Sound.PortAudio
</summary> </summary>
*/ */
public static partial class CPortAudio public static class CPortAudio
{ {
#region **** PORTAUDIO CALLBACKS **** #region **** PORTAUDIO CALLBACKS ****
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+6 -4
View File
@@ -141,6 +141,7 @@ namespace Vocaluxe.Lib.Video.Acinerella
//Size of the data in the buffer. //Size of the data in the buffer.
public readonly Int32 BufferSize; public readonly Int32 BufferSize;
} }
// Contains information about an Acinerella package. // Contains information about an Acinerella package.
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public struct SACPackage public struct SACPackage
@@ -278,9 +279,9 @@ namespace Vocaluxe.Lib.Video.Acinerella
string filename string filename
); );
// ReSharper disable UnusedMethodReturnValue.Global // ReSharper disable UnusedMethodReturnValue.Global
public static Int32 AcOpen2( public static Int32 AcOpen2(
// ReSharper restore UnusedMethodReturnValue.Global // ReSharper restore UnusedMethodReturnValue.Global
IntPtr pAcInstance, IntPtr pAcInstance,
string filename string filename
) )
@@ -430,9 +431,9 @@ namespace Vocaluxe.Lib.Video.Acinerella
[DllImport(_AcDll, EntryPoint = "ac_seek", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)] [DllImport(_AcDll, EntryPoint = "ac_seek", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
private static extern Int32 _ac_seek(IntPtr pAcDecoder, Int32 dir, Int64 targetPos); private static extern Int32 _ac_seek(IntPtr pAcDecoder, Int32 dir, Int64 targetPos);
// ReSharper disable UnusedMethodReturnValue.Global // ReSharper disable UnusedMethodReturnValue.Global
public static Int32 AcSeek(IntPtr pAcDecoder, Int32 dir, Int64 targetPos) public static Int32 AcSeek(IntPtr pAcDecoder, Int32 dir, Int64 targetPos)
// ReSharper restore UnusedMethodReturnValue.Global // ReSharper restore UnusedMethodReturnValue.Global
{ {
lock (_Lock) lock (_Lock)
{ {
@@ -450,5 +451,6 @@ namespace Vocaluxe.Lib.Video.Acinerella
out Int32 scoreMax out Int32 scoreMax
); );
} }
// ReSharper restore UnusedMember.Global // ReSharper restore UnusedMember.Global
} }
+1 -4
View File
@@ -262,10 +262,7 @@ namespace Vocaluxe.Lib.Video
public float Length public float Length
{ {
get get { return _FileOpened ? _Duration : 0f; }
{
return _FileOpened ? _Duration : 0f;
}
} }
public bool Paused public bool Paused
@@ -24,7 +24,7 @@ namespace Vocaluxe.Lib.Video.Gstreamer
{ {
public struct SNativeFrame public struct SNativeFrame
{ {
// ReSharper disable UnassignedField.Global // ReSharper disable UnassignedField.Global
internal IntPtr Buffer; internal IntPtr Buffer;
public int Size; public int Size;
public int Width; public int Width;
+7 -1
View File
@@ -101,7 +101,8 @@ namespace Vocaluxe.Lib.Webcam
num++; num++;
VideoCaptureDevice tmpdev = new VideoCaptureDevice(info.MonikerString); VideoCaptureDevice tmpdev = new VideoCaptureDevice(info.MonikerString);
foreach (VideoCapabilities capabilities in tmpdev.VideoCapabilities) { foreach (VideoCapabilities capabilities in tmpdev.VideoCapabilities)
{
SCapabilities item = new SCapabilities SCapabilities item = new SCapabilities
{ {
Framerate = capabilities.FrameRate, Framerate = capabilities.FrameRate,
@@ -162,6 +163,11 @@ namespace Vocaluxe.Lib.Webcam
return _Devices.ToArray(); return _Devices.ToArray();
} }
public bool IsDeviceAvailable()
{
return _Devices.Count > 0;
}
public bool Select(SWebcamConfig config) public bool Select(SWebcamConfig config)
{ {
//Close old camera connection //Close old camera connection
+1
View File
@@ -59,6 +59,7 @@ namespace Vocaluxe.Lib.Webcam
Bitmap GetBitmap(); Bitmap GetBitmap();
SWebcamConfig GetConfig(); SWebcamConfig GetConfig();
SWebcamDevice[] GetDevices(); SWebcamDevice[] GetDevices();
bool IsDeviceAvailable();
bool Select(SWebcamConfig webcamConfig); bool Select(SWebcamConfig webcamConfig);
} }
@@ -90,7 +90,7 @@ namespace Vocaluxe.Screens
_ThemeStatics = new string[] {_StaticBG, _StaticCover}; _ThemeStatics = new string[] {_StaticBG, _StaticCover};
_ThemeTexts = new string[] {_TextCurrentSong}; _ThemeTexts = new string[] {_TextCurrentSong};
_ThemeButtons = new string[]{_ButtonPlay,_ButtonPause,_ButtonPrevious,_ButtonNext,_ButtonRepeat,_ButtonShowVideo,_ButtonSing,_ButtonToBackgroundVideo}; _ThemeButtons = new string[] {_ButtonPlay, _ButtonPause, _ButtonPrevious, _ButtonNext, _ButtonRepeat, _ButtonShowVideo, _ButtonSing, _ButtonToBackgroundVideo};
} }
public override void LoadTheme(string xmlPath) public override void LoadTheme(string xmlPath)
+8 -6
View File
@@ -124,7 +124,7 @@ namespace Vocaluxe.Screens
return true; return true;
} }
// ReSharper disable RedundantOverridenMember // ReSharper disable RedundantOverridenMember
public override void OnShow() public override void OnShow()
{ {
base.OnShow(); base.OnShow();
@@ -132,7 +132,8 @@ namespace Vocaluxe.Screens
//if (Snowflakes != null) //if (Snowflakes != null)
// Snowflakes.Resume(); // Snowflakes.Resume();
} }
// ReSharper restore RedundantOverridenMember
// ReSharper restore RedundantOverridenMember
public override bool UpdateGame() public override bool UpdateGame()
{ {
@@ -150,9 +151,9 @@ namespace Vocaluxe.Screens
//Snowflakes.Draw(); //Snowflakes.Draw();
_DrawFG(); _DrawFG();
// ReSharper disable ConditionIsAlwaysTrueOrFalse // ReSharper disable ConditionIsAlwaysTrueOrFalse
if (CSettings.VersionRevision != ERevision.Release) if (CSettings.VersionRevision != ERevision.Release)
// ReSharper restore ConditionIsAlwaysTrueOrFalse // ReSharper restore ConditionIsAlwaysTrueOrFalse
{ {
CFonts.SetFont("Normal"); CFonts.SetFont("Normal");
CFonts.Style = EStyle.Normal; CFonts.Style = EStyle.Normal;
@@ -162,7 +163,7 @@ namespace Vocaluxe.Screens
return true; return true;
} }
// ReSharper disable RedundantOverridenMember // ReSharper disable RedundantOverridenMember
public override void OnClose() public override void OnClose()
{ {
base.OnClose(); base.OnClose();
@@ -170,6 +171,7 @@ namespace Vocaluxe.Screens
//if (Snowflakes != null) //if (Snowflakes != null)
// Snowflakes.Pause(); // Snowflakes.Pause();
} }
// ReSharper restore RedundantOverridenMember
// ReSharper restore RedundantOverridenMember
} }
} }
+6 -7
View File
@@ -375,7 +375,8 @@ namespace Vocaluxe.Screens
{ {
processed = true; processed = true;
CGraphics.FadeTo(EScreens.ScreenSong); CGraphics.FadeTo(EScreens.ScreenSong);
}else }
else
{ {
processed = true; processed = true;
_StartSong(); _StartSong();
@@ -511,12 +512,10 @@ namespace Vocaluxe.Screens
if (mouseEvent.LB && _IsMouseOver(mouseEvent)) if (mouseEvent.LB && _IsMouseOver(mouseEvent))
{ {
if (_Buttons[_ButtonBack].Selected) if (_Buttons[_ButtonBack].Selected)
{
CGraphics.FadeTo(EScreens.ScreenSong); CGraphics.FadeTo(EScreens.ScreenSong);
}else if (_Buttons[_ButtonStart].Selected) else if (_Buttons[_ButtonStart].Selected)
{
_StartSong(); _StartSong();
}else else
_UpdatePlayerNumber(); _UpdatePlayerNumber();
//Update Tiles-List //Update Tiles-List
_NameSelections[_NameSelection].UpdateList(); _NameSelections[_NameSelection].UpdateList();
@@ -587,7 +586,7 @@ namespace Vocaluxe.Screens
for (int i = 0; i < CSettings.MaxNumPlayer; i++) for (int i = 0; i < CSettings.MaxNumPlayer; i++)
{ {
//Update texture and name //Update texture and name
if (CConfig.Players[i].Length > 0) if (CConfig.Players[i] != "")
{ {
if (CGame.Player[i].ProfileID > -1 && CProfiles.NumProfiles > CGame.Player[i].ProfileID) if (CGame.Player[i].ProfileID > -1 && CProfiles.NumProfiles > CGame.Player[i].ProfileID)
{ {
@@ -675,7 +674,7 @@ namespace Vocaluxe.Screens
_Statics["StaticPlayer" + i].Visible = true; _Statics["StaticPlayer" + i].Visible = true;
_Statics["StaticPlayerAvatar" + i].Visible = true; _Statics["StaticPlayerAvatar" + i].Visible = true;
_Texts["TextPlayer" + i].Visible = true; _Texts["TextPlayer" + i].Visible = true;
if (_Texts["TextPlayer" + i].Text.Length == 0) if (_Texts["TextPlayer" + i].Text == "")
_Texts["TextPlayer" + i].Text = CLanguage.Translate("TR_SCREENNAMES_PLAYER") + " " + i; _Texts["TextPlayer" + i].Text = CLanguage.Translate("TR_SCREENNAMES_PLAYER") + " " + i;
_Equalizers["EqualizerPlayer" + i].Visible = true; _Equalizers["EqualizerPlayer" + i].Visible = true;
if (CGame.GetNumSongs() == 1 && CGame.GetSong(1).IsDuet) if (CGame.GetNumSongs() == 1 && CGame.GetSong(1).IsDuet)
+21 -24
View File
@@ -175,11 +175,10 @@ namespace Vocaluxe.Screens
SWebcamDevice[] devices = CWebcam.GetDevices(); SWebcamDevice[] devices = CWebcam.GetDevices();
bool ssVisible = false;
try try
{ {
if (devices != null) if (devices != null && devices.Length > 0)
{
if (devices.Length > 0)
{ {
_DeviceNr = 0; _DeviceNr = 0;
_CapabilityNr = 0; _CapabilityNr = 0;
@@ -199,18 +198,17 @@ namespace Vocaluxe.Screens
CWebcam.Close(); CWebcam.Close();
CWebcam.Select(CConfig.WebcamConfig); CWebcam.Select(CConfig.WebcamConfig);
CWebcam.Start(); CWebcam.Start();
} ssVisible = true;
} }
} }
catch (Exception e) catch (Exception e)
{ {
CLog.LogError("Error on listing webcam capabilities: " + e.Message); CLog.LogError("Error on listing webcam capabilities: " + e.Message);
devices = null;
} }
_SelectSlides[_SelectSlideWebcamDevices].Visible = devices != null && devices.Length > 0; _SelectSlides[_SelectSlideWebcamDevices].Visible = ssVisible;
_SelectSlides[_SelectSlideWebcamCapabilities].Visible = devices != null && devices.Length > 0; _SelectSlides[_SelectSlideWebcamCapabilities].Visible = ssVisible;
_Statics[_StaticWebcamOutput].Visible = devices != null && devices.Length > 0; _Statics[_StaticWebcamOutput].Visible = ssVisible;
} }
private void _SaveConfig() private void _SaveConfig()
@@ -234,18 +232,18 @@ namespace Vocaluxe.Screens
_DeviceNr = _SelectSlides[_SelectSlideWebcamDevices].Selection; _DeviceNr = _SelectSlides[_SelectSlideWebcamDevices].Selection;
_CapabilityNr = 0; _CapabilityNr = 0;
SWebcamDevice[] d = CWebcam.GetDevices(); SWebcamDevice d = CWebcam.GetDevices()[_DeviceNr];
for (int i = 0; i < d[_SelectSlides[_SelectSlideWebcamDevices].Selection].Capabilities.Count; i++) for (int i = 0; i < d.Capabilities.Count; i++)
{ {
_SelectSlides[_SelectSlideWebcamCapabilities].AddValue(d[_DeviceNr].Capabilities[i].Width + " x " + d[_DeviceNr].Capabilities[i].Height + _SelectSlides[_SelectSlideWebcamCapabilities].AddValue(d.Capabilities[i].Width + " x " + d.Capabilities[i].Height +
" @ " + d[_DeviceNr].Capabilities[i].Framerate + "FPS"); " @ " + d.Capabilities[i].Framerate + "FPS");
} }
_SelectSlides[_SelectSlideWebcamCapabilities].Selection = 0; _SelectSlides[_SelectSlideWebcamCapabilities].Selection = 0;
_Config.MonikerString = d[_SelectSlides[_SelectSlideWebcamDevices].Selection].MonikerString; _Config.MonikerString = d.MonikerString;
_Config.Width = d[_SelectSlides[_SelectSlideWebcamDevices].Selection].Capabilities[_SelectSlides[_SelectSlideWebcamCapabilities].Selection].Width; _Config.Width = d.Capabilities[_SelectSlides[_SelectSlideWebcamCapabilities].Selection].Width;
_Config.Height = d[_SelectSlides[_SelectSlideWebcamDevices].Selection].Capabilities[_SelectSlides[_SelectSlideWebcamCapabilities].Selection].Height; _Config.Height = d.Capabilities[_SelectSlides[_SelectSlideWebcamCapabilities].Selection].Height;
_Config.Framerate = d[_SelectSlides[_SelectSlideWebcamDevices].Selection].Capabilities[_SelectSlides[_SelectSlideWebcamCapabilities].Selection].Framerate; _Config.Framerate = d.Capabilities[_SelectSlides[_SelectSlideWebcamCapabilities].Selection].Framerate;
CWebcam.Close(); CWebcam.Close();
CWebcam.Select(_Config); CWebcam.Select(_Config);
@@ -259,11 +257,11 @@ namespace Vocaluxe.Screens
{ {
_CapabilityNr = _SelectSlides[_SelectSlideWebcamCapabilities].Selection; _CapabilityNr = _SelectSlides[_SelectSlideWebcamCapabilities].Selection;
SWebcamDevice[] d = CWebcam.GetDevices(); SWebcamDevice d = CWebcam.GetDevices()[_SelectSlides[_SelectSlideWebcamDevices].Selection];
_Config.MonikerString = d[_SelectSlides[_SelectSlideWebcamDevices].Selection].MonikerString; _Config.MonikerString = d.MonikerString;
_Config.Width = d[_SelectSlides[_SelectSlideWebcamDevices].Selection].Capabilities[_SelectSlides[_SelectSlideWebcamCapabilities].Selection].Width; _Config.Width = d.Capabilities[_SelectSlides[_SelectSlideWebcamCapabilities].Selection].Width;
_Config.Height = d[_SelectSlides[_SelectSlideWebcamDevices].Selection].Capabilities[_SelectSlides[_SelectSlideWebcamCapabilities].Selection].Height; _Config.Height = d.Capabilities[_SelectSlides[_SelectSlideWebcamCapabilities].Selection].Height;
_Config.Framerate = d[_SelectSlides[_SelectSlideWebcamDevices].Selection].Capabilities[_SelectSlides[_SelectSlideWebcamCapabilities].Selection].Framerate; _Config.Framerate = d.Capabilities[_SelectSlides[_SelectSlideWebcamCapabilities].Selection].Framerate;
CWebcam.Close(); CWebcam.Close();
CWebcam.Select(_Config); CWebcam.Select(_Config);
@@ -280,8 +278,8 @@ namespace Vocaluxe.Screens
for (int i = 0; i < devices.Length; i++) for (int i = 0; i < devices.Length; i++)
{ {
if (devices[i].MonikerString == CConfig.WebcamConfig.MonikerString) if (devices[i].MonikerString != CConfig.WebcamConfig.MonikerString)
{ continue;
for (int j = 0; j < devices[i].Capabilities.Count; j++) for (int j = 0; j < devices[i].Capabilities.Count; j++)
{ {
if (devices[i].Capabilities[j].Framerate == CConfig.WebcamConfig.Framerate && devices[i].Capabilities[j].Width == CConfig.WebcamConfig.Width && if (devices[i].Capabilities[j].Framerate == CConfig.WebcamConfig.Framerate && devices[i].Capabilities[j].Width == CConfig.WebcamConfig.Width &&
@@ -295,5 +293,4 @@ namespace Vocaluxe.Screens
} }
} }
} }
}
} }
+11 -14
View File
@@ -82,10 +82,7 @@ namespace Vocaluxe.Screens
_Buttons[_ButtonSaveSnapshot].Visible = false; _Buttons[_ButtonSaveSnapshot].Visible = false;
_Buttons[_ButtonDiscardSnapshot].Visible = false; _Buttons[_ButtonDiscardSnapshot].Visible = false;
_Buttons[_ButtonTakeSnapshot].Visible = false; _Buttons[_ButtonTakeSnapshot].Visible = false;
if (CWebcam.GetDevices().Length > 0) _Buttons[_ButtonWebcam].Visible = CWebcam.IsDeviceAvailable();
_Buttons[_ButtonWebcam].Visible = true;
else
_Buttons[_ButtonWebcam].Visible = false;
_SelectSlides[_SelectSlideDifficulty].SetValues<EGameDifficulty>(0); _SelectSlides[_SelectSlideDifficulty].SetValues<EGameDifficulty>(0);
_SelectSlides[_SelectSlideGuestProfile].SetValues<EOffOn>(0); _SelectSlides[_SelectSlideGuestProfile].SetValues<EOffOn>(0);
_SelectSlides[_SelectSlideActive].SetValues<EOffOn>(0); _SelectSlides[_SelectSlideActive].SetValues<EOffOn>(0);
@@ -132,13 +129,13 @@ namespace Vocaluxe.Screens
} }
else if (_Buttons[_ButtonDelete].Selected) else if (_Buttons[_ButtonDelete].Selected)
_DeleteProfile(); _DeleteProfile();
else if (_Buttons[_ButtonWebcam].Selected && CWebcam.GetDevices().Length > 0) else if (_Buttons[_ButtonWebcam].Selected && CWebcam.IsDeviceAvailable())
_OnWebcam(); _OnWebcam();
else if (_Buttons[_ButtonSaveSnapshot].Selected && CWebcam.GetDevices().Length > 0) else if (_Buttons[_ButtonSaveSnapshot].Selected && CWebcam.IsDeviceAvailable())
_OnSaveSnapshot(); _OnSaveSnapshot();
else if (_Buttons[_ButtonDiscardSnapshot].Selected && CWebcam.GetDevices().Length > 0) else if (_Buttons[_ButtonDiscardSnapshot].Selected && CWebcam.IsDeviceAvailable())
_OnDiscardSnapshot(); _OnDiscardSnapshot();
else if (_Buttons[_ButtonTakeSnapshot].Selected && CWebcam.GetDevices().Length > 0) else if (_Buttons[_ButtonTakeSnapshot].Selected && CWebcam.IsDeviceAvailable())
_OnTakeSnapshot(); _OnTakeSnapshot();
break; break;
@@ -212,7 +209,7 @@ namespace Vocaluxe.Screens
{ {
CProfiles.SetAvatar(_SelectSlides[_SelectSlideProfiles].Selection, CProfiles.SetAvatar(_SelectSlides[_SelectSlideProfiles].Selection,
_SelectSlides[_SelectSlideAvatars].Selection); _SelectSlides[_SelectSlideAvatars].Selection);
if (CWebcam.GetDevices().Length > 0 && _WebcamTexture.Index > 0) if (CWebcam.IsDeviceAvailable() && _WebcamTexture.Index > 0)
_OnDiscardSnapshot(); _OnDiscardSnapshot();
} }
else if (_SelectSlides[_SelectSlideGuestProfile].Selected) else if (_SelectSlides[_SelectSlideGuestProfile].Selected)
@@ -225,13 +222,13 @@ namespace Vocaluxe.Screens
CProfiles.SetActive(_SelectSlides[_SelectSlideProfiles].Selection, CProfiles.SetActive(_SelectSlides[_SelectSlideProfiles].Selection,
(EOffOn)_SelectSlides[_SelectSlideActive].Selection); (EOffOn)_SelectSlides[_SelectSlideActive].Selection);
} }
else if (_Buttons[_ButtonWebcam].Selected && CWebcam.GetDevices().Length > 0) else if (_Buttons[_ButtonWebcam].Selected && CWebcam.IsDeviceAvailable())
_OnWebcam(); _OnWebcam();
else if (_Buttons[_ButtonSaveSnapshot].Selected && CWebcam.GetDevices().Length > 0) else if (_Buttons[_ButtonSaveSnapshot].Selected && CWebcam.IsDeviceAvailable())
_OnSaveSnapshot(); _OnSaveSnapshot();
else if (_Buttons[_ButtonDiscardSnapshot].Selected && CWebcam.GetDevices().Length > 0) else if (_Buttons[_ButtonDiscardSnapshot].Selected && CWebcam.IsDeviceAvailable())
_OnDiscardSnapshot(); _OnDiscardSnapshot();
else if (_Buttons[_ButtonTakeSnapshot].Selected && CWebcam.GetDevices().Length > 0) else if (_Buttons[_ButtonTakeSnapshot].Selected && CWebcam.IsDeviceAvailable())
_OnTakeSnapshot(); _OnTakeSnapshot();
} }
@@ -313,7 +310,7 @@ namespace Vocaluxe.Screens
int avatarNr = CProfiles.GetAvatarNr(_SelectSlides[_SelectSlideProfiles].Selection); int avatarNr = CProfiles.GetAvatarNr(_SelectSlides[_SelectSlideProfiles].Selection);
_SelectSlides[_SelectSlideAvatars].Selection = avatarNr; _SelectSlides[_SelectSlideAvatars].Selection = avatarNr;
if (CWebcam.GetDevices().Length > 0 && _WebcamTexture.Index > 0) if (CWebcam.IsDeviceAvailable() && _WebcamTexture.Index > 0)
{ {
if (_Snapshot == null) if (_Snapshot == null)
CWebcam.GetFrame(ref _WebcamTexture); CWebcam.GetFrame(ref _WebcamTexture);
+5 -4
View File
@@ -230,7 +230,7 @@ namespace Vocaluxe.Screens
} }
break; break;
case Keys.W: case Keys.W:
if (CWebcam.GetDevices().Length > 0) if (CWebcam.IsDeviceAvailable())
{ {
_Webcam = !_Webcam; _Webcam = !_Webcam;
if (_Webcam) if (_Webcam)
@@ -614,7 +614,7 @@ namespace Vocaluxe.Screens
CDraw.RemoveTexture(ref _CurrentVideoTexture); CDraw.RemoveTexture(ref _CurrentVideoTexture);
if (song.VideoFileName.Length > 0) if (song.VideoFileName != "")
{ {
_CurrentVideo = CVideo.VdLoad(Path.Combine(song.Folder, song.VideoFileName)); _CurrentVideo = CVideo.VdLoad(Path.Combine(song.Folder, song.VideoFileName));
CVideo.VdSkip(_CurrentVideo, song.Start, song.VideoGap); CVideo.VdSkip(_CurrentVideo, song.Start, song.VideoGap);
@@ -622,7 +622,7 @@ namespace Vocaluxe.Screens
} }
CDraw.RemoveTexture(ref _Background); CDraw.RemoveTexture(ref _Background);
if (song.BackgroundFileName.Length > 0) if (song.BackgroundFileName != "")
_Background = CDraw.AddTexture(Path.Combine(song.Folder, song.BackgroundFileName)); _Background = CDraw.AddTexture(Path.Combine(song.Folder, song.BackgroundFileName));
_SingNotes[_SingBars].Reset(); _SingNotes[_SingBars].Reset();
@@ -1325,7 +1325,8 @@ namespace Vocaluxe.Screens
return; return;
CLines[] partLines = song.Notes.Lines; CLines[] partLines = song.Notes.Lines;
foreach (CLines partLine in partLines) { foreach (CLines partLine in partLines)
{
CLine[] line = partLine.Line; CLine[] line = partLine.Line;
for (int j = 0; j < line.Length; j++) for (int j = 0; j < line.Length; j++)
{ {
+3 -3
View File
@@ -233,7 +233,7 @@ namespace Vocaluxe.Screens
break; break;
case Keys.Back: case Keys.Back:
if (_SearchActive && _SearchText.Length > 0) if (_SearchActive && _SearchText != "")
_ApplyNewSearchFilter(_SearchText.Remove(_SearchText.Length - 1)); _ApplyNewSearchFilter(_SearchText.Remove(_SearchText.Length - 1));
if ((CSongs.Category < 0 || _Sso.Sorting.Tabs == EOffOn.TR_CONFIG_OFF) && !_Sso.Selection.PartyMode && !_SearchActive) if ((CSongs.Category < 0 || _Sso.Sorting.Tabs == EOffOn.TR_CONFIG_OFF) && !_Sso.Selection.PartyMode && !_SearchActive)
@@ -1041,13 +1041,13 @@ namespace Vocaluxe.Screens
if (songIndex != -1 && CSongs.NumVisibleSongs > 0 && CSongs.NumVisibleSongs > songIndex) if (songIndex != -1 && CSongs.NumVisibleSongs > 0 && CSongs.NumVisibleSongs > songIndex)
songID = CSongs.VisibleSongs[songIndex].ID; songID = CSongs.VisibleSongs[songIndex].ID;
if (newFilterString.Length == 0 && _Sso.Sorting.Tabs == EOffOn.TR_CONFIG_ON) if (newFilterString == "" && _Sso.Sorting.Tabs == EOffOn.TR_CONFIG_ON)
{ {
CSongs.Category = -1; CSongs.Category = -1;
refresh = true; refresh = true;
} }
if (newFilterString.Length > 0 && CSongs.Category != 0) if (newFilterString != "" && CSongs.Category != 0)
{ {
CSongs.Category = 0; CSongs.Category = 0;
refresh = true; refresh = true;
+5 -5
View File
@@ -118,7 +118,7 @@ namespace VocaluxeLib.Menu
writer.WriteComment("<Color>: Background color for type \"Color\" from ColorScheme (high priority)"); writer.WriteComment("<Color>: Background color for type \"Color\" from ColorScheme (high priority)");
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)"); writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
if (_Theme.ColorName.Length > 0) if (_Theme.ColorName != "")
writer.WriteElementString("Color", _Theme.ColorName); writer.WriteElementString("Color", _Theme.ColorName);
else else
{ {
@@ -139,13 +139,13 @@ namespace VocaluxeLib.Menu
public void Resume() public void Resume()
{ {
if (_Theme.Type == EBackgroundTypes.Video && _Theme.VideoName.Length > 0 && CBase.Config.GetVideoBackgrounds() == EOffOn.TR_CONFIG_ON) if (_Theme.Type == EBackgroundTypes.Video && _Theme.VideoName != "" && CBase.Config.GetVideoBackgrounds() == EOffOn.TR_CONFIG_ON)
CBase.Theme.SkinVideoResume(_Theme.VideoName, _PartyModeID); CBase.Theme.SkinVideoResume(_Theme.VideoName, _PartyModeID);
} }
public void Pause() public void Pause()
{ {
if (_Theme.VideoName.Length > 0) if (_Theme.VideoName != "")
CBase.Theme.SkinVideoPause(_Theme.VideoName, _PartyModeID); CBase.Theme.SkinVideoPause(_Theme.VideoName, _PartyModeID);
} }
@@ -165,7 +165,7 @@ namespace VocaluxeLib.Menu
ok = _DrawVideo(); ok = _DrawVideo();
} }
if (_Theme.TextureName.Length > 0 && if (_Theme.TextureName != "" &&
(_Theme.Type == EBackgroundTypes.Texture || (_Theme.Type == EBackgroundTypes.Texture ||
(_Theme.Type == EBackgroundTypes.Video && (CBase.Config.GetVideoBackgrounds() == EOffOn.TR_CONFIG_OFF || !ok)))) (_Theme.Type == EBackgroundTypes.Video && (CBase.Config.GetVideoBackgrounds() == EOffOn.TR_CONFIG_OFF || !ok))))
ok = _DrawTexture(); ok = _DrawTexture();
@@ -181,7 +181,7 @@ namespace VocaluxeLib.Menu
public void LoadTextures() public void LoadTextures()
{ {
if (_Theme.ColorName.Length > 0) if (_Theme.ColorName != "")
Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID); Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID);
} }
+4 -4
View File
@@ -239,7 +239,7 @@ namespace VocaluxeLib.Menu
writer.WriteComment("<Color>: Button color from ColorScheme (high priority)"); writer.WriteComment("<Color>: Button color from ColorScheme (high priority)");
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)"); writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
if (_Theme.ColorName.Length > 0) if (_Theme.ColorName != "")
writer.WriteElementString("Color", _Theme.ColorName); writer.WriteElementString("Color", _Theme.ColorName);
else else
{ {
@@ -251,7 +251,7 @@ namespace VocaluxeLib.Menu
writer.WriteComment("<SColor>: Selected button color from ColorScheme (high priority)"); writer.WriteComment("<SColor>: Selected button color from ColorScheme (high priority)");
writer.WriteComment("or <SR>, <SG>, <SB>, <SA> (lower priority)"); writer.WriteComment("or <SR>, <SG>, <SB>, <SA> (lower priority)");
if (_Theme.SelColorName.Length > 0) if (_Theme.SelColorName != "")
writer.WriteElementString("SColor", _Theme.SelColorName); writer.WriteElementString("SColor", _Theme.SelColorName);
else else
{ {
@@ -378,10 +378,10 @@ namespace VocaluxeLib.Menu
{ {
Text.LoadTextures(); Text.LoadTextures();
if (_Theme.ColorName.Length > 0) if (_Theme.ColorName != "")
Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID); Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID);
if (_Theme.SelColorName.Length > 0) if (_Theme.SelColorName != "")
SelColor = CBase.Theme.GetColor(_Theme.SelColorName, _PartyModeID); SelColor = CBase.Theme.GetColor(_Theme.SelColorName, _PartyModeID);
} }
+5 -5
View File
@@ -175,7 +175,7 @@ namespace VocaluxeLib.Menu
writer.WriteComment("<Color>: Equalizer color from ColorScheme (high priority)"); writer.WriteComment("<Color>: Equalizer color from ColorScheme (high priority)");
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)"); writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
if (_Theme.ColorName.Length > 0) if (_Theme.ColorName != "")
writer.WriteElementString("Color", _Theme.ColorName); writer.WriteElementString("Color", _Theme.ColorName);
else else
{ {
@@ -186,7 +186,7 @@ namespace VocaluxeLib.Menu
} }
writer.WriteComment("<MaxColor>: Equalizer color for maximal volume from ColorScheme (high priority)"); writer.WriteComment("<MaxColor>: Equalizer color for maximal volume from ColorScheme (high priority)");
writer.WriteComment("or <MaxR>, <MaxG>, <MaxB>, <MaxA> (lower priority)"); writer.WriteComment("or <MaxR>, <MaxG>, <MaxB>, <MaxA> (lower priority)");
if (_Theme.ColorName.Length > 0) if (_Theme.ColorName != "")
writer.WriteElementString("MaxColor", _Theme.ColorName); writer.WriteElementString("MaxColor", _Theme.ColorName);
else else
{ {
@@ -241,7 +241,7 @@ namespace VocaluxeLib.Menu
public void Draw() public void Draw()
{ {
if (_Bars == null || _Theme.Style!=EEqualizerStyle.Collums) if (_Bars == null || _Theme.Style != EEqualizerStyle.Collums)
return; return;
float dx = Rect.W / _Bars.Length; float dx = Rect.W / _Bars.Length;
@@ -274,10 +274,10 @@ namespace VocaluxeLib.Menu
public void LoadTextures() public void LoadTextures()
{ {
if (_Theme.ColorName.Length > 0) if (_Theme.ColorName != "")
Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID); Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID);
if (_Theme.MaxColorName.Length > 0) if (_Theme.MaxColorName != "")
MaxColor = CBase.Theme.GetColor(_Theme.MaxColorName, _PartyModeID); MaxColor = CBase.Theme.GetColor(_Theme.MaxColorName, _PartyModeID);
} }
-2
View File
@@ -157,9 +157,7 @@ namespace VocaluxeLib.Menu
try try
{ {
foreach (FileInfo file in dir.GetFiles(cast)) foreach (FileInfo file in dir.GetFiles(cast))
{
files.Add(!fullpath ? file.Name : file.FullName); files.Add(!fullpath ? file.Name : file.FullName);
}
if (recursive) if (recursive)
{ {
+4 -4
View File
@@ -172,7 +172,7 @@ namespace VocaluxeLib.Menu
writer.WriteComment("<Color>: Lyric text color from ColorScheme (high priority)"); writer.WriteComment("<Color>: Lyric text color from ColorScheme (high priority)");
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)"); writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
if (_Theme.ColorName.Length > 0) if (_Theme.ColorName != "")
writer.WriteElementString("Color", _Theme.ColorName); writer.WriteElementString("Color", _Theme.ColorName);
else else
{ {
@@ -184,7 +184,7 @@ namespace VocaluxeLib.Menu
writer.WriteComment("<SColor>: Highlighted lyric color from ColorScheme (high priority)"); writer.WriteComment("<SColor>: Highlighted lyric color from ColorScheme (high priority)");
writer.WriteComment("or <SR>, <SG>, <SB>, <SA> (lower priority)"); writer.WriteComment("or <SR>, <SG>, <SB>, <SA> (lower priority)");
if (_Theme.SelColorName.Length > 0) if (_Theme.SelColorName != "")
writer.WriteElementString("SColor", _Theme.SelColorName); writer.WriteElementString("SColor", _Theme.SelColorName);
else else
{ {
@@ -525,10 +525,10 @@ namespace VocaluxeLib.Menu
public void LoadTextures() public void LoadTextures()
{ {
if (_Theme.ColorName.Length > 0) if (_Theme.ColorName != "")
_Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID); _Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID);
if (_Theme.SelColorName.Length > 0) if (_Theme.SelColorName != "")
_ColorProcessed = CBase.Theme.GetColor(_Theme.SelColorName, _PartyModeID); _ColorProcessed = CBase.Theme.GetColor(_Theme.SelColorName, _PartyModeID);
} }
+8 -5
View File
@@ -194,7 +194,7 @@ namespace VocaluxeLib.Menu
public virtual void SaveTheme() public virtual void SaveTheme()
{ {
if (_ThemePath.Length == 0) if (_ThemePath == "")
return; return;
XmlWriterSettings settings = new XmlWriterSettings {Indent = true, Encoding = Encoding.UTF8, ConformanceLevel = ConformanceLevel.Document}; XmlWriterSettings settings = new XmlWriterSettings {Indent = true, Encoding = Encoding.UTF8, ConformanceLevel = ConformanceLevel.Document};
@@ -357,7 +357,7 @@ namespace VocaluxeLib.Menu
public virtual void ReloadTheme(string xmlPath) public virtual void ReloadTheme(string xmlPath)
{ {
if (_ThemePath.Length == 0) if (_ThemePath == "")
return; return;
UnloadTextures(); UnloadTextures();
@@ -436,7 +436,7 @@ namespace VocaluxeLib.Menu
#region ElementHandler #region ElementHandler
#region Create Elements #region Create Elements
// ReSharper disable UnusedMember.Global // ReSharper disable UnusedMember.Global
// ReSharper disable MemberCanBeProtected.Global // ReSharper disable MemberCanBeProtected.Global
public CButton GetNewButton() public CButton GetNewButton()
{ {
@@ -527,6 +527,7 @@ namespace VocaluxeLib.Menu
{ {
return new CParticleEffect(_PartyModeID, maxNumber, color, area, texture, size, type); return new CParticleEffect(_PartyModeID, maxNumber, color, area, texture, size, type);
} }
// ReSharper restore MemberCanBeProtected.Global // ReSharper restore MemberCanBeProtected.Global
// ReSharper restore UnusedMember.Global // ReSharper restore UnusedMember.Global
#endregion Create Elements #endregion Create Elements
@@ -793,7 +794,7 @@ namespace VocaluxeLib.Menu
#endregion Drawing #endregion Drawing
#region Elements #region Elements
// ReSharper disable MemberCanBePrivate.Global // ReSharper disable MemberCanBePrivate.Global
protected void _AddBackground(CBackground bg, String key = null) protected void _AddBackground(CBackground bg, String key = null)
{ {
_AddInteraction(_Backgrounds.Add(bg, key), EType.Background); _AddInteraction(_Backgrounds.Add(bg, key), EType.Background);
@@ -858,6 +859,7 @@ namespace VocaluxeLib.Menu
{ {
_ScreenSettings.Add(se, key); _ScreenSettings.Add(se, key);
} }
// ReSharper restore MemberCanBePrivate.Global // ReSharper restore MemberCanBePrivate.Global
#endregion Elements #endregion Elements
@@ -1515,7 +1517,7 @@ namespace VocaluxeLib.Menu
} }
} }
// ReSharper disable UnusedMember.Local // ReSharper disable UnusedMember.Local
private void _ToggleHighlighted() private void _ToggleHighlighted()
{ {
if (_Selection >= _Interactions.Count || _Selection < 0) if (_Selection >= _Interactions.Count || _Selection < 0)
@@ -1532,6 +1534,7 @@ namespace VocaluxeLib.Menu
return _Interactions[_Selection].Type == EType.SelectSlide && _SelectSlides[_Interactions[_Selection].Num].Highlighted; return _Interactions[_Selection].Type == EType.SelectSlide && _SelectSlides[_Interactions[_Selection].Num].Highlighted;
} }
// ReSharper restore UnusedMember.Local // ReSharper restore UnusedMember.Local
private bool _IsVisible(int interaction) private bool _IsVisible(int interaction)
+4 -4
View File
@@ -190,7 +190,7 @@ namespace VocaluxeLib.Menu
writer.WriteComment("<ColorEmptyTile>: Static color from ColorScheme (high priority)"); writer.WriteComment("<ColorEmptyTile>: Static color from ColorScheme (high priority)");
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)"); writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
if (_Theme.ColorEmptyTileName.Length > 0) if (_Theme.ColorEmptyTileName != "")
writer.WriteElementString("ColorEmptyTile", _Theme.ColorEmptyTileName); writer.WriteElementString("ColorEmptyTile", _Theme.ColorEmptyTileName);
else else
{ {
@@ -221,7 +221,7 @@ namespace VocaluxeLib.Menu
writer.WriteComment("<Font>: Text font name"); writer.WriteComment("<Font>: Text font name");
writer.WriteElementString("Font", _Theme.NameFont); writer.WriteElementString("Font", _Theme.NameFont);
writer.WriteComment("<Color>: Text color from ColorScheme (high priority)"); writer.WriteComment("<Color>: Text color from ColorScheme (high priority)");
if (_Theme.NameColorName.Length > 0) if (_Theme.NameColorName != "")
writer.WriteElementString("Color", _Theme.NameColorName); writer.WriteElementString("Color", _Theme.NameColorName);
else else
{ {
@@ -455,10 +455,10 @@ namespace VocaluxeLib.Menu
_TextureEmptyTile = CBase.Theme.GetSkinTexture(_Theme.TextureEmptyTileName, _PartyModeID); _TextureEmptyTile = CBase.Theme.GetSkinTexture(_Theme.TextureEmptyTileName, _PartyModeID);
_TextureTileSelected = CBase.Theme.GetSkinTexture(_Theme.TextureTileSelectedName, _PartyModeID); _TextureTileSelected = CBase.Theme.GetSkinTexture(_Theme.TextureTileSelectedName, _PartyModeID);
if (_Theme.ColorEmptyTileName.Length > 0) if (_Theme.ColorEmptyTileName != "")
ColorEmptyTile = CBase.Theme.GetColor(_Theme.ColorEmptyTileName, _PartyModeID); ColorEmptyTile = CBase.Theme.GetColor(_Theme.ColorEmptyTileName, _PartyModeID);
if (_Theme.NameColorName.Length > 0) if (_Theme.NameColorName != "")
_Theme.NameColor = CBase.Theme.GetColor(_Theme.NameColorName, _PartyModeID); _Theme.NameColor = CBase.Theme.GetColor(_Theme.NameColorName, _PartyModeID);
} }
+5 -5
View File
@@ -297,7 +297,7 @@ namespace VocaluxeLib.Menu
public void Draw() public void Draw()
{ {
if (_TextureName.Length > 0) if (_TextureName != "")
CBase.Drawing.DrawTexture(CBase.Theme.GetSkinTexture(_TextureName, _PartyModeID), _Rect, new SColorF(_Color.R, _Color.G, _Color.B, _Color.A * Alpha2 * _Alpha)); CBase.Drawing.DrawTexture(CBase.Theme.GetSkinTexture(_TextureName, _PartyModeID), _Rect, new SColorF(_Color.R, _Color.G, _Color.B, _Color.A * Alpha2 * _Alpha));
else else
CBase.Drawing.DrawTexture(_Texture, _Rect, new SColorF(_Color.R, _Color.G, _Color.B, _Color.A * Alpha2 * _Alpha)); CBase.Drawing.DrawTexture(_Texture, _Rect, new SColorF(_Color.R, _Color.G, _Color.B, _Color.A * Alpha2 * _Alpha));
@@ -433,7 +433,7 @@ namespace VocaluxeLib.Menu
writer.WriteComment("<Color>: ParticleEffect color from ColorScheme (high priority)"); writer.WriteComment("<Color>: ParticleEffect color from ColorScheme (high priority)");
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)"); writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
if (_Theme.ColorName.Length > 0) if (_Theme.ColorName != "")
writer.WriteElementString("Color", _Theme.ColorName); writer.WriteElementString("Color", _Theme.ColorName);
else else
{ {
@@ -544,7 +544,7 @@ namespace VocaluxeLib.Menu
h = 0; h = 0;
CParticle star; CParticle star;
if (_Theme.TextureName.Length > 0) if (_Theme.TextureName != "")
{ {
star = new CParticle(_PartyModeID, _Theme.TextureName, Color, star = new CParticle(_PartyModeID, _Theme.TextureName, Color,
CBase.Game.GetRandom(w) + Rect.X - size / 4f, CBase.Game.GetRandom(w) + Rect.X - size / 4f,
@@ -605,9 +605,9 @@ namespace VocaluxeLib.Menu
public void LoadTextures() public void LoadTextures()
{ {
if (_Theme.ColorName.Length > 0) if (_Theme.ColorName != "")
Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID); Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID);
if (_Theme.TextureName.Length > 0) if (_Theme.TextureName != "")
Texture = CBase.Theme.GetSkinTexture(_Theme.TextureName, _PartyModeID); Texture = CBase.Theme.GetSkinTexture(_Theme.TextureName, _PartyModeID);
} }
+5 -5
View File
@@ -370,7 +370,7 @@ namespace VocaluxeLib.Menu
writer.WriteComment("<ColorBackground>: Button color from ColorScheme (high priority)"); writer.WriteComment("<ColorBackground>: Button color from ColorScheme (high priority)");
writer.WriteComment("or <BackgroundR>, <BackgroundG>, <BackgroundB>, <BackgroundA> (lower priority)"); writer.WriteComment("or <BackgroundR>, <BackgroundG>, <BackgroundB>, <BackgroundA> (lower priority)");
if (_Theme.ColorBackgroundName.Length > 0) if (_Theme.ColorBackgroundName != "")
writer.WriteElementString("ColorBackground", _Theme.ColorBackgroundName); writer.WriteElementString("ColorBackground", _Theme.ColorBackgroundName);
else else
{ {
@@ -382,7 +382,7 @@ namespace VocaluxeLib.Menu
writer.WriteComment("<SColorBackground>: Selected paylist-entry color from ColorScheme (high priority)"); writer.WriteComment("<SColorBackground>: Selected paylist-entry color from ColorScheme (high priority)");
writer.WriteComment("or <SBackgroundR>, <SBackgroundG>, <SBackgroundB>, <SBackgroundA> (lower priority)"); writer.WriteComment("or <SBackgroundR>, <SBackgroundG>, <SBackgroundB>, <SBackgroundA> (lower priority)");
if (_Theme.SelColorBackgroundName.Length > 0) if (_Theme.SelColorBackgroundName != "")
writer.WriteElementString("SColorBackground", _Theme.SelColorBackgroundName); writer.WriteElementString("SColorBackground", _Theme.SelColorBackgroundName);
else else
{ {
@@ -471,10 +471,10 @@ namespace VocaluxeLib.Menu
public void LoadTextures() public void LoadTextures()
{ {
if (_Theme.ColorBackgroundName.Length > 0) if (_Theme.ColorBackgroundName != "")
BackgroundColor = CBase.Theme.GetColor(_Theme.ColorBackgroundName, _PartyModeID); BackgroundColor = CBase.Theme.GetColor(_Theme.ColorBackgroundName, _PartyModeID);
if (_Theme.SelColorBackgroundName.Length > 0) if (_Theme.SelColorBackgroundName != "")
BackgroundSelColor = CBase.Theme.GetColor(_Theme.SelColorBackgroundName, _PartyModeID); BackgroundSelColor = CBase.Theme.GetColor(_Theme.SelColorBackgroundName, _PartyModeID);
_Theme.Text1.LoadTextures(); _Theme.Text1.LoadTextures();
@@ -523,7 +523,7 @@ namespace VocaluxeLib.Menu
} }
else if (keyEvent.Key == Keys.Back || keyEvent.Key == Keys.Delete) else if (keyEvent.Key == Keys.Back || keyEvent.Key == Keys.Delete)
{ {
if (_Theme.ButtonPlaylistName.Text.Text.Length > 0) if (_Theme.ButtonPlaylistName.Text.Text != "")
_Theme.ButtonPlaylistName.Text.Text = _Theme.ButtonPlaylistName.Text.Text.Remove(_Theme.ButtonPlaylistName.Text.Text.Length - 1); _Theme.ButtonPlaylistName.Text.Text = _Theme.ButtonPlaylistName.Text.Text.Remove(_Theme.ButtonPlaylistName.Text.Text.Length - 1);
} }
} }
+2 -2
View File
@@ -37,10 +37,10 @@ namespace VocaluxeLib.Menu
public ESettingType Type; public ESettingType Type;
} }
// ReSharper disable ClassNeverInstantiated.Global // ReSharper disable ClassNeverInstantiated.Global
//Instantiated by reflection //Instantiated by reflection
public class CScreenSetting : IMenuElement public class CScreenSetting : IMenuElement
// ReSharper restore ClassNeverInstantiated.Global // ReSharper restore ClassNeverInstantiated.Global
{ {
private readonly int _PartyModeID; private readonly int _PartyModeID;
+14 -14
View File
@@ -417,7 +417,7 @@ namespace VocaluxeLib.Menu
writer.WriteComment("<Color>: SelectSlide color from ColorScheme (high priority)"); writer.WriteComment("<Color>: SelectSlide color from ColorScheme (high priority)");
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)"); writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
if (_Theme.ColorName.Length > 0) if (_Theme.ColorName != "")
writer.WriteElementString("Color", _Theme.ColorName); writer.WriteElementString("Color", _Theme.ColorName);
else else
{ {
@@ -429,7 +429,7 @@ namespace VocaluxeLib.Menu
writer.WriteComment("<SColor>: Selected SelectSlide color from ColorScheme (high priority)"); writer.WriteComment("<SColor>: Selected SelectSlide color from ColorScheme (high priority)");
writer.WriteComment("or <SR>, <SG>, <SB>, <SA> (lower priority)"); writer.WriteComment("or <SR>, <SG>, <SB>, <SA> (lower priority)");
if (_Theme.SelColorName.Length > 0) if (_Theme.SelColorName != "")
writer.WriteElementString("SColor", _Theme.SelColorName); writer.WriteElementString("SColor", _Theme.SelColorName);
else else
{ {
@@ -441,7 +441,7 @@ namespace VocaluxeLib.Menu
writer.WriteComment("<HColor>: Highlighted SelectSlide color from ColorScheme (high priority)"); writer.WriteComment("<HColor>: Highlighted SelectSlide color from ColorScheme (high priority)");
writer.WriteComment("or <HR>, <HG>, <HB>, <HA> (lower priority)"); writer.WriteComment("or <HR>, <HG>, <HB>, <HA> (lower priority)");
if (_Theme.HighlightColorName.Length > 0) if (_Theme.HighlightColorName != "")
writer.WriteElementString("HColor", _Theme.HighlightColorName); writer.WriteElementString("HColor", _Theme.HighlightColorName);
else else
{ {
@@ -453,7 +453,7 @@ namespace VocaluxeLib.Menu
writer.WriteComment("<ArrowColor>: Arrow color from ColorScheme (high priority)"); writer.WriteComment("<ArrowColor>: Arrow color from ColorScheme (high priority)");
writer.WriteComment("or <ArrowR>, <ArrowG>, <ArrowB>, <ArrowA> (lower priority)"); writer.WriteComment("or <ArrowR>, <ArrowG>, <ArrowB>, <ArrowA> (lower priority)");
if (_Theme.ArrowColorName.Length > 0) if (_Theme.ArrowColorName != "")
writer.WriteElementString("ArrowColor", _Theme.ArrowColorName); writer.WriteElementString("ArrowColor", _Theme.ArrowColorName);
else else
{ {
@@ -465,7 +465,7 @@ namespace VocaluxeLib.Menu
writer.WriteComment("<ArrowSColor>: Selected arrow color from ColorScheme (high priority)"); writer.WriteComment("<ArrowSColor>: Selected arrow color from ColorScheme (high priority)");
writer.WriteComment("or <ArrowSR>, <ArrowSG>, <ArrowSB>, <ArrowSA> (lower priority)"); writer.WriteComment("or <ArrowSR>, <ArrowSG>, <ArrowSB>, <ArrowSA> (lower priority)");
if (_Theme.SelArrowColorName.Length > 0) if (_Theme.SelArrowColorName != "")
writer.WriteElementString("ArrowSColor", _Theme.SelArrowColorName); writer.WriteElementString("ArrowSColor", _Theme.SelArrowColorName);
else else
{ {
@@ -477,7 +477,7 @@ namespace VocaluxeLib.Menu
writer.WriteComment("<TextColor>: Text color from ColorScheme (high priority)"); writer.WriteComment("<TextColor>: Text color from ColorScheme (high priority)");
writer.WriteComment("or <TextR>, <TextG>, <TextB>, <TextA> (lower priority)"); writer.WriteComment("or <TextR>, <TextG>, <TextB>, <TextA> (lower priority)");
if (_Theme.TextColorName.Length > 0) if (_Theme.TextColorName != "")
writer.WriteElementString("TextColor", _Theme.TextColorName); writer.WriteElementString("TextColor", _Theme.TextColorName);
else else
{ {
@@ -489,7 +489,7 @@ namespace VocaluxeLib.Menu
writer.WriteComment("<TextSColor>: Selected text color from ColorScheme (high priority)"); writer.WriteComment("<TextSColor>: Selected text color from ColorScheme (high priority)");
writer.WriteComment("or <TextSR>, <TextSG>, <TextSB>, <TextSA> (lower priority)"); writer.WriteComment("or <TextSR>, <TextSG>, <TextSB>, <TextSA> (lower priority)");
if (_Theme.SelTextColorName.Length > 0) if (_Theme.SelTextColorName != "")
writer.WriteElementString("TextSColor", _Theme.SelTextColorName); writer.WriteElementString("TextSColor", _Theme.SelTextColorName);
else else
{ {
@@ -797,25 +797,25 @@ namespace VocaluxeLib.Menu
public void LoadTextures() public void LoadTextures()
{ {
if (_Theme.ColorName.Length > 0) if (_Theme.ColorName != "")
Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID); Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID);
if (_Theme.SelColorName.Length > 0) if (_Theme.SelColorName != "")
SelColor = CBase.Theme.GetColor(_Theme.SelColorName, _PartyModeID); SelColor = CBase.Theme.GetColor(_Theme.SelColorName, _PartyModeID);
if (_Theme.HighlightColorName.Length > 0) if (_Theme.HighlightColorName != "")
HighlightColor = CBase.Theme.GetColor(_Theme.HighlightColorName, _PartyModeID); HighlightColor = CBase.Theme.GetColor(_Theme.HighlightColorName, _PartyModeID);
if (_Theme.ArrowColorName.Length > 0) if (_Theme.ArrowColorName != "")
ColorArrow = CBase.Theme.GetColor(_Theme.ArrowColorName, _PartyModeID); ColorArrow = CBase.Theme.GetColor(_Theme.ArrowColorName, _PartyModeID);
if (_Theme.SelArrowColorName.Length > 0) if (_Theme.SelArrowColorName != "")
SelColorArrow = CBase.Theme.GetColor(_Theme.SelArrowColorName, _PartyModeID); SelColorArrow = CBase.Theme.GetColor(_Theme.SelArrowColorName, _PartyModeID);
if (_Theme.TextColorName.Length > 0) if (_Theme.TextColorName != "")
TextColor = CBase.Theme.GetColor(_Theme.TextColorName, _PartyModeID); TextColor = CBase.Theme.GetColor(_Theme.TextColorName, _PartyModeID);
if (_Theme.SelColorName.Length > 0) if (_Theme.SelColorName != "")
SelTextColor = CBase.Theme.GetColor(_Theme.SelTextColorName, _PartyModeID); SelTextColor = CBase.Theme.GetColor(_Theme.SelTextColorName, _PartyModeID);
} }
+2 -2
View File
@@ -201,7 +201,7 @@ namespace VocaluxeLib.Menu
writer.WriteComment("<Color>: Static color from ColorScheme (high priority)"); writer.WriteComment("<Color>: Static color from ColorScheme (high priority)");
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)"); writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
if (_Theme.ColorName.Length > 0) if (_Theme.ColorName != "")
writer.WriteElementString("Color", _Theme.ColorName); writer.WriteElementString("Color", _Theme.ColorName);
else else
{ {
@@ -293,7 +293,7 @@ namespace VocaluxeLib.Menu
public void LoadTextures() public void LoadTextures()
{ {
if (_Theme.ColorName.Length > 0) if (_Theme.ColorName != "")
Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID); Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID);
} }
+5 -5
View File
@@ -541,7 +541,7 @@ namespace VocaluxeLib.Menu
writer.WriteComment("<Color>: Text color from ColorScheme (high priority)"); writer.WriteComment("<Color>: Text color from ColorScheme (high priority)");
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)"); writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
if (_Theme.ColorName.Length > 0) if (_Theme.ColorName != "")
writer.WriteElementString("Color", _Theme.ColorName); writer.WriteElementString("Color", _Theme.ColorName);
else else
{ {
@@ -553,7 +553,7 @@ namespace VocaluxeLib.Menu
writer.WriteComment("<SColor>: Selected Text color from ColorScheme (high priority)"); writer.WriteComment("<SColor>: Selected Text color from ColorScheme (high priority)");
writer.WriteComment("or <SR>, <SG>, <SB>, <SA> (lower priority)"); writer.WriteComment("or <SR>, <SG>, <SB>, <SA> (lower priority)");
if (_Theme.SelColorName.Length > 0) if (_Theme.SelColorName != "")
writer.WriteElementString("SColor", _Theme.SelColorName); writer.WriteElementString("SColor", _Theme.SelColorName);
else else
{ {
@@ -776,10 +776,10 @@ namespace VocaluxeLib.Menu
public void LoadTextures() public void LoadTextures()
{ {
if (_Theme.ColorName.Length > 0) if (_Theme.ColorName != "")
Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID); Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID);
if (_Theme.SelColorName.Length > 0) if (_Theme.SelColorName != "")
SelColor = CBase.Theme.GetColor(_Theme.SelColorName, _PartyModeID); SelColor = CBase.Theme.GetColor(_Theme.SelColorName, _PartyModeID);
} }
@@ -806,7 +806,7 @@ namespace VocaluxeLib.Menu
private void _UpdateTextPosition() private void _UpdateTextPosition()
{ {
if (_Text.Length == 0) if (_Text == "")
return; return;
CBase.Fonts.SetFont(Font); CBase.Fonts.SetFont(Font);
+1 -1
View File
@@ -112,7 +112,7 @@ namespace VocaluxeLib.Menu
resultCt++; resultCt++;
} }
if (resultCt!=1) if (resultCt != 1)
{ {
value = defaultValue; value = defaultValue;
return false; return false;
+1 -1
View File
@@ -136,7 +136,7 @@ namespace VocaluxeLib.Menu
public enum EBufferSize public enum EBufferSize
{ {
// ReSharper disable UnusedMember.Global // ReSharper disable UnusedMember.Global
B0 = 0, B0 = 0,
B512 = 512, B512 = 512,
B1024 = 1024, B1024 = 1024,
+1 -1
View File
@@ -245,7 +245,7 @@ namespace VocaluxeLib.Menu.SingNotes
SPlayerNotes notes = _PlayerNotes[n]; SPlayerNotes notes = _PlayerNotes[n];
if (line.Length == 0 || line.Length <= lineNr) if (line.Length <= lineNr)
return; return;
notes.Lines = line; notes.Lines = line;
+17 -17
View File
@@ -369,7 +369,7 @@ namespace VocaluxeLib.Menu.SongMenu
while (!sr.EndOfStream) while (!sr.EndOfStream)
{ {
string line = sr.ReadLine(); string line = sr.ReadLine();
if (line.Length == 0) if (line == "")
continue; continue;
if (!line[0].ToString().Equals("#")) if (!line[0].ToString().Equals("#"))
break; break;
@@ -381,7 +381,7 @@ namespace VocaluxeLib.Menu.SongMenu
string identifier = line.Substring(1, pos - 1).Trim().ToUpper(); string identifier = line.Substring(1, pos - 1).Trim().ToUpper();
string value = line.Substring(pos + 1, line.Length - pos - 1).Trim(); string value = line.Substring(pos + 1, line.Length - pos - 1).Trim();
if (value.Length > 0) if (value != "")
{ {
switch (identifier) switch (identifier)
{ {
@@ -395,7 +395,7 @@ namespace VocaluxeLib.Menu.SongMenu
while (!sr.EndOfStream) while (!sr.EndOfStream)
{ {
line = sr.ReadLine(); line = sr.ReadLine();
if (line.Length == 0) if (line == "")
continue; continue;
if (!line[0].ToString().Equals("#")) if (!line[0].ToString().Equals("#"))
break; break;
@@ -411,33 +411,33 @@ namespace VocaluxeLib.Menu.SongMenu
} }
break; break;
case "TITLE": case "TITLE":
if (value.Length > 0) if (value != "")
{ {
Title = value; Title = value;
headerFlags |= EHeaderFlags.Title; headerFlags |= EHeaderFlags.Title;
} }
break; break;
case "ARTIST": case "ARTIST":
if (value.Length > 0) if (value != "")
{ {
Artist = value; Artist = value;
headerFlags |= EHeaderFlags.Artist; headerFlags |= EHeaderFlags.Artist;
} }
break; break;
case "TITLE-ON-SORTING": case "TITLE-ON-SORTING":
if (value.Length > 0) if (value != "")
TitleSorting = value; TitleSorting = value;
break; break;
case "ARTIST-ON-SORTING": case "ARTIST-ON-SORTING":
if (value.Length > 0) if (value != "")
ArtistSorting = value; ArtistSorting = value;
break; break;
case "P1": case "P1":
if (value.Length > 0) if (value != "")
DuetPart1 = value; DuetPart1 = value;
break; break;
case "P2": case "P2":
if (value.Length > 0) if (value != "")
DuetPart2 = value; DuetPart2 = value;
break; break;
case "MP3": case "MP3":
@@ -608,10 +608,10 @@ namespace VocaluxeLib.Menu.SongMenu
_CheckFiles(); _CheckFiles();
//Before saving this tags to .txt: Check, if ArtistSorting and Artist are equal, then don't save this tag. //Before saving this tags to .txt: Check, if ArtistSorting and Artist are equal, then don't save this tag.
if (ArtistSorting.Length == 0) if (ArtistSorting == "")
ArtistSorting = Artist; ArtistSorting = Artist;
if (TitleSorting.Length == 0) if (TitleSorting == "")
TitleSorting = Title; TitleSorting = Title;
return true; return true;
@@ -821,7 +821,7 @@ namespace VocaluxeLib.Menu.SongMenu
{ {
if (_CoverSmallLoaded) if (_CoverSmallLoaded)
return; return;
if (CoverFileName.Length > 0) if (CoverFileName != "")
{ {
if (!CBase.DataBase.GetCover(Path.Combine(Folder, CoverFileName), ref _CoverTextureSmall, CBase.Config.GetCoverSize())) if (!CBase.DataBase.GetCover(Path.Combine(Folder, CoverFileName), ref _CoverTextureSmall, CBase.Config.GetCoverSize()))
_CoverTextureSmall = CBase.Cover.GetNoCover(); _CoverTextureSmall = CBase.Cover.GetNoCover();
@@ -834,7 +834,7 @@ namespace VocaluxeLib.Menu.SongMenu
private void _CheckFiles() private void _CheckFiles()
{ {
if (CoverFileName.Length == 0) if (CoverFileName == "")
{ {
List<string> files = CHelper.ListFiles(Folder, "*.jpg", false); List<string> files = CHelper.ListFiles(Folder, "*.jpg", false);
files.AddRange(CHelper.ListFiles(Folder, "*.png", false)); files.AddRange(CHelper.ListFiles(Folder, "*.png", false));
@@ -846,7 +846,7 @@ namespace VocaluxeLib.Menu.SongMenu
} }
} }
if (BackgroundFileName.Length == 0) if (BackgroundFileName == "")
{ {
List<string> files = CHelper.ListFiles(Folder, "*.jpg", false); List<string> files = CHelper.ListFiles(Folder, "*.jpg", false);
files.AddRange(CHelper.ListFiles(Folder, "*.png", false)); files.AddRange(CHelper.ListFiles(Folder, "*.png", false));
@@ -861,12 +861,12 @@ namespace VocaluxeLib.Menu.SongMenu
private void _CheckDuet() private void _CheckDuet()
{ {
if (DuetPart1.Length == 0) if (DuetPart1 == "")
{ {
DuetPart1 = "Part 1"; DuetPart1 = "Part 1";
CBase.Log.LogError("Warning: Can't find #P1-tag for duets in \"" + Artist + " - " + Title + "\"."); CBase.Log.LogError("Warning: Can't find #P1-tag for duets in \"" + Artist + " - " + Title + "\".");
} }
if (DuetPart2.Length == 0) if (DuetPart2 == "")
{ {
DuetPart2 = "Part 2"; DuetPart2 = "Part 2";
CBase.Log.LogError("Warning: Can't find #P2-tag for duets in \"" + Artist + " - " + Title + "\"."); CBase.Log.LogError("Warning: Can't find #P2-tag for duets in \"" + Artist + " - " + Title + "\".");
@@ -915,7 +915,7 @@ namespace VocaluxeLib.Menu.SongMenu
for (int k = 1; k <= max; k++) for (int k = 1; k <= max; k++)
{ {
if (sentences[i + k] == sentences[j + k] && sentences[i + k]!="") if (sentences[i + k] == sentences[j + k] && sentences[i + k] != "")
tempSeries.End = i + k; tempSeries.End = i + k;
else else
break; break;
@@ -44,7 +44,7 @@ namespace VocaluxeLib.Menu.SongMenu
public CSongMenuDreidel(int partyModeID) public CSongMenuDreidel(int partyModeID)
: base(partyModeID) {} : base(partyModeID) {}
// ReSharper disable RedundantOverridenMember // ReSharper disable RedundantOverridenMember
public override void Init() public override void Init()
{ {
base.Init(); base.Init();
@@ -59,6 +59,7 @@ namespace VocaluxeLib.Menu.SongMenu
_SongLength = _Theme.songMenuDreidel.TextSongLength; _SongLength = _Theme.songMenuDreidel.TextSongLength;
**/ **/
} }
// ReSharper restore RedundantOverridenMember
// ReSharper restore RedundantOverridenMember
} }
} }
@@ -349,7 +349,7 @@ namespace VocaluxeLib.Menu.SongMenu
writer.WriteComment("<Color>: Tile color from ColorScheme (high priority)"); writer.WriteComment("<Color>: Tile color from ColorScheme (high priority)");
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)"); writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
if (_Theme.ColorName.Length > 0) if (_Theme.ColorName != "")
writer.WriteElementString("Color", _Theme.ColorName); writer.WriteElementString("Color", _Theme.ColorName);
else else
{ {
@@ -481,13 +481,9 @@ namespace VocaluxeLib.Menu.SongMenu
_SelectedInternal = _SelectedPending; _SelectedInternal = _SelectedPending;
} }
public virtual void HandleInput(ref SKeyEvent keyEvent, SScreenSongOptions songOptions) public virtual void HandleInput(ref SKeyEvent keyEvent, SScreenSongOptions songOptions) {}
{
}
public virtual void HandleMouse(ref SMouseEvent mouseEvent, SScreenSongOptions songOptions) public virtual void HandleMouse(ref SMouseEvent mouseEvent, SScreenSongOptions songOptions) {}
{
}
public virtual void Draw() public virtual void Draw()
{ {
@@ -531,17 +527,11 @@ namespace VocaluxeLib.Menu.SongMenu
return -1; return -1;
} }
public virtual void SetSelectedSong(int visibleSongNr) public virtual void SetSelectedSong(int visibleSongNr) {}
{
}
public virtual void SetSelectedCategory(int categoryNr) public virtual void SetSelectedCategory(int categoryNr) {}
{
}
public virtual void SetSmallView(bool smallView) public virtual void SetSmallView(bool smallView) {}
{
}
public virtual bool IsSmallView() public virtual bool IsSmallView()
{ {
@@ -554,7 +544,7 @@ namespace VocaluxeLib.Menu.SongMenu
{ {
Init(); Init();
if (_Theme.ColorName.Length > 0) if (_Theme.ColorName != "")
_Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID); _Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID);
} }
@@ -635,7 +625,7 @@ namespace VocaluxeLib.Menu.SongMenu
_Streams.Add(stream); _Streams.Add(stream);
_Actsongstream = stream; _Actsongstream = stream;
if (CBase.Songs.GetVisibleSong(_Actsong).VideoFileName.Length > 0 && CBase.Config.GetVideoPreview() == EOffOn.TR_CONFIG_ON) if (CBase.Songs.GetVisibleSong(_Actsong).VideoFileName != "" && 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) if (_Video == -1)
@@ -154,7 +154,7 @@ namespace VocaluxeLib.Menu.SongMenu
_MedleyTagIcon.Visible = false; _MedleyTagIcon.Visible = false;
} }
if (CBase.Songs.GetNumVisibleSongs() == 0 && CBase.Songs.GetSearchFilter().Length > 0) if (CBase.Songs.GetNumVisibleSongs() == 0 && CBase.Songs.GetSearchFilter() != "")
{ {
_CoverBig.Texture = _CoverBigTexture; _CoverBig.Texture = _CoverBigTexture;
_Artist.Text = String.Empty; _Artist.Text = String.Empty;
@@ -418,7 +418,7 @@ namespace VocaluxeLib.Menu.SongMenu
_Artist.Text = song.Artist; _Artist.Text = song.Artist;
_Title.Text = song.Title; _Title.Text = song.Title;
_DuetIcon.Visible = song.IsDuet; _DuetIcon.Visible = song.IsDuet;
_VideoIcon.Visible = song.VideoFileName.Length > 0; _VideoIcon.Visible = song.VideoFileName != "";
_MedleyCalcIcon.Visible = song.Medley.Source == EMedleySource.Calculated; _MedleyCalcIcon.Visible = song.Medley.Source == EMedleySource.Calculated;
_MedleyTagIcon.Visible = song.Medley.Source == EMedleySource.Tag; _MedleyTagIcon.Visible = song.Medley.Source == EMedleySource.Tag;