Fix for background-music-files.

This commit is contained in:
Florian Küpper committed 2014-08-05 11:41:20 +02:00
1 parent 3612b9244b
commit 240f47090d
2 files changed
+20

No files matched your search

+5
View File
@@ -270,12 +270,17 @@ namespace Vocaluxe.Base
_SongPlayer.Play(); _SongPlayer.Play();
//otherwhise load //otherwhise load
if (_BGMusicFiles.Contains(_CurrentPlaylistElement))
_SongPlayer.Load(_CurrentPlaylistElement.MusicFilePath, 0f, true);
else
{
//Seek to #Start-Tag, if found //Seek to #Start-Tag, if found
float start = 0f; float start = 0f;
if (_CurrentPlaylistElement.Start > 0.001 && CConfig.BackgroundMusicUseStart == EOffOn.TR_CONFIG_ON) if (_CurrentPlaylistElement.Start > 0.001 && CConfig.BackgroundMusicUseStart == EOffOn.TR_CONFIG_ON)
start = _CurrentPlaylistElement.Start; start = _CurrentPlaylistElement.Start;
_SongPlayer.Load(CBase.Songs.GetSongByID(_CurrentPlaylistElement.SongID), start, true); _SongPlayer.Load(CBase.Songs.GetSongByID(_CurrentPlaylistElement.SongID), start, true);
} }
}
private static void _AddOwnMusic() private static void _AddOwnMusic()
{ {
+15
View File
@@ -76,6 +76,12 @@ namespace VocaluxeLib.Utils.Player
_LoadVideo(); _LoadVideo();
} }
public CSongPlayer(string file, bool loop = false, float position = 0f, bool autoplay = false)
: base(file, loop, position, autoplay)
{
_Song = null;
}
public CTexture GetVideoTexture() public CTexture GetVideoTexture()
{ {
if (_Video == -1 || _Song == null) if (_Video == -1 || _Song == null)
@@ -105,6 +111,15 @@ namespace VocaluxeLib.Utils.Player
base.Load(Path.Combine(song.Folder, song.MP3FileName), position, autoplay); base.Load(Path.Combine(song.Folder, song.MP3FileName), position, autoplay);
} }
public void Load(string file, float position = 0f, bool autoplay = false)
{
if (String.IsNullOrEmpty(file))
return;
_Song = null;
base.Load(file, position, autoplay);
}
public new void Close() public new void Close()
{ {
base.Close(); base.Close();