public static void Pause() { if (!_Playing) { return; } if (_VideoEnabled && _Video != -1) { CVideo.VdPause(_Video); CVideo.VdSkip(_Video, CSound.GetPosition(_CurrentMusicStream) + CSettings.BackgroundMusicFadeTime, _CurrentPlaylistElement.VideoGap); } CSound.FadeAndPause(_CurrentMusicStream, 0f, CSettings.BackgroundMusicFadeTime); _Playing = false; }
public static void SkinVideoPause(string VideoName) { int SkinIndex = GetSkinIndex(); if (SkinIndex != -1) { for (int i = 0; i < _Skins[SkinIndex].VideoList.Count; i++) { SkinElement sk = _Skins[SkinIndex].VideoList[i]; if (sk.Name == VideoName) { if (sk.VideoIndex == -1) { sk.VideoIndex = CVideo.VdLoad(GetVideoFilePath(sk.Name)); CVideo.VdSetLoop(sk.VideoIndex, true); } CVideo.VdPause(sk.VideoIndex); _Skins[SkinIndex].VideoList[i] = sk; return; } } } }
public static void LoadSkins() { for (int index = 0; index < _Skins.Count; index++) { bool loaded = false; XPathDocument xPathDoc = null; XPathNavigator navigator = null; try { xPathDoc = new XPathDocument(Path.Combine(_Skins[index].Path, _Skins[index].FileName)); navigator = xPathDoc.CreateNavigator(); loaded = true; } catch (Exception e) { CLog.LogError("Error loading skin " + _Skins[index].FileName + ": " + e.Message); loaded = false; if (navigator != null) { navigator = null; } if (xPathDoc != null) { xPathDoc = null; } } if (loaded) { string value = String.Empty; // load skins/textures List <string> keys = new List <string>(_Skins[index].SkinList.Keys); foreach (string name in keys) { try { CHelper.GetValueFromXML("//root/Skins/" + name, navigator, ref value, String.Empty); SkinElement sk = _Skins[index].SkinList[name]; sk.Value = value; sk.VideoIndex = -1; sk.Texture = CDraw.AddTexture(Path.Combine(_Skins[index].Path, sk.Value)); _Skins[index].SkinList[name] = sk; } catch (Exception e) { MessageBox.Show("Error on loading texture \"" + name + "\": " + e.Message + e.StackTrace); CLog.LogError("Error on loading texture \"" + name + "\": " + e.Message + e.StackTrace); } } // load videos for (int i = 0; i < _Skins[index].VideoList.Count; i++) { try { CHelper.GetValueFromXML("//root/Videos/" + _Skins[index].VideoList[i].Name, navigator, ref value, String.Empty); SkinElement sk = new SkinElement(); sk.Name = _Skins[index].VideoList[i].Name; sk.Value = value; sk.VideoIndex = CVideo.VdLoad(Path.Combine(_Skins[index].Path, sk.Value)); CVideo.VdSetLoop(sk.VideoIndex, true); CVideo.VdPause(sk.VideoIndex); sk.Texture = new STexture(-1); _Skins[index].VideoList[i] = sk; } catch (Exception e) { MessageBox.Show("Error on loading video \"" + _Skins[index].VideoList[i].Name + "\": " + e.Message + e.StackTrace); CLog.LogError("Error on loading video \"" + _Skins[index].VideoList[i].Name + "\": " + e.Message + e.StackTrace); } } // load colors LoadColors(navigator, index); } } }