load notes only one time (thx to rayo)

This commit is contained in:
Alexander Eckart committed 2012-03-17 09:56:26 +01:00
1 parent 4cd4ccd1f1
commit 3771cc5dc4
1 file changed
+4
+4
View File
@@ -25,6 +25,7 @@ namespace Vocaluxe.Lib.Song
class CSong class CSong
{ {
private bool _CoverLoaded = false; private bool _CoverLoaded = false;
private bool _NotesLoaded = false;
private STexture _CoverTextureSmall = new STexture(-1); private STexture _CoverTextureSmall = new STexture(-1);
private STexture _CoverTextureBig = new STexture(-1); private STexture _CoverTextureBig = new STexture(-1);
@@ -54,7 +55,9 @@ namespace Vocaluxe.Lib.Song
{ {
if (!_CoverLoaded) if (!_CoverLoaded)
{ {
if (!_NotesLoaded)
this.ReadNotes(); this.ReadNotes();
if (this.CoverFileName != String.Empty) if (this.CoverFileName != String.Empty)
{ {
if (!CDataBase.GetCover(Path.Combine(this.Folder, this.CoverFileName), ref _CoverTextureSmall, CConfig.CoverSize)) if (!CDataBase.GetCover(Path.Combine(this.Folder, this.CoverFileName), ref _CoverTextureSmall, CConfig.CoverSize))
@@ -466,6 +469,7 @@ namespace Vocaluxe.Lib.Song
CLog.LogError("Error loading song. Line No.: " + FileLineNo.ToString() + ". An unhandled exception occured (" + e.Message + "): " + FilePath); CLog.LogError("Error loading song. Line No.: " + FileLineNo.ToString() + ". An unhandled exception occured (" + e.Message + "): " + FilePath);
return false; return false;
} }
_NotesLoaded = true;
return true; return true;
} }