IMPORTANT: Format of all files with Resharper
NO functional changes. If you have problems merging your changes, merge/rebase on previous commit then merge this. Conflicts can easily be resolved (take yours if in doubt) After that merge next commits
This commit is contained in:
1 parent
3a110804d8
commit
149026ec32
57 files changed
+1242
-1099
No files matched your search
@@ -161,7 +161,7 @@ namespace VocaluxeLib
|
||||
return files;
|
||||
}
|
||||
|
||||
public static bool TryParse<T>(string value, out T result, bool ignoreCase=false)
|
||||
public static bool TryParse<T>(string value, out T result, bool ignoreCase = false)
|
||||
where T : struct
|
||||
{
|
||||
result = default(T);
|
||||
|
||||
@@ -1,4 +1,21 @@
|
||||
using System;
|
||||
#region license
|
||||
// This file is part of Vocaluxe.
|
||||
//
|
||||
// Vocaluxe is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Vocaluxe is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
@@ -9,7 +26,7 @@ namespace VocaluxeLib
|
||||
public static class Extensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Resizes the given list to the given size. Removes elements or adds default values
|
||||
/// Resizes the given list to the given size. Removes elements or adds default values
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="list"></param>
|
||||
@@ -25,7 +42,7 @@ namespace VocaluxeLib
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Makes the list at least the given size adding the given default values.
|
||||
/// Makes the list at least the given size adding the given default values.
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="list"></param>
|
||||
@@ -39,7 +56,7 @@ namespace VocaluxeLib
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Makes the list at least the given size adding a new instance of T
|
||||
/// Makes the list at least the given size adding a new instance of T
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="list"></param>
|
||||
@@ -51,7 +68,7 @@ namespace VocaluxeLib
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets all set bits starting from lowest (Bit 0)
|
||||
/// Gets all set bits starting from lowest (Bit 0)
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
@@ -100,7 +117,7 @@ namespace VocaluxeLib
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts value to a string in fixed point notation using invariant formating (english style decimal point)
|
||||
/// Converts value to a string in fixed point notation using invariant formating (english style decimal point)
|
||||
/// </summary>
|
||||
/// <param name="value">Value to be converted</param>
|
||||
/// <returns>String representation of value</returns>
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace VocaluxeLib
|
||||
int GetMaxNumMics();
|
||||
|
||||
/// <summary>
|
||||
/// Get the uniform settings for writing XML files. ALWAYS use this!
|
||||
/// Get the uniform settings for writing XML files. ALWAYS use this!
|
||||
/// </summary>
|
||||
XmlWriterSettings GetXMLSettings();
|
||||
}
|
||||
|
||||
@@ -138,9 +138,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
writer.WriteComment("<SlideShow%>: Texture name for slide-show");
|
||||
for (int i = 0; i < _Theme.SlideShowTextures.Count; i++)
|
||||
{
|
||||
writer.WriteElementString("SlideShow" + (i + 1), _Theme.SlideShowTextures[i]);
|
||||
}
|
||||
|
||||
writer.WriteComment("<Color>: Background color for type \"Color\" from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
|
||||
@@ -193,9 +191,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
|
||||
if (_Theme.Type == EBackgroundTypes.SlideShow && _Theme.SlideShowTextures.Count > 0)
|
||||
{
|
||||
ok = _DrawSlideShow();
|
||||
}
|
||||
|
||||
if (!String.IsNullOrEmpty(_Theme.TextureName) &&
|
||||
(_Theme.Type == EBackgroundTypes.Texture ||
|
||||
@@ -209,7 +205,10 @@ namespace VocaluxeLib.Menu
|
||||
return true;
|
||||
}
|
||||
|
||||
public void UnloadTextures() { _SlideShowTextures.Clear(); }
|
||||
public void UnloadTextures()
|
||||
{
|
||||
_SlideShowTextures.Clear();
|
||||
}
|
||||
|
||||
public void LoadTextures()
|
||||
{
|
||||
@@ -226,7 +225,7 @@ namespace VocaluxeLib.Menu
|
||||
if (!String.IsNullOrEmpty(image))
|
||||
{
|
||||
CTexture texture = CBase.Drawing.AddTexture(image);
|
||||
if(texture != null)
|
||||
if (texture != null)
|
||||
_SlideShowTextures.Add(texture);
|
||||
}
|
||||
}
|
||||
@@ -273,7 +272,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
private bool _DrawSlideShow()
|
||||
{
|
||||
if (_SlideShowTextures.Count > 0)
|
||||
if (_SlideShowTextures.Count > 0)
|
||||
{
|
||||
if (!_SlideShowTimer.IsRunning)
|
||||
{
|
||||
@@ -314,10 +313,10 @@ namespace VocaluxeLib.Menu
|
||||
{
|
||||
float alpha = (_SlideShowTimer.ElapsedMilliseconds - CBase.Settings.GetSlideShowImageTime()) / CBase.Settings.GetSlideShowFadeTime();
|
||||
CHelper.SetRect(bounds, out rect, texture.OrigAspect, EAspect.Crop);
|
||||
CBase.Drawing.DrawTexture(texture, new SRectF(rect.X, rect.Y, rect.Width, rect.Height, (CBase.Settings.GetZFar() / 4) - 1), new SColorF(1,1,1, alpha));
|
||||
CBase.Drawing.DrawTexture(texture, new SRectF(rect.X, rect.Y, rect.Width, rect.Height, (CBase.Settings.GetZFar() / 4) - 1), new SColorF(1, 1, 1, alpha));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace VocaluxeLib.Menu
|
||||
private bool _ThemeLoaded;
|
||||
|
||||
/// <summary>
|
||||
/// Holds a reference to Songline. DO NOT MODIFY
|
||||
/// Holds a reference to Songline. DO NOT MODIFY
|
||||
/// </summary>
|
||||
private CSongLine _Line;
|
||||
private CText _Text;
|
||||
|
||||
@@ -30,6 +30,7 @@ namespace VocaluxeLib.Menu
|
||||
public int[] NumPlayerTeams;
|
||||
public List<int>[] TeamList;
|
||||
}
|
||||
|
||||
public abstract class CMenuPartyNameSelection : CMenuParty
|
||||
{
|
||||
private bool _Teams;
|
||||
@@ -40,7 +41,7 @@ namespace VocaluxeLib.Menu
|
||||
protected bool _AllowChangeTeamNum = true;
|
||||
protected bool _ChangePlayerNumDynamic = true;
|
||||
protected bool _ChangeTeamNumDynamic = true;
|
||||
private int _CurrentTeam = 0;
|
||||
private int _CurrentTeam;
|
||||
|
||||
private bool _AvatarsChanged;
|
||||
private bool _ProfilesChanged;
|
||||
@@ -70,9 +71,9 @@ namespace VocaluxeLib.Menu
|
||||
public override void Init()
|
||||
{
|
||||
base.Init();
|
||||
_ThemeButtons = new string[] { _ButtonBack, _ButtonNext, _ButtonRandom, _ButtonIncreaseTeams, _ButtonDecreaseTeams, _ButtonIncreasePlayer, _ButtonDecreasePlayer };
|
||||
_ThemeSelectSlides = new string[] { _SelectSlideTeams, _SelectSlidePlayer };
|
||||
_ThemeNameSelections = new string[] { _NameSelection };
|
||||
_ThemeButtons = new string[] {_ButtonBack, _ButtonNext, _ButtonRandom, _ButtonIncreaseTeams, _ButtonDecreaseTeams, _ButtonIncreasePlayer, _ButtonDecreasePlayer};
|
||||
_ThemeSelectSlides = new string[] {_SelectSlideTeams, _SelectSlidePlayer};
|
||||
_ThemeNameSelections = new string[] {_NameSelection};
|
||||
|
||||
_ChooseAvatarStatic = GetNewStatic();
|
||||
_ChooseAvatarStatic.Visible = false;
|
||||
@@ -83,11 +84,11 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
public void SetPartyModeData(int numPlayer)
|
||||
{
|
||||
SetPartyModeData(1, numPlayer, new int[] { numPlayer });
|
||||
SetPartyModeData(1, numPlayer, new int[] {numPlayer});
|
||||
_CurrentTeam = 0;
|
||||
}
|
||||
|
||||
public void SetPartyModeData(int numTeams, int numPlayer, int[] numPlayerTeams)
|
||||
public void SetPartyModeData(int numTeams, int numPlayer, int[] numPlayerTeams)
|
||||
{
|
||||
_NumTeams = numTeams;
|
||||
_NumPlayer = numPlayer;
|
||||
@@ -141,13 +142,14 @@ namespace VocaluxeLib.Menu
|
||||
_AddPlayer(_CurrentTeam, _SelectedProfileID);
|
||||
}
|
||||
//Started selecting with 'P'
|
||||
if (_SelectingFast) {
|
||||
if (_SelectingFast)
|
||||
{
|
||||
if (!_ChangePlayerNumDynamic && _TeamList[_CurrentTeam].Count == _NumPlayerTeams[_CurrentTeam])
|
||||
resetSelection = true;
|
||||
else if (_TeamList[_CurrentTeam].Count == _PartyMode.GetMaxPlayerPerTeam())
|
||||
resetSelection = true;
|
||||
}
|
||||
else if(!_SelectingFast)
|
||||
else if (!_SelectingFast)
|
||||
resetSelection = true;
|
||||
break;
|
||||
|
||||
@@ -292,14 +294,15 @@ namespace VocaluxeLib.Menu
|
||||
else if (_SelectSlides[_SelectSlidePlayer].Selected)
|
||||
IncreasePlayerNum(_CurrentTeam);
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
if (numPressed > 0)
|
||||
{
|
||||
if (_ChangeTeamNumDynamic && numPressed < _PartyMode.GetMaxTeams() && numPressed > _SelectSlides[_SelectSlideTeams].NumValues)
|
||||
{
|
||||
while (numPressed < _PartyMode.GetMaxTeams())
|
||||
IncreaseTeamNum();
|
||||
}
|
||||
if (numPressed <= _SelectSlides[_SelectSlideTeams].NumValues)
|
||||
_SelectSlides[_SelectSlideTeams].SetSelectionByValueIndex(numPressed - 1);
|
||||
}
|
||||
@@ -353,7 +356,7 @@ namespace VocaluxeLib.Menu
|
||||
_OldMouseX = mouseEvent.X;
|
||||
_OldMouseY = mouseEvent.Y;
|
||||
}
|
||||
// LeftButton isn't hold anymore, but Select-Mode is still active -> "Drop" of Avatar
|
||||
// LeftButton isn't hold anymore, but Select-Mode is still active -> "Drop" of Avatar
|
||||
else if (_SelectedProfileID >= 0 && !_SelectingFast)
|
||||
{
|
||||
//Check if mouse is in drop-area
|
||||
@@ -439,7 +442,7 @@ namespace VocaluxeLib.Menu
|
||||
else if (mouseEvent.RB)
|
||||
{
|
||||
bool exit = true;
|
||||
if (_SelectSlides[_SelectSlidePlayer].Selected && _TeamList[_CurrentTeam].Count > 0 )
|
||||
if (_SelectSlides[_SelectSlidePlayer].Selected && _TeamList[_CurrentTeam].Count > 0)
|
||||
{
|
||||
int currentSelection = _SelectSlides[_SelectSlidePlayer].Selection;
|
||||
int id = _TeamList[_CurrentTeam][currentSelection];
|
||||
@@ -447,7 +450,7 @@ namespace VocaluxeLib.Menu
|
||||
_UpdatePlayerSlide();
|
||||
exit = false;
|
||||
}
|
||||
|
||||
|
||||
if (exit)
|
||||
Back();
|
||||
}
|
||||
@@ -568,9 +571,7 @@ namespace VocaluxeLib.Menu
|
||||
return;
|
||||
|
||||
if (_NumTeams - 1 >= _PartyMode.GetMinTeams())
|
||||
{
|
||||
_NumTeams--;
|
||||
}
|
||||
_UpdateButtonState();
|
||||
}
|
||||
|
||||
@@ -601,9 +602,8 @@ namespace VocaluxeLib.Menu
|
||||
}
|
||||
_UpdateButtonState();
|
||||
}
|
||||
|
||||
#region private methods
|
||||
|
||||
#region private methods
|
||||
private void _OnProfileChanged(EProfileChangedFlags flags)
|
||||
{
|
||||
if (EProfileChangedFlags.Avatar == (EProfileChangedFlags.Avatar & flags))
|
||||
@@ -650,9 +650,7 @@ namespace VocaluxeLib.Menu
|
||||
_SelectSlides[_SelectSlidePlayer].AddValue(name, avatar);
|
||||
}
|
||||
for (int i = _TeamList[_CurrentTeam].Count; i < _NumPlayerTeams[_CurrentTeam]; i++)
|
||||
{
|
||||
_SelectSlides[_SelectSlidePlayer].AddValue("", _NameSelections[_NameSelection].TextureEmptyTile);
|
||||
}
|
||||
if (selection >= _TeamList[_CurrentTeam].Count)
|
||||
selection = _TeamList[_CurrentTeam].Count - 1;
|
||||
_SelectSlides[_SelectSlidePlayer].SetSelectionByValueIndex(selection);
|
||||
@@ -664,13 +662,12 @@ namespace VocaluxeLib.Menu
|
||||
_SelectSlides[_SelectSlideTeams].Clear();
|
||||
for (int i = 1; i <= _NumTeams; i++)
|
||||
_SelectSlides[_SelectSlideTeams].AddValue("Team " + i);
|
||||
|
||||
}
|
||||
|
||||
private void _UpdateButtonVisibility()
|
||||
{
|
||||
_Buttons[_ButtonIncreaseTeams].Visible = _AllowChangePlayerNum && _Teams && _PartyMode.GetMinTeams() != _PartyMode.GetMaxTeams();
|
||||
_Buttons[_ButtonDecreaseTeams].Visible = _AllowChangePlayerNum && _Teams && _PartyMode.GetMinTeams() != _PartyMode.GetMaxTeams();
|
||||
_Buttons[_ButtonIncreaseTeams].Visible = _AllowChangePlayerNum && _Teams && _PartyMode.GetMinTeams() != _PartyMode.GetMaxTeams();
|
||||
_Buttons[_ButtonDecreaseTeams].Visible = _AllowChangePlayerNum && _Teams && _PartyMode.GetMinTeams() != _PartyMode.GetMaxTeams();
|
||||
_Buttons[_ButtonIncreasePlayer].Visible = _AllowChangePlayerNum;
|
||||
_Buttons[_ButtonDecreasePlayer].Visible = _AllowChangePlayerNum;
|
||||
}
|
||||
@@ -711,9 +708,7 @@ namespace VocaluxeLib.Menu
|
||||
List<int> ids = new List<int>();
|
||||
ids.AddRange(_TeamList[t]);
|
||||
for (int p = 0; p < ids.Count; p++)
|
||||
{
|
||||
_RemovePlayer(t, ids[p]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -745,7 +740,6 @@ namespace VocaluxeLib.Menu
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -376,7 +376,7 @@ namespace VocaluxeLib.Menu
|
||||
_Player = player;
|
||||
_PlayerSelector.Color = CBase.Theme.GetPlayerColor(player);
|
||||
}
|
||||
//Normal activation
|
||||
//Normal activation
|
||||
else if (active)
|
||||
{
|
||||
Selection = 0;
|
||||
@@ -385,7 +385,7 @@ namespace VocaluxeLib.Menu
|
||||
_PlayerSelector.Color = CBase.Theme.GetPlayerColor(player);
|
||||
_PlayerSelector.Visible = true;
|
||||
}
|
||||
//Deactivate
|
||||
//Deactivate
|
||||
else
|
||||
{
|
||||
Selection = -1;
|
||||
@@ -415,7 +415,8 @@ namespace VocaluxeLib.Menu
|
||||
{
|
||||
_Tiles[i].Avatar.Texture = CBase.Profiles.GetAvatar(_VisibleProfiles[i + offset * _Tiles.Count]);
|
||||
_Tiles[i].Avatar.Color = new SColorF(1, 1, 1, 1);
|
||||
_Tiles[i].Name.Text = CBase.Profiles.GetPlayerName(_VisibleProfiles[i + offset * _Tiles.Count]); ;
|
||||
_Tiles[i].Name.Text = CBase.Profiles.GetPlayerName(_VisibleProfiles[i + offset * _Tiles.Count]);
|
||||
;
|
||||
_Tiles[i].ProfileID = _VisibleProfiles[i + offset * _Tiles.Count];
|
||||
}
|
||||
else
|
||||
@@ -462,7 +463,7 @@ namespace VocaluxeLib.Menu
|
||||
return new CStatic(_PartyModeID);
|
||||
}
|
||||
|
||||
public void UnloadTextures() { }
|
||||
public void UnloadTextures() {}
|
||||
|
||||
public void LoadTextures()
|
||||
{
|
||||
@@ -486,12 +487,14 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
public void UseProfile(int id)
|
||||
{
|
||||
if(id > -1)
|
||||
if (id > -1)
|
||||
{
|
||||
if (!_UsedProfiles.Contains(id) && CBase.Profiles.IsProfileIDValid(id) && !CBase.Profiles.IsGuest(id))
|
||||
{
|
||||
_UsedProfiles.Add(id);
|
||||
UpdateList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void RemoveUsedProfile(int id)
|
||||
@@ -513,7 +516,7 @@ namespace VocaluxeLib.Menu
|
||||
if (_VisibleProfiles.Count == _UsedProfiles.Count)
|
||||
return id;
|
||||
|
||||
while(id == -1)
|
||||
while (id == -1)
|
||||
{
|
||||
int rand = CBase.Game.GetRandom(_VisibleProfiles.Count);
|
||||
if (_UsedProfiles.Contains(_VisibleProfiles[rand]))
|
||||
@@ -532,7 +535,7 @@ namespace VocaluxeLib.Menu
|
||||
for (int j = 0; j < _NumW; j++)
|
||||
{
|
||||
var rect = new SRectF(Rect.X + j * (_TileW + _SpaceW), Rect.Y + i * (_TileH + _SpaceH), _TileW, _TileH, Rect.Z);
|
||||
var tileStatic = new CStatic(_PartyModeID, _TextureEmptyTile, ColorEmptyTile, rect) { Aspect = EAspect.Crop };
|
||||
var tileStatic = new CStatic(_PartyModeID, _TextureEmptyTile, ColorEmptyTile, rect) {Aspect = EAspect.Crop};
|
||||
var tileText = new CText(rect.X + rect.W / 2, rect.Y + rect.H + _Theme.NameSpace, rect.Z, _Theme.NameHeight, rect.W, EAlignment.Center, _Theme.NameStyle,
|
||||
_Theme.NameFont, _Theme.NameColor, "");
|
||||
_Tiles.Add(new CTile(tileStatic, tileText, -1));
|
||||
|
||||
@@ -71,10 +71,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
base._PreviewIdInternal = value;
|
||||
_UpdatePreview();
|
||||
}
|
||||
get
|
||||
{
|
||||
return base._PreviewIdInternal;
|
||||
}
|
||||
get { return base._PreviewIdInternal; }
|
||||
}
|
||||
|
||||
public override int GetActualSelection()
|
||||
@@ -375,7 +372,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
}
|
||||
|
||||
if (!keyEvent.Handled)
|
||||
{
|
||||
{
|
||||
_ActualSelection = _Locked;
|
||||
if (_PreviewId != _Locked)
|
||||
_PreviewId = _Locked;
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
#region license
|
||||
// This file is part of Vocaluxe.
|
||||
// This file is part of Vocaluxe.
|
||||
//
|
||||
// Vocaluxe is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
// Vocaluxe is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Vocaluxe is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
// Vocaluxe is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
|
||||
#endregion
|
||||
|
||||
using VocaluxeLib.Draw;
|
||||
|
||||
@@ -121,7 +121,7 @@ namespace VocaluxeLib.Profile
|
||||
string filename = string.Empty;
|
||||
// ReSharper disable LoopCanBeConvertedToQuery
|
||||
foreach (char chr in PlayerName)
|
||||
// ReSharper restore LoopCanBeConvertedToQuery
|
||||
// ReSharper restore LoopCanBeConvertedToQuery
|
||||
{
|
||||
if (char.IsLetter(chr))
|
||||
filename += chr.ToString();
|
||||
@@ -166,13 +166,9 @@ namespace VocaluxeLib.Profile
|
||||
writer.WriteElementString("UserRole", Enum.GetName(typeof(EUserRole), UserRole));
|
||||
writer.WriteElementString("Active", Enum.GetName(typeof(EOffOn), Active));
|
||||
if (PasswordHash != null)
|
||||
{
|
||||
writer.WriteElementString("PasswordHash", Convert.ToBase64String(PasswordHash));
|
||||
}
|
||||
if (PasswordSalt != null)
|
||||
{
|
||||
writer.WriteElementString("PasswordSalt", Convert.ToBase64String(PasswordSalt));
|
||||
}
|
||||
writer.WriteEndElement();
|
||||
|
||||
writer.WriteEndElement(); //end of root
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace VocaluxeLib.Songs
|
||||
public int StartBeat { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Last beat of this note. First valid beat for a note after that is at EndBeat+1
|
||||
/// Last beat of this note. First valid beat for a note after that is at EndBeat+1
|
||||
/// </summary>
|
||||
public int EndBeat
|
||||
{
|
||||
|
||||
@@ -80,7 +80,7 @@ namespace VocaluxeLib.Songs
|
||||
|
||||
#region Methods
|
||||
/// <summary>
|
||||
/// Find last note with StartBeat
|
||||
/// Find last note with StartBeat
|
||||
/// </summary>
|
||||
/// <param name="beat"></param>
|
||||
/// <returns>Note index of last note with StartBeat or -1 if all notes start after beat</returns>
|
||||
|
||||
@@ -134,21 +134,21 @@ namespace VocaluxeLib.Songs
|
||||
public readonly List<String> UnknownTags = new List<string>();
|
||||
|
||||
/// <summary>
|
||||
/// Start of the song in s (s in txt)
|
||||
/// Start of the song in s (s in txt)
|
||||
/// </summary>
|
||||
public float Start;
|
||||
/// <summary>
|
||||
/// End of the song in s (ms in txt)
|
||||
/// End of the song in s (ms in txt)
|
||||
/// </summary>
|
||||
public float Finish;
|
||||
|
||||
public float BPM = 1f;
|
||||
/// <summary>
|
||||
/// Gap of the mp3 in s (ms in txt)
|
||||
/// Gap of the mp3 in s (ms in txt)
|
||||
/// </summary>
|
||||
public float Gap;
|
||||
/// <summary>
|
||||
/// Gap of the video in s (s in txt)
|
||||
/// Gap of the video in s (s in txt)
|
||||
/// </summary>
|
||||
public float VideoGap;
|
||||
|
||||
@@ -194,7 +194,7 @@ namespace VocaluxeLib.Songs
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if the requested game mode is available
|
||||
/// Returns true if the requested game mode is available
|
||||
/// </summary>
|
||||
/// <param name="gameMode"></param>
|
||||
/// <returns>true if the requested game mode is available</returns>
|
||||
|
||||
@@ -1,4 +1,21 @@
|
||||
using System;
|
||||
#region license
|
||||
// This file is part of Vocaluxe.
|
||||
//
|
||||
// Vocaluxe is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Vocaluxe is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -6,12 +23,12 @@ using System.Text;
|
||||
namespace VocaluxeLib.Songs
|
||||
{
|
||||
/// <summary>
|
||||
/// Part of CSong that is required for note loading
|
||||
/// Part of CSong that is required for note loading
|
||||
/// </summary>
|
||||
public partial class CSong
|
||||
{
|
||||
/// <summary>
|
||||
/// Factor the bpm given in the txt is multiplied with
|
||||
/// Factor the bpm given in the txt is multiplied with
|
||||
/// </summary>
|
||||
private const int _BPMFactor = 4;
|
||||
|
||||
@@ -54,7 +71,7 @@ namespace VocaluxeLib.Songs
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Logs a given message with file name and line#
|
||||
/// Logs a given message with file name and line#
|
||||
/// </summary>
|
||||
/// <param name="msg">Message</param>
|
||||
/// <param name="error">True prepends "Error: "; False prepends "Warning: "</param>
|
||||
@@ -470,9 +487,9 @@ namespace VocaluxeLib.Songs
|
||||
private const int _MaxOverlapNoteCt = 3;
|
||||
|
||||
/// <summary>
|
||||
/// Read notes. First try to read notes normally (assume standard)<br/>
|
||||
/// If there are more than _MaxZeroNoteCt with length < 1, try to read notes adding 1 to length<br/>
|
||||
/// Then if there are more than _MaxOverlapNoteCt fallback to first version ignoring notes with length < 1
|
||||
/// Read notes. First try to read notes normally (assume standard)<br />
|
||||
/// If there are more than _MaxZeroNoteCt with length < 1, try to read notes adding 1 to length<br />
|
||||
/// Then if there are more than _MaxOverlapNoteCt fallback to first version ignoring notes with length < 1
|
||||
/// </summary>
|
||||
/// <param name="forceReload"></param>
|
||||
/// <returns></returns>
|
||||
|
||||
@@ -1,4 +1,21 @@
|
||||
using System;
|
||||
#region license
|
||||
// This file is part of Vocaluxe.
|
||||
//
|
||||
// Vocaluxe is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Vocaluxe is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace VocaluxeLib.Songs
|
||||
|
||||
#region Methods
|
||||
/// <summary>
|
||||
/// Find last line with StartBeat
|
||||
/// Find last line with StartBeat
|
||||
/// </summary>
|
||||
/// <param name="beat"></param>
|
||||
/// <returns></returns>
|
||||
@@ -128,7 +128,7 @@ namespace VocaluxeLib.Songs
|
||||
{
|
||||
CSongLine prevLine = _Lines[insPos];
|
||||
//We already have a line break here
|
||||
if (prevLine.StartBeat == startBeat && (prevLine.NoteCount==0 || prevLine.FirstNoteBeat == startBeat))
|
||||
if (prevLine.StartBeat == startBeat && (prevLine.NoteCount == 0 || prevLine.FirstNoteBeat == startBeat))
|
||||
return false;
|
||||
//Maybe we have to split the previous line
|
||||
while (prevLine.NoteCount > 0 && prevLine.LastNote.StartBeat >= startBeat)
|
||||
|
||||
Reference in new issue
Block a user