Some changes to preview-start.

This commit is contained in:
Florian Küpper committed 2014-08-20 19:10:13 +02:00
1 parent c6e8854dda
commit d0958b69be
3 files changed
+14 -11

No files matched your search

+13
View File
@@ -310,6 +310,19 @@ namespace Vocaluxe.Base
_PlaysPreview = true;
_PreviewPlayer.Load(song, start);
float startposition = song.Preview.StartTime;
float length = _PreviewPlayer.Length;
if (song.Preview.Source == EDataSource.None)
startposition = length / 4f;
else if (startposition > length - 5f)
startposition = Math.Max(0f, Math.Min(length / 4f, length - 5f));
_PreviewPlayer.Position = startposition;
Play();
}
public static void PlayPreview(float start = -1f)