#BACKGROUND-Tag could be multiple now, when there are more than one bgs, a slide-show will shown in ScreenSing.

This commit is contained in:
Florian Küpper committed 2013-10-26 15:17:14 +02:00
1 parent 8a638d8e9a
commit 88344ec8b4
5 files changed
+49 -10

No files matched your search

+19 -2
View File
@@ -119,6 +119,8 @@ namespace Vocaluxe.Screens
private bool _Pause; private bool _Pause;
private bool _Webcam; private bool _Webcam;
private CBackground _SlideShow;
public override void Init() public override void Init()
{ {
base.Init(); base.Init();
@@ -474,6 +476,8 @@ namespace Vocaluxe.Screens
CDraw.DrawTexture(background, new SRectF(rect.X, rect.Y, rect.Width, rect.Height, 0f), CDraw.DrawTexture(background, new SRectF(rect.X, rect.Y, rect.Width, rect.Height, 0f),
background.Color, new SRectF(bounds.X, bounds.Y, bounds.Width, bounds.Height, 0f)); background.Color, new SRectF(bounds.X, bounds.Y, bounds.Width, bounds.Height, 0f));
} }
else if (_SlideShow != null)
_SlideShow.Draw();
} }
_DrawBG(); _DrawBG();
@@ -557,6 +561,9 @@ namespace Vocaluxe.Screens
} }
CDraw.RemoveTexture(ref _Background); CDraw.RemoveTexture(ref _Background);
if(_SlideShow != null)
_SlideShow.RemoveSlideShowTextures();
_Lyrics[_LyricMain].Clear(); _Lyrics[_LyricMain].Clear();
_Lyrics[_LyricSub].Clear(); _Lyrics[_LyricSub].Clear();
_Lyrics[_LyricMainDuet].Clear(); _Lyrics[_LyricMainDuet].Clear();
@@ -622,8 +629,18 @@ namespace Vocaluxe.Screens
} }
CDraw.RemoveTexture(ref _Background); CDraw.RemoveTexture(ref _Background);
if (!String.IsNullOrEmpty(song.BackgroundFileName)) if (song.BackgroundFileNames.Count > 1)
_Background = CDraw.AddTexture(Path.Combine(song.Folder, song.BackgroundFileName)); {
_SlideShow = GetNewBackground();
foreach(string s in song.BackgroundFileNames)
_SlideShow.AddSlideShowTexture(Path.Combine(song.Folder, s));
_Background = null;
}
else if (song.BackgroundFileNames.Count == 1)
{
if (!String.IsNullOrEmpty(song.BackgroundFileNames[0]))
_Background = CDraw.AddTexture(Path.Combine(song.Folder, song.BackgroundFileNames[0]));
}
_SingNotes[_SingBars].Reset(); _SingNotes[_SingBars].Reset();
+24 -2
View File
@@ -70,6 +70,7 @@ namespace VocaluxeLib.Menu
_PartyModeID = partyModeID; _PartyModeID = partyModeID;
_ThemeLoaded = false; _ThemeLoaded = false;
_Theme = new SThemeBackground(); _Theme = new SThemeBackground();
_Theme.SlideShowTextures = new List<string>();
Color = new SColorF(0f, 0f, 0f, 1f); Color = new SColorF(0f, 0f, 0f, 1f);
} }
@@ -103,7 +104,7 @@ namespace VocaluxeLib.Menu
string slideShow = ""; string slideShow = "";
int i = 1; int i = 1;
_Theme.SlideShowTextures = new List<string>();
while (xmlReader.ItemExists(item + "/SlideShow" + i)) while (xmlReader.ItemExists(item + "/SlideShow" + i))
{ {
xmlReader.GetValue(item + "/SlideShow" + i, out slideShow, String.Empty); xmlReader.GetValue(item + "/SlideShow" + i, out slideShow, String.Empty);
@@ -190,7 +191,7 @@ namespace VocaluxeLib.Menu
ok = _DrawVideo(); ok = _DrawVideo();
} }
if (_Theme.Type == EBackgroundTypes.SlideShow && _Theme.SlideShowTextures.Count > 0) if (_Theme.Type == EBackgroundTypes.SlideShow )
{ {
ok = _DrawSlideShow(); ok = _DrawSlideShow();
} }
@@ -218,6 +219,27 @@ namespace VocaluxeLib.Menu
_SlideShowTextures.Add(CBase.Theme.GetSkinTexture(s, _PartyModeID)); _SlideShowTextures.Add(CBase.Theme.GetSkinTexture(s, _PartyModeID));
} }
public void AddSlideShowTexture(string image)
{
_Theme.Type = EBackgroundTypes.SlideShow;
if (!String.IsNullOrEmpty(image))
{
CTexture texture = CBase.Drawing.AddTexture(image);
if(texture != null)
_SlideShowTextures.Add(texture);
}
}
public void RemoveSlideShowTextures()
{
foreach (CTexture tex in _SlideShowTextures)
{
CTexture texture = tex;
CBase.Drawing.RemoveTexture(ref texture);
}
_SlideShowTextures.Clear();
}
public void ReloadTextures() public void ReloadTextures()
{ {
UnloadTextures(); UnloadTextures();
+4 -4
View File
@@ -97,7 +97,7 @@ namespace VocaluxeLib.Songs
public string MP3FileName = String.Empty; public string MP3FileName = String.Empty;
public string CoverFileName = String.Empty; public string CoverFileName = String.Empty;
public string BackgroundFileName = String.Empty; public List<string> BackgroundFileNames = new List<string>();
public string VideoFileName = String.Empty; public string VideoFileName = String.Empty;
public EAspect VideoAspect = EAspect.Crop; public EAspect VideoAspect = EAspect.Crop;
@@ -226,7 +226,7 @@ namespace VocaluxeLib.Songs
MP3FileName = song.MP3FileName; MP3FileName = song.MP3FileName;
CoverFileName = song.CoverFileName; CoverFileName = song.CoverFileName;
BackgroundFileName = song.BackgroundFileName; BackgroundFileNames = song.BackgroundFileNames;
VideoFileName = song.VideoFileName; VideoFileName = song.VideoFileName;
VideoAspect = song.VideoAspect; VideoAspect = song.VideoAspect;
@@ -328,7 +328,7 @@ namespace VocaluxeLib.Songs
} }
} }
if (BackgroundFileName == "") if (BackgroundFileNames.Count == 0)
{ {
List<string> files = CHelper.ListFiles(Folder, "*.jpg"); List<string> files = CHelper.ListFiles(Folder, "*.jpg");
files.AddRange(CHelper.ListFiles(Folder, "*.jpeg")); files.AddRange(CHelper.ListFiles(Folder, "*.jpeg"));
@@ -338,7 +338,7 @@ namespace VocaluxeLib.Songs
{ {
if (file.ContainsIgnoreCase("[BG]") && if (file.ContainsIgnoreCase("[BG]") &&
(file.ContainsIgnoreCase(Title) || file.ContainsIgnoreCase(Artist))) (file.ContainsIgnoreCase(Title) || file.ContainsIgnoreCase(Artist)))
BackgroundFileName = file; BackgroundFileNames.Add(file);
} }
} }
} }
+1 -1
View File
@@ -243,7 +243,7 @@ namespace VocaluxeLib.Songs
break; break;
case "BACKGROUND": case "BACKGROUND":
if (File.Exists(Path.Combine(_Song.Folder, value))) if (File.Exists(Path.Combine(_Song.Folder, value)))
_Song.BackgroundFileName = value; _Song.BackgroundFileNames.Add(value);
else else
_LogWarning("Can't find background file: " + Path.Combine(_Song.Folder, value)); _LogWarning("Can't find background file: " + Path.Combine(_Song.Folder, value));
break; break;
+1 -1
View File
@@ -74,7 +74,7 @@ namespace VocaluxeLib.Songs
_WriteHeaderEntry("YEAR", _Song.Year); _WriteHeaderEntry("YEAR", _Song.Year);
_WriteHeaderEntry("MP3", _Song.MP3FileName); _WriteHeaderEntry("MP3", _Song.MP3FileName);
_WriteHeaderEntry("COVER", _Song.CoverFileName); _WriteHeaderEntry("COVER", _Song.CoverFileName);
_WriteHeaderEntry("BACKGROUND", _Song.BackgroundFileName); _WriteHeaderEntrys("BACKGROUND", _Song.BackgroundFileNames);
_WriteHeaderEntry("VIDEO", _Song.VideoFileName); _WriteHeaderEntry("VIDEO", _Song.VideoFileName);
_WriteHeaderEntry("VIDEOGAP", _Song.VideoGap); _WriteHeaderEntry("VIDEOGAP", _Song.VideoGap);
if (_Song.VideoAspect != EAspect.Crop) if (_Song.VideoAspect != EAspect.Crop)