protected void SelectSong(int nr) { if (CSongs.Category >= 0 && (CSongs.NumVisibleSongs > 0) && (nr >= 0) && ((_actsong != nr) || (_streams.Count == 0))) { foreach (int stream in _streams) { CSound.FadeAndStop(stream, 0f, 1f); } _streams.Clear(); CVideo.VdClose(_video); _video = -1; CDraw.RemoveTexture(ref _vidtex); _actsong = nr; if (_actsong >= CSongs.NumVisibleSongs) { _actsong = 0; } int _stream = CSound.Load(Path.Combine(CSongs.VisibleSongs[_actsong].Folder, CSongs.VisibleSongs[_actsong].MP3FileName), true); CSound.SetStreamVolumeMax(_stream, _MaxVolume); CSound.SetStreamVolume(_stream, 0f); float startposition = CSongs.VisibleSongs[_actsong].PreviewStart; if (startposition == 0f) { startposition = CSound.GetLength(_stream) / 4f; } CSound.SetPosition(_stream, startposition); CSound.Play(_stream); CSound.Fade(_stream, 100f, 3f); _streams.Add(_stream); _actsongstream = _stream; if (CSongs.VisibleSongs[_actsong].VideoFileName != String.Empty && CConfig.VideoPreview == EOffOn.TR_CONFIG_ON) { _video = CVideo.VdLoad(Path.Combine(CSongs.VisibleSongs[_actsong].Folder, CSongs.VisibleSongs[_actsong].VideoFileName)); if (_video == -1) { return; } CVideo.VdSkip(_video, startposition, CSongs.VisibleSongs[_actsong].VideoGap); _VideoFadeTimer.Stop(); _VideoFadeTimer.Reset(); _VideoFadeTimer.Start(); } } }
protected void Reset() { foreach (int stream in _streams) { CSound.FadeAndStop(stream, 0f, 0.75f); } _streams.Clear(); CVideo.VdClose(_video); _video = -1; CDraw.RemoveTexture(ref _vidtex); _timer.Stop(); _timer.Reset(); _SelectedInternal = _SelectedPending; }
private void CloseSong() { CSound.FadeAndStop(_CurrentStream, 0f, 0.5f); CSound.RecordStop(); if (_CurrentVideo != -1) { CVideo.VdClose(_CurrentVideo); _CurrentVideo = -1; CDraw.RemoveTexture(ref _CurrentVideoTexture); } CDraw.RemoveTexture(ref _Background); Lyrics[htLyrics(LyricMain)].Clear(); Lyrics[htLyrics(LyricSub)].Clear(); Lyrics[htLyrics(LyricMainDuet)].Clear(); Lyrics[htLyrics(LyricSubDuet)].Clear(); Lyrics[htLyrics(LyricMainTop)].Clear(); Lyrics[htLyrics(LyricSubTop)].Clear(); Texts[htTexts(TextSongName)].Text = String.Empty; }