private void _LoadVideo() { if (_Song == null) { return; } if (_Video != null || !SongHasVideo) { return; } string videoFilePath = Path.Combine(_Song.Folder, _Song.VideoFileName); _Video = CBase.Video.Load(videoFilePath); if (_Video == null) { return; } _VideoFading = new CFading(0f, 1f, 3f); if (IsPlaying) { CBase.Video.Skip(_Video, Position, _Song.VideoGap); CBase.Video.Resume(_Video); } else { CBase.Video.Skip(_Video, 0f, _Song.VideoGap); } }
public static void ResetToTime(float time, float nextStart, int soundStream, CVideoStream vidStream) { if (time < 0) { time = 0; } CurrentBeatF = GetBeatFromTime(time, GetSong().BPM, GetSong().Gap); for (int p = 0; p < _NumPlayers; p++) { Players[p].Points = 0; Players[p].PointsGoldenNotes = 0; Players[p].PointsLineBonus = 0; int l = 0; int deleteLine = 0; foreach (CSungLine line in Players[p].SungLines) { int n = -1; int deleteNote = 0; Players[p].PointsLineBonus += line.BonusPoints; foreach (CSungNote note in line.Notes) { if (note.StartBeat < nextStart) { if (note.Hit && note.HitNote.Type == ENoteType.Golden) { Players[p].PointsGoldenNotes += note.Points; } Players[p].Points += note.Points; } else if (deleteNote != -1) { deleteNote = n; } n++; } while (line.NoteCount > n && n >= 0) { if (line.Notes[n].Hit && line.Notes[n].HitNote.Type == ENoteType.Golden) { Players[p].PointsGoldenNotes -= line.Notes[n].Points; } Players[p].Points -= line.Notes[n].Points; line.DeleteNote(n); } if (line.LastNoteBeat > CurrentBeat && deleteLine == 0) { deleteLine = l; } l++; } Players[p].SungLines.RemoveRange(deleteLine, Players[p].SungLines.Count - deleteLine); } CSound.SetPosition(soundStream, time); CVideo.Skip(vidStream, time, GetSong().VideoGap); }
public static void Close(ref CVideoStream stream) { //Check for null because the videostreams may close themselves on destroy (GC) if (_VideoDecoder != null) { _VideoDecoder.Close(ref stream); } }
public void SetLoop(CVideoStream stream, bool loop) { CDecoder decoder; if (_TryGetDecoder(stream, out decoder)) { decoder.Loop = loop; } }
public void Pause(CVideoStream stream) { CDecoder decoder; if (_TryGetDecoder(stream, out decoder)) { decoder.Paused = true; } }
public void Resume(CVideoStream stream) { CDecoder decoder; if (_TryGetDecoder(stream, out decoder)) { decoder.Paused = false; } }
private bool _TryGetDecoder(CVideoStream stream, out CDecoder decoder) { if (stream == null) { decoder = null; return(false); } return(_Decoder.TryGetValue(stream.ID, out decoder)); }
public void Load(string videoName) { _VideoStream = CThemes.GetSkinVideo(videoName, -1, false); if (_VideoStream == null) { return; } _Loaded = true; CVideo.Pause(_VideoStream); }
public float GetLength(CVideoStream stream) { CDecoder decoder; if (_TryGetDecoder(stream, out decoder)) { return(decoder.Length); } return(0f); }
public bool Finished(CVideoStream stream) { CDecoder decoder; if (_TryGetDecoder(stream, out decoder)) { return(decoder.Finished); } return(true); }
public bool Skip(CVideoStream stream, float start, float gap) { CDecoder decoder; if (_TryGetDecoder(stream, out decoder)) { return(decoder.Skip(start, gap)); } return(false); }
public void Pause(CVideoStream stream) { try { CVideo.Pause(stream); } catch (NotSupportedException e) { CLog.LogError($"Clould not pause the background video: {e.Message}"); } }
public bool GetFrame(CVideoStream stream, float time) { CDecoder decoder; if (_TryGetDecoder(stream, out decoder)) { return(decoder.GetFrame(ref stream.Texture, time, out stream.VideoTime)); } stream.VideoTime = 0; return(false); }
public void Resume(CVideoStream stream) { try { CVideo.Resume(stream); } catch (NotSupportedException e) { CLog.Error($"Clould not resume the background video: {e.Message}"); } }
public void Close(ref CVideoStream stream) { try { CVideo.Close(ref stream); } catch (NotSupportedException e) { CLog.Error($"Clould not close the background video: {e.Message}"); } }
public static CVideoStream GetSkinVideo(string videoName, int partyModeID, bool loop = true) { Debug.Assert(!String.IsNullOrEmpty(videoName)); CVideoStream video = CurrentThemes[partyModeID].CurrentSkin.GetVideo(videoName, loop); if (video == null) { _LogMissingElement(partyModeID, "video", videoName); } return(video); }
public static float GetLength(CVideoStream stream) { if (stream == null) { throw new ArgumentException("stream is null"); } if (_VideoDecoder == null) { throw new NotSupportedException("_VideoDecoder is null (already closed?)"); } return(_VideoDecoder.GetLength(stream)); }
public static void Resume(CVideoStream stream) { if (stream == null) { throw new ArgumentException("stream is null"); } if (_VideoDecoder == null) { throw new NotSupportedException("_VideoDecoder is null (already closed?)"); } _VideoDecoder.Resume(stream); }
public static void SetLoop(CVideoStream stream, bool loop) { if (stream == null) { throw new ArgumentException("stream is null"); } if (_VideoDecoder == null) { throw new NotSupportedException("_VideoDecoder is null (already closed?)"); } _VideoDecoder.SetLoop(stream, loop); }
public static bool Skip(CVideoStream stream, float start, float gap) { if (stream == null) { throw new ArgumentException("stream is null"); } if (_VideoDecoder == null) { throw new NotSupportedException("_VideoDecoder is null (already closed?)"); } return(_VideoDecoder.Skip(stream, start, gap)); }
public static bool GetFrame(CVideoStream stream, float time) { if (stream == null) { throw new ArgumentException("stream is null"); } if (_VideoDecoder == null) { throw new NotSupportedException("_VideoDecoder is null (already closed?)"); } return(_VideoDecoder.GetFrame(stream, time)); }
public static bool Finished(CVideoStream stream) { if (stream == null) { throw new ArgumentException("stream is null"); } if (_VideoDecoder == null) { throw new NotSupportedException("_VideoDecoder is null (already closed?)"); } return(_VideoDecoder.Finished(stream)); }
public void Close(ref CVideoStream stream) { if (stream == null) { return; } CDecoder decoder; if (_TryGetDecoder(stream, out decoder)) { decoder.Close(); _Decoder.Remove(stream.ID); } stream.SetClosed(); stream = null; }
public void LoadSkin() { if (!ThemeLoaded) { return; } _Theme.Color.Get(_PartyModeID, out Color); if (_Theme.Type == EBackgroundTypes.SlideShow) { foreach (string s in _Theme.SlideShowTextures) { _SlideShowTextures.Add(CBase.Themes.GetSkinTexture(s, _PartyModeID)); } } if (_Theme.Type == EBackgroundTypes.Video) { _VideoStream = CBase.Themes.GetSkinVideo(_Theme.VideoName, _PartyModeID, true); } }
public static void SetLoop(CVideoStream stream, bool loop) { _VideoDecoder.SetLoop(stream, loop); }
public static bool Finished(CVideoStream stream) { return(_VideoDecoder.Finished(stream)); }
public static float GetLength(CVideoStream stream) { return(_VideoDecoder.GetLength(stream)); }
public static bool GetFrame(CVideoStream stream, float time) { return(_VideoDecoder.GetFrame(stream, time)); }
public static bool Skip(CVideoStream stream, float start, float gap) { return(_VideoDecoder.Skip(stream, start, gap)); }
public static void Pause(CVideoStream stream) { _VideoDecoder.Pause(stream); }