/// <summary> /// Stops a J-JaxCue. /// </summary> /// <param name="name">The name of the JSong to be stopped.</param> public static void Stop(string name) { JJaxCategory cat = GetCategory(name); if (cat != null) { cat.Stop(name); } }
/// <summary> /// Pauses \ resumes a JSong. /// </summary> /// <param name="name">The name of the JSong.</param> public static void PauseResume(string name) { JJaxCategory cat = GetCategory(name); if (cat != null) { cat.PauseResume(name); } }
/// <summary> /// Finds out is a particular song is being played. /// </summary> /// <param name="name">The name of the song to be checked.</param> /// <returns>The result of the check.</returns> public static bool IsPlaying(string name) { JJaxCategory cat = GetCategory(name); if (cat != null) { return(cat.IsPlaying(name)); } return(false); }
static JJaxCategory GetCategory(string name) { CueInfo info = (from c in cueInfos where c.Name == name select c).FirstOrDefault(); if (info != null) { JJaxCategory cat = (from c in categories where c.Name == info.CategoryName select c).FirstOrDefault(); return(cat); } return(null); }
/// <summary> /// Plays a sound that sounds like it's being played in 3D space. /// </summary> /// <param name="soundName">The name of the sound.</param> /// <param name="position">The position of the sound.</param> public static void PlaySound3D(string soundName, Vector3 position) { if (soundName != null) { if (GetTotalBeingPlayed() <= 60) { CueInfo info = (from c in cueInfos where c.Name == soundName select c).FirstOrDefault(); if (info != null) { if (!info.SingleInstance || (info.SingleInstance && !IsPlaying(soundName))) { JJaxCue song; if (position != Vector3.Zero) { song = new JJaxCue(info, position); } else { song = new JJaxCue(info); } JJaxCategory cate = GetCategory(soundName); cate.Play(song); } } else { throw new ArgumentNullException("Sound dosn't exist " + soundName); } } } }