#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:
1 parent
8a638d8e9a
commit
88344ec8b4
5 files changed
+49
-10
No files matched your search
@@ -119,6 +119,8 @@ namespace Vocaluxe.Screens
|
||||
private bool _Pause;
|
||||
private bool _Webcam;
|
||||
|
||||
private CBackground _SlideShow;
|
||||
|
||||
public override void Init()
|
||||
{
|
||||
base.Init();
|
||||
@@ -474,6 +476,8 @@ namespace Vocaluxe.Screens
|
||||
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));
|
||||
}
|
||||
else if (_SlideShow != null)
|
||||
_SlideShow.Draw();
|
||||
}
|
||||
|
||||
_DrawBG();
|
||||
@@ -557,6 +561,9 @@ namespace Vocaluxe.Screens
|
||||
}
|
||||
CDraw.RemoveTexture(ref _Background);
|
||||
|
||||
if(_SlideShow != null)
|
||||
_SlideShow.RemoveSlideShowTextures();
|
||||
|
||||
_Lyrics[_LyricMain].Clear();
|
||||
_Lyrics[_LyricSub].Clear();
|
||||
_Lyrics[_LyricMainDuet].Clear();
|
||||
@@ -622,8 +629,18 @@ namespace Vocaluxe.Screens
|
||||
}
|
||||
|
||||
CDraw.RemoveTexture(ref _Background);
|
||||
if (!String.IsNullOrEmpty(song.BackgroundFileName))
|
||||
_Background = CDraw.AddTexture(Path.Combine(song.Folder, song.BackgroundFileName));
|
||||
if (song.BackgroundFileNames.Count > 1)
|
||||
{
|
||||
_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();
|
||||
|
||||
|
||||
@@ -70,6 +70,7 @@ namespace VocaluxeLib.Menu
|
||||
_PartyModeID = partyModeID;
|
||||
_ThemeLoaded = false;
|
||||
_Theme = new SThemeBackground();
|
||||
_Theme.SlideShowTextures = new List<string>();
|
||||
|
||||
Color = new SColorF(0f, 0f, 0f, 1f);
|
||||
}
|
||||
@@ -103,7 +104,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
string slideShow = "";
|
||||
int i = 1;
|
||||
_Theme.SlideShowTextures = new List<string>();
|
||||
|
||||
while (xmlReader.ItemExists(item + "/SlideShow" + i))
|
||||
{
|
||||
xmlReader.GetValue(item + "/SlideShow" + i, out slideShow, String.Empty);
|
||||
@@ -190,7 +191,7 @@ namespace VocaluxeLib.Menu
|
||||
ok = _DrawVideo();
|
||||
}
|
||||
|
||||
if (_Theme.Type == EBackgroundTypes.SlideShow && _Theme.SlideShowTextures.Count > 0)
|
||||
if (_Theme.Type == EBackgroundTypes.SlideShow )
|
||||
{
|
||||
ok = _DrawSlideShow();
|
||||
}
|
||||
@@ -218,6 +219,27 @@ namespace VocaluxeLib.Menu
|
||||
_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()
|
||||
{
|
||||
UnloadTextures();
|
||||
|
||||
@@ -97,7 +97,7 @@ namespace VocaluxeLib.Songs
|
||||
|
||||
public string MP3FileName = 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 EAspect VideoAspect = EAspect.Crop;
|
||||
@@ -226,7 +226,7 @@ namespace VocaluxeLib.Songs
|
||||
|
||||
MP3FileName = song.MP3FileName;
|
||||
CoverFileName = song.CoverFileName;
|
||||
BackgroundFileName = song.BackgroundFileName;
|
||||
BackgroundFileNames = song.BackgroundFileNames;
|
||||
VideoFileName = song.VideoFileName;
|
||||
|
||||
VideoAspect = song.VideoAspect;
|
||||
@@ -328,7 +328,7 @@ namespace VocaluxeLib.Songs
|
||||
}
|
||||
}
|
||||
|
||||
if (BackgroundFileName == "")
|
||||
if (BackgroundFileNames.Count == 0)
|
||||
{
|
||||
List<string> files = CHelper.ListFiles(Folder, "*.jpg");
|
||||
files.AddRange(CHelper.ListFiles(Folder, "*.jpeg"));
|
||||
@@ -338,7 +338,7 @@ namespace VocaluxeLib.Songs
|
||||
{
|
||||
if (file.ContainsIgnoreCase("[BG]") &&
|
||||
(file.ContainsIgnoreCase(Title) || file.ContainsIgnoreCase(Artist)))
|
||||
BackgroundFileName = file;
|
||||
BackgroundFileNames.Add(file);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -243,7 +243,7 @@ namespace VocaluxeLib.Songs
|
||||
break;
|
||||
case "BACKGROUND":
|
||||
if (File.Exists(Path.Combine(_Song.Folder, value)))
|
||||
_Song.BackgroundFileName = value;
|
||||
_Song.BackgroundFileNames.Add(value);
|
||||
else
|
||||
_LogWarning("Can't find background file: " + Path.Combine(_Song.Folder, value));
|
||||
break;
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace VocaluxeLib.Songs
|
||||
_WriteHeaderEntry("YEAR", _Song.Year);
|
||||
_WriteHeaderEntry("MP3", _Song.MP3FileName);
|
||||
_WriteHeaderEntry("COVER", _Song.CoverFileName);
|
||||
_WriteHeaderEntry("BACKGROUND", _Song.BackgroundFileName);
|
||||
_WriteHeaderEntrys("BACKGROUND", _Song.BackgroundFileNames);
|
||||
_WriteHeaderEntry("VIDEO", _Song.VideoFileName);
|
||||
_WriteHeaderEntry("VIDEOGAP", _Song.VideoGap);
|
||||
if (_Song.VideoAspect != EAspect.Crop)
|
||||
|
||||
Reference in new issue
Block a user