Previous-function of bg-music is now similar to other audio-player. Clicking on prev-button during song: Play song from start, Clicking on prev-button during first 1.5 sec, go to prev song.
This commit is contained in:
1 parent
2340011ba3
commit
837ee463b5
1 file changed
+10
-5
@@ -293,9 +293,17 @@ namespace Vocaluxe.Base
|
|||||||
public static void Previous()
|
public static void Previous()
|
||||||
{
|
{
|
||||||
if (_PreviousFileNames.Count > 0 || _PreviousMusicIndex >= 0)
|
if (_PreviousFileNames.Count > 0 || _PreviousMusicIndex >= 0)
|
||||||
|
{
|
||||||
|
float pos = CSound.GetPosition(_CurrentMusicStream);
|
||||||
|
if (CSound.GetPosition(_CurrentMusicStream) >= 1.5f)
|
||||||
|
{
|
||||||
|
CSound.SetPosition(_CurrentMusicStream, 0);
|
||||||
|
if (_VideoEnabled && _Video != -1)
|
||||||
|
CVideo.VdSkip(_Video, 0f, _CurrentPlaylistElement.VideoGap);
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
Stop();
|
Stop();
|
||||||
|
|
||||||
_PreviousMusicIndex--;
|
_PreviousMusicIndex--;
|
||||||
if (_PreviousMusicIndex < 0)
|
if (_PreviousMusicIndex < 0)
|
||||||
_PreviousMusicIndex = 0; //No previous songs left, so play the first
|
_PreviousMusicIndex = 0; //No previous songs left, so play the first
|
||||||
@@ -309,10 +317,7 @@ namespace Vocaluxe.Base
|
|||||||
Play();
|
Play();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (_CurrentMusicStream != -1)
|
||||||
public static void Repeat()
|
|
||||||
{
|
|
||||||
if (_AllFileNames.Count > 0 && _CurrentMusicStream != -1)
|
|
||||||
{
|
{
|
||||||
CSound.SetPosition(_CurrentMusicStream, 0);
|
CSound.SetPosition(_CurrentMusicStream, 0);
|
||||||
if (_VideoEnabled && _Video != -1)
|
if (_VideoEnabled && _Video != -1)
|
||||||
|
|||||||
Reference in new issue
Block a user