Loop preview song and video
This commit is contained in:
1 parent
ba7627513e
commit
f2bd61937f
3 files changed
+12
-5
No files matched your search
@@ -769,6 +769,11 @@ namespace Vocaluxe.Base
|
||||
{
|
||||
return CVideo.Close(videoStream);
|
||||
}
|
||||
|
||||
public void SetLoop(int streamID, bool loop = true)
|
||||
{
|
||||
CVideo.SetLoop(streamID, loop);
|
||||
}
|
||||
}
|
||||
|
||||
class CBsound : ISound
|
||||
|
||||
@@ -248,10 +248,11 @@ namespace VocaluxeLib
|
||||
public interface IVideo
|
||||
{
|
||||
int Load(string videoFileName);
|
||||
bool Skip(int videoStream, float startPosition, float videoGap);
|
||||
bool GetFrame(int videoStream, ref CTexture videoTexture, float time, out float videoTime);
|
||||
bool IsFinished(int videoStream);
|
||||
bool Close(int videoStream);
|
||||
bool Skip(int streamID, float startPosition, float videoGap);
|
||||
bool GetFrame(int streamID, ref CTexture videoTexture, float time, out float videoTime);
|
||||
bool IsFinished(int streamID);
|
||||
bool Close(int streamID);
|
||||
void SetLoop(int streamID, bool loop = true);
|
||||
}
|
||||
|
||||
public interface ISound
|
||||
|
||||
@@ -524,7 +524,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
return;
|
||||
|
||||
//TODO: Using prescan here causes Vocaluxe to hang a bit on loading the song but we need the length below
|
||||
int stream = CBase.Sound.Load(Path.Combine(song.Folder, song.MP3FileName), false, true);
|
||||
int stream = CBase.Sound.Load(Path.Combine(song.Folder, song.MP3FileName), true, true);
|
||||
|
||||
float startposition = song.Preview.StartTime;
|
||||
float length = CBase.Sound.GetLength(stream);
|
||||
@@ -551,6 +551,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
_PreviewVideoStream = CBase.Video.Load(Path.Combine(song.Folder, song.VideoFileName));
|
||||
if (_PreviewVideoStream == -1)
|
||||
return;
|
||||
CBase.Video.SetLoop(_PreviewVideoStream);
|
||||
CBase.Video.Skip(_PreviewVideoStream, startposition, song.VideoGap);
|
||||
_VideoFading = new CFading(0f, 1f, 3f);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user