Fix renaming of Editions etc.
This commit is contained in:
1 parent
da91f177eb
commit
0a97a2e46d
5 files changed
+35
-19
No files matched your search
+1
-4
@@ -1,6 +1,6 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Express 2012 for Windows Desktop
|
||||
# Visual Studio 2012
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Vocaluxe", "Vocaluxe\Vocaluxe.csproj", "{2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{6F3E1874-F28A-40E9-AFBD-31934D593678} = {6F3E1874-F28A-40E9-AFBD-31934D593678}
|
||||
@@ -154,7 +154,4 @@ Global
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(Performance) = preSolution
|
||||
HasPerformanceSessions = true
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -157,10 +157,10 @@ namespace Vocaluxe.Base
|
||||
switch (_SongSorting)
|
||||
{
|
||||
case ESongSorting.TR_CONFIG_EDITION:
|
||||
fieldName = "Edition";
|
||||
fieldName = "Editions";
|
||||
break;
|
||||
case ESongSorting.TR_CONFIG_GENRE:
|
||||
fieldName = "Genre";
|
||||
fieldName = "Genres";
|
||||
break;
|
||||
case ESongSorting.TR_CONFIG_FOLDER:
|
||||
fieldName = "FolderName";
|
||||
@@ -177,7 +177,7 @@ namespace Vocaluxe.Base
|
||||
fieldName = "Year";
|
||||
break;
|
||||
case ESongSorting.TR_CONFIG_LANGUAGE:
|
||||
fieldName = "Language";
|
||||
fieldName = "Languages";
|
||||
break;
|
||||
case ESongSorting.TR_CONFIG_DATEADDED:
|
||||
fieldName = "DateAdded";
|
||||
|
||||
@@ -117,6 +117,9 @@ namespace VocaluxeLib.Songs
|
||||
public string TitleSorting = String.Empty;
|
||||
public string ArtistSorting = String.Empty;
|
||||
|
||||
public string Creator = "";
|
||||
public string Version = "";
|
||||
|
||||
/// <summary>
|
||||
/// Start of the song in s (s in txt)
|
||||
/// </summary>
|
||||
@@ -148,7 +151,7 @@ namespace VocaluxeLib.Songs
|
||||
get { return Notes.VoiceCount > 1; }
|
||||
}
|
||||
|
||||
public readonly List<string> Edition = new List<string>();
|
||||
public readonly List<string> Editions = new List<string>();
|
||||
public readonly List<string> Genres = new List<string>();
|
||||
public string Year = "";
|
||||
|
||||
@@ -227,7 +230,7 @@ namespace VocaluxeLib.Songs
|
||||
_CatIndex = song._CatIndex;
|
||||
_Selected = song._Selected;
|
||||
|
||||
Edition = new List<string>(song.Edition);
|
||||
Editions = new List<string>(song.Editions);
|
||||
|
||||
Genres = new List<string>(song.Genres);
|
||||
|
||||
|
||||
@@ -109,6 +109,8 @@ namespace VocaluxeLib.Songs
|
||||
if (pos <= 1)
|
||||
continue;
|
||||
string identifier = line.Substring(1, pos - 1).Trim().ToUpper();
|
||||
if (identifier.Contains(" "))
|
||||
continue;
|
||||
string value = line.Substring(pos + 1).Trim();
|
||||
|
||||
if (value == "")
|
||||
@@ -147,6 +149,12 @@ namespace VocaluxeLib.Songs
|
||||
case "ARTIST-ON-SORTING":
|
||||
_Song.ArtistSorting = value;
|
||||
break;
|
||||
case "CREATOR":
|
||||
_Song.Creator = value;
|
||||
break;
|
||||
case "VERSION":
|
||||
_Song.Version = value;
|
||||
break;
|
||||
case "MP3":
|
||||
if (File.Exists(Path.Combine(_Song.Folder, value)))
|
||||
{
|
||||
@@ -170,7 +178,7 @@ namespace VocaluxeLib.Songs
|
||||
break;
|
||||
case "EDITION":
|
||||
if (value.Length > 1)
|
||||
_Song.Edition.Add(value);
|
||||
_Song.Editions.Add(value);
|
||||
else
|
||||
_LogWarning("Invalid edition");
|
||||
break;
|
||||
@@ -276,7 +284,7 @@ namespace VocaluxeLib.Songs
|
||||
if (value.ToUpper() == "YES")
|
||||
_Song.Relative = true;
|
||||
break;
|
||||
case "RESULTION":
|
||||
case "RESOULTION":
|
||||
_LogWarning("#RESOLUTION tag is outdated and ignored. Test the song to see if note timing is still correct!");
|
||||
break;
|
||||
default:
|
||||
@@ -291,6 +299,8 @@ namespace VocaluxeLib.Songs
|
||||
_Song.Notes.VoiceNames[curPlayer] = value;
|
||||
}
|
||||
}
|
||||
else
|
||||
_LogWarning("Unknown tag: #" + identifier);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -31,23 +31,29 @@ namespace VocaluxeLib.Songs
|
||||
|
||||
private void _WriteHeaderEntry<T>(StreamWriter sw, string id, IList<T> value)
|
||||
{
|
||||
if (value!=null && value.Count>0)
|
||||
foreach (var val in value)
|
||||
if (value != null && value.Count > 0)
|
||||
{
|
||||
foreach (T val in value)
|
||||
_WriteHeaderEntry(sw, id, val);
|
||||
}
|
||||
}
|
||||
|
||||
private void _WriteHeader(StreamWriter sw)
|
||||
{
|
||||
_WriteHeaderEntry(sw, "ENCODING", _Song.Encoding);
|
||||
_WriteHeaderEntry(sw, "CREATOR", _Song.Creator);
|
||||
_WriteHeaderEntry(sw, "VERSION", _Song.Version);
|
||||
_WriteHeaderEntry(sw, "COMMENT", _Song._Comment);
|
||||
_WriteHeaderEntry(sw, "TITLE", _Song.Title);
|
||||
_WriteHeaderEntry(sw, "ARTIST", _Song.Artist);
|
||||
if (!_Song.Title.Equals(_Song.TitleSorting)) _WriteHeaderEntry(sw, "TITLE-ON-SORTING", _Song.TitleSorting);
|
||||
if (!_Song.Artist.Equals(_Song.ArtistSorting)) _WriteHeaderEntry(sw, "ARTIST-ON-SORTING", _Song.ArtistSorting);
|
||||
_WriteHeaderEntry(sw, "LANGUAGE", _Song.Languages);
|
||||
_WriteHeaderEntry(sw, "EDITION", _Song.Edition);
|
||||
if (!_Song.Title.Equals(_Song.TitleSorting))
|
||||
_WriteHeaderEntry(sw, "TITLE-ON-SORTING", _Song.TitleSorting);
|
||||
if (!_Song.Artist.Equals(_Song.ArtistSorting))
|
||||
_WriteHeaderEntry(sw, "ARTIST-ON-SORTING", _Song.ArtistSorting);
|
||||
_WriteHeaderEntry(sw, "EDITION", _Song.Editions);
|
||||
_WriteHeaderEntry(sw, "GENRE", _Song.Genres);
|
||||
_WriteHeaderEntry(sw, "LANGUAGE", _Song.Languages);
|
||||
_WriteHeaderEntry(sw, "YEAR", _Song.Year);
|
||||
_WriteHeaderEntry(sw, "COMMENT", _Song._Comment);
|
||||
_WriteHeaderEntry(sw, "MP3", _Song.MP3FileName);
|
||||
_WriteHeaderEntry(sw, "COVER", _Song.CoverFileName);
|
||||
_WriteHeaderEntry(sw, "BACKGROUND", _Song.BackgroundFileName);
|
||||
@@ -60,7 +66,7 @@ namespace VocaluxeLib.Songs
|
||||
_WriteHeaderEntry(sw, "PREVIEWSTART", _Song.PreviewStart);
|
||||
_WriteHeaderEntry(sw, "START", _Song.Start);
|
||||
_WriteHeaderEntry(sw, "END", _Song.Finish);
|
||||
if(!_Song.CalculateMedley)
|
||||
if (!_Song.CalculateMedley)
|
||||
_WriteHeaderEntry(sw, "CALCMEDLEY", "OFF");
|
||||
if (_Song.Medley.Source == EMedleySource.Tag)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user